initial cut at admin api operations (#537)

This commit is contained in:
Michael Quigley 2024-12-09 12:56:57 -05:00
parent 842f3e8c20
commit 38b32d15d0
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
49 changed files with 6649 additions and 0 deletions

View File

@ -0,0 +1,146 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewAddOrganizationMemberParams creates a new AddOrganizationMemberParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewAddOrganizationMemberParams() *AddOrganizationMemberParams {
return &AddOrganizationMemberParams{
timeout: cr.DefaultTimeout,
}
}
// NewAddOrganizationMemberParamsWithTimeout creates a new AddOrganizationMemberParams object
// with the ability to set a timeout on a request.
func NewAddOrganizationMemberParamsWithTimeout(timeout time.Duration) *AddOrganizationMemberParams {
return &AddOrganizationMemberParams{
timeout: timeout,
}
}
// NewAddOrganizationMemberParamsWithContext creates a new AddOrganizationMemberParams object
// with the ability to set a context for a request.
func NewAddOrganizationMemberParamsWithContext(ctx context.Context) *AddOrganizationMemberParams {
return &AddOrganizationMemberParams{
Context: ctx,
}
}
// NewAddOrganizationMemberParamsWithHTTPClient creates a new AddOrganizationMemberParams object
// with the ability to set a custom HTTPClient for a request.
func NewAddOrganizationMemberParamsWithHTTPClient(client *http.Client) *AddOrganizationMemberParams {
return &AddOrganizationMemberParams{
HTTPClient: client,
}
}
/*
AddOrganizationMemberParams contains all the parameters to send to the API endpoint
for the add organization member operation.
Typically these are written to a http.Request.
*/
type AddOrganizationMemberParams struct {
// Body.
Body AddOrganizationMemberBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the add organization member params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AddOrganizationMemberParams) WithDefaults() *AddOrganizationMemberParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the add organization member params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *AddOrganizationMemberParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the add organization member params
func (o *AddOrganizationMemberParams) WithTimeout(timeout time.Duration) *AddOrganizationMemberParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the add organization member params
func (o *AddOrganizationMemberParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the add organization member params
func (o *AddOrganizationMemberParams) WithContext(ctx context.Context) *AddOrganizationMemberParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the add organization member params
func (o *AddOrganizationMemberParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the add organization member params
func (o *AddOrganizationMemberParams) WithHTTPClient(client *http.Client) *AddOrganizationMemberParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the add organization member params
func (o *AddOrganizationMemberParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the add organization member params
func (o *AddOrganizationMemberParams) WithBody(body AddOrganizationMemberBody) *AddOrganizationMemberParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the add organization member params
func (o *AddOrganizationMemberParams) SetBody(body AddOrganizationMemberBody) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *AddOrganizationMemberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,252 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// AddOrganizationMemberReader is a Reader for the AddOrganizationMember structure.
type AddOrganizationMemberReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *AddOrganizationMemberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewAddOrganizationMemberCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewAddOrganizationMemberUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewAddOrganizationMemberInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /organization/add] addOrganizationMember", response, response.Code())
}
}
// NewAddOrganizationMemberCreated creates a AddOrganizationMemberCreated with default headers values
func NewAddOrganizationMemberCreated() *AddOrganizationMemberCreated {
return &AddOrganizationMemberCreated{}
}
/*
AddOrganizationMemberCreated describes a response with status code 201, with default header values.
member added
*/
type AddOrganizationMemberCreated struct {
}
// IsSuccess returns true when this add organization member created response has a 2xx status code
func (o *AddOrganizationMemberCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this add organization member created response has a 3xx status code
func (o *AddOrganizationMemberCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this add organization member created response has a 4xx status code
func (o *AddOrganizationMemberCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this add organization member created response has a 5xx status code
func (o *AddOrganizationMemberCreated) IsServerError() bool {
return false
}
// IsCode returns true when this add organization member created response a status code equal to that given
func (o *AddOrganizationMemberCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the add organization member created response
func (o *AddOrganizationMemberCreated) Code() int {
return 201
}
func (o *AddOrganizationMemberCreated) Error() string {
return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberCreated ", 201)
}
func (o *AddOrganizationMemberCreated) String() string {
return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberCreated ", 201)
}
func (o *AddOrganizationMemberCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAddOrganizationMemberUnauthorized creates a AddOrganizationMemberUnauthorized with default headers values
func NewAddOrganizationMemberUnauthorized() *AddOrganizationMemberUnauthorized {
return &AddOrganizationMemberUnauthorized{}
}
/*
AddOrganizationMemberUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type AddOrganizationMemberUnauthorized struct {
}
// IsSuccess returns true when this add organization member unauthorized response has a 2xx status code
func (o *AddOrganizationMemberUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this add organization member unauthorized response has a 3xx status code
func (o *AddOrganizationMemberUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this add organization member unauthorized response has a 4xx status code
func (o *AddOrganizationMemberUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this add organization member unauthorized response has a 5xx status code
func (o *AddOrganizationMemberUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this add organization member unauthorized response a status code equal to that given
func (o *AddOrganizationMemberUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the add organization member unauthorized response
func (o *AddOrganizationMemberUnauthorized) Code() int {
return 401
}
func (o *AddOrganizationMemberUnauthorized) Error() string {
return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberUnauthorized ", 401)
}
func (o *AddOrganizationMemberUnauthorized) String() string {
return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberUnauthorized ", 401)
}
func (o *AddOrganizationMemberUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewAddOrganizationMemberInternalServerError creates a AddOrganizationMemberInternalServerError with default headers values
func NewAddOrganizationMemberInternalServerError() *AddOrganizationMemberInternalServerError {
return &AddOrganizationMemberInternalServerError{}
}
/*
AddOrganizationMemberInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type AddOrganizationMemberInternalServerError struct {
}
// IsSuccess returns true when this add organization member internal server error response has a 2xx status code
func (o *AddOrganizationMemberInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this add organization member internal server error response has a 3xx status code
func (o *AddOrganizationMemberInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this add organization member internal server error response has a 4xx status code
func (o *AddOrganizationMemberInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this add organization member internal server error response has a 5xx status code
func (o *AddOrganizationMemberInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this add organization member internal server error response a status code equal to that given
func (o *AddOrganizationMemberInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the add organization member internal server error response
func (o *AddOrganizationMemberInternalServerError) Code() int {
return 500
}
func (o *AddOrganizationMemberInternalServerError) Error() string {
return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberInternalServerError ", 500)
}
func (o *AddOrganizationMemberInternalServerError) String() string {
return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberInternalServerError ", 500)
}
func (o *AddOrganizationMemberInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
/*
AddOrganizationMemberBody add organization member body
swagger:model AddOrganizationMemberBody
*/
type AddOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this add organization member body
func (o *AddOrganizationMemberBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add organization member body based on context it is used
func (o *AddOrganizationMemberBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *AddOrganizationMemberBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *AddOrganizationMemberBody) UnmarshalBinary(b []byte) error {
var res AddOrganizationMemberBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -30,25 +30,74 @@ type ClientOption func(*runtime.ClientOperation)
// ClientService is the interface for Client methods
type ClientService interface {
AddOrganizationMember(params *AddOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrganizationMemberCreated, error)
CreateAccount(params *CreateAccountParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateAccountCreated, error)
CreateFrontend(params *CreateFrontendParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateFrontendCreated, error)
CreateIdentity(params *CreateIdentityParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateIdentityCreated, error)
CreateOrganization(params *CreateOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrganizationCreated, error)
DeleteFrontend(params *DeleteFrontendParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteFrontendOK, error)
DeleteOrganization(params *DeleteOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrganizationOK, error)
Grants(params *GrantsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*GrantsOK, error)
InviteTokenGenerate(params *InviteTokenGenerateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InviteTokenGenerateCreated, error)
ListFrontends(params *ListFrontendsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFrontendsOK, error)
ListOrganizationMembers(params *ListOrganizationMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOrganizationMembersOK, error)
RemoveOrganizationMember(params *RemoveOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveOrganizationMemberOK, error)
UpdateFrontend(params *UpdateFrontendParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateFrontendOK, error)
SetTransport(transport runtime.ClientTransport)
}
/*
AddOrganizationMember add organization member API
*/
func (a *Client) AddOrganizationMember(params *AddOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrganizationMemberCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewAddOrganizationMemberParams()
}
op := &runtime.ClientOperation{
ID: "addOrganizationMember",
Method: "POST",
PathPattern: "/organization/add",
ProducesMediaTypes: []string{"application/zrok.v1+json"},
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
Schemes: []string{"http"},
Params: params,
Reader: &AddOrganizationMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*AddOrganizationMemberCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for addOrganizationMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
CreateAccount create account API
*/
@ -166,6 +215,45 @@ func (a *Client) CreateIdentity(params *CreateIdentityParams, authInfo runtime.C
panic(msg)
}
/*
CreateOrganization create organization API
*/
func (a *Client) CreateOrganization(params *CreateOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*CreateOrganizationCreated, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewCreateOrganizationParams()
}
op := &runtime.ClientOperation{
ID: "createOrganization",
Method: "POST",
PathPattern: "/organization",
ProducesMediaTypes: []string{"application/zrok.v1+json"},
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
Schemes: []string{"http"},
Params: params,
Reader: &CreateOrganizationReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*CreateOrganizationCreated)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for createOrganization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
DeleteFrontend delete frontend API
*/
@ -205,6 +293,45 @@ func (a *Client) DeleteFrontend(params *DeleteFrontendParams, authInfo runtime.C
panic(msg)
}
/*
DeleteOrganization delete organization API
*/
func (a *Client) DeleteOrganization(params *DeleteOrganizationParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DeleteOrganizationOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewDeleteOrganizationParams()
}
op := &runtime.ClientOperation{
ID: "deleteOrganization",
Method: "DELETE",
PathPattern: "/organization",
ProducesMediaTypes: []string{"application/zrok.v1+json"},
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
Schemes: []string{"http"},
Params: params,
Reader: &DeleteOrganizationReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*DeleteOrganizationOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for deleteOrganization: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
Grants grants API
*/
@ -322,6 +449,84 @@ func (a *Client) ListFrontends(params *ListFrontendsParams, authInfo runtime.Cli
panic(msg)
}
/*
ListOrganizationMembers list organization members API
*/
func (a *Client) ListOrganizationMembers(params *ListOrganizationMembersParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListOrganizationMembersOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewListOrganizationMembersParams()
}
op := &runtime.ClientOperation{
ID: "listOrganizationMembers",
Method: "POST",
PathPattern: "/organization/members",
ProducesMediaTypes: []string{"application/zrok.v1+json"},
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
Schemes: []string{"http"},
Params: params,
Reader: &ListOrganizationMembersReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*ListOrganizationMembersOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listOrganizationMembers: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
RemoveOrganizationMember remove organization member API
*/
func (a *Client) RemoveOrganizationMember(params *RemoveOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*RemoveOrganizationMemberOK, error) {
// TODO: Validate the params before sending
if params == nil {
params = NewRemoveOrganizationMemberParams()
}
op := &runtime.ClientOperation{
ID: "removeOrganizationMember",
Method: "POST",
PathPattern: "/organization/remove",
ProducesMediaTypes: []string{"application/zrok.v1+json"},
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
Schemes: []string{"http"},
Params: params,
Reader: &RemoveOrganizationMemberReader{formats: a.formats},
AuthInfo: authInfo,
Context: params.Context,
Client: params.HTTPClient,
}
for _, opt := range opts {
opt(op)
}
result, err := a.transport.Submit(op)
if err != nil {
return nil, err
}
success, ok := result.(*RemoveOrganizationMemberOK)
if ok {
return success, nil
}
// unexpected success response
// safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for removeOrganizationMember: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
UpdateFrontend update frontend API
*/

View File

@ -0,0 +1,146 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewCreateOrganizationParams creates a new CreateOrganizationParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewCreateOrganizationParams() *CreateOrganizationParams {
return &CreateOrganizationParams{
timeout: cr.DefaultTimeout,
}
}
// NewCreateOrganizationParamsWithTimeout creates a new CreateOrganizationParams object
// with the ability to set a timeout on a request.
func NewCreateOrganizationParamsWithTimeout(timeout time.Duration) *CreateOrganizationParams {
return &CreateOrganizationParams{
timeout: timeout,
}
}
// NewCreateOrganizationParamsWithContext creates a new CreateOrganizationParams object
// with the ability to set a context for a request.
func NewCreateOrganizationParamsWithContext(ctx context.Context) *CreateOrganizationParams {
return &CreateOrganizationParams{
Context: ctx,
}
}
// NewCreateOrganizationParamsWithHTTPClient creates a new CreateOrganizationParams object
// with the ability to set a custom HTTPClient for a request.
func NewCreateOrganizationParamsWithHTTPClient(client *http.Client) *CreateOrganizationParams {
return &CreateOrganizationParams{
HTTPClient: client,
}
}
/*
CreateOrganizationParams contains all the parameters to send to the API endpoint
for the create organization operation.
Typically these are written to a http.Request.
*/
type CreateOrganizationParams struct {
// Body.
Body CreateOrganizationBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the create organization params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateOrganizationParams) WithDefaults() *CreateOrganizationParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the create organization params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *CreateOrganizationParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the create organization params
func (o *CreateOrganizationParams) WithTimeout(timeout time.Duration) *CreateOrganizationParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the create organization params
func (o *CreateOrganizationParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the create organization params
func (o *CreateOrganizationParams) WithContext(ctx context.Context) *CreateOrganizationParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the create organization params
func (o *CreateOrganizationParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the create organization params
func (o *CreateOrganizationParams) WithHTTPClient(client *http.Client) *CreateOrganizationParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the create organization params
func (o *CreateOrganizationParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the create organization params
func (o *CreateOrganizationParams) WithBody(body CreateOrganizationBody) *CreateOrganizationParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the create organization params
func (o *CreateOrganizationParams) SetBody(body CreateOrganizationBody) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *CreateOrganizationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,303 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// CreateOrganizationReader is a Reader for the CreateOrganization structure.
type CreateOrganizationReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *CreateOrganizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 201:
result := NewCreateOrganizationCreated()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewCreateOrganizationUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewCreateOrganizationInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /organization] createOrganization", response, response.Code())
}
}
// NewCreateOrganizationCreated creates a CreateOrganizationCreated with default headers values
func NewCreateOrganizationCreated() *CreateOrganizationCreated {
return &CreateOrganizationCreated{}
}
/*
CreateOrganizationCreated describes a response with status code 201, with default header values.
organization created
*/
type CreateOrganizationCreated struct {
Payload *CreateOrganizationCreatedBody
}
// IsSuccess returns true when this create organization created response has a 2xx status code
func (o *CreateOrganizationCreated) IsSuccess() bool {
return true
}
// IsRedirect returns true when this create organization created response has a 3xx status code
func (o *CreateOrganizationCreated) IsRedirect() bool {
return false
}
// IsClientError returns true when this create organization created response has a 4xx status code
func (o *CreateOrganizationCreated) IsClientError() bool {
return false
}
// IsServerError returns true when this create organization created response has a 5xx status code
func (o *CreateOrganizationCreated) IsServerError() bool {
return false
}
// IsCode returns true when this create organization created response a status code equal to that given
func (o *CreateOrganizationCreated) IsCode(code int) bool {
return code == 201
}
// Code gets the status code for the create organization created response
func (o *CreateOrganizationCreated) Code() int {
return 201
}
func (o *CreateOrganizationCreated) Error() string {
return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated %+v", 201, o.Payload)
}
func (o *CreateOrganizationCreated) String() string {
return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated %+v", 201, o.Payload)
}
func (o *CreateOrganizationCreated) GetPayload() *CreateOrganizationCreatedBody {
return o.Payload
}
func (o *CreateOrganizationCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(CreateOrganizationCreatedBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewCreateOrganizationUnauthorized creates a CreateOrganizationUnauthorized with default headers values
func NewCreateOrganizationUnauthorized() *CreateOrganizationUnauthorized {
return &CreateOrganizationUnauthorized{}
}
/*
CreateOrganizationUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type CreateOrganizationUnauthorized struct {
}
// IsSuccess returns true when this create organization unauthorized response has a 2xx status code
func (o *CreateOrganizationUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this create organization unauthorized response has a 3xx status code
func (o *CreateOrganizationUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this create organization unauthorized response has a 4xx status code
func (o *CreateOrganizationUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this create organization unauthorized response has a 5xx status code
func (o *CreateOrganizationUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this create organization unauthorized response a status code equal to that given
func (o *CreateOrganizationUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the create organization unauthorized response
func (o *CreateOrganizationUnauthorized) Code() int {
return 401
}
func (o *CreateOrganizationUnauthorized) Error() string {
return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized ", 401)
}
func (o *CreateOrganizationUnauthorized) String() string {
return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized ", 401)
}
func (o *CreateOrganizationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewCreateOrganizationInternalServerError creates a CreateOrganizationInternalServerError with default headers values
func NewCreateOrganizationInternalServerError() *CreateOrganizationInternalServerError {
return &CreateOrganizationInternalServerError{}
}
/*
CreateOrganizationInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type CreateOrganizationInternalServerError struct {
}
// IsSuccess returns true when this create organization internal server error response has a 2xx status code
func (o *CreateOrganizationInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this create organization internal server error response has a 3xx status code
func (o *CreateOrganizationInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this create organization internal server error response has a 4xx status code
func (o *CreateOrganizationInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this create organization internal server error response has a 5xx status code
func (o *CreateOrganizationInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this create organization internal server error response a status code equal to that given
func (o *CreateOrganizationInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the create organization internal server error response
func (o *CreateOrganizationInternalServerError) Code() int {
return 500
}
func (o *CreateOrganizationInternalServerError) Error() string {
return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError ", 500)
}
func (o *CreateOrganizationInternalServerError) String() string {
return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError ", 500)
}
func (o *CreateOrganizationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
/*
CreateOrganizationBody create organization body
swagger:model CreateOrganizationBody
*/
type CreateOrganizationBody struct {
// description
Description string `json:"description,omitempty"`
}
// Validate validates this create organization body
func (o *CreateOrganizationBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this create organization body based on context it is used
func (o *CreateOrganizationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *CreateOrganizationBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *CreateOrganizationBody) UnmarshalBinary(b []byte) error {
var res CreateOrganizationBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
/*
CreateOrganizationCreatedBody create organization created body
swagger:model CreateOrganizationCreatedBody
*/
type CreateOrganizationCreatedBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this create organization created body
func (o *CreateOrganizationCreatedBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this create organization created body based on context it is used
func (o *CreateOrganizationCreatedBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *CreateOrganizationCreatedBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *CreateOrganizationCreatedBody) UnmarshalBinary(b []byte) error {
var res CreateOrganizationCreatedBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,146 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewDeleteOrganizationParams creates a new DeleteOrganizationParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewDeleteOrganizationParams() *DeleteOrganizationParams {
return &DeleteOrganizationParams{
timeout: cr.DefaultTimeout,
}
}
// NewDeleteOrganizationParamsWithTimeout creates a new DeleteOrganizationParams object
// with the ability to set a timeout on a request.
func NewDeleteOrganizationParamsWithTimeout(timeout time.Duration) *DeleteOrganizationParams {
return &DeleteOrganizationParams{
timeout: timeout,
}
}
// NewDeleteOrganizationParamsWithContext creates a new DeleteOrganizationParams object
// with the ability to set a context for a request.
func NewDeleteOrganizationParamsWithContext(ctx context.Context) *DeleteOrganizationParams {
return &DeleteOrganizationParams{
Context: ctx,
}
}
// NewDeleteOrganizationParamsWithHTTPClient creates a new DeleteOrganizationParams object
// with the ability to set a custom HTTPClient for a request.
func NewDeleteOrganizationParamsWithHTTPClient(client *http.Client) *DeleteOrganizationParams {
return &DeleteOrganizationParams{
HTTPClient: client,
}
}
/*
DeleteOrganizationParams contains all the parameters to send to the API endpoint
for the delete organization operation.
Typically these are written to a http.Request.
*/
type DeleteOrganizationParams struct {
// Body.
Body DeleteOrganizationBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the delete organization params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteOrganizationParams) WithDefaults() *DeleteOrganizationParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the delete organization params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteOrganizationParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the delete organization params
func (o *DeleteOrganizationParams) WithTimeout(timeout time.Duration) *DeleteOrganizationParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the delete organization params
func (o *DeleteOrganizationParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the delete organization params
func (o *DeleteOrganizationParams) WithContext(ctx context.Context) *DeleteOrganizationParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the delete organization params
func (o *DeleteOrganizationParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the delete organization params
func (o *DeleteOrganizationParams) WithHTTPClient(client *http.Client) *DeleteOrganizationParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the delete organization params
func (o *DeleteOrganizationParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the delete organization params
func (o *DeleteOrganizationParams) WithBody(body DeleteOrganizationBody) *DeleteOrganizationParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the delete organization params
func (o *DeleteOrganizationParams) SetBody(body DeleteOrganizationBody) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *DeleteOrganizationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,252 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DeleteOrganizationReader is a Reader for the DeleteOrganization structure.
type DeleteOrganizationReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *DeleteOrganizationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewDeleteOrganizationOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewDeleteOrganizationUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewDeleteOrganizationInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[DELETE /organization] deleteOrganization", response, response.Code())
}
}
// NewDeleteOrganizationOK creates a DeleteOrganizationOK with default headers values
func NewDeleteOrganizationOK() *DeleteOrganizationOK {
return &DeleteOrganizationOK{}
}
/*
DeleteOrganizationOK describes a response with status code 200, with default header values.
organization deleted
*/
type DeleteOrganizationOK struct {
}
// IsSuccess returns true when this delete organization o k response has a 2xx status code
func (o *DeleteOrganizationOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this delete organization o k response has a 3xx status code
func (o *DeleteOrganizationOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete organization o k response has a 4xx status code
func (o *DeleteOrganizationOK) IsClientError() bool {
return false
}
// IsServerError returns true when this delete organization o k response has a 5xx status code
func (o *DeleteOrganizationOK) IsServerError() bool {
return false
}
// IsCode returns true when this delete organization o k response a status code equal to that given
func (o *DeleteOrganizationOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the delete organization o k response
func (o *DeleteOrganizationOK) Code() int {
return 200
}
func (o *DeleteOrganizationOK) Error() string {
return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationOK ", 200)
}
func (o *DeleteOrganizationOK) String() string {
return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationOK ", 200)
}
func (o *DeleteOrganizationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewDeleteOrganizationUnauthorized creates a DeleteOrganizationUnauthorized with default headers values
func NewDeleteOrganizationUnauthorized() *DeleteOrganizationUnauthorized {
return &DeleteOrganizationUnauthorized{}
}
/*
DeleteOrganizationUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type DeleteOrganizationUnauthorized struct {
}
// IsSuccess returns true when this delete organization unauthorized response has a 2xx status code
func (o *DeleteOrganizationUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete organization unauthorized response has a 3xx status code
func (o *DeleteOrganizationUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete organization unauthorized response has a 4xx status code
func (o *DeleteOrganizationUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this delete organization unauthorized response has a 5xx status code
func (o *DeleteOrganizationUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this delete organization unauthorized response a status code equal to that given
func (o *DeleteOrganizationUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the delete organization unauthorized response
func (o *DeleteOrganizationUnauthorized) Code() int {
return 401
}
func (o *DeleteOrganizationUnauthorized) Error() string {
return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationUnauthorized ", 401)
}
func (o *DeleteOrganizationUnauthorized) String() string {
return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationUnauthorized ", 401)
}
func (o *DeleteOrganizationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewDeleteOrganizationInternalServerError creates a DeleteOrganizationInternalServerError with default headers values
func NewDeleteOrganizationInternalServerError() *DeleteOrganizationInternalServerError {
return &DeleteOrganizationInternalServerError{}
}
/*
DeleteOrganizationInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type DeleteOrganizationInternalServerError struct {
}
// IsSuccess returns true when this delete organization internal server error response has a 2xx status code
func (o *DeleteOrganizationInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this delete organization internal server error response has a 3xx status code
func (o *DeleteOrganizationInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this delete organization internal server error response has a 4xx status code
func (o *DeleteOrganizationInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this delete organization internal server error response has a 5xx status code
func (o *DeleteOrganizationInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this delete organization internal server error response a status code equal to that given
func (o *DeleteOrganizationInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the delete organization internal server error response
func (o *DeleteOrganizationInternalServerError) Code() int {
return 500
}
func (o *DeleteOrganizationInternalServerError) Error() string {
return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationInternalServerError ", 500)
}
func (o *DeleteOrganizationInternalServerError) String() string {
return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationInternalServerError ", 500)
}
func (o *DeleteOrganizationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
/*
DeleteOrganizationBody delete organization body
swagger:model DeleteOrganizationBody
*/
type DeleteOrganizationBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this delete organization body
func (o *DeleteOrganizationBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this delete organization body based on context it is used
func (o *DeleteOrganizationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *DeleteOrganizationBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *DeleteOrganizationBody) UnmarshalBinary(b []byte) error {
var res DeleteOrganizationBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,146 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewListOrganizationMembersParams creates a new ListOrganizationMembersParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewListOrganizationMembersParams() *ListOrganizationMembersParams {
return &ListOrganizationMembersParams{
timeout: cr.DefaultTimeout,
}
}
// NewListOrganizationMembersParamsWithTimeout creates a new ListOrganizationMembersParams object
// with the ability to set a timeout on a request.
func NewListOrganizationMembersParamsWithTimeout(timeout time.Duration) *ListOrganizationMembersParams {
return &ListOrganizationMembersParams{
timeout: timeout,
}
}
// NewListOrganizationMembersParamsWithContext creates a new ListOrganizationMembersParams object
// with the ability to set a context for a request.
func NewListOrganizationMembersParamsWithContext(ctx context.Context) *ListOrganizationMembersParams {
return &ListOrganizationMembersParams{
Context: ctx,
}
}
// NewListOrganizationMembersParamsWithHTTPClient creates a new ListOrganizationMembersParams object
// with the ability to set a custom HTTPClient for a request.
func NewListOrganizationMembersParamsWithHTTPClient(client *http.Client) *ListOrganizationMembersParams {
return &ListOrganizationMembersParams{
HTTPClient: client,
}
}
/*
ListOrganizationMembersParams contains all the parameters to send to the API endpoint
for the list organization members operation.
Typically these are written to a http.Request.
*/
type ListOrganizationMembersParams struct {
// Body.
Body ListOrganizationMembersBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the list organization members params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ListOrganizationMembersParams) WithDefaults() *ListOrganizationMembersParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the list organization members params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ListOrganizationMembersParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the list organization members params
func (o *ListOrganizationMembersParams) WithTimeout(timeout time.Duration) *ListOrganizationMembersParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the list organization members params
func (o *ListOrganizationMembersParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the list organization members params
func (o *ListOrganizationMembersParams) WithContext(ctx context.Context) *ListOrganizationMembersParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the list organization members params
func (o *ListOrganizationMembersParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the list organization members params
func (o *ListOrganizationMembersParams) WithHTTPClient(client *http.Client) *ListOrganizationMembersParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the list organization members params
func (o *ListOrganizationMembersParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the list organization members params
func (o *ListOrganizationMembersParams) WithBody(body ListOrganizationMembersBody) *ListOrganizationMembersParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the list organization members params
func (o *ListOrganizationMembersParams) SetBody(body ListOrganizationMembersBody) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *ListOrganizationMembersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,412 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"io"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// ListOrganizationMembersReader is a Reader for the ListOrganizationMembers structure.
type ListOrganizationMembersReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ListOrganizationMembersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewListOrganizationMembersOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewListOrganizationMembersUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewListOrganizationMembersInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /organization/members] listOrganizationMembers", response, response.Code())
}
}
// NewListOrganizationMembersOK creates a ListOrganizationMembersOK with default headers values
func NewListOrganizationMembersOK() *ListOrganizationMembersOK {
return &ListOrganizationMembersOK{}
}
/*
ListOrganizationMembersOK describes a response with status code 200, with default header values.
list organization members
*/
type ListOrganizationMembersOK struct {
Payload *ListOrganizationMembersOKBody
}
// IsSuccess returns true when this list organization members o k response has a 2xx status code
func (o *ListOrganizationMembersOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this list organization members o k response has a 3xx status code
func (o *ListOrganizationMembersOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this list organization members o k response has a 4xx status code
func (o *ListOrganizationMembersOK) IsClientError() bool {
return false
}
// IsServerError returns true when this list organization members o k response has a 5xx status code
func (o *ListOrganizationMembersOK) IsServerError() bool {
return false
}
// IsCode returns true when this list organization members o k response a status code equal to that given
func (o *ListOrganizationMembersOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the list organization members o k response
func (o *ListOrganizationMembersOK) Code() int {
return 200
}
func (o *ListOrganizationMembersOK) Error() string {
return fmt.Sprintf("[POST /organization/members][%d] listOrganizationMembersOK %+v", 200, o.Payload)
}
func (o *ListOrganizationMembersOK) String() string {
return fmt.Sprintf("[POST /organization/members][%d] listOrganizationMembersOK %+v", 200, o.Payload)
}
func (o *ListOrganizationMembersOK) GetPayload() *ListOrganizationMembersOKBody {
return o.Payload
}
func (o *ListOrganizationMembersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(ListOrganizationMembersOKBody)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewListOrganizationMembersUnauthorized creates a ListOrganizationMembersUnauthorized with default headers values
func NewListOrganizationMembersUnauthorized() *ListOrganizationMembersUnauthorized {
return &ListOrganizationMembersUnauthorized{}
}
/*
ListOrganizationMembersUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type ListOrganizationMembersUnauthorized struct {
}
// IsSuccess returns true when this list organization members unauthorized response has a 2xx status code
func (o *ListOrganizationMembersUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this list organization members unauthorized response has a 3xx status code
func (o *ListOrganizationMembersUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this list organization members unauthorized response has a 4xx status code
func (o *ListOrganizationMembersUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this list organization members unauthorized response has a 5xx status code
func (o *ListOrganizationMembersUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this list organization members unauthorized response a status code equal to that given
func (o *ListOrganizationMembersUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the list organization members unauthorized response
func (o *ListOrganizationMembersUnauthorized) Code() int {
return 401
}
func (o *ListOrganizationMembersUnauthorized) Error() string {
return fmt.Sprintf("[POST /organization/members][%d] listOrganizationMembersUnauthorized ", 401)
}
func (o *ListOrganizationMembersUnauthorized) String() string {
return fmt.Sprintf("[POST /organization/members][%d] listOrganizationMembersUnauthorized ", 401)
}
func (o *ListOrganizationMembersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewListOrganizationMembersInternalServerError creates a ListOrganizationMembersInternalServerError with default headers values
func NewListOrganizationMembersInternalServerError() *ListOrganizationMembersInternalServerError {
return &ListOrganizationMembersInternalServerError{}
}
/*
ListOrganizationMembersInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type ListOrganizationMembersInternalServerError struct {
}
// IsSuccess returns true when this list organization members internal server error response has a 2xx status code
func (o *ListOrganizationMembersInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this list organization members internal server error response has a 3xx status code
func (o *ListOrganizationMembersInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this list organization members internal server error response has a 4xx status code
func (o *ListOrganizationMembersInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this list organization members internal server error response has a 5xx status code
func (o *ListOrganizationMembersInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this list organization members internal server error response a status code equal to that given
func (o *ListOrganizationMembersInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the list organization members internal server error response
func (o *ListOrganizationMembersInternalServerError) Code() int {
return 500
}
func (o *ListOrganizationMembersInternalServerError) Error() string {
return fmt.Sprintf("[POST /organization/members][%d] listOrganizationMembersInternalServerError ", 500)
}
func (o *ListOrganizationMembersInternalServerError) String() string {
return fmt.Sprintf("[POST /organization/members][%d] listOrganizationMembersInternalServerError ", 500)
}
func (o *ListOrganizationMembersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
/*
ListOrganizationMembersBody list organization members body
swagger:model ListOrganizationMembersBody
*/
type ListOrganizationMembersBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this list organization members body
func (o *ListOrganizationMembersBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list organization members body based on context it is used
func (o *ListOrganizationMembersBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListOrganizationMembersBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListOrganizationMembersBody) UnmarshalBinary(b []byte) error {
var res ListOrganizationMembersBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
/*
ListOrganizationMembersOKBody list organization members o k body
swagger:model ListOrganizationMembersOKBody
*/
type ListOrganizationMembersOKBody struct {
// members
Members []*ListOrganizationMembersOKBodyMembersItems0 `json:"members"`
}
// Validate validates this list organization members o k body
func (o *ListOrganizationMembersOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateMembers(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *ListOrganizationMembersOKBody) validateMembers(formats strfmt.Registry) error {
if swag.IsZero(o.Members) { // not required
return nil
}
for i := 0; i < len(o.Members); i++ {
if swag.IsZero(o.Members[i]) { // not required
continue
}
if o.Members[i] != nil {
if err := o.Members[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this list organization members o k body based on the context it is used
func (o *ListOrganizationMembersOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := o.contextValidateMembers(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *ListOrganizationMembersOKBody) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(o.Members); i++ {
if o.Members[i] != nil {
if swag.IsZero(o.Members[i]) { // not required
return nil
}
if err := o.Members[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (o *ListOrganizationMembersOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListOrganizationMembersOKBody) UnmarshalBinary(b []byte) error {
var res ListOrganizationMembersOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
/*
ListOrganizationMembersOKBodyMembersItems0 list organization members o k body members items0
swagger:model ListOrganizationMembersOKBodyMembersItems0
*/
type ListOrganizationMembersOKBodyMembersItems0 struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this list organization members o k body members items0
func (o *ListOrganizationMembersOKBodyMembersItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list organization members o k body members items0 based on context it is used
func (o *ListOrganizationMembersOKBodyMembersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListOrganizationMembersOKBodyMembersItems0) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListOrganizationMembersOKBodyMembersItems0) UnmarshalBinary(b []byte) error {
var res ListOrganizationMembersOKBodyMembersItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,146 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
// NewRemoveOrganizationMemberParams creates a new RemoveOrganizationMemberParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewRemoveOrganizationMemberParams() *RemoveOrganizationMemberParams {
return &RemoveOrganizationMemberParams{
timeout: cr.DefaultTimeout,
}
}
// NewRemoveOrganizationMemberParamsWithTimeout creates a new RemoveOrganizationMemberParams object
// with the ability to set a timeout on a request.
func NewRemoveOrganizationMemberParamsWithTimeout(timeout time.Duration) *RemoveOrganizationMemberParams {
return &RemoveOrganizationMemberParams{
timeout: timeout,
}
}
// NewRemoveOrganizationMemberParamsWithContext creates a new RemoveOrganizationMemberParams object
// with the ability to set a context for a request.
func NewRemoveOrganizationMemberParamsWithContext(ctx context.Context) *RemoveOrganizationMemberParams {
return &RemoveOrganizationMemberParams{
Context: ctx,
}
}
// NewRemoveOrganizationMemberParamsWithHTTPClient creates a new RemoveOrganizationMemberParams object
// with the ability to set a custom HTTPClient for a request.
func NewRemoveOrganizationMemberParamsWithHTTPClient(client *http.Client) *RemoveOrganizationMemberParams {
return &RemoveOrganizationMemberParams{
HTTPClient: client,
}
}
/*
RemoveOrganizationMemberParams contains all the parameters to send to the API endpoint
for the remove organization member operation.
Typically these are written to a http.Request.
*/
type RemoveOrganizationMemberParams struct {
// Body.
Body RemoveOrganizationMemberBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the remove organization member params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *RemoveOrganizationMemberParams) WithDefaults() *RemoveOrganizationMemberParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the remove organization member params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *RemoveOrganizationMemberParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the remove organization member params
func (o *RemoveOrganizationMemberParams) WithTimeout(timeout time.Duration) *RemoveOrganizationMemberParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the remove organization member params
func (o *RemoveOrganizationMemberParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the remove organization member params
func (o *RemoveOrganizationMemberParams) WithContext(ctx context.Context) *RemoveOrganizationMemberParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the remove organization member params
func (o *RemoveOrganizationMemberParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the remove organization member params
func (o *RemoveOrganizationMemberParams) WithHTTPClient(client *http.Client) *RemoveOrganizationMemberParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the remove organization member params
func (o *RemoveOrganizationMemberParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the remove organization member params
func (o *RemoveOrganizationMemberParams) WithBody(body RemoveOrganizationMemberBody) *RemoveOrganizationMemberParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the remove organization member params
func (o *RemoveOrganizationMemberParams) SetBody(body RemoveOrganizationMemberBody) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *RemoveOrganizationMemberParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
if err := r.SetTimeout(o.timeout); err != nil {
return err
}
var res []error
if err := r.SetBodyParam(o.Body); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,252 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"fmt"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// RemoveOrganizationMemberReader is a Reader for the RemoveOrganizationMember structure.
type RemoveOrganizationMemberReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *RemoveOrganizationMemberReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewRemoveOrganizationMemberOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewRemoveOrganizationMemberUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewRemoveOrganizationMemberInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /organization/remove] removeOrganizationMember", response, response.Code())
}
}
// NewRemoveOrganizationMemberOK creates a RemoveOrganizationMemberOK with default headers values
func NewRemoveOrganizationMemberOK() *RemoveOrganizationMemberOK {
return &RemoveOrganizationMemberOK{}
}
/*
RemoveOrganizationMemberOK describes a response with status code 200, with default header values.
member removed
*/
type RemoveOrganizationMemberOK struct {
}
// IsSuccess returns true when this remove organization member o k response has a 2xx status code
func (o *RemoveOrganizationMemberOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this remove organization member o k response has a 3xx status code
func (o *RemoveOrganizationMemberOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this remove organization member o k response has a 4xx status code
func (o *RemoveOrganizationMemberOK) IsClientError() bool {
return false
}
// IsServerError returns true when this remove organization member o k response has a 5xx status code
func (o *RemoveOrganizationMemberOK) IsServerError() bool {
return false
}
// IsCode returns true when this remove organization member o k response a status code equal to that given
func (o *RemoveOrganizationMemberOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the remove organization member o k response
func (o *RemoveOrganizationMemberOK) Code() int {
return 200
}
func (o *RemoveOrganizationMemberOK) Error() string {
return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberOK ", 200)
}
func (o *RemoveOrganizationMemberOK) String() string {
return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberOK ", 200)
}
func (o *RemoveOrganizationMemberOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewRemoveOrganizationMemberUnauthorized creates a RemoveOrganizationMemberUnauthorized with default headers values
func NewRemoveOrganizationMemberUnauthorized() *RemoveOrganizationMemberUnauthorized {
return &RemoveOrganizationMemberUnauthorized{}
}
/*
RemoveOrganizationMemberUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type RemoveOrganizationMemberUnauthorized struct {
}
// IsSuccess returns true when this remove organization member unauthorized response has a 2xx status code
func (o *RemoveOrganizationMemberUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this remove organization member unauthorized response has a 3xx status code
func (o *RemoveOrganizationMemberUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this remove organization member unauthorized response has a 4xx status code
func (o *RemoveOrganizationMemberUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this remove organization member unauthorized response has a 5xx status code
func (o *RemoveOrganizationMemberUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this remove organization member unauthorized response a status code equal to that given
func (o *RemoveOrganizationMemberUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the remove organization member unauthorized response
func (o *RemoveOrganizationMemberUnauthorized) Code() int {
return 401
}
func (o *RemoveOrganizationMemberUnauthorized) Error() string {
return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberUnauthorized ", 401)
}
func (o *RemoveOrganizationMemberUnauthorized) String() string {
return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberUnauthorized ", 401)
}
func (o *RemoveOrganizationMemberUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewRemoveOrganizationMemberInternalServerError creates a RemoveOrganizationMemberInternalServerError with default headers values
func NewRemoveOrganizationMemberInternalServerError() *RemoveOrganizationMemberInternalServerError {
return &RemoveOrganizationMemberInternalServerError{}
}
/*
RemoveOrganizationMemberInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type RemoveOrganizationMemberInternalServerError struct {
}
// IsSuccess returns true when this remove organization member internal server error response has a 2xx status code
func (o *RemoveOrganizationMemberInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this remove organization member internal server error response has a 3xx status code
func (o *RemoveOrganizationMemberInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this remove organization member internal server error response has a 4xx status code
func (o *RemoveOrganizationMemberInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this remove organization member internal server error response has a 5xx status code
func (o *RemoveOrganizationMemberInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this remove organization member internal server error response a status code equal to that given
func (o *RemoveOrganizationMemberInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the remove organization member internal server error response
func (o *RemoveOrganizationMemberInternalServerError) Code() int {
return 500
}
func (o *RemoveOrganizationMemberInternalServerError) Error() string {
return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberInternalServerError ", 500)
}
func (o *RemoveOrganizationMemberInternalServerError) String() string {
return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberInternalServerError ", 500)
}
func (o *RemoveOrganizationMemberInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
/*
RemoveOrganizationMemberBody remove organization member body
swagger:model RemoveOrganizationMemberBody
*/
type RemoveOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this remove organization member body
func (o *RemoveOrganizationMemberBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this remove organization member body based on context it is used
func (o *RemoveOrganizationMemberBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *RemoveOrganizationMemberBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *RemoveOrganizationMemberBody) UnmarshalBinary(b []byte) error {
var res RemoveOrganizationMemberBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -831,6 +831,210 @@ func init() {
}
}
},
"/organization": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "createOrganization",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"description": {
"type": "string"
}
}
}
}
],
"responses": {
"201": {
"description": "organization created",
"schema": {
"properties": {
"token": {
"type": "string"
}
}
}
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
},
"delete": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "deleteOrganization",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"token": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "organization deleted"
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/organization/add": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "addOrganizationMember",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"email": {
"type": "string"
}
}
}
}
],
"responses": {
"201": {
"description": "member added"
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/organization/members": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "listOrganizationMembers",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"token": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "list organization members",
"schema": {
"properties": {
"members": {
"type": "array",
"items": {
"properties": {
"email": {
"type": "string"
}
}
}
}
}
}
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/organization/remove": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "removeOrganizationMember",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"email": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "member removed"
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/overview": {
"get": {
"security": [
@ -2681,6 +2885,206 @@ func init() {
}
}
},
"/organization": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "createOrganization",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"description": {
"type": "string"
}
}
}
}
],
"responses": {
"201": {
"description": "organization created",
"schema": {
"properties": {
"token": {
"type": "string"
}
}
}
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
},
"delete": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "deleteOrganization",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"token": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "organization deleted"
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/organization/add": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "addOrganizationMember",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"email": {
"type": "string"
}
}
}
}
],
"responses": {
"201": {
"description": "member added"
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/organization/members": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "listOrganizationMembers",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"token": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "list organization members",
"schema": {
"properties": {
"members": {
"type": "array",
"items": {
"$ref": "#/definitions/MembersItems0"
}
}
}
}
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/organization/remove": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "removeOrganizationMember",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"email": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "member removed"
},
"401": {
"description": "unauthorized"
},
"500": {
"description": "internal server error"
}
}
}
},
"/overview": {
"get": {
"security": [
@ -3064,6 +3468,13 @@ func init() {
}
},
"definitions": {
"MembersItems0": {
"properties": {
"email": {
"type": "string"
}
}
},
"accessRequest": {
"type": "object",
"properties": {

View File

@ -0,0 +1,111 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/rest_model_zrok"
)
// AddOrganizationMemberHandlerFunc turns a function with the right signature into a add organization member handler
type AddOrganizationMemberHandlerFunc func(AddOrganizationMemberParams, *rest_model_zrok.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn AddOrganizationMemberHandlerFunc) Handle(params AddOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder {
return fn(params, principal)
}
// AddOrganizationMemberHandler interface for that can handle valid add organization member params
type AddOrganizationMemberHandler interface {
Handle(AddOrganizationMemberParams, *rest_model_zrok.Principal) middleware.Responder
}
// NewAddOrganizationMember creates a new http.Handler for the add organization member operation
func NewAddOrganizationMember(ctx *middleware.Context, handler AddOrganizationMemberHandler) *AddOrganizationMember {
return &AddOrganizationMember{Context: ctx, Handler: handler}
}
/*
AddOrganizationMember swagger:route POST /organization/add admin addOrganizationMember
AddOrganizationMember add organization member API
*/
type AddOrganizationMember struct {
Context *middleware.Context
Handler AddOrganizationMemberHandler
}
func (o *AddOrganizationMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewAddOrganizationMemberParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *rest_model_zrok.Principal
if uprinc != nil {
principal = uprinc.(*rest_model_zrok.Principal) // this is really a rest_model_zrok.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// AddOrganizationMemberBody add organization member body
//
// swagger:model AddOrganizationMemberBody
type AddOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this add organization member body
func (o *AddOrganizationMemberBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this add organization member body based on context it is used
func (o *AddOrganizationMemberBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *AddOrganizationMemberBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *AddOrganizationMemberBody) UnmarshalBinary(b []byte) error {
var res AddOrganizationMemberBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,74 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
)
// NewAddOrganizationMemberParams creates a new AddOrganizationMemberParams object
//
// There are no default values defined in the spec.
func NewAddOrganizationMemberParams() AddOrganizationMemberParams {
return AddOrganizationMemberParams{}
}
// AddOrganizationMemberParams contains all the bound params for the add organization member operation
// typically these are obtained from a http.Request
//
// swagger:parameters addOrganizationMember
type AddOrganizationMemberParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Body AddOrganizationMemberBody
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewAddOrganizationMemberParams() beforehand.
func (o *AddOrganizationMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body AddOrganizationMemberBody
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("body", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
)
// AddOrganizationMemberCreatedCode is the HTTP code returned for type AddOrganizationMemberCreated
const AddOrganizationMemberCreatedCode int = 201
/*
AddOrganizationMemberCreated member added
swagger:response addOrganizationMemberCreated
*/
type AddOrganizationMemberCreated struct {
}
// NewAddOrganizationMemberCreated creates AddOrganizationMemberCreated with default headers values
func NewAddOrganizationMemberCreated() *AddOrganizationMemberCreated {
return &AddOrganizationMemberCreated{}
}
// WriteResponse to the client
func (o *AddOrganizationMemberCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(201)
}
// AddOrganizationMemberUnauthorizedCode is the HTTP code returned for type AddOrganizationMemberUnauthorized
const AddOrganizationMemberUnauthorizedCode int = 401
/*
AddOrganizationMemberUnauthorized unauthorized
swagger:response addOrganizationMemberUnauthorized
*/
type AddOrganizationMemberUnauthorized struct {
}
// NewAddOrganizationMemberUnauthorized creates AddOrganizationMemberUnauthorized with default headers values
func NewAddOrganizationMemberUnauthorized() *AddOrganizationMemberUnauthorized {
return &AddOrganizationMemberUnauthorized{}
}
// WriteResponse to the client
func (o *AddOrganizationMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
}
// AddOrganizationMemberInternalServerErrorCode is the HTTP code returned for type AddOrganizationMemberInternalServerError
const AddOrganizationMemberInternalServerErrorCode int = 500
/*
AddOrganizationMemberInternalServerError internal server error
swagger:response addOrganizationMemberInternalServerError
*/
type AddOrganizationMemberInternalServerError struct {
}
// NewAddOrganizationMemberInternalServerError creates AddOrganizationMemberInternalServerError with default headers values
func NewAddOrganizationMemberInternalServerError() *AddOrganizationMemberInternalServerError {
return &AddOrganizationMemberInternalServerError{}
}
// WriteResponse to the client
func (o *AddOrganizationMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// AddOrganizationMemberURL generates an URL for the add organization member operation
type AddOrganizationMemberURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *AddOrganizationMemberURL) WithBasePath(bp string) *AddOrganizationMemberURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *AddOrganizationMemberURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *AddOrganizationMemberURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/organization/add"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *AddOrganizationMemberURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *AddOrganizationMemberURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *AddOrganizationMemberURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on AddOrganizationMemberURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on AddOrganizationMemberURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *AddOrganizationMemberURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@ -0,0 +1,148 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/rest_model_zrok"
)
// CreateOrganizationHandlerFunc turns a function with the right signature into a create organization handler
type CreateOrganizationHandlerFunc func(CreateOrganizationParams, *rest_model_zrok.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn CreateOrganizationHandlerFunc) Handle(params CreateOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder {
return fn(params, principal)
}
// CreateOrganizationHandler interface for that can handle valid create organization params
type CreateOrganizationHandler interface {
Handle(CreateOrganizationParams, *rest_model_zrok.Principal) middleware.Responder
}
// NewCreateOrganization creates a new http.Handler for the create organization operation
func NewCreateOrganization(ctx *middleware.Context, handler CreateOrganizationHandler) *CreateOrganization {
return &CreateOrganization{Context: ctx, Handler: handler}
}
/*
CreateOrganization swagger:route POST /organization admin createOrganization
CreateOrganization create organization API
*/
type CreateOrganization struct {
Context *middleware.Context
Handler CreateOrganizationHandler
}
func (o *CreateOrganization) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewCreateOrganizationParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *rest_model_zrok.Principal
if uprinc != nil {
principal = uprinc.(*rest_model_zrok.Principal) // this is really a rest_model_zrok.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// CreateOrganizationBody create organization body
//
// swagger:model CreateOrganizationBody
type CreateOrganizationBody struct {
// description
Description string `json:"description,omitempty"`
}
// Validate validates this create organization body
func (o *CreateOrganizationBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this create organization body based on context it is used
func (o *CreateOrganizationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *CreateOrganizationBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *CreateOrganizationBody) UnmarshalBinary(b []byte) error {
var res CreateOrganizationBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
// CreateOrganizationCreatedBody create organization created body
//
// swagger:model CreateOrganizationCreatedBody
type CreateOrganizationCreatedBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this create organization created body
func (o *CreateOrganizationCreatedBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this create organization created body based on context it is used
func (o *CreateOrganizationCreatedBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *CreateOrganizationCreatedBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *CreateOrganizationCreatedBody) UnmarshalBinary(b []byte) error {
var res CreateOrganizationCreatedBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,74 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
)
// NewCreateOrganizationParams creates a new CreateOrganizationParams object
//
// There are no default values defined in the spec.
func NewCreateOrganizationParams() CreateOrganizationParams {
return CreateOrganizationParams{}
}
// CreateOrganizationParams contains all the bound params for the create organization operation
// typically these are obtained from a http.Request
//
// swagger:parameters createOrganization
type CreateOrganizationParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Body CreateOrganizationBody
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewCreateOrganizationParams() beforehand.
func (o *CreateOrganizationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body CreateOrganizationBody
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("body", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,107 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
)
// CreateOrganizationCreatedCode is the HTTP code returned for type CreateOrganizationCreated
const CreateOrganizationCreatedCode int = 201
/*
CreateOrganizationCreated organization created
swagger:response createOrganizationCreated
*/
type CreateOrganizationCreated struct {
/*
In: Body
*/
Payload *CreateOrganizationCreatedBody `json:"body,omitempty"`
}
// NewCreateOrganizationCreated creates CreateOrganizationCreated with default headers values
func NewCreateOrganizationCreated() *CreateOrganizationCreated {
return &CreateOrganizationCreated{}
}
// WithPayload adds the payload to the create organization created response
func (o *CreateOrganizationCreated) WithPayload(payload *CreateOrganizationCreatedBody) *CreateOrganizationCreated {
o.Payload = payload
return o
}
// SetPayload sets the payload to the create organization created response
func (o *CreateOrganizationCreated) SetPayload(payload *CreateOrganizationCreatedBody) {
o.Payload = payload
}
// WriteResponse to the client
func (o *CreateOrganizationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(201)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
// CreateOrganizationUnauthorizedCode is the HTTP code returned for type CreateOrganizationUnauthorized
const CreateOrganizationUnauthorizedCode int = 401
/*
CreateOrganizationUnauthorized unauthorized
swagger:response createOrganizationUnauthorized
*/
type CreateOrganizationUnauthorized struct {
}
// NewCreateOrganizationUnauthorized creates CreateOrganizationUnauthorized with default headers values
func NewCreateOrganizationUnauthorized() *CreateOrganizationUnauthorized {
return &CreateOrganizationUnauthorized{}
}
// WriteResponse to the client
func (o *CreateOrganizationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
}
// CreateOrganizationInternalServerErrorCode is the HTTP code returned for type CreateOrganizationInternalServerError
const CreateOrganizationInternalServerErrorCode int = 500
/*
CreateOrganizationInternalServerError internal server error
swagger:response createOrganizationInternalServerError
*/
type CreateOrganizationInternalServerError struct {
}
// NewCreateOrganizationInternalServerError creates CreateOrganizationInternalServerError with default headers values
func NewCreateOrganizationInternalServerError() *CreateOrganizationInternalServerError {
return &CreateOrganizationInternalServerError{}
}
// WriteResponse to the client
func (o *CreateOrganizationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// CreateOrganizationURL generates an URL for the create organization operation
type CreateOrganizationURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *CreateOrganizationURL) WithBasePath(bp string) *CreateOrganizationURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *CreateOrganizationURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *CreateOrganizationURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/organization"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *CreateOrganizationURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *CreateOrganizationURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *CreateOrganizationURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on CreateOrganizationURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on CreateOrganizationURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *CreateOrganizationURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@ -0,0 +1,111 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/rest_model_zrok"
)
// DeleteOrganizationHandlerFunc turns a function with the right signature into a delete organization handler
type DeleteOrganizationHandlerFunc func(DeleteOrganizationParams, *rest_model_zrok.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn DeleteOrganizationHandlerFunc) Handle(params DeleteOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder {
return fn(params, principal)
}
// DeleteOrganizationHandler interface for that can handle valid delete organization params
type DeleteOrganizationHandler interface {
Handle(DeleteOrganizationParams, *rest_model_zrok.Principal) middleware.Responder
}
// NewDeleteOrganization creates a new http.Handler for the delete organization operation
func NewDeleteOrganization(ctx *middleware.Context, handler DeleteOrganizationHandler) *DeleteOrganization {
return &DeleteOrganization{Context: ctx, Handler: handler}
}
/*
DeleteOrganization swagger:route DELETE /organization admin deleteOrganization
DeleteOrganization delete organization API
*/
type DeleteOrganization struct {
Context *middleware.Context
Handler DeleteOrganizationHandler
}
func (o *DeleteOrganization) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewDeleteOrganizationParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *rest_model_zrok.Principal
if uprinc != nil {
principal = uprinc.(*rest_model_zrok.Principal) // this is really a rest_model_zrok.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// DeleteOrganizationBody delete organization body
//
// swagger:model DeleteOrganizationBody
type DeleteOrganizationBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this delete organization body
func (o *DeleteOrganizationBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this delete organization body based on context it is used
func (o *DeleteOrganizationBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *DeleteOrganizationBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *DeleteOrganizationBody) UnmarshalBinary(b []byte) error {
var res DeleteOrganizationBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,74 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
)
// NewDeleteOrganizationParams creates a new DeleteOrganizationParams object
//
// There are no default values defined in the spec.
func NewDeleteOrganizationParams() DeleteOrganizationParams {
return DeleteOrganizationParams{}
}
// DeleteOrganizationParams contains all the bound params for the delete organization operation
// typically these are obtained from a http.Request
//
// swagger:parameters deleteOrganization
type DeleteOrganizationParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Body DeleteOrganizationBody
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewDeleteOrganizationParams() beforehand.
func (o *DeleteOrganizationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body DeleteOrganizationBody
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("body", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
)
// DeleteOrganizationOKCode is the HTTP code returned for type DeleteOrganizationOK
const DeleteOrganizationOKCode int = 200
/*
DeleteOrganizationOK organization deleted
swagger:response deleteOrganizationOK
*/
type DeleteOrganizationOK struct {
}
// NewDeleteOrganizationOK creates DeleteOrganizationOK with default headers values
func NewDeleteOrganizationOK() *DeleteOrganizationOK {
return &DeleteOrganizationOK{}
}
// WriteResponse to the client
func (o *DeleteOrganizationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
// DeleteOrganizationUnauthorizedCode is the HTTP code returned for type DeleteOrganizationUnauthorized
const DeleteOrganizationUnauthorizedCode int = 401
/*
DeleteOrganizationUnauthorized unauthorized
swagger:response deleteOrganizationUnauthorized
*/
type DeleteOrganizationUnauthorized struct {
}
// NewDeleteOrganizationUnauthorized creates DeleteOrganizationUnauthorized with default headers values
func NewDeleteOrganizationUnauthorized() *DeleteOrganizationUnauthorized {
return &DeleteOrganizationUnauthorized{}
}
// WriteResponse to the client
func (o *DeleteOrganizationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
}
// DeleteOrganizationInternalServerErrorCode is the HTTP code returned for type DeleteOrganizationInternalServerError
const DeleteOrganizationInternalServerErrorCode int = 500
/*
DeleteOrganizationInternalServerError internal server error
swagger:response deleteOrganizationInternalServerError
*/
type DeleteOrganizationInternalServerError struct {
}
// NewDeleteOrganizationInternalServerError creates DeleteOrganizationInternalServerError with default headers values
func NewDeleteOrganizationInternalServerError() *DeleteOrganizationInternalServerError {
return &DeleteOrganizationInternalServerError{}
}
// WriteResponse to the client
func (o *DeleteOrganizationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// DeleteOrganizationURL generates an URL for the delete organization operation
type DeleteOrganizationURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *DeleteOrganizationURL) WithBasePath(bp string) *DeleteOrganizationURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *DeleteOrganizationURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *DeleteOrganizationURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/organization"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *DeleteOrganizationURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *DeleteOrganizationURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *DeleteOrganizationURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on DeleteOrganizationURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on DeleteOrganizationURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *DeleteOrganizationURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@ -0,0 +1,256 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"strconv"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/rest_model_zrok"
)
// ListOrganizationMembersHandlerFunc turns a function with the right signature into a list organization members handler
type ListOrganizationMembersHandlerFunc func(ListOrganizationMembersParams, *rest_model_zrok.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn ListOrganizationMembersHandlerFunc) Handle(params ListOrganizationMembersParams, principal *rest_model_zrok.Principal) middleware.Responder {
return fn(params, principal)
}
// ListOrganizationMembersHandler interface for that can handle valid list organization members params
type ListOrganizationMembersHandler interface {
Handle(ListOrganizationMembersParams, *rest_model_zrok.Principal) middleware.Responder
}
// NewListOrganizationMembers creates a new http.Handler for the list organization members operation
func NewListOrganizationMembers(ctx *middleware.Context, handler ListOrganizationMembersHandler) *ListOrganizationMembers {
return &ListOrganizationMembers{Context: ctx, Handler: handler}
}
/*
ListOrganizationMembers swagger:route POST /organization/members admin listOrganizationMembers
ListOrganizationMembers list organization members API
*/
type ListOrganizationMembers struct {
Context *middleware.Context
Handler ListOrganizationMembersHandler
}
func (o *ListOrganizationMembers) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewListOrganizationMembersParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *rest_model_zrok.Principal
if uprinc != nil {
principal = uprinc.(*rest_model_zrok.Principal) // this is really a rest_model_zrok.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// ListOrganizationMembersBody list organization members body
//
// swagger:model ListOrganizationMembersBody
type ListOrganizationMembersBody struct {
// token
Token string `json:"token,omitempty"`
}
// Validate validates this list organization members body
func (o *ListOrganizationMembersBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list organization members body based on context it is used
func (o *ListOrganizationMembersBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListOrganizationMembersBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListOrganizationMembersBody) UnmarshalBinary(b []byte) error {
var res ListOrganizationMembersBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
// ListOrganizationMembersOKBody list organization members o k body
//
// swagger:model ListOrganizationMembersOKBody
type ListOrganizationMembersOKBody struct {
// members
Members []*ListOrganizationMembersOKBodyMembersItems0 `json:"members"`
}
// Validate validates this list organization members o k body
func (o *ListOrganizationMembersOKBody) Validate(formats strfmt.Registry) error {
var res []error
if err := o.validateMembers(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *ListOrganizationMembersOKBody) validateMembers(formats strfmt.Registry) error {
if swag.IsZero(o.Members) { // not required
return nil
}
for i := 0; i < len(o.Members); i++ {
if swag.IsZero(o.Members[i]) { // not required
continue
}
if o.Members[i] != nil {
if err := o.Members[i].Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// ContextValidate validate this list organization members o k body based on the context it is used
func (o *ListOrganizationMembersOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
var res []error
if err := o.contextValidateMembers(ctx, formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (o *ListOrganizationMembersOKBody) contextValidateMembers(ctx context.Context, formats strfmt.Registry) error {
for i := 0; i < len(o.Members); i++ {
if o.Members[i] != nil {
if swag.IsZero(o.Members[i]) { // not required
return nil
}
if err := o.Members[i].ContextValidate(ctx, formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
} else if ce, ok := err.(*errors.CompositeError); ok {
return ce.ValidateName("listOrganizationMembersOK" + "." + "members" + "." + strconv.Itoa(i))
}
return err
}
}
}
return nil
}
// MarshalBinary interface implementation
func (o *ListOrganizationMembersOKBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListOrganizationMembersOKBody) UnmarshalBinary(b []byte) error {
var res ListOrganizationMembersOKBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
// ListOrganizationMembersOKBodyMembersItems0 list organization members o k body members items0
//
// swagger:model ListOrganizationMembersOKBodyMembersItems0
type ListOrganizationMembersOKBodyMembersItems0 struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this list organization members o k body members items0
func (o *ListOrganizationMembersOKBodyMembersItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list organization members o k body members items0 based on context it is used
func (o *ListOrganizationMembersOKBodyMembersItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListOrganizationMembersOKBodyMembersItems0) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListOrganizationMembersOKBodyMembersItems0) UnmarshalBinary(b []byte) error {
var res ListOrganizationMembersOKBodyMembersItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,74 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
)
// NewListOrganizationMembersParams creates a new ListOrganizationMembersParams object
//
// There are no default values defined in the spec.
func NewListOrganizationMembersParams() ListOrganizationMembersParams {
return ListOrganizationMembersParams{}
}
// ListOrganizationMembersParams contains all the bound params for the list organization members operation
// typically these are obtained from a http.Request
//
// swagger:parameters listOrganizationMembers
type ListOrganizationMembersParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Body ListOrganizationMembersBody
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewListOrganizationMembersParams() beforehand.
func (o *ListOrganizationMembersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body ListOrganizationMembersBody
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("body", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,107 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
)
// ListOrganizationMembersOKCode is the HTTP code returned for type ListOrganizationMembersOK
const ListOrganizationMembersOKCode int = 200
/*
ListOrganizationMembersOK list organization members
swagger:response listOrganizationMembersOK
*/
type ListOrganizationMembersOK struct {
/*
In: Body
*/
Payload *ListOrganizationMembersOKBody `json:"body,omitempty"`
}
// NewListOrganizationMembersOK creates ListOrganizationMembersOK with default headers values
func NewListOrganizationMembersOK() *ListOrganizationMembersOK {
return &ListOrganizationMembersOK{}
}
// WithPayload adds the payload to the list organization members o k response
func (o *ListOrganizationMembersOK) WithPayload(payload *ListOrganizationMembersOKBody) *ListOrganizationMembersOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list organization members o k response
func (o *ListOrganizationMembersOK) SetPayload(payload *ListOrganizationMembersOKBody) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListOrganizationMembersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
// ListOrganizationMembersUnauthorizedCode is the HTTP code returned for type ListOrganizationMembersUnauthorized
const ListOrganizationMembersUnauthorizedCode int = 401
/*
ListOrganizationMembersUnauthorized unauthorized
swagger:response listOrganizationMembersUnauthorized
*/
type ListOrganizationMembersUnauthorized struct {
}
// NewListOrganizationMembersUnauthorized creates ListOrganizationMembersUnauthorized with default headers values
func NewListOrganizationMembersUnauthorized() *ListOrganizationMembersUnauthorized {
return &ListOrganizationMembersUnauthorized{}
}
// WriteResponse to the client
func (o *ListOrganizationMembersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
}
// ListOrganizationMembersInternalServerErrorCode is the HTTP code returned for type ListOrganizationMembersInternalServerError
const ListOrganizationMembersInternalServerErrorCode int = 500
/*
ListOrganizationMembersInternalServerError internal server error
swagger:response listOrganizationMembersInternalServerError
*/
type ListOrganizationMembersInternalServerError struct {
}
// NewListOrganizationMembersInternalServerError creates ListOrganizationMembersInternalServerError with default headers values
func NewListOrganizationMembersInternalServerError() *ListOrganizationMembersInternalServerError {
return &ListOrganizationMembersInternalServerError{}
}
// WriteResponse to the client
func (o *ListOrganizationMembersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// ListOrganizationMembersURL generates an URL for the list organization members operation
type ListOrganizationMembersURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *ListOrganizationMembersURL) WithBasePath(bp string) *ListOrganizationMembersURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *ListOrganizationMembersURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *ListOrganizationMembersURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/organization/members"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *ListOrganizationMembersURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *ListOrganizationMembersURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *ListOrganizationMembersURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on ListOrganizationMembersURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on ListOrganizationMembersURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *ListOrganizationMembersURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@ -0,0 +1,111 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"context"
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/rest_model_zrok"
)
// RemoveOrganizationMemberHandlerFunc turns a function with the right signature into a remove organization member handler
type RemoveOrganizationMemberHandlerFunc func(RemoveOrganizationMemberParams, *rest_model_zrok.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn RemoveOrganizationMemberHandlerFunc) Handle(params RemoveOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder {
return fn(params, principal)
}
// RemoveOrganizationMemberHandler interface for that can handle valid remove organization member params
type RemoveOrganizationMemberHandler interface {
Handle(RemoveOrganizationMemberParams, *rest_model_zrok.Principal) middleware.Responder
}
// NewRemoveOrganizationMember creates a new http.Handler for the remove organization member operation
func NewRemoveOrganizationMember(ctx *middleware.Context, handler RemoveOrganizationMemberHandler) *RemoveOrganizationMember {
return &RemoveOrganizationMember{Context: ctx, Handler: handler}
}
/*
RemoveOrganizationMember swagger:route POST /organization/remove admin removeOrganizationMember
RemoveOrganizationMember remove organization member API
*/
type RemoveOrganizationMember struct {
Context *middleware.Context
Handler RemoveOrganizationMemberHandler
}
func (o *RemoveOrganizationMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewRemoveOrganizationMemberParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *rest_model_zrok.Principal
if uprinc != nil {
principal = uprinc.(*rest_model_zrok.Principal) // this is really a rest_model_zrok.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// RemoveOrganizationMemberBody remove organization member body
//
// swagger:model RemoveOrganizationMemberBody
type RemoveOrganizationMemberBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this remove organization member body
func (o *RemoveOrganizationMemberBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this remove organization member body based on context it is used
func (o *RemoveOrganizationMemberBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *RemoveOrganizationMemberBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *RemoveOrganizationMemberBody) UnmarshalBinary(b []byte) error {
var res RemoveOrganizationMemberBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}

View File

@ -0,0 +1,74 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
)
// NewRemoveOrganizationMemberParams creates a new RemoveOrganizationMemberParams object
//
// There are no default values defined in the spec.
func NewRemoveOrganizationMemberParams() RemoveOrganizationMemberParams {
return RemoveOrganizationMemberParams{}
}
// RemoveOrganizationMemberParams contains all the bound params for the remove organization member operation
// typically these are obtained from a http.Request
//
// swagger:parameters removeOrganizationMember
type RemoveOrganizationMemberParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Body RemoveOrganizationMemberBody
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewRemoveOrganizationMemberParams() beforehand.
func (o *RemoveOrganizationMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body RemoveOrganizationMemberBody
if err := route.Consumer.Consume(r.Body, &body); err != nil {
res = append(res, errors.NewParseError("body", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = body
}
}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
)
// RemoveOrganizationMemberOKCode is the HTTP code returned for type RemoveOrganizationMemberOK
const RemoveOrganizationMemberOKCode int = 200
/*
RemoveOrganizationMemberOK member removed
swagger:response removeOrganizationMemberOK
*/
type RemoveOrganizationMemberOK struct {
}
// NewRemoveOrganizationMemberOK creates RemoveOrganizationMemberOK with default headers values
func NewRemoveOrganizationMemberOK() *RemoveOrganizationMemberOK {
return &RemoveOrganizationMemberOK{}
}
// WriteResponse to the client
func (o *RemoveOrganizationMemberOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
// RemoveOrganizationMemberUnauthorizedCode is the HTTP code returned for type RemoveOrganizationMemberUnauthorized
const RemoveOrganizationMemberUnauthorizedCode int = 401
/*
RemoveOrganizationMemberUnauthorized unauthorized
swagger:response removeOrganizationMemberUnauthorized
*/
type RemoveOrganizationMemberUnauthorized struct {
}
// NewRemoveOrganizationMemberUnauthorized creates RemoveOrganizationMemberUnauthorized with default headers values
func NewRemoveOrganizationMemberUnauthorized() *RemoveOrganizationMemberUnauthorized {
return &RemoveOrganizationMemberUnauthorized{}
}
// WriteResponse to the client
func (o *RemoveOrganizationMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(401)
}
// RemoveOrganizationMemberInternalServerErrorCode is the HTTP code returned for type RemoveOrganizationMemberInternalServerError
const RemoveOrganizationMemberInternalServerErrorCode int = 500
/*
RemoveOrganizationMemberInternalServerError internal server error
swagger:response removeOrganizationMemberInternalServerError
*/
type RemoveOrganizationMemberInternalServerError struct {
}
// NewRemoveOrganizationMemberInternalServerError creates RemoveOrganizationMemberInternalServerError with default headers values
func NewRemoveOrganizationMemberInternalServerError() *RemoveOrganizationMemberInternalServerError {
return &RemoveOrganizationMemberInternalServerError{}
}
// WriteResponse to the client
func (o *RemoveOrganizationMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(500)
}

View File

@ -0,0 +1,87 @@
// Code generated by go-swagger; DO NOT EDIT.
package admin
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// RemoveOrganizationMemberURL generates an URL for the remove organization member operation
type RemoveOrganizationMemberURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *RemoveOrganizationMemberURL) WithBasePath(bp string) *RemoveOrganizationMemberURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *RemoveOrganizationMemberURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *RemoveOrganizationMemberURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/organization/remove"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *RemoveOrganizationMemberURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *RemoveOrganizationMemberURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *RemoveOrganizationMemberURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on RemoveOrganizationMemberURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on RemoveOrganizationMemberURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *RemoveOrganizationMemberURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@ -52,6 +52,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
ShareAccessHandler: share.AccessHandlerFunc(func(params share.AccessParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation share.Access has not yet been implemented")
}),
AdminAddOrganizationMemberHandler: admin.AddOrganizationMemberHandlerFunc(func(params admin.AddOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.AddOrganizationMember has not yet been implemented")
}),
AccountChangePasswordHandler: account.ChangePasswordHandlerFunc(func(params account.ChangePasswordParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation account.ChangePassword has not yet been implemented")
}),
@ -67,9 +70,15 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
AdminCreateIdentityHandler: admin.CreateIdentityHandlerFunc(func(params admin.CreateIdentityParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.CreateIdentity has not yet been implemented")
}),
AdminCreateOrganizationHandler: admin.CreateOrganizationHandlerFunc(func(params admin.CreateOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.CreateOrganization has not yet been implemented")
}),
AdminDeleteFrontendHandler: admin.DeleteFrontendHandlerFunc(func(params admin.DeleteFrontendParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.DeleteFrontend has not yet been implemented")
}),
AdminDeleteOrganizationHandler: admin.DeleteOrganizationHandlerFunc(func(params admin.DeleteOrganizationParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.DeleteOrganization has not yet been implemented")
}),
EnvironmentDisableHandler: environment.DisableHandlerFunc(func(params environment.DisableParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation environment.Disable has not yet been implemented")
}),
@ -109,6 +118,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
AdminListFrontendsHandler: admin.ListFrontendsHandlerFunc(func(params admin.ListFrontendsParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.ListFrontends has not yet been implemented")
}),
AdminListOrganizationMembersHandler: admin.ListOrganizationMembersHandlerFunc(func(params admin.ListOrganizationMembersParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.ListOrganizationMembers has not yet been implemented")
}),
AccountLoginHandler: account.LoginHandlerFunc(func(params account.LoginParams) middleware.Responder {
return middleware.NotImplemented("operation account.Login has not yet been implemented")
}),
@ -121,6 +133,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
AccountRegisterHandler: account.RegisterHandlerFunc(func(params account.RegisterParams) middleware.Responder {
return middleware.NotImplemented("operation account.Register has not yet been implemented")
}),
AdminRemoveOrganizationMemberHandler: admin.RemoveOrganizationMemberHandlerFunc(func(params admin.RemoveOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin.RemoveOrganizationMember has not yet been implemented")
}),
AccountResetPasswordHandler: account.ResetPasswordHandlerFunc(func(params account.ResetPasswordParams) middleware.Responder {
return middleware.NotImplemented("operation account.ResetPassword has not yet been implemented")
}),
@ -200,6 +215,8 @@ type ZrokAPI struct {
// ShareAccessHandler sets the operation handler for the access operation
ShareAccessHandler share.AccessHandler
// AdminAddOrganizationMemberHandler sets the operation handler for the add organization member operation
AdminAddOrganizationMemberHandler admin.AddOrganizationMemberHandler
// AccountChangePasswordHandler sets the operation handler for the change password operation
AccountChangePasswordHandler account.ChangePasswordHandler
// MetadataConfigurationHandler sets the operation handler for the configuration operation
@ -210,8 +227,12 @@ type ZrokAPI struct {
AdminCreateFrontendHandler admin.CreateFrontendHandler
// AdminCreateIdentityHandler sets the operation handler for the create identity operation
AdminCreateIdentityHandler admin.CreateIdentityHandler
// AdminCreateOrganizationHandler sets the operation handler for the create organization operation
AdminCreateOrganizationHandler admin.CreateOrganizationHandler
// AdminDeleteFrontendHandler sets the operation handler for the delete frontend operation
AdminDeleteFrontendHandler admin.DeleteFrontendHandler
// AdminDeleteOrganizationHandler sets the operation handler for the delete organization operation
AdminDeleteOrganizationHandler admin.DeleteOrganizationHandler
// EnvironmentDisableHandler sets the operation handler for the disable operation
EnvironmentDisableHandler environment.DisableHandler
// EnvironmentEnableHandler sets the operation handler for the enable operation
@ -238,6 +259,8 @@ type ZrokAPI struct {
AdminInviteTokenGenerateHandler admin.InviteTokenGenerateHandler
// AdminListFrontendsHandler sets the operation handler for the list frontends operation
AdminListFrontendsHandler admin.ListFrontendsHandler
// AdminListOrganizationMembersHandler sets the operation handler for the list organization members operation
AdminListOrganizationMembersHandler admin.ListOrganizationMembersHandler
// AccountLoginHandler sets the operation handler for the login operation
AccountLoginHandler account.LoginHandler
// MetadataOverviewHandler sets the operation handler for the overview operation
@ -246,6 +269,8 @@ type ZrokAPI struct {
AccountRegenerateTokenHandler account.RegenerateTokenHandler
// AccountRegisterHandler sets the operation handler for the register operation
AccountRegisterHandler account.RegisterHandler
// AdminRemoveOrganizationMemberHandler sets the operation handler for the remove organization member operation
AdminRemoveOrganizationMemberHandler admin.RemoveOrganizationMemberHandler
// AccountResetPasswordHandler sets the operation handler for the reset password operation
AccountResetPasswordHandler account.ResetPasswordHandler
// AccountResetPasswordRequestHandler sets the operation handler for the reset password request operation
@ -348,6 +373,9 @@ func (o *ZrokAPI) Validate() error {
if o.ShareAccessHandler == nil {
unregistered = append(unregistered, "share.AccessHandler")
}
if o.AdminAddOrganizationMemberHandler == nil {
unregistered = append(unregistered, "admin.AddOrganizationMemberHandler")
}
if o.AccountChangePasswordHandler == nil {
unregistered = append(unregistered, "account.ChangePasswordHandler")
}
@ -363,9 +391,15 @@ func (o *ZrokAPI) Validate() error {
if o.AdminCreateIdentityHandler == nil {
unregistered = append(unregistered, "admin.CreateIdentityHandler")
}
if o.AdminCreateOrganizationHandler == nil {
unregistered = append(unregistered, "admin.CreateOrganizationHandler")
}
if o.AdminDeleteFrontendHandler == nil {
unregistered = append(unregistered, "admin.DeleteFrontendHandler")
}
if o.AdminDeleteOrganizationHandler == nil {
unregistered = append(unregistered, "admin.DeleteOrganizationHandler")
}
if o.EnvironmentDisableHandler == nil {
unregistered = append(unregistered, "environment.DisableHandler")
}
@ -405,6 +439,9 @@ func (o *ZrokAPI) Validate() error {
if o.AdminListFrontendsHandler == nil {
unregistered = append(unregistered, "admin.ListFrontendsHandler")
}
if o.AdminListOrganizationMembersHandler == nil {
unregistered = append(unregistered, "admin.ListOrganizationMembersHandler")
}
if o.AccountLoginHandler == nil {
unregistered = append(unregistered, "account.LoginHandler")
}
@ -417,6 +454,9 @@ func (o *ZrokAPI) Validate() error {
if o.AccountRegisterHandler == nil {
unregistered = append(unregistered, "account.RegisterHandler")
}
if o.AdminRemoveOrganizationMemberHandler == nil {
unregistered = append(unregistered, "admin.RemoveOrganizationMemberHandler")
}
if o.AccountResetPasswordHandler == nil {
unregistered = append(unregistered, "account.ResetPasswordHandler")
}
@ -550,6 +590,10 @@ func (o *ZrokAPI) initHandlerCache() {
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/organization/add"] = admin.NewAddOrganizationMember(o.context, o.AdminAddOrganizationMemberHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/changePassword"] = account.NewChangePassword(o.context, o.AccountChangePasswordHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@ -567,10 +611,18 @@ func (o *ZrokAPI) initHandlerCache() {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/identity"] = admin.NewCreateIdentity(o.context, o.AdminCreateIdentityHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/organization"] = admin.NewCreateOrganization(o.context, o.AdminCreateOrganizationHandler)
if o.handlers["DELETE"] == nil {
o.handlers["DELETE"] = make(map[string]http.Handler)
}
o.handlers["DELETE"]["/frontend"] = admin.NewDeleteFrontend(o.context, o.AdminDeleteFrontendHandler)
if o.handlers["DELETE"] == nil {
o.handlers["DELETE"] = make(map[string]http.Handler)
}
o.handlers["DELETE"]["/organization"] = admin.NewDeleteOrganization(o.context, o.AdminDeleteOrganizationHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
@ -626,6 +678,10 @@ func (o *ZrokAPI) initHandlerCache() {
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/organization/members"] = admin.NewListOrganizationMembers(o.context, o.AdminListOrganizationMembersHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/login"] = account.NewLogin(o.context, o.AccountLoginHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@ -642,6 +698,10 @@ func (o *ZrokAPI) initHandlerCache() {
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/organization/remove"] = admin.NewRemoveOrganizationMember(o.context, o.AdminRemoveOrganizationMemberHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/resetPassword"] = account.NewResetPassword(o.context, o.AccountResetPasswordHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)

View File

@ -16,6 +16,7 @@ model/createFrontendRequest.ts
model/createFrontendResponse.ts
model/createIdentity201Response.ts
model/createIdentityRequest.ts
model/createOrganizationRequest.ts
model/deleteFrontendRequest.ts
model/disableRequest.ts
model/enableRequest.ts
@ -26,6 +27,7 @@ model/frontend.ts
model/grantsRequest.ts
model/inviteRequest.ts
model/inviteTokenGenerateRequest.ts
model/listOrganizationMembers200Response.ts
model/loginRequest.ts
model/metrics.ts
model/metricsSample.ts

View File

@ -20,9 +20,11 @@ import { CreateFrontendRequest } from '../model/createFrontendRequest';
import { CreateFrontendResponse } from '../model/createFrontendResponse';
import { CreateIdentity201Response } from '../model/createIdentity201Response';
import { CreateIdentityRequest } from '../model/createIdentityRequest';
import { CreateOrganizationRequest } from '../model/createOrganizationRequest';
import { DeleteFrontendRequest } from '../model/deleteFrontendRequest';
import { GrantsRequest } from '../model/grantsRequest';
import { InviteTokenGenerateRequest } from '../model/inviteTokenGenerateRequest';
import { ListOrganizationMembers200Response } from '../model/listOrganizationMembers200Response';
import { PublicFrontend } from '../model/publicFrontend';
import { RegenerateToken200Response } from '../model/regenerateToken200Response';
import { UpdateFrontendRequest } from '../model/updateFrontendRequest';
@ -99,6 +101,64 @@ export class AdminApi {
this.interceptors.push(interceptor);
}
/**
*
* @param body
*/
public async addOrganizationMember (body?: GrantsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/organization/add';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "GrantsRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
@ -297,6 +357,72 @@ export class AdminApi {
});
});
}
/**
*
* @param body
*/
public async createOrganization (body?: CreateOrganizationRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: RegenerateToken200Response; }> {
const localVarPath = this.basePath + '/organization';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "CreateOrganizationRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: RegenerateToken200Response; }>((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, "RegenerateToken200Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
@ -355,6 +481,64 @@ export class AdminApi {
});
});
}
/**
*
* @param body
*/
public async deleteOrganization (body?: RegenerateToken200Response, 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);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'DELETE',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RegenerateToken200Response")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
@ -535,6 +719,130 @@ export class AdminApi {
});
});
}
/**
*
* @param body
*/
public async listOrganizationMembers (body?: RegenerateToken200Response, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ListOrganizationMembers200Response; }> {
const localVarPath = this.basePath + '/organization/members';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
const produces = ['application/zrok.v1+json'];
// give precedence to 'application/json'
if (produces.indexOf('application/json') >= 0) {
localVarHeaderParams.Accept = 'application/json';
} else {
localVarHeaderParams.Accept = produces.join(',');
}
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "RegenerateToken200Response")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body: ListOrganizationMembers200Response; }>((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, "ListOrganizationMembers200Response");
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body
*/
public async removeOrganizationMember (body?: GrantsRequest, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
const localVarPath = this.basePath + '/organization/remove';
let localVarQueryParameters: any = {};
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
let localVarFormParams: any = {};
(<any>Object).assign(localVarHeaderParams, options.headers);
let localVarUseFormData = false;
let localVarRequestOptions: localVarRequest.Options = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
useQuerystring: this._useQuerystring,
json: true,
body: ObjectSerializer.serialize(body, "GrantsRequest")
};
let authenticationPromise = Promise.resolve();
if (this.authentications.key.apiKey) {
authenticationPromise = authenticationPromise.then(() => this.authentications.key.applyToRequest(localVarRequestOptions));
}
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
let interceptorPromise = authenticationPromise;
for (const interceptor of this.interceptors) {
interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));
}
return interceptorPromise.then(() => {
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
(<any>localVarRequestOptions).formData = localVarFormParams;
} else {
localVarRequestOptions.form = localVarFormParams;
}
}
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
localVarRequest(localVarRequestOptions, (error, response, body) => {
if (error) {
reject(error);
} else {
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
} else {
reject(new HttpError(response, body, response.statusCode));
}
}
});
});
});
}
/**
*
* @param body

View File

@ -0,0 +1,31 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.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 CreateOrganizationRequest {
'description'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "description",
"baseName": "description",
"type": "string"
} ];
static getAttributeTypeMap() {
return CreateOrganizationRequest.attributeTypeMap;
}
}

View File

@ -0,0 +1,32 @@
/**
* zrok
* zrok client access
*
* The version of the OpenAPI document: 0.3.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';
import { GrantsRequest } from './grantsRequest';
export class ListOrganizationMembers200Response {
'members'?: Array<GrantsRequest>;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "members",
"baseName": "members",
"type": "Array<GrantsRequest>"
} ];
static getAttributeTypeMap() {
return ListOrganizationMembers200Response.attributeTypeMap;
}
}

View File

@ -10,6 +10,7 @@ export * from './createFrontendRequest';
export * from './createFrontendResponse';
export * from './createIdentity201Response';
export * from './createIdentityRequest';
export * from './createOrganizationRequest';
export * from './deleteFrontendRequest';
export * from './disableRequest';
export * from './enableRequest';
@ -20,6 +21,7 @@ export * from './frontend';
export * from './grantsRequest';
export * from './inviteRequest';
export * from './inviteTokenGenerateRequest';
export * from './listOrganizationMembers200Response';
export * from './loginRequest';
export * from './metrics';
export * from './metricsSample';
@ -66,6 +68,7 @@ import { CreateFrontendRequest } from './createFrontendRequest';
import { CreateFrontendResponse } from './createFrontendResponse';
import { CreateIdentity201Response } from './createIdentity201Response';
import { CreateIdentityRequest } from './createIdentityRequest';
import { CreateOrganizationRequest } from './createOrganizationRequest';
import { DeleteFrontendRequest } from './deleteFrontendRequest';
import { DisableRequest } from './disableRequest';
import { EnableRequest } from './enableRequest';
@ -76,6 +79,7 @@ import { Frontend } from './frontend';
import { GrantsRequest } from './grantsRequest';
import { InviteRequest } from './inviteRequest';
import { InviteTokenGenerateRequest } from './inviteTokenGenerateRequest';
import { ListOrganizationMembers200Response } from './listOrganizationMembers200Response';
import { LoginRequest } from './loginRequest';
import { Metrics } from './metrics';
import { MetricsSample } from './metricsSample';
@ -130,6 +134,7 @@ let typeMap: {[index: string]: any} = {
"CreateFrontendResponse": CreateFrontendResponse,
"CreateIdentity201Response": CreateIdentity201Response,
"CreateIdentityRequest": CreateIdentityRequest,
"CreateOrganizationRequest": CreateOrganizationRequest,
"DeleteFrontendRequest": DeleteFrontendRequest,
"DisableRequest": DisableRequest,
"EnableRequest": EnableRequest,
@ -140,6 +145,7 @@ let typeMap: {[index: string]: any} = {
"GrantsRequest": GrantsRequest,
"InviteRequest": InviteRequest,
"InviteTokenGenerateRequest": InviteTokenGenerateRequest,
"ListOrganizationMembers200Response": ListOrganizationMembers200Response,
"LoginRequest": LoginRequest,
"Metrics": Metrics,
"MetricsSample": MetricsSample,

View File

@ -45,6 +45,7 @@ from zrok_api.models.frontends import Frontends
from zrok_api.models.grants_body import GrantsBody
from zrok_api.models.identity_body import IdentityBody
from zrok_api.models.inline_response200 import InlineResponse200
from zrok_api.models.inline_response2001 import InlineResponse2001
from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.invite_request import InviteRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
@ -52,6 +53,11 @@ from zrok_api.models.login_request import LoginRequest
from zrok_api.models.login_response import LoginResponse
from zrok_api.models.metrics import Metrics
from zrok_api.models.metrics_sample import MetricsSample
from zrok_api.models.organization_add_body import OrganizationAddBody
from zrok_api.models.organization_body import OrganizationBody
from zrok_api.models.organization_body1 import OrganizationBody1
from zrok_api.models.organization_members_body import OrganizationMembersBody
from zrok_api.models.organization_remove_body import OrganizationRemoveBody
from zrok_api.models.overview import Overview
from zrok_api.models.password_requirements import PasswordRequirements
from zrok_api.models.principal import Principal

View File

@ -32,6 +32,95 @@ class AdminApi(object):
api_client = ApiClient()
self.api_client = api_client
def add_organization_member(self, **kwargs): # noqa: E501
"""add_organization_member # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_organization_member(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationAddBody body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.add_organization_member_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.add_organization_member_with_http_info(**kwargs) # noqa: E501
return data
def add_organization_member_with_http_info(self, **kwargs): # noqa: E501
"""add_organization_member # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.add_organization_member_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationAddBody body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method add_organization_member" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/organization/add', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def create_account(self, **kwargs): # noqa: E501
"""create_account # noqa: E501
@ -311,6 +400,99 @@ class AdminApi(object):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def create_organization(self, **kwargs): # noqa: E501
"""create_organization # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_organization(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationBody body:
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.create_organization_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.create_organization_with_http_info(**kwargs) # noqa: E501
return data
def create_organization_with_http_info(self, **kwargs): # noqa: E501
"""create_organization # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.create_organization_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationBody body:
:return: InlineResponse200
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method create_organization" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/organization', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse200', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_frontend(self, **kwargs): # noqa: E501
"""delete_frontend # noqa: E501
@ -400,6 +582,95 @@ class AdminApi(object):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def delete_organization(self, **kwargs): # noqa: E501
"""delete_organization # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_organization(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationBody1 body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.delete_organization_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.delete_organization_with_http_info(**kwargs) # noqa: E501
return data
def delete_organization_with_http_info(self, **kwargs): # noqa: E501
"""delete_organization # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.delete_organization_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationBody1 body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method delete_organization" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/organization', 'DELETE',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def grants(self, **kwargs): # noqa: E501
"""grants # noqa: E501
@ -663,6 +934,188 @@ class AdminApi(object):
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def list_organization_members(self, **kwargs): # noqa: E501
"""list_organization_members # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_organization_members(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationMembersBody body:
:return: InlineResponse2001
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.list_organization_members_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.list_organization_members_with_http_info(**kwargs) # noqa: E501
return data
def list_organization_members_with_http_info(self, **kwargs): # noqa: E501
"""list_organization_members # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.list_organization_members_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationMembersBody body:
:return: InlineResponse2001
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method list_organization_members" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/zrok.v1+json']) # noqa: E501
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/organization/members', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='InlineResponse2001', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def remove_organization_member(self, **kwargs): # noqa: E501
"""remove_organization_member # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.remove_organization_member(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationRemoveBody body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.remove_organization_member_with_http_info(**kwargs) # noqa: E501
else:
(data) = self.remove_organization_member_with_http_info(**kwargs) # noqa: E501
return data
def remove_organization_member_with_http_info(self, **kwargs): # noqa: E501
"""remove_organization_member # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.remove_organization_member_with_http_info(async_req=True)
>>> result = thread.get()
:param async_req bool
:param OrganizationRemoveBody body:
:return: None
If the method is called asynchronously,
returns the request thread.
"""
all_params = ['body'] # noqa: E501
all_params.append('async_req')
all_params.append('_return_http_data_only')
all_params.append('_preload_content')
all_params.append('_request_timeout')
params = locals()
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method remove_organization_member" % key
)
params[key] = val
del params['kwargs']
collection_formats = {}
path_params = {}
query_params = []
header_params = {}
form_params = []
local_var_files = {}
body_params = None
if 'body' in params:
body_params = params['body']
# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
['application/zrok.v1+json']) # noqa: E501
# Authentication setting
auth_settings = ['key'] # noqa: E501
return self.api_client.call_api(
'/organization/remove', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_return_http_data_only=params.get('_return_http_data_only'),
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def update_frontend(self, **kwargs): # noqa: E501
"""update_frontend # noqa: E501

View File

@ -35,6 +35,7 @@ from zrok_api.models.frontends import Frontends
from zrok_api.models.grants_body import GrantsBody
from zrok_api.models.identity_body import IdentityBody
from zrok_api.models.inline_response200 import InlineResponse200
from zrok_api.models.inline_response2001 import InlineResponse2001
from zrok_api.models.inline_response201 import InlineResponse201
from zrok_api.models.invite_request import InviteRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
@ -42,6 +43,11 @@ from zrok_api.models.login_request import LoginRequest
from zrok_api.models.login_response import LoginResponse
from zrok_api.models.metrics import Metrics
from zrok_api.models.metrics_sample import MetricsSample
from zrok_api.models.organization_add_body import OrganizationAddBody
from zrok_api.models.organization_body import OrganizationBody
from zrok_api.models.organization_body1 import OrganizationBody1
from zrok_api.models.organization_members_body import OrganizationMembersBody
from zrok_api.models.organization_remove_body import OrganizationRemoveBody
from zrok_api.models.overview import Overview
from zrok_api.models.password_requirements import PasswordRequirements
from zrok_api.models.principal import Principal

View File

@ -0,0 +1,110 @@
# coding: utf-8
"""
zrok
zrok client access # noqa: E501
OpenAPI spec version: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InlineResponse2001(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 = {
'members': 'list[OrganizationRemoveBody]'
}
attribute_map = {
'members': 'members'
}
def __init__(self, members=None): # noqa: E501
"""InlineResponse2001 - a model defined in Swagger""" # noqa: E501
self._members = None
self.discriminator = None
if members is not None:
self.members = members
@property
def members(self):
"""Gets the members of this InlineResponse2001. # noqa: E501
:return: The members of this InlineResponse2001. # noqa: E501
:rtype: list[OrganizationRemoveBody]
"""
return self._members
@members.setter
def members(self, members):
"""Sets the members of this InlineResponse2001.
:param members: The members of this InlineResponse2001. # noqa: E501
:type: list[OrganizationRemoveBody]
"""
self._members = members
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(InlineResponse2001, 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, InlineResponse2001):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrganizationAddBody(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'
}
attribute_map = {
'email': 'email'
}
def __init__(self, email=None): # noqa: E501
"""OrganizationAddBody - a model defined in Swagger""" # noqa: E501
self._email = None
self.discriminator = None
if email is not None:
self.email = email
@property
def email(self):
"""Gets the email of this OrganizationAddBody. # noqa: E501
:return: The email of this OrganizationAddBody. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this OrganizationAddBody.
:param email: The email of this OrganizationAddBody. # noqa: E501
:type: str
"""
self._email = email
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(OrganizationAddBody, 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, OrganizationAddBody):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrganizationBody(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 = {
'description': 'str'
}
attribute_map = {
'description': 'description'
}
def __init__(self, description=None): # noqa: E501
"""OrganizationBody - a model defined in Swagger""" # noqa: E501
self._description = None
self.discriminator = None
if description is not None:
self.description = description
@property
def description(self):
"""Gets the description of this OrganizationBody. # noqa: E501
:return: The description of this OrganizationBody. # noqa: E501
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""Sets the description of this OrganizationBody.
:param description: The description of this OrganizationBody. # 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(OrganizationBody, 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, OrganizationBody):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrganizationBody1(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
"""OrganizationBody1 - 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 OrganizationBody1. # noqa: E501
:return: The token of this OrganizationBody1. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this OrganizationBody1.
:param token: The token of this OrganizationBody1. # 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(OrganizationBody1, 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, OrganizationBody1):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrganizationMembersBody(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
"""OrganizationMembersBody - 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 OrganizationMembersBody. # noqa: E501
:return: The token of this OrganizationMembersBody. # noqa: E501
:rtype: str
"""
return self._token
@token.setter
def token(self, token):
"""Sets the token of this OrganizationMembersBody.
:param token: The token of this OrganizationMembersBody. # 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(OrganizationMembersBody, 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, OrganizationMembersBody):
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: 0.3.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class OrganizationRemoveBody(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'
}
attribute_map = {
'email': 'email'
}
def __init__(self, email=None): # noqa: E501
"""OrganizationRemoveBody - a model defined in Swagger""" # noqa: E501
self._email = None
self.discriminator = None
if email is not None:
self.email = email
@property
def email(self):
"""Gets the email of this OrganizationRemoveBody. # noqa: E501
:return: The email of this OrganizationRemoveBody. # noqa: E501
:rtype: str
"""
return self._email
@email.setter
def email(self, email):
"""Sets the email of this OrganizationRemoveBody.
:param email: The email of this OrganizationRemoveBody. # noqa: E501
:type: str
"""
self._email = email
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(OrganizationRemoveBody, 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, OrganizationRemoveBody):
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

@ -381,6 +381,127 @@ paths:
description: unauthorized
500:
description: internal server error
/organization:
post:
tags:
- admin
security:
- key: []
operationId: createOrganization
parameters:
- name: body
in: body
schema:
properties:
description:
type: string
responses:
201:
description: organization created
schema:
properties:
token:
type: string
401:
description: unauthorized
500:
description: internal server error
delete:
tags:
- admin
security:
- key: []
operationId: deleteOrganization
parameters:
- name: body
in: body
schema:
properties:
token:
type: string
responses:
200:
description: organization deleted
401:
description: unauthorized
500:
description: internal server error
/organization/add:
post:
tags:
- admin
security:
- key: []
operationId: addOrganizationMember
parameters:
- name: body
in: body
schema:
properties:
email:
type: string
responses:
201:
description: member added
401:
description: unauthorized
500:
description: internal server error
/organization/members:
post:
tags:
- admin
security:
- key: []
operationId: listOrganizationMembers
parameters:
- name: body
in: body
schema:
properties:
token:
type: string
responses:
200:
description: list organization members
schema:
properties:
members:
type: array
items:
properties:
email:
type: string
401:
description: unauthorized
500:
description: internal server error
/organization/remove:
post:
tags:
- admin
security:
- key: []
operationId: removeOrganizationMember
parameters:
- name: body
in: body
schema:
properties:
email:
type: string
responses:
200:
description: member removed
401:
description: unauthorized
500:
description: internal server error
#
# environment
#

View File

@ -113,6 +113,81 @@ export function inviteTokenGenerate(options) {
return gateway.request(inviteTokenGenerateOperation, parameters)
}
/**
* @param {object} options Optional options
* @param {object} [options.body]
* @return {Promise<object>} organization created
*/
export function createOrganization(options) {
if (!options) options = {}
const parameters = {
body: {
body: options.body
}
}
return gateway.request(createOrganizationOperation, parameters)
}
/**
* @param {object} options Optional options
* @param {object} [options.body]
* @return {Promise<object>} organization deleted
*/
export function deleteOrganization(options) {
if (!options) options = {}
const parameters = {
body: {
body: options.body
}
}
return gateway.request(deleteOrganizationOperation, parameters)
}
/**
* @param {object} options Optional options
* @param {object} [options.body]
* @return {Promise<object>} member added
*/
export function addOrganizationMember(options) {
if (!options) options = {}
const parameters = {
body: {
body: options.body
}
}
return gateway.request(addOrganizationMemberOperation, parameters)
}
/**
* @param {object} options Optional options
* @param {object} [options.body]
* @return {Promise<object>} list organization members
*/
export function listOrganizationMembers(options) {
if (!options) options = {}
const parameters = {
body: {
body: options.body
}
}
return gateway.request(listOrganizationMembersOperation, parameters)
}
/**
* @param {object} options Optional options
* @param {object} [options.body]
* @return {Promise<object>} member removed
*/
export function removeOrganizationMember(options) {
if (!options) options = {}
const parameters = {
body: {
body: options.body
}
}
return gateway.request(removeOrganizationMemberOperation, parameters)
}
const createAccountOperation = {
path: '/account',
contentTypes: ['application/zrok.v1+json'],
@ -199,3 +274,58 @@ const inviteTokenGenerateOperation = {
}
]
}
const createOrganizationOperation = {
path: '/organization',
contentTypes: ['application/zrok.v1+json'],
method: 'post',
security: [
{
id: 'key'
}
]
}
const deleteOrganizationOperation = {
path: '/organization',
contentTypes: ['application/zrok.v1+json'],
method: 'delete',
security: [
{
id: 'key'
}
]
}
const addOrganizationMemberOperation = {
path: '/organization/add',
contentTypes: ['application/zrok.v1+json'],
method: 'post',
security: [
{
id: 'key'
}
]
}
const listOrganizationMembersOperation = {
path: '/organization/members',
contentTypes: ['application/zrok.v1+json'],
method: 'post',
security: [
{
id: 'key'
}
]
}
const removeOrganizationMemberOperation = {
path: '/organization/remove',
contentTypes: ['application/zrok.v1+json'],
method: 'post',
security: [
{
id: 'key'
}
]
}