verify endpoint polish (#834)

This commit is contained in:
Michael Quigley 2025-02-03 12:59:55 -05:00
parent d9b32e14c9
commit 14d03b88f7
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
32 changed files with 1079 additions and 230 deletions

View File

@ -2,20 +2,18 @@ package controller
import ( import (
"github.com/go-openapi/runtime/middleware" "github.com/go-openapi/runtime/middleware"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/rest_server_zrok/operations/account" "github.com/openziti/zrok/rest_server_zrok/operations/account"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
) )
type verifyHandler struct { type verifyHandler struct{}
}
func newVerifyHandler() *verifyHandler { func newVerifyHandler() *verifyHandler {
return &verifyHandler{} return &verifyHandler{}
} }
func (self *verifyHandler) Handle(params account.VerifyParams) middleware.Responder { func (h *verifyHandler) Handle(params account.VerifyParams) middleware.Responder {
if params.Body != nil { if params.Body.Token != "" {
logrus.Debugf("received verify request for token '%v'", params.Body.Token) logrus.Debugf("received verify request for token '%v'", params.Body.Token)
tx, err := str.Begin() tx, err := str.Begin()
if err != nil { if err != nil {
@ -30,7 +28,7 @@ func (self *verifyHandler) Handle(params account.VerifyParams) middleware.Respon
return account.NewVerifyNotFound() return account.NewVerifyNotFound()
} }
return account.NewVerifyOK().WithPayload(&rest_model_zrok.VerifyResponse{Email: ar.Email}) return account.NewVerifyOK().WithPayload(&account.VerifyOKBody{Email: ar.Email})
} }
logrus.Error("empty verification request") logrus.Error("empty verification request")
return account.NewVerifyInternalServerError() return account.NewVerifyInternalServerError()

View File

@ -14,8 +14,6 @@ import (
"github.com/go-openapi/runtime" "github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client" cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt" "github.com/go-openapi/strfmt"
"github.com/openziti/zrok/rest_model_zrok"
) )
// NewVerifyParams creates a new VerifyParams object, // NewVerifyParams creates a new VerifyParams object,
@ -64,7 +62,7 @@ VerifyParams contains all the parameters to send to the API endpoint
type VerifyParams struct { type VerifyParams struct {
// Body. // Body.
Body *rest_model_zrok.VerifyRequest Body VerifyBody
timeout time.Duration timeout time.Duration
Context context.Context Context context.Context
@ -120,13 +118,13 @@ func (o *VerifyParams) SetHTTPClient(client *http.Client) {
} }
// WithBody adds the body to the verify params // WithBody adds the body to the verify params
func (o *VerifyParams) WithBody(body *rest_model_zrok.VerifyRequest) *VerifyParams { func (o *VerifyParams) WithBody(body VerifyBody) *VerifyParams {
o.SetBody(body) o.SetBody(body)
return o return o
} }
// SetBody adds the body to the verify params // SetBody adds the body to the verify params
func (o *VerifyParams) SetBody(body *rest_model_zrok.VerifyRequest) { func (o *VerifyParams) SetBody(body VerifyBody) {
o.Body = body o.Body = body
} }
@ -137,11 +135,9 @@ func (o *VerifyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regist
return err return err
} }
var res []error var res []error
if o.Body != nil {
if err := r.SetBodyParam(o.Body); err != nil { if err := r.SetBodyParam(o.Body); err != nil {
return err return err
} }
}
if len(res) > 0 { if len(res) > 0 {
return errors.CompositeValidationError(res...) return errors.CompositeValidationError(res...)

View File

@ -6,13 +6,13 @@ package account
// Editing this file might prove futile when you re-run the swagger generate command // Editing this file might prove futile when you re-run the swagger generate command
import ( import (
"context"
"fmt" "fmt"
"io" "io"
"github.com/go-openapi/runtime" "github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt" "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/rest_model_zrok"
) )
// VerifyReader is a Reader for the Verify structure. // VerifyReader is a Reader for the Verify structure.
@ -57,7 +57,7 @@ VerifyOK describes a response with status code 200, with default header values.
token ready token ready
*/ */
type VerifyOK struct { type VerifyOK struct {
Payload *rest_model_zrok.VerifyResponse Payload *VerifyOKBody
} }
// IsSuccess returns true when this verify o k response has a 2xx status code // IsSuccess returns true when this verify o k response has a 2xx status code
@ -98,13 +98,13 @@ func (o *VerifyOK) String() string {
return fmt.Sprintf("[POST /verify][%d] verifyOK %+v", 200, o.Payload) return fmt.Sprintf("[POST /verify][%d] verifyOK %+v", 200, o.Payload)
} }
func (o *VerifyOK) GetPayload() *rest_model_zrok.VerifyResponse { func (o *VerifyOK) GetPayload() *VerifyOKBody {
return o.Payload return o.Payload
} }
func (o *VerifyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { func (o *VerifyOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(rest_model_zrok.VerifyResponse) o.Payload = new(VerifyOKBody)
// response payload // response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
@ -225,3 +225,79 @@ func (o *VerifyInternalServerError) readResponse(response runtime.ClientResponse
return nil return nil
} }
/*
VerifyBody verify body
swagger:model VerifyBody
*/
type VerifyBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this verify body
func (o *VerifyBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this verify body based on context it is used
func (o *VerifyBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *VerifyBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *VerifyBody) UnmarshalBinary(b []byte) error {
var res VerifyBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
/*
VerifyOKBody verify o k body
swagger:model VerifyOKBody
*/
type VerifyOKBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this verify o k body
func (o *VerifyOKBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this verify o k body based on context it is used
func (o *VerifyOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *VerifyOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *VerifyOKBody) UnmarshalBinary(b []byte) error {
var res VerifyOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -1677,7 +1677,11 @@ func init() {
"name": "body", "name": "body",
"in": "body", "in": "body",
"schema": { "schema": {
"$ref": "#/definitions/verifyRequest" "properties": {
"token": {
"type": "string"
}
}
} }
} }
], ],
@ -1685,7 +1689,11 @@ func init() {
"200": { "200": {
"description": "token ready", "description": "token ready",
"schema": { "schema": {
"$ref": "#/definitions/verifyResponse" "properties": {
"email": {
"type": "string"
}
}
} }
}, },
"404": { "404": {
@ -2271,22 +2279,6 @@ func init() {
} }
} }
}, },
"verifyRequest": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"verifyResponse": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
},
"version": { "version": {
"type": "string" "type": "string"
} }
@ -3928,7 +3920,11 @@ func init() {
"name": "body", "name": "body",
"in": "body", "in": "body",
"schema": { "schema": {
"$ref": "#/definitions/verifyRequest" "properties": {
"token": {
"type": "string"
}
}
} }
} }
], ],
@ -3936,7 +3932,11 @@ func init() {
"200": { "200": {
"description": "token ready", "description": "token ready",
"schema": { "schema": {
"$ref": "#/definitions/verifyResponse" "properties": {
"email": {
"type": "string"
}
}
} }
}, },
"404": { "404": {
@ -4555,22 +4555,6 @@ func init() {
} }
} }
}, },
"verifyRequest": {
"type": "object",
"properties": {
"token": {
"type": "string"
}
}
},
"verifyResponse": {
"type": "object",
"properties": {
"email": {
"type": "string"
}
}
},
"version": { "version": {
"type": "string" "type": "string"
} }

View File

@ -6,9 +6,12 @@ package account
// Editing this file might prove futile when you re-run the generate command // Editing this file might prove futile when you re-run the generate command
import ( import (
"context"
"net/http" "net/http"
"github.com/go-openapi/runtime/middleware" "github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
) )
// VerifyHandlerFunc turns a function with the right signature into a verify handler // VerifyHandlerFunc turns a function with the right signature into a verify handler
@ -54,3 +57,77 @@ func (o *Verify) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
o.Context.Respond(rw, r, route.Produces, route, res) o.Context.Respond(rw, r, route.Produces, route, res)
} }
// VerifyBody verify body
//
// swagger:model VerifyBody
type VerifyBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this verify body
func (o *VerifyBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this verify body based on context it is used
func (o *VerifyBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *VerifyBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *VerifyBody) UnmarshalBinary(b []byte) error {
var res VerifyBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
// VerifyOKBody verify o k body
//
// swagger:model VerifyOKBody
type VerifyOKBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this verify o k body
func (o *VerifyOKBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this verify o k body based on context it is used
func (o *VerifyOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *VerifyOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *VerifyOKBody) UnmarshalBinary(b []byte) error {
var res VerifyOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -12,8 +12,6 @@ import (
"github.com/go-openapi/runtime" "github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware" "github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate" "github.com/go-openapi/validate"
"github.com/openziti/zrok/rest_model_zrok"
) )
// NewVerifyParams creates a new VerifyParams object // NewVerifyParams creates a new VerifyParams object
@ -36,7 +34,7 @@ type VerifyParams struct {
/* /*
In: body In: body
*/ */
Body *rest_model_zrok.VerifyRequest Body VerifyBody
} }
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
@ -50,7 +48,7 @@ func (o *VerifyParams) BindRequest(r *http.Request, route *middleware.MatchedRou
if runtime.HasBody(r) { if runtime.HasBody(r) {
defer r.Body.Close() defer r.Body.Close()
var body rest_model_zrok.VerifyRequest var body VerifyBody
if err := route.Consumer.Consume(r.Body, &body); err != nil { if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("body", "body", "", err)) res = append(res, errors.NewParseError("body", "body", "", err))
} else { } else {
@ -65,7 +63,7 @@ func (o *VerifyParams) BindRequest(r *http.Request, route *middleware.MatchedRou
} }
if len(res) == 0 { if len(res) == 0 {
o.Body = &body o.Body = body
} }
} }
} }

View File

@ -9,8 +9,6 @@ import (
"net/http" "net/http"
"github.com/go-openapi/runtime" "github.com/go-openapi/runtime"
"github.com/openziti/zrok/rest_model_zrok"
) )
// VerifyOKCode is the HTTP code returned for type VerifyOK // VerifyOKCode is the HTTP code returned for type VerifyOK
@ -26,7 +24,7 @@ type VerifyOK struct {
/* /*
In: Body In: Body
*/ */
Payload *rest_model_zrok.VerifyResponse `json:"body,omitempty"` Payload *VerifyOKBody `json:"body,omitempty"`
} }
// NewVerifyOK creates VerifyOK with default headers values // NewVerifyOK creates VerifyOK with default headers values
@ -36,13 +34,13 @@ func NewVerifyOK() *VerifyOK {
} }
// WithPayload adds the payload to the verify o k response // WithPayload adds the payload to the verify o k response
func (o *VerifyOK) WithPayload(payload *rest_model_zrok.VerifyResponse) *VerifyOK { func (o *VerifyOK) WithPayload(payload *VerifyOKBody) *VerifyOK {
o.Payload = payload o.Payload = payload
return o return o
} }
// SetPayload sets the payload to the verify o k response // SetPayload sets the payload to the verify o k response
func (o *VerifyOK) SetPayload(payload *rest_model_zrok.VerifyResponse) { func (o *VerifyOK) SetPayload(payload *VerifyOKBody) {
o.Payload = payload o.Payload = payload
} }

View File

@ -26,7 +26,6 @@ model/environmentAndResources.ts
model/frontend.ts model/frontend.ts
model/getSparklines200Response.ts model/getSparklines200Response.ts
model/getSparklinesRequest.ts model/getSparklinesRequest.ts
model/grantsRequest.ts
model/inviteRequest.ts model/inviteRequest.ts
model/inviteTokenGenerateRequest.ts model/inviteTokenGenerateRequest.ts
model/listMemberships200Response.ts model/listMemberships200Response.ts
@ -55,5 +54,4 @@ model/unaccessRequest.ts
model/unshareRequest.ts model/unshareRequest.ts
model/updateFrontendRequest.ts model/updateFrontendRequest.ts
model/updateShareRequest.ts model/updateShareRequest.ts
model/verifyRequest.ts model/verify200Response.ts
model/verifyResponse.ts

View File

@ -21,8 +21,7 @@ import { LoginRequest } from '../model/loginRequest';
import { RegenerateToken200Response } from '../model/regenerateToken200Response'; import { RegenerateToken200Response } from '../model/regenerateToken200Response';
import { RegenerateTokenRequest } from '../model/regenerateTokenRequest'; import { RegenerateTokenRequest } from '../model/regenerateTokenRequest';
import { RegisterRequest } from '../model/registerRequest'; import { RegisterRequest } from '../model/registerRequest';
import { VerifyRequest } from '../model/verifyRequest'; import { Verify200Response } from '../model/verify200Response';
import { VerifyResponse } from '../model/verifyResponse';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
@ -536,7 +535,7 @@ export class AccountApi {
* *
* @param body * @param body
*/ */
public async verify (body?: VerifyRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: VerifyResponse; }> { public async verify (body?: RegenerateToken200Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Verify200Response; }> {
const localVarPath = this.basePath + '/verify'; const localVarPath = this.basePath + '/verify';
let localVarQueryParameters: any = {}; let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders); let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
@ -560,7 +559,7 @@ export class AccountApi {
uri: localVarPath, uri: localVarPath,
useQuerystring: this._useQuerystring, useQuerystring: this._useQuerystring,
json: true, json: true,
body: ObjectSerializer.serialize(body, "VerifyRequest") body: ObjectSerializer.serialize(body, "RegenerateToken200Response")
}; };
let authenticationPromise = Promise.resolve(); let authenticationPromise = Promise.resolve();
@ -579,13 +578,13 @@ export class AccountApi {
localVarRequestOptions.form = localVarFormParams; localVarRequestOptions.form = localVarFormParams;
} }
} }
return new Promise<{ response: http.IncomingMessage; body: VerifyResponse; }>((resolve, reject) => { return new Promise<{ response: http.IncomingMessage; body: Verify200Response; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => { localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) { if (error) {
reject(error); reject(error);
} else { } else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
body = ObjectSerializer.deserialize(body, "VerifyResponse"); body = ObjectSerializer.deserialize(body, "Verify200Response");
resolve({ response: response, body: body }); resolve({ response: response, body: body });
} else { } else {
reject(new HttpError(response, body, response.statusCode)); reject(new HttpError(response, body, response.statusCode));

View File

@ -22,7 +22,6 @@ import { CreateIdentity201Response } from '../model/createIdentity201Response';
import { CreateIdentityRequest } from '../model/createIdentityRequest'; import { CreateIdentityRequest } from '../model/createIdentityRequest';
import { CreateOrganizationRequest } from '../model/createOrganizationRequest'; import { CreateOrganizationRequest } from '../model/createOrganizationRequest';
import { DeleteFrontendRequest } from '../model/deleteFrontendRequest'; import { DeleteFrontendRequest } from '../model/deleteFrontendRequest';
import { GrantsRequest } from '../model/grantsRequest';
import { InviteTokenGenerateRequest } from '../model/inviteTokenGenerateRequest'; import { InviteTokenGenerateRequest } from '../model/inviteTokenGenerateRequest';
import { ListOrganizationMembers200Response } from '../model/listOrganizationMembers200Response'; import { ListOrganizationMembers200Response } from '../model/listOrganizationMembers200Response';
import { ListOrganizations200Response } from '../model/listOrganizations200Response'; import { ListOrganizations200Response } from '../model/listOrganizations200Response';
@ -31,6 +30,7 @@ import { PublicFrontend } from '../model/publicFrontend';
import { RegenerateToken200Response } from '../model/regenerateToken200Response'; import { RegenerateToken200Response } from '../model/regenerateToken200Response';
import { RemoveOrganizationMemberRequest } from '../model/removeOrganizationMemberRequest'; import { RemoveOrganizationMemberRequest } from '../model/removeOrganizationMemberRequest';
import { UpdateFrontendRequest } from '../model/updateFrontendRequest'; import { UpdateFrontendRequest } from '../model/updateFrontendRequest';
import { Verify200Response } from '../model/verify200Response';
import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models';
import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models';
@ -546,7 +546,7 @@ export class AdminApi {
* *
* @param body * @param body
*/ */
public async grants (body?: GrantsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> { public async grants (body?: Verify200Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/grants'; const localVarPath = this.basePath + '/grants';
let localVarQueryParameters: any = {}; let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders); let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
@ -563,7 +563,7 @@ export class AdminApi {
uri: localVarPath, uri: localVarPath,
useQuerystring: this._useQuerystring, useQuerystring: this._useQuerystring,
json: true, json: true,
body: ObjectSerializer.serialize(body, "GrantsRequest") body: ObjectSerializer.serialize(body, "Verify200Response")
}; };
let authenticationPromise = Promise.resolve(); let authenticationPromise = Promise.resolve();

View File

@ -20,7 +20,6 @@ export * from './environmentAndResources';
export * from './frontend'; export * from './frontend';
export * from './getSparklines200Response'; export * from './getSparklines200Response';
export * from './getSparklinesRequest'; export * from './getSparklinesRequest';
export * from './grantsRequest';
export * from './inviteRequest'; export * from './inviteRequest';
export * from './inviteTokenGenerateRequest'; export * from './inviteTokenGenerateRequest';
export * from './listMemberships200Response'; export * from './listMemberships200Response';
@ -48,8 +47,7 @@ export * from './unaccessRequest';
export * from './unshareRequest'; export * from './unshareRequest';
export * from './updateFrontendRequest'; export * from './updateFrontendRequest';
export * from './updateShareRequest'; export * from './updateShareRequest';
export * from './verifyRequest'; export * from './verify200Response';
export * from './verifyResponse';
import * as fs from 'fs'; import * as fs from 'fs';
@ -84,7 +82,6 @@ import { EnvironmentAndResources } from './environmentAndResources';
import { Frontend } from './frontend'; import { Frontend } from './frontend';
import { GetSparklines200Response } from './getSparklines200Response'; import { GetSparklines200Response } from './getSparklines200Response';
import { GetSparklinesRequest } from './getSparklinesRequest'; import { GetSparklinesRequest } from './getSparklinesRequest';
import { GrantsRequest } from './grantsRequest';
import { InviteRequest } from './inviteRequest'; import { InviteRequest } from './inviteRequest';
import { InviteTokenGenerateRequest } from './inviteTokenGenerateRequest'; import { InviteTokenGenerateRequest } from './inviteTokenGenerateRequest';
import { ListMemberships200Response } from './listMemberships200Response'; import { ListMemberships200Response } from './listMemberships200Response';
@ -112,8 +109,7 @@ import { UnaccessRequest } from './unaccessRequest';
import { UnshareRequest } from './unshareRequest'; import { UnshareRequest } from './unshareRequest';
import { UpdateFrontendRequest } from './updateFrontendRequest'; import { UpdateFrontendRequest } from './updateFrontendRequest';
import { UpdateShareRequest } from './updateShareRequest'; import { UpdateShareRequest } from './updateShareRequest';
import { VerifyRequest } from './verifyRequest'; import { Verify200Response } from './verify200Response';
import { VerifyResponse } from './verifyResponse';
/* tslint:disable:no-unused-variable */ /* tslint:disable:no-unused-variable */
let primitives = [ let primitives = [
@ -156,7 +152,6 @@ let typeMap: {[index: string]: any} = {
"Frontend": Frontend, "Frontend": Frontend,
"GetSparklines200Response": GetSparklines200Response, "GetSparklines200Response": GetSparklines200Response,
"GetSparklinesRequest": GetSparklinesRequest, "GetSparklinesRequest": GetSparklinesRequest,
"GrantsRequest": GrantsRequest,
"InviteRequest": InviteRequest, "InviteRequest": InviteRequest,
"InviteTokenGenerateRequest": InviteTokenGenerateRequest, "InviteTokenGenerateRequest": InviteTokenGenerateRequest,
"ListMemberships200Response": ListMemberships200Response, "ListMemberships200Response": ListMemberships200Response,
@ -184,8 +179,7 @@ let typeMap: {[index: string]: any} = {
"UnshareRequest": UnshareRequest, "UnshareRequest": UnshareRequest,
"UpdateFrontendRequest": UpdateFrontendRequest, "UpdateFrontendRequest": UpdateFrontendRequest,
"UpdateShareRequest": UpdateShareRequest, "UpdateShareRequest": UpdateShareRequest,
"VerifyRequest": VerifyRequest, "Verify200Response": Verify200Response,
"VerifyResponse": VerifyResponse,
} }
export class ObjectSerializer { export class ObjectSerializer {

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 Verify200Response {
'email'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "email",
"baseName": "email",
"type": "string"
} ];
static getAttributeTypeMap() {
return Verify200Response.attributeTypeMap;
}
}

View File

@ -46,12 +46,13 @@ from zrok_api.models.grants_body import GrantsBody
from zrok_api.models.identity_body import IdentityBody from zrok_api.models.identity_body import IdentityBody
from zrok_api.models.inline_response200 import InlineResponse200 from zrok_api.models.inline_response200 import InlineResponse200
from zrok_api.models.inline_response2001 import InlineResponse2001 from zrok_api.models.inline_response2001 import InlineResponse2001
from zrok_api.models.inline_response2001_members import InlineResponse2001Members
from zrok_api.models.inline_response2002 import InlineResponse2002 from zrok_api.models.inline_response2002 import InlineResponse2002
from zrok_api.models.inline_response2002_organizations import InlineResponse2002Organizations from zrok_api.models.inline_response2002_members import InlineResponse2002Members
from zrok_api.models.inline_response2003 import InlineResponse2003 from zrok_api.models.inline_response2003 import InlineResponse2003
from zrok_api.models.inline_response2003_memberships import InlineResponse2003Memberships from zrok_api.models.inline_response2003_organizations import InlineResponse2003Organizations
from zrok_api.models.inline_response2004 import InlineResponse2004 from zrok_api.models.inline_response2004 import InlineResponse2004
from zrok_api.models.inline_response2004_memberships import InlineResponse2004Memberships
from zrok_api.models.inline_response2005 import InlineResponse2005
from zrok_api.models.inline_response201 import InlineResponse201 from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.invite_body import InviteBody from zrok_api.models.invite_body import InviteBody
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
@ -83,6 +84,5 @@ from zrok_api.models.unaccess_request import UnaccessRequest
from zrok_api.models.unshare_request import UnshareRequest from zrok_api.models.unshare_request import UnshareRequest
from zrok_api.models.update_frontend_request import UpdateFrontendRequest from zrok_api.models.update_frontend_request import UpdateFrontendRequest
from zrok_api.models.update_share_request import UpdateShareRequest from zrok_api.models.update_share_request import UpdateShareRequest
from zrok_api.models.verify_request import VerifyRequest from zrok_api.models.verify_body import VerifyBody
from zrok_api.models.verify_response import VerifyResponse
from zrok_api.models.version import Version from zrok_api.models.version import Version

View File

@ -688,8 +688,8 @@ class AccountApi(object):
>>> result = thread.get() >>> result = thread.get()
:param async_req bool :param async_req bool
:param VerifyRequest body: :param VerifyBody body:
:return: VerifyResponse :return: InlineResponse2001
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -709,8 +709,8 @@ class AccountApi(object):
>>> result = thread.get() >>> result = thread.get()
:param async_req bool :param async_req bool
:param VerifyRequest body: :param VerifyBody body:
:return: VerifyResponse :return: InlineResponse2001
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -764,7 +764,7 @@ class AccountApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='VerifyResponse', # noqa: E501 response_type='InlineResponse2001', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),

View File

@ -131,7 +131,7 @@ class AdminApi(object):
:param async_req bool :param async_req bool
:param AccountBody body: :param AccountBody body:
:return: InlineResponse200 :return: VerifyBody
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -152,7 +152,7 @@ class AdminApi(object):
:param async_req bool :param async_req bool
:param AccountBody body: :param AccountBody body:
:return: InlineResponse200 :return: VerifyBody
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -206,7 +206,7 @@ class AdminApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse200', # noqa: E501 response_type='VerifyBody', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),
@ -410,7 +410,7 @@ class AdminApi(object):
:param async_req bool :param async_req bool
:param OrganizationBody body: :param OrganizationBody body:
:return: InlineResponse200 :return: VerifyBody
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -431,7 +431,7 @@ class AdminApi(object):
:param async_req bool :param async_req bool
:param OrganizationBody body: :param OrganizationBody body:
:return: InlineResponse200 :return: VerifyBody
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -485,7 +485,7 @@ class AdminApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse200', # noqa: E501 response_type='VerifyBody', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),
@ -944,7 +944,7 @@ class AdminApi(object):
:param async_req bool :param async_req bool
:param OrganizationListBody body: :param OrganizationListBody body:
:return: InlineResponse2001 :return: InlineResponse2002
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -965,7 +965,7 @@ class AdminApi(object):
:param async_req bool :param async_req bool
:param OrganizationListBody body: :param OrganizationListBody body:
:return: InlineResponse2001 :return: InlineResponse2002
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -1019,7 +1019,7 @@ class AdminApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse2001', # noqa: E501 response_type='InlineResponse2002', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),
@ -1036,7 +1036,7 @@ class AdminApi(object):
>>> result = thread.get() >>> result = thread.get()
:param async_req bool :param async_req bool
:return: InlineResponse2002 :return: InlineResponse2003
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -1056,7 +1056,7 @@ class AdminApi(object):
>>> result = thread.get() >>> result = thread.get()
:param async_req bool :param async_req bool
:return: InlineResponse2002 :return: InlineResponse2003
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -1104,7 +1104,7 @@ class AdminApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse2002', # noqa: E501 response_type='InlineResponse2003', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),

View File

@ -774,7 +774,7 @@ class MetadataApi(object):
:param async_req bool :param async_req bool
:param SparklinesBody body: :param SparklinesBody body:
:return: InlineResponse2004 :return: InlineResponse2005
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -795,7 +795,7 @@ class MetadataApi(object):
:param async_req bool :param async_req bool
:param SparklinesBody body: :param SparklinesBody body:
:return: InlineResponse2004 :return: InlineResponse2005
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -849,7 +849,7 @@ class MetadataApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse2004', # noqa: E501 response_type='InlineResponse2005', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),
@ -866,7 +866,7 @@ class MetadataApi(object):
>>> result = thread.get() >>> result = thread.get()
:param async_req bool :param async_req bool
:return: InlineResponse2003 :return: InlineResponse2004
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -886,7 +886,7 @@ class MetadataApi(object):
>>> result = thread.get() >>> result = thread.get()
:param async_req bool :param async_req bool
:return: InlineResponse2003 :return: InlineResponse2004
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -934,7 +934,7 @@ class MetadataApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse2003', # noqa: E501 response_type='InlineResponse2004', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),
@ -952,7 +952,7 @@ class MetadataApi(object):
:param async_req bool :param async_req bool
:param str organization_token: (required) :param str organization_token: (required)
:return: InlineResponse2001 :return: InlineResponse2002
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -973,7 +973,7 @@ class MetadataApi(object):
:param async_req bool :param async_req bool
:param str organization_token: (required) :param str organization_token: (required)
:return: InlineResponse2001 :return: InlineResponse2002
If the method is called asynchronously, If the method is called asynchronously,
returns the request thread. returns the request thread.
""" """
@ -1027,7 +1027,7 @@ class MetadataApi(object):
body=body_params, body=body_params,
post_params=form_params, post_params=form_params,
files=local_var_files, files=local_var_files,
response_type='InlineResponse2001', # noqa: E501 response_type='InlineResponse2002', # noqa: E501
auth_settings=auth_settings, auth_settings=auth_settings,
async_req=params.get('async_req'), async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'), _return_http_data_only=params.get('_return_http_data_only'),

View File

@ -36,12 +36,13 @@ from zrok_api.models.grants_body import GrantsBody
from zrok_api.models.identity_body import IdentityBody from zrok_api.models.identity_body import IdentityBody
from zrok_api.models.inline_response200 import InlineResponse200 from zrok_api.models.inline_response200 import InlineResponse200
from zrok_api.models.inline_response2001 import InlineResponse2001 from zrok_api.models.inline_response2001 import InlineResponse2001
from zrok_api.models.inline_response2001_members import InlineResponse2001Members
from zrok_api.models.inline_response2002 import InlineResponse2002 from zrok_api.models.inline_response2002 import InlineResponse2002
from zrok_api.models.inline_response2002_organizations import InlineResponse2002Organizations from zrok_api.models.inline_response2002_members import InlineResponse2002Members
from zrok_api.models.inline_response2003 import InlineResponse2003 from zrok_api.models.inline_response2003 import InlineResponse2003
from zrok_api.models.inline_response2003_memberships import InlineResponse2003Memberships from zrok_api.models.inline_response2003_organizations import InlineResponse2003Organizations
from zrok_api.models.inline_response2004 import InlineResponse2004 from zrok_api.models.inline_response2004 import InlineResponse2004
from zrok_api.models.inline_response2004_memberships import InlineResponse2004Memberships
from zrok_api.models.inline_response2005 import InlineResponse2005
from zrok_api.models.inline_response201 import InlineResponse201 from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.invite_body import InviteBody from zrok_api.models.invite_body import InviteBody
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
@ -73,6 +74,5 @@ from zrok_api.models.unaccess_request import UnaccessRequest
from zrok_api.models.unshare_request import UnshareRequest from zrok_api.models.unshare_request import UnshareRequest
from zrok_api.models.update_frontend_request import UpdateFrontendRequest from zrok_api.models.update_frontend_request import UpdateFrontendRequest
from zrok_api.models.update_share_request import UpdateShareRequest from zrok_api.models.update_share_request import UpdateShareRequest
from zrok_api.models.verify_request import VerifyRequest from zrok_api.models.verify_body import VerifyBody
from zrok_api.models.verify_response import VerifyResponse
from zrok_api.models.version import Version from zrok_api.models.version import Version

View File

@ -28,40 +28,40 @@ class InlineResponse2001(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
'members': 'list[InlineResponse2001Members]' 'email': 'str'
} }
attribute_map = { attribute_map = {
'members': 'members' 'email': 'email'
} }
def __init__(self, members=None): # noqa: E501 def __init__(self, email=None): # noqa: E501
"""InlineResponse2001 - a model defined in Swagger""" # noqa: E501 """InlineResponse2001 - a model defined in Swagger""" # noqa: E501
self._members = None self._email = None
self.discriminator = None self.discriminator = None
if members is not None: if email is not None:
self.members = members self.email = email
@property @property
def members(self): def email(self):
"""Gets the members of this InlineResponse2001. # noqa: E501 """Gets the email of this InlineResponse2001. # noqa: E501
:return: The members of this InlineResponse2001. # noqa: E501 :return: The email of this InlineResponse2001. # noqa: E501
:rtype: list[InlineResponse2001Members] :rtype: str
""" """
return self._members return self._email
@members.setter @email.setter
def members(self, members): def email(self, email):
"""Sets the members of this InlineResponse2001. """Sets the email of this InlineResponse2001.
:param members: The members of this InlineResponse2001. # noqa: E501 :param email: The email of this InlineResponse2001. # noqa: E501
:type: list[InlineResponse2001Members] :type: str
""" """
self._members = members self._email = email
def to_dict(self): def to_dict(self):
"""Returns the model properties as a dict""" """Returns the model properties as a dict"""

View File

@ -28,40 +28,40 @@ class InlineResponse2002(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
'organizations': 'list[InlineResponse2002Organizations]' 'members': 'list[InlineResponse2002Members]'
} }
attribute_map = { attribute_map = {
'organizations': 'organizations' 'members': 'members'
} }
def __init__(self, organizations=None): # noqa: E501 def __init__(self, members=None): # noqa: E501
"""InlineResponse2002 - a model defined in Swagger""" # noqa: E501 """InlineResponse2002 - a model defined in Swagger""" # noqa: E501
self._organizations = None self._members = None
self.discriminator = None self.discriminator = None
if organizations is not None: if members is not None:
self.organizations = organizations self.members = members
@property @property
def organizations(self): def members(self):
"""Gets the organizations of this InlineResponse2002. # noqa: E501 """Gets the members of this InlineResponse2002. # noqa: E501
:return: The organizations of this InlineResponse2002. # noqa: E501 :return: The members of this InlineResponse2002. # noqa: E501
:rtype: list[InlineResponse2002Organizations] :rtype: list[InlineResponse2002Members]
""" """
return self._organizations return self._members
@organizations.setter @members.setter
def organizations(self, organizations): def members(self, members):
"""Sets the organizations of this InlineResponse2002. """Sets the members of this InlineResponse2002.
:param organizations: The organizations of this InlineResponse2002. # noqa: E501 :param members: The members of this InlineResponse2002. # noqa: E501
:type: list[InlineResponse2002Organizations] :type: list[InlineResponse2002Members]
""" """
self._organizations = organizations self._members = members
def to_dict(self): def to_dict(self):
"""Returns the model properties as a dict""" """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 InlineResponse2002Members(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 = {
'email': 'str',
'admin': 'bool'
}
attribute_map = {
'email': 'email',
'admin': 'admin'
}
def __init__(self, email=None, admin=None): # noqa: E501
"""InlineResponse2002Members - a model defined in Swagger""" # noqa: E501
self._email = None
self._admin = None
self.discriminator = None
if email is not None:
self.email = email
if admin is not None:
self.admin = admin
@property
def email(self):
"""Gets the email of this InlineResponse2002Members. # noqa: E501
:return: The email of this InlineResponse2002Members. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this InlineResponse2002Members.
:param email: The email of this InlineResponse2002Members. # noqa: E501
:type: str
"""
self._email = email
@property
def admin(self):
"""Gets the admin of this InlineResponse2002Members. # noqa: E501
:return: The admin of this InlineResponse2002Members. # noqa: E501
:rtype: bool
"""
return self._admin
@admin.setter
def admin(self, admin):
"""Sets the admin of this InlineResponse2002Members.
:param admin: The admin of this InlineResponse2002Members. # noqa: E501
:type: bool
"""
self._admin = admin
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(InlineResponse2002Members, 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, InlineResponse2002Members):
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,40 +28,40 @@ class InlineResponse2003(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
'memberships': 'list[InlineResponse2003Memberships]' 'organizations': 'list[InlineResponse2003Organizations]'
} }
attribute_map = { attribute_map = {
'memberships': 'memberships' 'organizations': 'organizations'
} }
def __init__(self, memberships=None): # noqa: E501 def __init__(self, organizations=None): # noqa: E501
"""InlineResponse2003 - a model defined in Swagger""" # noqa: E501 """InlineResponse2003 - a model defined in Swagger""" # noqa: E501
self._memberships = None self._organizations = None
self.discriminator = None self.discriminator = None
if memberships is not None: if organizations is not None:
self.memberships = memberships self.organizations = organizations
@property @property
def memberships(self): def organizations(self):
"""Gets the memberships of this InlineResponse2003. # noqa: E501 """Gets the organizations of this InlineResponse2003. # noqa: E501
:return: The memberships of this InlineResponse2003. # noqa: E501 :return: The organizations of this InlineResponse2003. # noqa: E501
:rtype: list[InlineResponse2003Memberships] :rtype: list[InlineResponse2003Organizations]
""" """
return self._memberships return self._organizations
@memberships.setter @organizations.setter
def memberships(self, memberships): def organizations(self, organizations):
"""Sets the memberships of this InlineResponse2003. """Sets the organizations of this InlineResponse2003.
:param memberships: The memberships of this InlineResponse2003. # noqa: E501 :param organizations: The organizations of this InlineResponse2003. # noqa: E501
:type: list[InlineResponse2003Memberships] :type: list[InlineResponse2003Organizations]
""" """
self._memberships = memberships self._organizations = organizations
def to_dict(self): def to_dict(self):
"""Returns the model properties as a dict""" """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 InlineResponse2003Organizations(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 = {
'token': 'str',
'description': 'str'
}
attribute_map = {
'token': 'token',
'description': 'description'
}
def __init__(self, token=None, description=None): # noqa: E501
"""InlineResponse2003Organizations - a model defined in Swagger""" # noqa: E501
self._token = None
self._description = None
self.discriminator = None
if token is not None:
self.token = token
if description is not None:
self.description = description
@property
def token(self):
"""Gets the token of this InlineResponse2003Organizations. # noqa: E501
:return: The token of this InlineResponse2003Organizations. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this InlineResponse2003Organizations.
:param token: The token of this InlineResponse2003Organizations. # noqa: E501
:type: str
"""
self._token = token
@property
def description(self):
"""Gets the description of this InlineResponse2003Organizations. # noqa: E501
:return: The description of this InlineResponse2003Organizations. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this InlineResponse2003Organizations.
:param description: The description of this InlineResponse2003Organizations. # noqa: E501
:type: str
"""
self._description = description
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(InlineResponse2003Organizations, 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, InlineResponse2003Organizations):
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,40 +28,40 @@ class InlineResponse2004(object):
and the value is json key in definition. and the value is json key in definition.
""" """
swagger_types = { swagger_types = {
'sparklines': 'list[Metrics]' 'memberships': 'list[InlineResponse2004Memberships]'
} }
attribute_map = { attribute_map = {
'sparklines': 'sparklines' 'memberships': 'memberships'
} }
def __init__(self, sparklines=None): # noqa: E501 def __init__(self, memberships=None): # noqa: E501
"""InlineResponse2004 - a model defined in Swagger""" # noqa: E501 """InlineResponse2004 - a model defined in Swagger""" # noqa: E501
self._sparklines = None self._memberships = None
self.discriminator = None self.discriminator = None
if sparklines is not None: if memberships is not None:
self.sparklines = sparklines self.memberships = memberships
@property @property
def sparklines(self): def memberships(self):
"""Gets the sparklines of this InlineResponse2004. # noqa: E501 """Gets the memberships of this InlineResponse2004. # noqa: E501
:return: The sparklines of this InlineResponse2004. # noqa: E501 :return: The memberships of this InlineResponse2004. # noqa: E501
:rtype: list[Metrics] :rtype: list[InlineResponse2004Memberships]
""" """
return self._sparklines return self._memberships
@sparklines.setter @memberships.setter
def sparklines(self, sparklines): def memberships(self, memberships):
"""Sets the sparklines of this InlineResponse2004. """Sets the memberships of this InlineResponse2004.
:param sparklines: The sparklines of this InlineResponse2004. # noqa: E501 :param memberships: The memberships of this InlineResponse2004. # noqa: E501
:type: list[Metrics] :type: list[InlineResponse2004Memberships]
""" """
self._sparklines = sparklines self._memberships = memberships
def to_dict(self): def to_dict(self):
"""Returns the model properties as a dict""" """Returns the model properties as a dict"""

View File

@ -0,0 +1,162 @@
# 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 InlineResponse2004Memberships(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 = {
'token': 'str',
'description': 'str',
'admin': 'bool'
}
attribute_map = {
'token': 'token',
'description': 'description',
'admin': 'admin'
}
def __init__(self, token=None, description=None, admin=None): # noqa: E501
"""InlineResponse2004Memberships - a model defined in Swagger""" # noqa: E501
self._token = None
self._description = None
self._admin = None
self.discriminator = None
if token is not None:
self.token = token
if description is not None:
self.description = description
if admin is not None:
self.admin = admin
@property
def token(self):
"""Gets the token of this InlineResponse2004Memberships. # noqa: E501
:return: The token of this InlineResponse2004Memberships. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this InlineResponse2004Memberships.
:param token: The token of this InlineResponse2004Memberships. # noqa: E501
:type: str
"""
self._token = token
@property
def description(self):
"""Gets the description of this InlineResponse2004Memberships. # noqa: E501
:return: The description of this InlineResponse2004Memberships. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this InlineResponse2004Memberships.
:param description: The description of this InlineResponse2004Memberships. # noqa: E501
:type: str
"""
self._description = description
@property
def admin(self):
"""Gets the admin of this InlineResponse2004Memberships. # noqa: E501
:return: The admin of this InlineResponse2004Memberships. # noqa: E501
:rtype: bool
"""
return self._admin
@admin.setter
def admin(self, admin):
"""Sets the admin of this InlineResponse2004Memberships.
:param admin: The admin of this InlineResponse2004Memberships. # noqa: E501
:type: bool
"""
self._admin = admin
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(InlineResponse2004Memberships, 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, InlineResponse2004Memberships):
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

@ -0,0 +1,110 @@
# 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 InlineResponse2005(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 = {
'sparklines': 'list[Metrics]'
}
attribute_map = {
'sparklines': 'sparklines'
}
def __init__(self, sparklines=None): # noqa: E501
"""InlineResponse2005 - a model defined in Swagger""" # noqa: E501
self._sparklines = None
self.discriminator = None
if sparklines is not None:
self.sparklines = sparklines
@property
def sparklines(self):
"""Gets the sparklines of this InlineResponse2005. # noqa: E501
:return: The sparklines of this InlineResponse2005. # noqa: E501
:rtype: list[Metrics]
"""
return self._sparklines
@sparklines.setter
def sparklines(self, sparklines):
"""Sets the sparklines of this InlineResponse2005.
:param sparklines: The sparklines of this InlineResponse2005. # noqa: E501
:type: list[Metrics]
"""
self._sparklines = sparklines
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(InlineResponse2005, 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, InlineResponse2005):
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

@ -0,0 +1,110 @@
# 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 VerifyBody(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 = {
'token': 'str'
}
attribute_map = {
'token': 'token'
}
def __init__(self, token=None): # noqa: E501
"""VerifyBody - a model defined in Swagger""" # noqa: E501
self._token = None
self.discriminator = None
if token is not None:
self.token = token
@property
def token(self):
"""Gets the token of this VerifyBody. # noqa: E501
:return: The token of this VerifyBody. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this VerifyBody.
:param token: The token of this VerifyBody. # noqa: E501
:type: str
"""
self._token = token
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(VerifyBody, 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, VerifyBody):
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

@ -206,12 +206,16 @@ paths:
- name: body - name: body
in: body in: body
schema: schema:
$ref: "#/definitions/verifyRequest" properties:
token:
type: string
responses: responses:
200: 200:
description: token ready description: token ready
schema: schema:
$ref: "#/definitions/verifyResponse" properties:
email:
type: string
404: 404:
description: token not found description: token not found
500: 500:
@ -1445,17 +1449,6 @@ definitions:
items: items:
type: string type: string
verifyRequest:
type: object
properties:
token:
type: string
verifyResponse:
type: object
properties:
email:
type: string
version: version:
type: string type: string

View File

@ -24,7 +24,6 @@ models/EnvironmentAndResources.ts
models/Frontend.ts models/Frontend.ts
models/GetSparklines200Response.ts models/GetSparklines200Response.ts
models/GetSparklinesRequest.ts models/GetSparklinesRequest.ts
models/GrantsRequest.ts
models/InviteRequest.ts models/InviteRequest.ts
models/InviteTokenGenerateRequest.ts models/InviteTokenGenerateRequest.ts
models/ListMemberships200Response.ts models/ListMemberships200Response.ts
@ -53,7 +52,6 @@ models/UnaccessRequest.ts
models/UnshareRequest.ts models/UnshareRequest.ts
models/UpdateFrontendRequest.ts models/UpdateFrontendRequest.ts
models/UpdateShareRequest.ts models/UpdateShareRequest.ts
models/VerifyRequest.ts models/Verify200Response.ts
models/VerifyResponse.ts
models/index.ts models/index.ts
runtime.ts runtime.ts

View File

@ -21,8 +21,7 @@ import type {
RegenerateToken200Response, RegenerateToken200Response,
RegenerateTokenRequest, RegenerateTokenRequest,
RegisterRequest, RegisterRequest,
VerifyRequest, Verify200Response,
VerifyResponse,
} from '../models/index'; } from '../models/index';
import { import {
ChangePasswordRequestFromJSON, ChangePasswordRequestFromJSON,
@ -37,10 +36,8 @@ import {
RegenerateTokenRequestToJSON, RegenerateTokenRequestToJSON,
RegisterRequestFromJSON, RegisterRequestFromJSON,
RegisterRequestToJSON, RegisterRequestToJSON,
VerifyRequestFromJSON, Verify200ResponseFromJSON,
VerifyRequestToJSON, Verify200ResponseToJSON,
VerifyResponseFromJSON,
VerifyResponseToJSON,
} from '../models/index'; } from '../models/index';
export interface ChangePasswordOperationRequest { export interface ChangePasswordOperationRequest {
@ -71,8 +68,8 @@ export interface ResetPasswordRequestRequest {
body?: RegenerateTokenRequest; body?: RegenerateTokenRequest;
} }
export interface VerifyOperationRequest { export interface VerifyRequest {
body?: VerifyRequest; body?: RegenerateToken200Response;
} }
/** /**
@ -279,7 +276,7 @@ export class AccountApi extends runtime.BaseAPI {
/** /**
*/ */
async verifyRaw(requestParameters: VerifyOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyResponse>> { async verifyRaw(requestParameters: VerifyRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Verify200Response>> {
const queryParameters: any = {}; const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {}; const headerParameters: runtime.HTTPHeaders = {};
@ -291,15 +288,15 @@ export class AccountApi extends runtime.BaseAPI {
method: 'POST', method: 'POST',
headers: headerParameters, headers: headerParameters,
query: queryParameters, query: queryParameters,
body: VerifyRequestToJSON(requestParameters['body']), body: RegenerateToken200ResponseToJSON(requestParameters['body']),
}, initOverrides); }, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => VerifyResponseFromJSON(jsonValue)); return new runtime.JSONApiResponse(response, (jsonValue) => Verify200ResponseFromJSON(jsonValue));
} }
/** /**
*/ */
async verify(requestParameters: VerifyOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyResponse> { async verify(requestParameters: VerifyRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Verify200Response> {
const response = await this.verifyRaw(requestParameters, initOverrides); const response = await this.verifyRaw(requestParameters, initOverrides);
return await response.value(); return await response.value();
} }

View File

@ -22,7 +22,6 @@ import type {
CreateIdentityRequest, CreateIdentityRequest,
CreateOrganizationRequest, CreateOrganizationRequest,
DeleteFrontendRequest, DeleteFrontendRequest,
GrantsRequest,
InviteTokenGenerateRequest, InviteTokenGenerateRequest,
ListOrganizationMembers200Response, ListOrganizationMembers200Response,
ListOrganizations200Response, ListOrganizations200Response,
@ -31,6 +30,7 @@ import type {
RegenerateToken200Response, RegenerateToken200Response,
RemoveOrganizationMemberRequest, RemoveOrganizationMemberRequest,
UpdateFrontendRequest, UpdateFrontendRequest,
Verify200Response,
} from '../models/index'; } from '../models/index';
import { import {
AddOrganizationMemberRequestFromJSON, AddOrganizationMemberRequestFromJSON,
@ -47,8 +47,6 @@ import {
CreateOrganizationRequestToJSON, CreateOrganizationRequestToJSON,
DeleteFrontendRequestFromJSON, DeleteFrontendRequestFromJSON,
DeleteFrontendRequestToJSON, DeleteFrontendRequestToJSON,
GrantsRequestFromJSON,
GrantsRequestToJSON,
InviteTokenGenerateRequestFromJSON, InviteTokenGenerateRequestFromJSON,
InviteTokenGenerateRequestToJSON, InviteTokenGenerateRequestToJSON,
ListOrganizationMembers200ResponseFromJSON, ListOrganizationMembers200ResponseFromJSON,
@ -65,6 +63,8 @@ import {
RemoveOrganizationMemberRequestToJSON, RemoveOrganizationMemberRequestToJSON,
UpdateFrontendRequestFromJSON, UpdateFrontendRequestFromJSON,
UpdateFrontendRequestToJSON, UpdateFrontendRequestToJSON,
Verify200ResponseFromJSON,
Verify200ResponseToJSON,
} from '../models/index'; } from '../models/index';
export interface AddOrganizationMemberOperationRequest { export interface AddOrganizationMemberOperationRequest {
@ -95,8 +95,8 @@ export interface DeleteOrganizationRequest {
body?: RegenerateToken200Response; body?: RegenerateToken200Response;
} }
export interface GrantsOperationRequest { export interface GrantsRequest {
body?: GrantsRequest; body?: Verify200Response;
} }
export interface InviteTokenGenerateOperationRequest { export interface InviteTokenGenerateOperationRequest {
@ -336,7 +336,7 @@ export class AdminApi extends runtime.BaseAPI {
/** /**
*/ */
async grantsRaw(requestParameters: GrantsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> { async grantsRaw(requestParameters: GrantsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {}; const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {}; const headerParameters: runtime.HTTPHeaders = {};
@ -352,7 +352,7 @@ export class AdminApi extends runtime.BaseAPI {
method: 'POST', method: 'POST',
headers: headerParameters, headers: headerParameters,
query: queryParameters, query: queryParameters,
body: GrantsRequestToJSON(requestParameters['body']), body: Verify200ResponseToJSON(requestParameters['body']),
}, initOverrides); }, initOverrides);
return new runtime.VoidApiResponse(response); return new runtime.VoidApiResponse(response);
@ -360,7 +360,7 @@ export class AdminApi extends runtime.BaseAPI {
/** /**
*/ */
async grants(requestParameters: GrantsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> { async grants(requestParameters: GrantsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.grantsRaw(requestParameters, initOverrides); await this.grantsRaw(requestParameters, initOverrides);
} }

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 Verify200Response
*/
export interface Verify200Response {
/**
*
* @type {string}
* @memberof Verify200Response
*/
email?: string;
}
/**
* Check if a given object implements the Verify200Response interface.
*/
export function instanceOfVerify200Response(value: object): value is Verify200Response {
return true;
}
export function Verify200ResponseFromJSON(json: any): Verify200Response {
return Verify200ResponseFromJSONTyped(json, false);
}
export function Verify200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): Verify200Response {
if (json == null) {
return json;
}
return {
'email': json['email'] == null ? undefined : json['email'],
};
}
export function Verify200ResponseToJSON(value?: Verify200Response | null): any {
if (value == null) {
return value;
}
return {
'email': value['email'],
};
}

View File

@ -19,7 +19,6 @@ export * from './EnvironmentAndResources';
export * from './Frontend'; export * from './Frontend';
export * from './GetSparklines200Response'; export * from './GetSparklines200Response';
export * from './GetSparklinesRequest'; export * from './GetSparklinesRequest';
export * from './GrantsRequest';
export * from './InviteRequest'; export * from './InviteRequest';
export * from './InviteTokenGenerateRequest'; export * from './InviteTokenGenerateRequest';
export * from './ListMemberships200Response'; export * from './ListMemberships200Response';
@ -48,5 +47,4 @@ export * from './UnaccessRequest';
export * from './UnshareRequest'; export * from './UnshareRequest';
export * from './UpdateFrontendRequest'; export * from './UpdateFrontendRequest';
export * from './UpdateShareRequest'; export * from './UpdateShareRequest';
export * from './VerifyRequest'; export * from './Verify200Response';
export * from './VerifyResponse';