organization toke (#820, #834)

This commit is contained in:
Michael Quigley 2025-02-04 14:26:27 -05:00
parent 09fdb92861
commit 598bfcc571
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
56 changed files with 454 additions and 192 deletions

View File

@ -41,7 +41,7 @@ func (cmd *adminCreateOrgMemberCommand) run(_ *cobra.Command, args []string) {
}
req := admin.NewAddOrganizationMemberParams()
req.Body.Token = args[0]
req.Body.OrganizationToken = args[0]
req.Body.Email = args[1]
req.Body.Admin = cmd.admin

View File

@ -48,5 +48,5 @@ func (cmd *adminCreateOrganizationCommand) run(_ *cobra.Command, _ []string) {
panic(err)
}
logrus.Infof("created new organization with token '%v'", resp.Payload.Token)
logrus.Infof("created new organization with organization token '%v'", resp.Payload.OrganizationToken)
}

View File

@ -39,7 +39,7 @@ func (cmd *adminDeleteOrgMemberCommand) run(_ *cobra.Command, args []string) {
}
req := admin.NewRemoveOrganizationMemberParams()
req.Body.Token = args[0]
req.Body.OrganizationToken = args[0]
req.Body.Email = args[1]
_, err = zrok.Admin.RemoveOrganizationMember(req, mustGetAdminAuth())

View File

@ -39,7 +39,7 @@ func (cmd *adminDeleteOrganizationCommand) run(_ *cobra.Command, args []string)
}
req := admin.NewDeleteOrganizationParams()
req.Body.Token = args[0]
req.Body.OrganizationToken = args[0]
_, err = zrok.Admin.DeleteOrganization(req, mustGetAdminAuth())
if err != nil {

View File

@ -52,7 +52,7 @@ func (c *adminListOrganizationsCommand) run(_ *cobra.Command, _ []string) {
t.SetStyle(table.StyleColoredDark)
t.AppendHeader(table.Row{"Organization Token", "Description"})
for _, org := range resp.Payload.Organizations {
t.AppendRow(table.Row{org.Token, org.Description})
t.AppendRow(table.Row{org.OrganizationToken, org.Description})
}
t.Render()
fmt.Println()

View File

@ -32,9 +32,9 @@ func (h *addOrganizationMemberHandler) Handle(params admin.AddOrganizationMember
return admin.NewAddOrganizationMemberNotFound()
}
org, err := str.FindOrganizationByToken(params.Body.Token, trx)
org, err := str.FindOrganizationByToken(params.Body.OrganizationToken, trx)
if err != nil {
logrus.Errorf("error finding organization '%v': %v", params.Body.Token, err)
logrus.Errorf("error finding organization '%v': %v", params.Body.OrganizationToken, err)
return admin.NewAddOrganizationMemberNotFound()
}

View File

@ -49,5 +49,5 @@ func (h *createOrganizationHandler) Handle(params admin.CreateOrganizationParams
logrus.Infof("added organzation '%v' with description '%v'", org.Token, org.Description)
return admin.NewCreateOrganizationCreated().WithPayload(&admin.CreateOrganizationCreatedBody{Token: org.Token})
return admin.NewCreateOrganizationCreated().WithPayload(&admin.CreateOrganizationCreatedBody{OrganizationToken: org.Token})
}

View File

@ -26,7 +26,7 @@ func (h *deleteOrganizationHandler) Handle(params admin.DeleteOrganizationParams
}
defer func() { _ = trx.Rollback() }()
org, err := str.FindOrganizationByToken(params.Body.Token, trx)
org, err := str.FindOrganizationByToken(params.Body.OrganizationToken, trx)
if err != nil {
logrus.Errorf("error finding organization by token: %v", err)
return admin.NewDeleteOrganizationNotFound()

View File

@ -34,7 +34,7 @@ func (h *listOrganizationsHandler) Handle(_ admin.ListOrganizationsParams, princ
var out []*admin.ListOrganizationsOKBodyOrganizationsItems0
for _, org := range orgs {
out = append(out, &admin.ListOrganizationsOKBodyOrganizationsItems0{Description: org.Description, Token: org.Token})
out = append(out, &admin.ListOrganizationsOKBodyOrganizationsItems0{Description: org.Description, OrganizationToken: org.Token})
}
return admin.NewListOrganizationsOK().WithPayload(&admin.ListOrganizationsOKBody{Organizations: out})
}

View File

@ -32,9 +32,9 @@ func (h *removeOrganizationMemberHandler) Handle(params admin.RemoveOrganization
return admin.NewAddOrganizationMemberNotFound()
}
org, err := str.FindOrganizationByToken(params.Body.Token, trx)
org, err := str.FindOrganizationByToken(params.Body.OrganizationToken, trx)
if err != nil {
logrus.Errorf("error finding organization '%v': %v", params.Body.Token, err)
logrus.Errorf("error finding organization '%v': %v", params.Body.OrganizationToken, err)
return admin.NewAddOrganizationMemberNotFound()
}

View File

@ -287,8 +287,8 @@ type AddOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this add organization member body

View File

@ -270,8 +270,8 @@ swagger:model CreateOrganizationCreatedBody
*/
type CreateOrganizationCreatedBody struct {
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this create organization created body

View File

@ -281,8 +281,8 @@ swagger:model DeleteOrganizationBody
*/
type DeleteOrganizationBody struct {
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this delete organization body

View File

@ -344,8 +344,8 @@ type ListOrganizationsOKBodyOrganizationsItems0 struct {
// description
Description string `json:"description,omitempty"`
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this list organizations o k body organizations items0

View File

@ -284,8 +284,8 @@ type RemoveOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this remove organization member body

View File

@ -1075,7 +1075,7 @@ func init() {
"description": "organization created",
"schema": {
"properties": {
"token": {
"organizationToken": {
"type": "string"
}
}
@ -1105,7 +1105,7 @@ func init() {
"in": "body",
"schema": {
"properties": {
"token": {
"organizationToken": {
"type": "string"
}
}
@ -1151,7 +1151,7 @@ func init() {
"email": {
"type": "string"
},
"token": {
"organizationToken": {
"type": "string"
}
}
@ -1251,7 +1251,7 @@ func init() {
"email": {
"type": "string"
},
"token": {
"organizationToken": {
"type": "string"
}
}
@ -1297,7 +1297,7 @@ func init() {
"description": {
"type": "string"
},
"token": {
"organizationToken": {
"type": "string"
}
}
@ -3235,7 +3235,7 @@ func init() {
"description": "organization created",
"schema": {
"properties": {
"token": {
"organizationToken": {
"type": "string"
}
}
@ -3265,7 +3265,7 @@ func init() {
"in": "body",
"schema": {
"properties": {
"token": {
"organizationToken": {
"type": "string"
}
}
@ -3311,7 +3311,7 @@ func init() {
"email": {
"type": "string"
},
"token": {
"organizationToken": {
"type": "string"
}
}
@ -3404,7 +3404,7 @@ func init() {
"email": {
"type": "string"
},
"token": {
"organizationToken": {
"type": "string"
}
}
@ -4060,7 +4060,7 @@ func init() {
"description": {
"type": "string"
},
"token": {
"organizationToken": {
"type": "string"
}
}

View File

@ -84,8 +84,8 @@ type AddOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this add organization member body

View File

@ -115,8 +115,8 @@ func (o *CreateOrganizationBody) UnmarshalBinary(b []byte) error {
// swagger:model CreateOrganizationCreatedBody
type CreateOrganizationCreatedBody struct {
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this create organization created body

View File

@ -78,8 +78,8 @@ func (o *DeleteOrganization) ServeHTTP(rw http.ResponseWriter, r *http.Request)
// swagger:model DeleteOrganizationBody
type DeleteOrganizationBody struct {
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this delete organization body

View File

@ -189,8 +189,8 @@ type ListOrganizationsOKBodyOrganizationsItems0 struct {
// description
Description string `json:"description,omitempty"`
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this list organizations o k body organizations items0

View File

@ -81,8 +81,8 @@ type RemoveOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
// token
Token string `json:"token,omitempty"`
// organization token
OrganizationToken string `json:"organizationToken,omitempty"`
}
// Validate validates this remove organization member body

View File

@ -17,6 +17,7 @@ model/createFrontend201Response.ts
model/createFrontendRequest.ts
model/createIdentity201Response.ts
model/createIdentityRequest.ts
model/createOrganization201Response.ts
model/createOrganizationRequest.ts
model/disableRequest.ts
model/enableRequest.ts

View File

@ -20,6 +20,7 @@ import { CreateFrontend201Response } from '../model/createFrontend201Response';
import { CreateFrontendRequest } from '../model/createFrontendRequest';
import { CreateIdentity201Response } from '../model/createIdentity201Response';
import { CreateIdentityRequest } from '../model/createIdentityRequest';
import { CreateOrganization201Response } from '../model/createOrganization201Response';
import { CreateOrganizationRequest } from '../model/createOrganizationRequest';
import { InviteTokenGenerateRequest } from '../model/inviteTokenGenerateRequest';
import { ListFrontends200ResponseInner } from '../model/listFrontends200ResponseInner';
@ -364,7 +365,7 @@ export class AdminApi {
*
* @param body
*/
public async createOrganization (body?: CreateOrganizationRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VerifyRequest; }> {
public async createOrganization (body?: CreateOrganizationRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: CreateOrganization201Response; }> {
const localVarPath = this.basePath + '/organization';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
@ -410,13 +411,13 @@ export class AdminApi {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: VerifyRequest; }>((resolve, reject) => {
return new Promise<{ response: http.IncomingMessage; body: CreateOrganization201Response; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "VerifyRequest");
body = ObjectSerializer.deserialize(body, "CreateOrganization201Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
@ -488,7 +489,7 @@ export class AdminApi {
*
* @param body
*/
public async deleteOrganization (body?: VerifyRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
public async deleteOrganization (body?: CreateOrganization201Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/organization';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
@ -505,7 +506,7 @@ export class AdminApi {
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "VerifyRequest")
body: ObjectSerializer.serialize(body, "CreateOrganization201Response")
};
let authenticationPromise = Promise.resolve();

View File

@ -13,7 +13,7 @@
import { RequestFile } from './models';
export class AddOrganizationMemberRequest {
'token'?: string;
'organizationToken'?: string;
'email'?: string;
'admin'?: boolean;
@ -21,8 +21,8 @@ export class AddOrganizationMemberRequest {
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"name": "organizationToken",
"baseName": "organizationToken",
"type": "string"
},
{

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { RequestFile } from './models';
export class CreateOrganization201Response {
'organizationToken'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "organizationToken",
"baseName": "organizationToken",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreateOrganization201Response.attributeTypeMap;
}
}

View File

@ -13,15 +13,15 @@
import { RequestFile } from './models';
export class ListOrganizations200ResponseOrganizationsInner {
'token'?: string;
'organizationToken'?: string;
'description'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"name": "organizationToken",
"baseName": "organizationToken",
"type": "string"
},
{

View File

@ -10,6 +10,7 @@ export * from './createFrontend201Response';
export * from './createFrontendRequest';
export * from './createIdentity201Response';
export * from './createIdentityRequest';
export * from './createOrganization201Response';
export * from './createOrganizationRequest';
export * from './disableRequest';
export * from './enableRequest';
@ -71,6 +72,7 @@ import { CreateFrontend201Response } from './createFrontend201Response';
import { CreateFrontendRequest } from './createFrontendRequest';
import { CreateIdentity201Response } from './createIdentity201Response';
import { CreateIdentityRequest } from './createIdentityRequest';
import { CreateOrganization201Response } from './createOrganization201Response';
import { CreateOrganizationRequest } from './createOrganizationRequest';
import { DisableRequest } from './disableRequest';
import { EnableRequest } from './enableRequest';
@ -140,6 +142,7 @@ let typeMap: {[index: string]: any} = {
"CreateFrontendRequest": CreateFrontendRequest,
"CreateIdentity201Response": CreateIdentity201Response,
"CreateIdentityRequest": CreateIdentityRequest,
"CreateOrganization201Response": CreateOrganization201Response,
"CreateOrganizationRequest": CreateOrganizationRequest,
"DisableRequest": DisableRequest,
"EnableRequest": EnableRequest,

View File

@ -13,15 +13,15 @@
import { RequestFile } from './models';
export class RemoveOrganizationMemberRequest {
'token'?: string;
'organizationToken'?: string;
'email'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "token",
"baseName": "token",
"name": "organizationToken",
"baseName": "organizationToken",
"type": "string"
},
{

View File

@ -223,6 +223,7 @@ Class | Method | HTTP request | Description
- [InlineResponse201](docs/InlineResponse201.md)
- [InlineResponse2011](docs/InlineResponse2011.md)
- [InlineResponse2012](docs/InlineResponse2012.md)
- [InlineResponse2013](docs/InlineResponse2013.md)
- [InviteBody](docs/InviteBody.md)
- [LoginBody](docs/LoginBody.md)
- [Metrics](docs/Metrics.md)

View File

@ -223,7 +223,7 @@ 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)
# **create_organization**
> VerifyBody create_organization(body=body)
> InlineResponse2012 create_organization(body=body)
@ -260,7 +260,7 @@ Name | Type | Description | Notes
### Return type
[**VerifyBody**](VerifyBody.md)
[**InlineResponse2012**](InlineResponse2012.md)
### Authorization

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **str** | | [optional]
**organization_token** | **str** | | [optional]
**description** | **str** | | [optional]
[[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

@ -3,8 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontend_token** | **str** | | [optional]
**backend_mode** | **str** | | [optional]
**organization_token** | **str** | | [optional]
[[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

@ -0,0 +1,10 @@
# InlineResponse2013
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**frontend_token** | **str** | | [optional]
**backend_mode** | **str** | | [optional]
[[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

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **str** | | [optional]
**organization_token** | **str** | | [optional]
**email** | **str** | | [optional]
**admin** | **bool** | | [optional]

View File

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **str** | | [optional]
**organization_token** | **str** | | [optional]
[[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

@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **str** | | [optional]
**organization_token** | **str** | | [optional]
**email** | **str** | | [optional]
[[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

@ -11,7 +11,7 @@ Method | HTTP request | Description
[**update_share**](ShareApi.md#update_share) | **PATCH** /share |
# **access**
> InlineResponse2012 access(body=body)
> InlineResponse2013 access(body=body)
@ -48,7 +48,7 @@ Name | Type | Description | Notes
### Return type
[**InlineResponse2012**](InlineResponse2012.md)
[**InlineResponse2013**](InlineResponse2013.md)
### Authorization

View File

@ -0,0 +1,39 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import zrok_api
from zrok_api.models.inline_response2013 import InlineResponse2013 # noqa: E501
from zrok_api.rest import ApiException
class TestInlineResponse2013(unittest.TestCase):
"""InlineResponse2013 unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testInlineResponse2013(self):
"""Test InlineResponse2013"""
# FIXME: construct object with mandatory attributes with example values
# model = zrok_api.models.inline_response2013.InlineResponse2013() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()

View File

@ -55,6 +55,7 @@ from zrok_api.models.inline_response2006 import InlineResponse2006
from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.inline_response2011 import InlineResponse2011
from zrok_api.models.inline_response2012 import InlineResponse2012
from zrok_api.models.inline_response2013 import InlineResponse2013
from zrok_api.models.invite_body import InviteBody
from zrok_api.models.login_body import LoginBody
from zrok_api.models.metrics import Metrics

View File

@ -410,7 +410,7 @@ class AdminApi(object):
:param async_req bool
:param OrganizationBody body:
:return: VerifyBody
:return: InlineResponse2012
If the method is called asynchronously,
returns the request thread.
"""
@ -431,7 +431,7 @@ class AdminApi(object):
:param async_req bool
:param OrganizationBody body:
:return: VerifyBody
:return: InlineResponse2012
If the method is called asynchronously,
returns the request thread.
"""
@ -485,7 +485,7 @@ class AdminApi(object):
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='VerifyBody', # noqa: E501
response_type='InlineResponse2012', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),

View File

@ -42,7 +42,7 @@ class ShareApi(object):
:param async_req bool
:param AccessBody body:
:return: InlineResponse2012
:return: InlineResponse2013
If the method is called asynchronously,
returns the request thread.
"""
@ -63,7 +63,7 @@ class ShareApi(object):
:param async_req bool
:param AccessBody body:
:return: InlineResponse2012
:return: InlineResponse2013
If the method is called asynchronously,
returns the request thread.
"""
@ -117,7 +117,7 @@ class ShareApi(object):
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2012', # noqa: E501
response_type='InlineResponse2013', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),

View File

@ -45,6 +45,7 @@ from zrok_api.models.inline_response2006 import InlineResponse2006
from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.inline_response2011 import InlineResponse2011
from zrok_api.models.inline_response2012 import InlineResponse2012
from zrok_api.models.inline_response2013 import InlineResponse2013
from zrok_api.models.invite_body import InviteBody
from zrok_api.models.login_body import LoginBody
from zrok_api.models.metrics import Metrics

View File

@ -28,45 +28,45 @@ class InlineResponse2004Organizations(object):
and the value is json key in definition.
"""
swagger_types = {
'token': 'str',
'organization_token': 'str',
'description': 'str'
}
attribute_map = {
'token': 'token',
'organization_token': 'organizationToken',
'description': 'description'
}
def __init__(self, token=None, description=None): # noqa: E501
def __init__(self, organization_token=None, description=None): # noqa: E501
"""InlineResponse2004Organizations - a model defined in Swagger""" # noqa: E501
self._token = None
self._organization_token = None
self._description = None
self.discriminator = None
if token is not None:
self.token = token
if organization_token is not None:
self.organization_token = organization_token
if description is not None:
self.description = description
@property
def token(self):
"""Gets the token of this InlineResponse2004Organizations. # noqa: E501
def organization_token(self):
"""Gets the organization_token of this InlineResponse2004Organizations. # noqa: E501
:return: The token of this InlineResponse2004Organizations. # noqa: E501
:return: The organization_token of this InlineResponse2004Organizations. # noqa: E501
:rtype: str
"""
return self._token
return self._organization_token
@token.setter
def token(self, token):
"""Sets the token of this InlineResponse2004Organizations.
@organization_token.setter
def organization_token(self, organization_token):
"""Sets the organization_token of this InlineResponse2004Organizations.
:param token: The token of this InlineResponse2004Organizations. # noqa: E501
:param organization_token: The organization_token of this InlineResponse2004Organizations. # noqa: E501
:type: str
"""
self._token = token
self._organization_token = organization_token
@property
def description(self):

View File

@ -28,66 +28,40 @@ class InlineResponse2012(object):
and the value is json key in definition.
"""
swagger_types = {
'frontend_token': 'str',
'backend_mode': 'str'
'organization_token': 'str'
}
attribute_map = {
'frontend_token': 'frontendToken',
'backend_mode': 'backendMode'
'organization_token': 'organizationToken'
}
def __init__(self, frontend_token=None, backend_mode=None): # noqa: E501
def __init__(self, organization_token=None): # noqa: E501
"""InlineResponse2012 - a model defined in Swagger""" # noqa: E501
self._frontend_token = None
self._backend_mode = None
self._organization_token = None
self.discriminator = None
if frontend_token is not None:
self.frontend_token = frontend_token
if backend_mode is not None:
self.backend_mode = backend_mode
if organization_token is not None:
self.organization_token = organization_token
@property
def frontend_token(self):
"""Gets the frontend_token of this InlineResponse2012. # noqa: E501
def organization_token(self):
"""Gets the organization_token of this InlineResponse2012. # noqa: E501
:return: The frontend_token of this InlineResponse2012. # noqa: E501
:return: The organization_token of this InlineResponse2012. # noqa: E501
:rtype: str
"""
return self._frontend_token
return self._organization_token
@frontend_token.setter
def frontend_token(self, frontend_token):
"""Sets the frontend_token of this InlineResponse2012.
@organization_token.setter
def organization_token(self, organization_token):
"""Sets the organization_token of this InlineResponse2012.
:param frontend_token: The frontend_token of this InlineResponse2012. # noqa: E501
:param organization_token: The organization_token of this InlineResponse2012. # noqa: E501
:type: str
"""
self._frontend_token = frontend_token
@property
def backend_mode(self):
"""Gets the backend_mode of this InlineResponse2012. # noqa: E501
:return: The backend_mode of this InlineResponse2012. # noqa: E501
:rtype: str
"""
return self._backend_mode
@backend_mode.setter
def backend_mode(self, backend_mode):
"""Sets the backend_mode of this InlineResponse2012.
:param backend_mode: The backend_mode of this InlineResponse2012. # noqa: E501
:type: str
"""
self._backend_mode = backend_mode
self._organization_token = organization_token
def to_dict(self):
"""Returns the model properties as a dict"""

View File

@ -0,0 +1,136 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 1.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InlineResponse2013(object):
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is json key in definition.
"""
swagger_types = {
'frontend_token': 'str',
'backend_mode': 'str'
}
attribute_map = {
'frontend_token': 'frontendToken',
'backend_mode': 'backendMode'
}
def __init__(self, frontend_token=None, backend_mode=None): # noqa: E501
"""InlineResponse2013 - a model defined in Swagger""" # noqa: E501
self._frontend_token = None
self._backend_mode = None
self.discriminator = None
if frontend_token is not None:
self.frontend_token = frontend_token
if backend_mode is not None:
self.backend_mode = backend_mode
@property
def frontend_token(self):
"""Gets the frontend_token of this InlineResponse2013. # noqa: E501
:return: The frontend_token of this InlineResponse2013. # noqa: E501
:rtype: str
"""
return self._frontend_token
@frontend_token.setter
def frontend_token(self, frontend_token):
"""Sets the frontend_token of this InlineResponse2013.
:param frontend_token: The frontend_token of this InlineResponse2013. # noqa: E501
:type: str
"""
self._frontend_token = frontend_token
@property
def backend_mode(self):
"""Gets the backend_mode of this InlineResponse2013. # noqa: E501
:return: The backend_mode of this InlineResponse2013. # noqa: E501
:rtype: str
"""
return self._backend_mode
@backend_mode.setter
def backend_mode(self, backend_mode):
"""Sets the backend_mode of this InlineResponse2013.
:param backend_mode: The backend_mode of this InlineResponse2013. # noqa: E501
:type: str
"""
self._backend_mode = backend_mode
def to_dict(self):
"""Returns the model properties as a dict"""
result = {}
for attr, _ in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map(
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
value
))
elif hasattr(value, "to_dict"):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map(
lambda item: (item[0], item[1].to_dict())
if hasattr(item[1], "to_dict") else item,
value.items()
))
else:
result[attr] = value
if issubclass(InlineResponse2013, dict):
for key, value in self.items():
result[key] = value
return result
def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict())
def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str()
def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, InlineResponse2013):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
"""Returns true if both objects are not equal"""
return not self == other

View File

@ -28,50 +28,50 @@ class OrganizationAddBody(object):
and the value is json key in definition.
"""
swagger_types = {
'token': 'str',
'organization_token': 'str',
'email': 'str',
'admin': 'bool'
}
attribute_map = {
'token': 'token',
'organization_token': 'organizationToken',
'email': 'email',
'admin': 'admin'
}
def __init__(self, token=None, email=None, admin=None): # noqa: E501
def __init__(self, organization_token=None, email=None, admin=None): # noqa: E501
"""OrganizationAddBody - a model defined in Swagger""" # noqa: E501
self._token = None
self._organization_token = None
self._email = None
self._admin = None
self.discriminator = None
if token is not None:
self.token = token
if organization_token is not None:
self.organization_token = organization_token
if email is not None:
self.email = email
if admin is not None:
self.admin = admin
@property
def token(self):
"""Gets the token of this OrganizationAddBody. # noqa: E501
def organization_token(self):
"""Gets the organization_token of this OrganizationAddBody. # noqa: E501
:return: The token of this OrganizationAddBody. # noqa: E501
:return: The organization_token of this OrganizationAddBody. # noqa: E501
:rtype: str
"""
return self._token
return self._organization_token
@token.setter
def token(self, token):
"""Sets the token of this OrganizationAddBody.
@organization_token.setter
def organization_token(self, organization_token):
"""Sets the organization_token of this OrganizationAddBody.
:param token: The token of this OrganizationAddBody. # noqa: E501
:param organization_token: The organization_token of this OrganizationAddBody. # noqa: E501
:type: str
"""
self._token = token
self._organization_token = organization_token
@property
def email(self):

View File

@ -28,40 +28,40 @@ class OrganizationBody1(object):
and the value is json key in definition.
"""
swagger_types = {
'token': 'str'
'organization_token': 'str'
}
attribute_map = {
'token': 'token'
'organization_token': 'organizationToken'
}
def __init__(self, token=None): # noqa: E501
def __init__(self, organization_token=None): # noqa: E501
"""OrganizationBody1 - a model defined in Swagger""" # noqa: E501
self._token = None
self._organization_token = None
self.discriminator = None
if token is not None:
self.token = token
if organization_token is not None:
self.organization_token = organization_token
@property
def token(self):
"""Gets the token of this OrganizationBody1. # noqa: E501
def organization_token(self):
"""Gets the organization_token of this OrganizationBody1. # noqa: E501
:return: The token of this OrganizationBody1. # noqa: E501
:return: The organization_token of this OrganizationBody1. # noqa: E501
:rtype: str
"""
return self._token
return self._organization_token
@token.setter
def token(self, token):
"""Sets the token of this OrganizationBody1.
@organization_token.setter
def organization_token(self, organization_token):
"""Sets the organization_token of this OrganizationBody1.
:param token: The token of this OrganizationBody1. # noqa: E501
:param organization_token: The organization_token of this OrganizationBody1. # noqa: E501
:type: str
"""
self._token = token
self._organization_token = organization_token
def to_dict(self):
"""Returns the model properties as a dict"""

View File

@ -28,45 +28,45 @@ class OrganizationRemoveBody(object):
and the value is json key in definition.
"""
swagger_types = {
'token': 'str',
'organization_token': 'str',
'email': 'str'
}
attribute_map = {
'token': 'token',
'organization_token': 'organizationToken',
'email': 'email'
}
def __init__(self, token=None, email=None): # noqa: E501
def __init__(self, organization_token=None, email=None): # noqa: E501
"""OrganizationRemoveBody - a model defined in Swagger""" # noqa: E501
self._token = None
self._organization_token = None
self._email = None
self.discriminator = None
if token is not None:
self.token = token
if organization_token is not None:
self.organization_token = organization_token
if email is not None:
self.email = email
@property
def token(self):
"""Gets the token of this OrganizationRemoveBody. # noqa: E501
def organization_token(self):
"""Gets the organization_token of this OrganizationRemoveBody. # noqa: E501
:return: The token of this OrganizationRemoveBody. # noqa: E501
:return: The organization_token of this OrganizationRemoveBody. # noqa: E501
:rtype: str
"""
return self._token
return self._organization_token
@token.setter
def token(self, token):
"""Sets the token of this OrganizationRemoveBody.
@organization_token.setter
def organization_token(self, organization_token):
"""Sets the organization_token of this OrganizationRemoveBody.
:param token: The token of this OrganizationRemoveBody. # noqa: E501
:param organization_token: The organization_token of this OrganizationRemoveBody. # noqa: E501
:type: str
"""
self._token = token
self._organization_token = organization_token
@property
def email(self):

View File

@ -471,7 +471,7 @@ paths:
description: organization created
schema:
properties:
token:
organizationToken:
type: string
401:
description: unauthorized
@ -488,7 +488,7 @@ paths:
in: body
schema:
properties:
token:
organizationToken:
type: string
responses:
200:
@ -512,7 +512,7 @@ paths:
in: body
schema:
properties:
token:
organizationToken:
type: string
email:
type: string
@ -574,7 +574,7 @@ paths:
in: body
schema:
properties:
token:
organizationToken:
type: string
email:
type: string
@ -604,7 +604,7 @@ paths:
type: array
items:
properties:
token:
organizationToken:
type: string
description:
type: string

View File

@ -14,6 +14,7 @@ models/CreateFrontend201Response.ts
models/CreateFrontendRequest.ts
models/CreateIdentity201Response.ts
models/CreateIdentityRequest.ts
models/CreateOrganization201Response.ts
models/CreateOrganizationRequest.ts
models/DisableRequest.ts
models/EnableRequest.ts

View File

@ -20,6 +20,7 @@ import type {
CreateFrontendRequest,
CreateIdentity201Response,
CreateIdentityRequest,
CreateOrganization201Response,
CreateOrganizationRequest,
InviteTokenGenerateRequest,
ListFrontends200ResponseInner,
@ -43,6 +44,8 @@ import {
CreateIdentity201ResponseToJSON,
CreateIdentityRequestFromJSON,
CreateIdentityRequestToJSON,
CreateOrganization201ResponseFromJSON,
CreateOrganization201ResponseToJSON,
CreateOrganizationRequestFromJSON,
CreateOrganizationRequestToJSON,
InviteTokenGenerateRequestFromJSON,
@ -92,7 +95,7 @@ export interface DeleteFrontendRequest {
}
export interface DeleteOrganizationRequest {
body?: VerifyRequest;
body?: CreateOrganization201Response;
}
export interface GrantsRequest {
@ -245,7 +248,7 @@ export class AdminApi extends runtime.BaseAPI {
/**
*/
async createOrganizationRaw(requestParameters: CreateOrganizationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyRequest>> {
async createOrganizationRaw(requestParameters: CreateOrganizationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateOrganization201Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
@ -264,12 +267,12 @@ export class AdminApi extends runtime.BaseAPI {
body: CreateOrganizationRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VerifyRequestFromJSON(jsonValue));
return new runtime.JSONApiResponse(response, (jsonValue) => CreateOrganization201ResponseFromJSON(jsonValue));
}
/**
*/
async createOrganization(requestParameters: CreateOrganizationOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyRequest> {
async createOrganization(requestParameters: CreateOrganizationOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CreateOrganization201Response> {
const response = await this.createOrganizationRaw(requestParameters, initOverrides);
return await response.value();
}
@ -322,7 +325,7 @@ export class AdminApi extends runtime.BaseAPI {
method: 'DELETE',
headers: headerParameters,
query: queryParameters,
body: VerifyRequestToJSON(requestParameters['body']),
body: CreateOrganization201ResponseToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.VoidApiResponse(response);

View File

@ -24,7 +24,7 @@ export interface AddOrganizationMemberRequest {
* @type {string}
* @memberof AddOrganizationMemberRequest
*/
token?: string;
organizationToken?: string;
/**
*
* @type {string}
@ -56,7 +56,7 @@ export function AddOrganizationMemberRequestFromJSONTyped(json: any, ignoreDiscr
}
return {
'token': json['token'] == null ? undefined : json['token'],
'organizationToken': json['organizationToken'] == null ? undefined : json['organizationToken'],
'email': json['email'] == null ? undefined : json['email'],
'admin': json['admin'] == null ? undefined : json['admin'],
};
@ -68,7 +68,7 @@ export function AddOrganizationMemberRequestToJSON(value?: AddOrganizationMember
}
return {
'token': value['token'],
'organizationToken': value['organizationToken'],
'email': value['email'],
'admin': value['admin'],
};

View File

@ -0,0 +1,60 @@
/* tslint:disable */
/* eslint-disable */
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface CreateOrganization201Response
*/
export interface CreateOrganization201Response {
/**
*
* @type {string}
* @memberof CreateOrganization201Response
*/
organizationToken?: string;
}
/**
* Check if a given object implements the CreateOrganization201Response interface.
*/
export function instanceOfCreateOrganization201Response(value: object): value is CreateOrganization201Response {
return true;
}
export function CreateOrganization201ResponseFromJSON(json: any): CreateOrganization201Response {
return CreateOrganization201ResponseFromJSONTyped(json, false);
}
export function CreateOrganization201ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateOrganization201Response {
if (json == null) {
return json;
}
return {
'organizationToken': json['organizationToken'] == null ? undefined : json['organizationToken'],
};
}
export function CreateOrganization201ResponseToJSON(value?: CreateOrganization201Response | null): any {
if (value == null) {
return value;
}
return {
'organizationToken': value['organizationToken'],
};
}

View File

@ -24,7 +24,7 @@ export interface ListOrganizations200ResponseOrganizationsInner {
* @type {string}
* @memberof ListOrganizations200ResponseOrganizationsInner
*/
token?: string;
organizationToken?: string;
/**
*
* @type {string}
@ -50,7 +50,7 @@ export function ListOrganizations200ResponseOrganizationsInnerFromJSONTyped(json
}
return {
'token': json['token'] == null ? undefined : json['token'],
'organizationToken': json['organizationToken'] == null ? undefined : json['organizationToken'],
'description': json['description'] == null ? undefined : json['description'],
};
}
@ -61,7 +61,7 @@ export function ListOrganizations200ResponseOrganizationsInnerToJSON(value?: Lis
}
return {
'token': value['token'],
'organizationToken': value['organizationToken'],
'description': value['description'],
};
}

View File

@ -24,7 +24,7 @@ export interface RemoveOrganizationMemberRequest {
* @type {string}
* @memberof RemoveOrganizationMemberRequest
*/
token?: string;
organizationToken?: string;
/**
*
* @type {string}
@ -50,7 +50,7 @@ export function RemoveOrganizationMemberRequestFromJSONTyped(json: any, ignoreDi
}
return {
'token': json['token'] == null ? undefined : json['token'],
'organizationToken': json['organizationToken'] == null ? undefined : json['organizationToken'],
'email': json['email'] == null ? undefined : json['email'],
};
}
@ -61,7 +61,7 @@ export function RemoveOrganizationMemberRequestToJSON(value?: RemoveOrganization
}
return {
'token': value['token'],
'organizationToken': value['organizationToken'],
'email': value['email'],
};
}

View File

@ -9,6 +9,7 @@ export * from './CreateFrontend201Response';
export * from './CreateFrontendRequest';
export * from './CreateIdentity201Response';
export * from './CreateIdentityRequest';
export * from './CreateOrganization201Response';
export * from './CreateOrganizationRequest';
export * from './DisableRequest';
export * from './EnableRequest';