admin/listAppliedLimitClasses (#1210)

This commit is contained in:
Michael Quigley
2026-03-24 16:00:46 -04:00
parent 6c038e18f0
commit b73aa57572
38 changed files with 2074 additions and 457 deletions
+79
View File
@@ -0,0 +1,79 @@
package main
import (
"fmt"
"os"
"time"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/openziti/zrok/v2/environment"
"github.com/openziti/zrok/v2/rest_client_zrok/admin"
"github.com/openziti/zrok/v2/util"
"github.com/spf13/cobra"
)
func init() {
adminListCmd.AddCommand(newAdminListAppliedLimitClassesCommand().cmd)
}
type adminListAppliedLimitClassesCommand struct {
cmd *cobra.Command
}
func newAdminListAppliedLimitClassesCommand() *adminListAppliedLimitClassesCommand {
cmd := &cobra.Command{
Use: "applied-limit-classes <email>",
Aliases: []string{"alcs"},
Short: "List limit classes applied to the specified account",
Args: cobra.ExactArgs(1),
}
command := &adminListAppliedLimitClassesCommand{cmd: cmd}
cmd.Run = command.run
return command
}
func (cmd *adminListAppliedLimitClassesCommand) run(_ *cobra.Command, args []string) {
env, err := environment.LoadRoot()
if err != nil {
panic(err)
}
zrok, err := env.Client()
if err != nil {
panic(err)
}
req := admin.NewListAppliedLimitClassesParams()
req.Body.Email = args[0]
resp, err := zrok.Admin.ListAppliedLimitClasses(req, mustGetAdminAuth())
if err != nil {
panic(err)
}
fmt.Println()
t := table.NewWriter()
t.SetOutputMirror(os.Stdout)
t.SetStyle(table.StyleRounded)
t.AppendHeader(table.Row{"ID", "Label", "Backend Mode", "Envs", "Shares", "Reserved", "Unique Names", "Share FEs", "Period Min", "Rx", "Tx", "Total", "Action", "Updated At"})
for _, lc := range resp.Payload {
t.AppendRow(table.Row{
lc.ID,
lc.Label,
lc.BackendMode,
lc.Environments,
lc.Shares,
lc.ReservedShares,
lc.UniqueNames,
lc.ShareFrontends,
lc.PeriodMinutes,
util.BytesToSize(lc.RxBytes),
util.BytesToSize(lc.TxBytes),
util.BytesToSize(lc.TotalBytes),
lc.LimitAction,
time.UnixMilli(lc.UpdatedAt),
})
}
t.Render()
fmt.Println()
}
+1
View File
@@ -73,6 +73,7 @@ func Run(inCfg *config.Config) error {
api.AdminDeleteOrganizationHandler = newDeleteOrganizationHandler()
api.AdminGrantsHandler = newGrantsHandler()
api.AdminInviteTokenGenerateHandler = newInviteTokenGenerateHandler()
api.AdminListAppliedLimitClassesHandler = newListAppliedLimitClassesHandler()
api.AdminListFrontendsHandler = newListFrontendsHandler()
api.AdminListFrontendNamespaceMappingsHandler = newListFrontendNamespaceMappingsHandler()
api.AdminListLimitClassesHandler = newListLimitClassesHandler()
+42
View File
@@ -0,0 +1,42 @@
package controller
import (
"github.com/go-openapi/runtime/middleware"
"github.com/michaelquigley/df/dl"
"github.com/openziti/zrok/v2/rest_model_zrok"
"github.com/openziti/zrok/v2/rest_server_zrok/operations/admin"
)
type listAppliedLimitClassesHandler struct{}
func newListAppliedLimitClassesHandler() *listAppliedLimitClassesHandler {
return &listAppliedLimitClassesHandler{}
}
func (h *listAppliedLimitClassesHandler) Handle(params admin.ListAppliedLimitClassesParams, principal *rest_model_zrok.Principal) middleware.Responder {
if !principal.Admin {
dl.Error("invalid admin principal")
return admin.NewListAppliedLimitClassesUnauthorized()
}
trx, err := str.Begin()
if err != nil {
dl.Errorf("error starting transaction: %v", err)
return admin.NewListAppliedLimitClassesInternalServerError()
}
defer func() { _ = trx.Rollback() }()
acct, err := str.FindAccountWithEmail(params.Body.Email, trx)
if err != nil {
dl.Errorf("error finding account with email '%v': %v", params.Body.Email, err)
return admin.NewListAppliedLimitClassesNotFound()
}
lcs, err := str.FindAppliedLimitClassesForAccount(acct.Id, trx)
if err != nil {
dl.Errorf("error finding applied limit classes for '%v': %v", params.Body.Email, err)
return admin.NewListAppliedLimitClassesInternalServerError()
}
return admin.NewListAppliedLimitClassesOK().WithPayload(limitClassesToApi(lcs))
}
+33 -24
View File
@@ -3,6 +3,7 @@ package controller
import (
"github.com/go-openapi/runtime/middleware"
"github.com/michaelquigley/df/dl"
"github.com/openziti/zrok/v2/controller/store"
"github.com/openziti/zrok/v2/rest_model_zrok"
"github.com/openziti/zrok/v2/rest_server_zrok/operations/admin"
)
@@ -32,30 +33,38 @@ func (h *listLimitClassesHandler) Handle(params admin.ListLimitClassesParams, pr
return admin.NewListLimitClassesInternalServerError()
}
var limitClasses []*admin.ListLimitClassesOKBodyItems0
return admin.NewListLimitClassesOK().WithPayload(limitClassesToApi(lcs))
}
func limitClassToApi(lc *store.LimitClass) *rest_model_zrok.LimitClass {
out := &rest_model_zrok.LimitClass{
ID: int64(lc.Id),
Environments: int64(lc.Environments),
Shares: int64(lc.Shares),
ReservedShares: int64(lc.ReservedShares),
UniqueNames: int64(lc.UniqueNames),
ShareFrontends: int64(lc.ShareFrontends),
PeriodMinutes: int64(lc.PeriodMinutes),
RxBytes: lc.RxBytes,
TxBytes: lc.TxBytes,
TotalBytes: lc.TotalBytes,
LimitAction: string(lc.LimitAction),
CreatedAt: lc.CreatedAt.UnixMilli(),
UpdatedAt: lc.UpdatedAt.UnixMilli(),
}
if lc.Label != nil {
out.Label = *lc.Label
}
if lc.BackendMode != nil {
out.BackendMode = string(*lc.BackendMode)
}
return out
}
func limitClassesToApi(lcs []*store.LimitClass) []*rest_model_zrok.LimitClass {
var out []*rest_model_zrok.LimitClass
for _, lc := range lcs {
item := &admin.ListLimitClassesOKBodyItems0{
ID: int64(lc.Id),
Environments: int64(lc.Environments),
Shares: int64(lc.Shares),
ReservedShares: int64(lc.ReservedShares),
UniqueNames: int64(lc.UniqueNames),
ShareFrontends: int64(lc.ShareFrontends),
PeriodMinutes: int64(lc.PeriodMinutes),
RxBytes: lc.RxBytes,
TxBytes: lc.TxBytes,
TotalBytes: lc.TotalBytes,
LimitAction: string(lc.LimitAction),
CreatedAt: lc.CreatedAt.UnixMilli(),
UpdatedAt: lc.UpdatedAt.UnixMilli(),
}
if lc.Label != nil {
item.Label = *lc.Label
}
if lc.BackendMode != nil {
item.BackendMode = string(*lc.BackendMode)
}
limitClasses = append(limitClasses, item)
out = append(out, limitClassToApi(lc))
}
return admin.NewListLimitClassesOK().WithPayload(limitClasses)
return out
}
+46
View File
@@ -134,6 +134,8 @@ type ClientService interface {
InviteTokenGenerate(params *InviteTokenGenerateParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*InviteTokenGenerateCreated, error)
ListAppliedLimitClasses(params *ListAppliedLimitClassesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAppliedLimitClassesOK, error)
ListFrontendNamespaceMappings(params *ListFrontendNamespaceMappingsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFrontendNamespaceMappingsOK, error)
ListFrontends(params *ListFrontendsParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListFrontendsOK, error)
@@ -911,6 +913,50 @@ func (a *Client) InviteTokenGenerate(params *InviteTokenGenerateParams, authInfo
panic(msg)
}
/*
ListAppliedLimitClasses list applied limit classes API
*/
func (a *Client) ListAppliedLimitClasses(params *ListAppliedLimitClassesParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ListAppliedLimitClassesOK, error) {
// NOTE: parameters are not validated before sending
if params == nil {
params = NewListAppliedLimitClassesParams()
}
op := &runtime.ClientOperation{
ID: "listAppliedLimitClasses",
Method: "POST",
PathPattern: "/applied-limit-class/list",
ProducesMediaTypes: []string{"application/zrok.v1+json"},
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
Schemes: []string{"http"},
Params: params,
Reader: &ListAppliedLimitClassesReader{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
}
// only one success response has to be checked
success, ok := result.(*ListAppliedLimitClassesOK)
if ok {
return success, nil
}
// unexpected success response.
// no default response is defined.
//
// safeguard: normally, in the absence of a default response, unknown success responses return an error above: so this is a codegen issue
msg := fmt.Sprintf("unexpected success response for listAppliedLimitClasses: API contract not enforced by server. Client expected to get an error, but got: %T", result)
panic(msg)
}
/*
ListFrontendNamespaceMappings list frontend namespace mappings API
*/
@@ -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"
)
// NewListAppliedLimitClassesParams creates a new ListAppliedLimitClassesParams 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 NewListAppliedLimitClassesParams() *ListAppliedLimitClassesParams {
return &ListAppliedLimitClassesParams{
timeout: cr.DefaultTimeout,
}
}
// NewListAppliedLimitClassesParamsWithTimeout creates a new ListAppliedLimitClassesParams object
// with the ability to set a timeout on a request.
func NewListAppliedLimitClassesParamsWithTimeout(timeout time.Duration) *ListAppliedLimitClassesParams {
return &ListAppliedLimitClassesParams{
timeout: timeout,
}
}
// NewListAppliedLimitClassesParamsWithContext creates a new ListAppliedLimitClassesParams object
// with the ability to set a context for a request.
func NewListAppliedLimitClassesParamsWithContext(ctx context.Context) *ListAppliedLimitClassesParams {
return &ListAppliedLimitClassesParams{
Context: ctx,
}
}
// NewListAppliedLimitClassesParamsWithHTTPClient creates a new ListAppliedLimitClassesParams object
// with the ability to set a custom HTTPClient for a request.
func NewListAppliedLimitClassesParamsWithHTTPClient(client *http.Client) *ListAppliedLimitClassesParams {
return &ListAppliedLimitClassesParams{
HTTPClient: client,
}
}
/*
ListAppliedLimitClassesParams contains all the parameters to send to the API endpoint
for the list applied limit classes operation.
Typically these are written to a http.Request.
*/
type ListAppliedLimitClassesParams struct {
// Body.
Body ListAppliedLimitClassesBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithDefaults hydrates default values in the list applied limit classes params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ListAppliedLimitClassesParams) WithDefaults() *ListAppliedLimitClassesParams {
o.SetDefaults()
return o
}
// SetDefaults hydrates default values in the list applied limit classes params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *ListAppliedLimitClassesParams) SetDefaults() {
// no default values defined for this parameter
}
// WithTimeout adds the timeout to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) WithTimeout(timeout time.Duration) *ListAppliedLimitClassesParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) WithContext(ctx context.Context) *ListAppliedLimitClassesParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithHTTPClient adds the HTTPClient to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) WithHTTPClient(client *http.Client) *ListAppliedLimitClassesParams {
o.SetHTTPClient(client)
return o
}
// SetHTTPClient adds the HTTPClient to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) SetHTTPClient(client *http.Client) {
o.HTTPClient = client
}
// WithBody adds the body to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) WithBody(body ListAppliedLimitClassesBody) *ListAppliedLimitClassesParams {
o.SetBody(body)
return o
}
// SetBody adds the body to the list applied limit classes params
func (o *ListAppliedLimitClassesParams) SetBody(body ListAppliedLimitClassesBody) {
o.Body = body
}
// WriteToRequest writes these params to a swagger request
func (o *ListAppliedLimitClassesParams) 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
}
@@ -0,0 +1,331 @@
// 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"
"encoding/json"
stderrors "errors"
"fmt"
"io"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/v2/rest_model_zrok"
)
// ListAppliedLimitClassesReader is a Reader for the ListAppliedLimitClasses structure.
type ListAppliedLimitClassesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *ListAppliedLimitClassesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (any, error) {
switch response.Code() {
case 200:
result := NewListAppliedLimitClassesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewListAppliedLimitClassesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewListAppliedLimitClassesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewListAppliedLimitClassesInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("[POST /applied-limit-class/list] listAppliedLimitClasses", response, response.Code())
}
}
// NewListAppliedLimitClassesOK creates a ListAppliedLimitClassesOK with default headers values
func NewListAppliedLimitClassesOK() *ListAppliedLimitClassesOK {
return &ListAppliedLimitClassesOK{}
}
/*
ListAppliedLimitClassesOK describes a response with status code 200, with default header values.
applied limit classes
*/
type ListAppliedLimitClassesOK struct {
Payload []*rest_model_zrok.LimitClass
}
// IsSuccess returns true when this list applied limit classes o k response has a 2xx status code
func (o *ListAppliedLimitClassesOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this list applied limit classes o k response has a 3xx status code
func (o *ListAppliedLimitClassesOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this list applied limit classes o k response has a 4xx status code
func (o *ListAppliedLimitClassesOK) IsClientError() bool {
return false
}
// IsServerError returns true when this list applied limit classes o k response has a 5xx status code
func (o *ListAppliedLimitClassesOK) IsServerError() bool {
return false
}
// IsCode returns true when this list applied limit classes o k response a status code equal to that given
func (o *ListAppliedLimitClassesOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the list applied limit classes o k response
func (o *ListAppliedLimitClassesOK) Code() int {
return 200
}
func (o *ListAppliedLimitClassesOK) Error() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesOK %s", 200, payload)
}
func (o *ListAppliedLimitClassesOK) String() string {
payload, _ := json.Marshal(o.Payload)
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesOK %s", 200, payload)
}
func (o *ListAppliedLimitClassesOK) GetPayload() []*rest_model_zrok.LimitClass {
return o.Payload
}
func (o *ListAppliedLimitClassesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && !stderrors.Is(err, io.EOF) {
return err
}
return nil
}
// NewListAppliedLimitClassesUnauthorized creates a ListAppliedLimitClassesUnauthorized with default headers values
func NewListAppliedLimitClassesUnauthorized() *ListAppliedLimitClassesUnauthorized {
return &ListAppliedLimitClassesUnauthorized{}
}
/*
ListAppliedLimitClassesUnauthorized describes a response with status code 401, with default header values.
unauthorized
*/
type ListAppliedLimitClassesUnauthorized struct {
}
// IsSuccess returns true when this list applied limit classes unauthorized response has a 2xx status code
func (o *ListAppliedLimitClassesUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this list applied limit classes unauthorized response has a 3xx status code
func (o *ListAppliedLimitClassesUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this list applied limit classes unauthorized response has a 4xx status code
func (o *ListAppliedLimitClassesUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this list applied limit classes unauthorized response has a 5xx status code
func (o *ListAppliedLimitClassesUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this list applied limit classes unauthorized response a status code equal to that given
func (o *ListAppliedLimitClassesUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the list applied limit classes unauthorized response
func (o *ListAppliedLimitClassesUnauthorized) Code() int {
return 401
}
func (o *ListAppliedLimitClassesUnauthorized) Error() string {
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesUnauthorized", 401)
}
func (o *ListAppliedLimitClassesUnauthorized) String() string {
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesUnauthorized", 401)
}
func (o *ListAppliedLimitClassesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewListAppliedLimitClassesNotFound creates a ListAppliedLimitClassesNotFound with default headers values
func NewListAppliedLimitClassesNotFound() *ListAppliedLimitClassesNotFound {
return &ListAppliedLimitClassesNotFound{}
}
/*
ListAppliedLimitClassesNotFound describes a response with status code 404, with default header values.
account not found
*/
type ListAppliedLimitClassesNotFound struct {
}
// IsSuccess returns true when this list applied limit classes not found response has a 2xx status code
func (o *ListAppliedLimitClassesNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this list applied limit classes not found response has a 3xx status code
func (o *ListAppliedLimitClassesNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this list applied limit classes not found response has a 4xx status code
func (o *ListAppliedLimitClassesNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this list applied limit classes not found response has a 5xx status code
func (o *ListAppliedLimitClassesNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this list applied limit classes not found response a status code equal to that given
func (o *ListAppliedLimitClassesNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the list applied limit classes not found response
func (o *ListAppliedLimitClassesNotFound) Code() int {
return 404
}
func (o *ListAppliedLimitClassesNotFound) Error() string {
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesNotFound", 404)
}
func (o *ListAppliedLimitClassesNotFound) String() string {
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesNotFound", 404)
}
func (o *ListAppliedLimitClassesNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
// NewListAppliedLimitClassesInternalServerError creates a ListAppliedLimitClassesInternalServerError with default headers values
func NewListAppliedLimitClassesInternalServerError() *ListAppliedLimitClassesInternalServerError {
return &ListAppliedLimitClassesInternalServerError{}
}
/*
ListAppliedLimitClassesInternalServerError describes a response with status code 500, with default header values.
internal server error
*/
type ListAppliedLimitClassesInternalServerError struct {
}
// IsSuccess returns true when this list applied limit classes internal server error response has a 2xx status code
func (o *ListAppliedLimitClassesInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this list applied limit classes internal server error response has a 3xx status code
func (o *ListAppliedLimitClassesInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this list applied limit classes internal server error response has a 4xx status code
func (o *ListAppliedLimitClassesInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this list applied limit classes internal server error response has a 5xx status code
func (o *ListAppliedLimitClassesInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this list applied limit classes internal server error response a status code equal to that given
func (o *ListAppliedLimitClassesInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the list applied limit classes internal server error response
func (o *ListAppliedLimitClassesInternalServerError) Code() int {
return 500
}
func (o *ListAppliedLimitClassesInternalServerError) Error() string {
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesInternalServerError", 500)
}
func (o *ListAppliedLimitClassesInternalServerError) String() string {
return fmt.Sprintf("[POST /applied-limit-class/list][%d] listAppliedLimitClassesInternalServerError", 500)
}
func (o *ListAppliedLimitClassesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
return nil
}
/*
ListAppliedLimitClassesBody list applied limit classes body
swagger:model ListAppliedLimitClassesBody
*/
type ListAppliedLimitClassesBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this list applied limit classes body
func (o *ListAppliedLimitClassesBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list applied limit classes body based on context it is used
func (o *ListAppliedLimitClassesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListAppliedLimitClassesBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListAppliedLimitClassesBody) UnmarshalBinary(b []byte) error {
var res ListAppliedLimitClassesBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
@@ -15,6 +15,8 @@ import (
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/openziti/zrok/v2/rest_model_zrok"
)
// ListLimitClassesReader is a Reader for the ListLimitClasses structure.
@@ -59,7 +61,7 @@ ListLimitClassesOK describes a response with status code 200, with default heade
limit classes
*/
type ListLimitClassesOK struct {
Payload []*ListLimitClassesOKBodyItems0
Payload []*rest_model_zrok.LimitClass
}
// IsSuccess returns true when this list limit classes o k response has a 2xx status code
@@ -102,7 +104,7 @@ func (o *ListLimitClassesOK) String() string {
return fmt.Sprintf("[POST /limit-class/list][%d] listLimitClassesOK %s", 200, payload)
}
func (o *ListLimitClassesOK) GetPayload() []*ListLimitClassesOKBodyItems0 {
func (o *ListLimitClassesOK) GetPayload() []*rest_model_zrok.LimitClass {
return o.Payload
}
@@ -265,83 +267,3 @@ func (o *ListLimitClassesBody) UnmarshalBinary(b []byte) error {
*o = res
return nil
}
/*
ListLimitClassesOKBodyItems0 list limit classes o k body items0
swagger:model ListLimitClassesOKBodyItems0
*/
type ListLimitClassesOKBodyItems0 struct {
// backend mode
BackendMode string `json:"backendMode,omitempty"`
// created at
CreatedAt int64 `json:"createdAt,omitempty"`
// environments
Environments int64 `json:"environments,omitempty"`
// id
ID int64 `json:"id,omitempty"`
// label
Label string `json:"label,omitempty"`
// limit action
LimitAction string `json:"limitAction,omitempty"`
// period minutes
PeriodMinutes int64 `json:"periodMinutes,omitempty"`
// reserved shares
ReservedShares int64 `json:"reservedShares,omitempty"`
// rx bytes
RxBytes int64 `json:"rxBytes,omitempty"`
// share frontends
ShareFrontends int64 `json:"shareFrontends,omitempty"`
// shares
Shares int64 `json:"shares,omitempty"`
// total bytes
TotalBytes int64 `json:"totalBytes,omitempty"`
// tx bytes
TxBytes int64 `json:"txBytes,omitempty"`
// unique names
UniqueNames int64 `json:"uniqueNames,omitempty"`
// updated at
UpdatedAt int64 `json:"updatedAt,omitempty"`
}
// Validate validates this list limit classes o k body items0
func (o *ListLimitClassesOKBodyItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list limit classes o k body items0 based on context it is used
func (o *ListLimitClassesOKBodyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListLimitClassesOKBodyItems0) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListLimitClassesOKBodyItems0) UnmarshalBinary(b []byte) error {
var res ListLimitClassesOKBodyItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
+92
View File
@@ -0,0 +1,92 @@
// Code generated by go-swagger; DO NOT EDIT.
package rest_model_zrok
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// LimitClass limit class
//
// swagger:model limitClass
type LimitClass struct {
// backend mode
BackendMode string `json:"backendMode,omitempty"`
// created at
CreatedAt int64 `json:"createdAt,omitempty"`
// environments
Environments int64 `json:"environments,omitempty"`
// id
ID int64 `json:"id,omitempty"`
// label
Label string `json:"label,omitempty"`
// limit action
LimitAction string `json:"limitAction,omitempty"`
// period minutes
PeriodMinutes int64 `json:"periodMinutes,omitempty"`
// reserved shares
ReservedShares int64 `json:"reservedShares,omitempty"`
// rx bytes
RxBytes int64 `json:"rxBytes,omitempty"`
// share frontends
ShareFrontends int64 `json:"shareFrontends,omitempty"`
// shares
Shares int64 `json:"shares,omitempty"`
// total bytes
TotalBytes int64 `json:"totalBytes,omitempty"`
// tx bytes
TxBytes int64 `json:"txBytes,omitempty"`
// unique names
UniqueNames int64 `json:"uniqueNames,omitempty"`
// updated at
UpdatedAt int64 `json:"updatedAt,omitempty"`
}
// Validate validates this limit class
func (m *LimitClass) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this limit class based on context it is used
func (m *LimitClass) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *LimitClass) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *LimitClass) UnmarshalBinary(b []byte) error {
var res LimitClass
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
+194 -99
View File
@@ -969,6 +969,52 @@ func init() {
}
}
},
"/applied-limit-class/list": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "listAppliedLimitClasses",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"email": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "applied limit classes",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/limitClass"
}
}
},
"401": {
"description": "unauthorized"
},
"404": {
"description": "account not found"
},
"500": {
"description": "internal server error"
}
}
}
},
"/changePassword": {
"post": {
"security": [
@@ -2025,54 +2071,7 @@ func init() {
"schema": {
"type": "array",
"items": {
"type": "object",
"properties": {
"backendMode": {
"type": "string"
},
"createdAt": {
"type": "integer"
},
"environments": {
"type": "integer"
},
"id": {
"type": "integer"
},
"label": {
"type": "string"
},
"limitAction": {
"type": "string"
},
"periodMinutes": {
"type": "integer"
},
"reservedShares": {
"type": "integer"
},
"rxBytes": {
"type": "integer"
},
"shareFrontends": {
"type": "integer"
},
"shares": {
"type": "integer"
},
"totalBytes": {
"type": "integer"
},
"txBytes": {
"type": "integer"
},
"uniqueNames": {
"type": "integer"
},
"updatedAt": {
"type": "integer"
}
}
"$ref": "#/definitions/limitClass"
}
}
},
@@ -4176,6 +4175,56 @@ func init() {
"$ref": "#/definitions/frontend"
}
},
"limitClass": {
"type": "object",
"properties": {
"backendMode": {
"type": "string"
},
"createdAt": {
"type": "integer"
},
"environments": {
"type": "integer"
},
"id": {
"type": "integer"
},
"label": {
"type": "string"
},
"limitAction": {
"type": "string"
},
"periodMinutes": {
"type": "integer"
},
"reservedShares": {
"type": "integer"
},
"rxBytes": {
"type": "integer"
},
"shareFrontends": {
"type": "integer"
},
"shares": {
"type": "integer"
},
"totalBytes": {
"type": "integer"
},
"txBytes": {
"type": "integer"
},
"uniqueNames": {
"type": "integer"
},
"updatedAt": {
"type": "integer"
}
}
},
"metrics": {
"type": "object",
"properties": {
@@ -5405,6 +5454,52 @@ func init() {
}
}
},
"/applied-limit-class/list": {
"post": {
"security": [
{
"key": []
}
],
"tags": [
"admin"
],
"operationId": "listAppliedLimitClasses",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"properties": {
"email": {
"type": "string"
}
}
}
}
],
"responses": {
"200": {
"description": "applied limit classes",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/limitClass"
}
}
},
"401": {
"description": "unauthorized"
},
"404": {
"description": "account not found"
},
"500": {
"description": "internal server error"
}
}
}
},
"/changePassword": {
"post": {
"security": [
@@ -6421,7 +6516,7 @@ func init() {
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ListLimitClassesOKBodyItems0"
"$ref": "#/definitions/limitClass"
}
}
},
@@ -8333,56 +8428,6 @@ func init() {
}
}
},
"ListLimitClassesOKBodyItems0": {
"type": "object",
"properties": {
"backendMode": {
"type": "string"
},
"createdAt": {
"type": "integer"
},
"environments": {
"type": "integer"
},
"id": {
"type": "integer"
},
"label": {
"type": "string"
},
"limitAction": {
"type": "string"
},
"periodMinutes": {
"type": "integer"
},
"reservedShares": {
"type": "integer"
},
"rxBytes": {
"type": "integer"
},
"shareFrontends": {
"type": "integer"
},
"shares": {
"type": "integer"
},
"totalBytes": {
"type": "integer"
},
"txBytes": {
"type": "integer"
},
"uniqueNames": {
"type": "integer"
},
"updatedAt": {
"type": "integer"
}
}
},
"ListNamespaceFrontendMappingsOKBodyItems0": {
"type": "object",
"properties": {
@@ -8789,6 +8834,56 @@ func init() {
"$ref": "#/definitions/frontend"
}
},
"limitClass": {
"type": "object",
"properties": {
"backendMode": {
"type": "string"
},
"createdAt": {
"type": "integer"
},
"environments": {
"type": "integer"
},
"id": {
"type": "integer"
},
"label": {
"type": "string"
},
"limitAction": {
"type": "string"
},
"periodMinutes": {
"type": "integer"
},
"reservedShares": {
"type": "integer"
},
"rxBytes": {
"type": "integer"
},
"shareFrontends": {
"type": "integer"
},
"shares": {
"type": "integer"
},
"totalBytes": {
"type": "integer"
},
"txBytes": {
"type": "integer"
},
"uniqueNames": {
"type": "integer"
},
"updatedAt": {
"type": "integer"
}
}
},
"metrics": {
"type": "object",
"properties": {
@@ -0,0 +1,112 @@
// 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/v2/rest_model_zrok"
)
// ListAppliedLimitClassesHandlerFunc turns a function with the right signature into a list applied limit classes handler
type ListAppliedLimitClassesHandlerFunc func(ListAppliedLimitClassesParams, *rest_model_zrok.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn ListAppliedLimitClassesHandlerFunc) Handle(params ListAppliedLimitClassesParams, principal *rest_model_zrok.Principal) middleware.Responder {
return fn(params, principal)
}
// ListAppliedLimitClassesHandler interface for that can handle valid list applied limit classes params
type ListAppliedLimitClassesHandler interface {
Handle(ListAppliedLimitClassesParams, *rest_model_zrok.Principal) middleware.Responder
}
// NewListAppliedLimitClasses creates a new http.Handler for the list applied limit classes operation
func NewListAppliedLimitClasses(ctx *middleware.Context, handler ListAppliedLimitClassesHandler) *ListAppliedLimitClasses {
return &ListAppliedLimitClasses{Context: ctx, Handler: handler}
}
/*
ListAppliedLimitClasses swagger:route POST /applied-limit-class/list admin listAppliedLimitClasses
ListAppliedLimitClasses list applied limit classes API
*/
type ListAppliedLimitClasses struct {
Context *middleware.Context
Handler ListAppliedLimitClassesHandler
}
func (o *ListAppliedLimitClasses) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewListAppliedLimitClassesParams()
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)
}
// ListAppliedLimitClassesBody list applied limit classes body
//
// swagger:model ListAppliedLimitClassesBody
type ListAppliedLimitClassesBody struct {
// email
Email string `json:"email,omitempty"`
}
// Validate validates this list applied limit classes body
func (o *ListAppliedLimitClassesBody) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list applied limit classes body based on context it is used
func (o *ListAppliedLimitClassesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListAppliedLimitClassesBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListAppliedLimitClassesBody) UnmarshalBinary(b []byte) error {
var res ListAppliedLimitClassesBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
@@ -0,0 +1,75 @@
// 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"
)
// NewListAppliedLimitClassesParams creates a new ListAppliedLimitClassesParams object
//
// There are no default values defined in the spec.
func NewListAppliedLimitClassesParams() ListAppliedLimitClassesParams {
return ListAppliedLimitClassesParams{}
}
// ListAppliedLimitClassesParams contains all the bound params for the list applied limit classes operation
// typically these are obtained from a http.Request
//
// swagger:parameters listAppliedLimitClasses
type ListAppliedLimitClassesParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: body
*/
Body ListAppliedLimitClassesBody
}
// 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 NewListAppliedLimitClassesParams() beforehand.
func (o *ListAppliedLimitClassesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer func() {
_ = r.Body.Close()
}()
var body ListAppliedLimitClassesBody
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
}
@@ -0,0 +1,137 @@
// 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"
"github.com/openziti/zrok/v2/rest_model_zrok"
)
// ListAppliedLimitClassesOKCode is the HTTP code returned for type ListAppliedLimitClassesOK
const ListAppliedLimitClassesOKCode int = 200
/*
ListAppliedLimitClassesOK applied limit classes
swagger:response listAppliedLimitClassesOK
*/
type ListAppliedLimitClassesOK struct {
/*
In: Body
*/
Payload []*rest_model_zrok.LimitClass `json:"body,omitempty"`
}
// NewListAppliedLimitClassesOK creates ListAppliedLimitClassesOK with default headers values
func NewListAppliedLimitClassesOK() *ListAppliedLimitClassesOK {
return &ListAppliedLimitClassesOK{}
}
// WithPayload adds the payload to the list applied limit classes o k response
func (o *ListAppliedLimitClassesOK) WithPayload(payload []*rest_model_zrok.LimitClass) *ListAppliedLimitClassesOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list applied limit classes o k response
func (o *ListAppliedLimitClassesOK) SetPayload(payload []*rest_model_zrok.LimitClass) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ListAppliedLimitClassesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
payload := o.Payload
if payload == nil {
// return empty array
payload = make([]*rest_model_zrok.LimitClass, 0, 50)
}
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
// ListAppliedLimitClassesUnauthorizedCode is the HTTP code returned for type ListAppliedLimitClassesUnauthorized
const ListAppliedLimitClassesUnauthorizedCode int = 401
/*
ListAppliedLimitClassesUnauthorized unauthorized
swagger:response listAppliedLimitClassesUnauthorized
*/
type ListAppliedLimitClassesUnauthorized struct {
}
// NewListAppliedLimitClassesUnauthorized creates ListAppliedLimitClassesUnauthorized with default headers values
func NewListAppliedLimitClassesUnauthorized() *ListAppliedLimitClassesUnauthorized {
return &ListAppliedLimitClassesUnauthorized{}
}
// WriteResponse to the client
func (o *ListAppliedLimitClassesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) // Remove Content-Type on empty responses
rw.WriteHeader(401)
}
// ListAppliedLimitClassesNotFoundCode is the HTTP code returned for type ListAppliedLimitClassesNotFound
const ListAppliedLimitClassesNotFoundCode int = 404
/*
ListAppliedLimitClassesNotFound account not found
swagger:response listAppliedLimitClassesNotFound
*/
type ListAppliedLimitClassesNotFound struct {
}
// NewListAppliedLimitClassesNotFound creates ListAppliedLimitClassesNotFound with default headers values
func NewListAppliedLimitClassesNotFound() *ListAppliedLimitClassesNotFound {
return &ListAppliedLimitClassesNotFound{}
}
// WriteResponse to the client
func (o *ListAppliedLimitClassesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) // Remove Content-Type on empty responses
rw.WriteHeader(404)
}
// ListAppliedLimitClassesInternalServerErrorCode is the HTTP code returned for type ListAppliedLimitClassesInternalServerError
const ListAppliedLimitClassesInternalServerErrorCode int = 500
/*
ListAppliedLimitClassesInternalServerError internal server error
swagger:response listAppliedLimitClassesInternalServerError
*/
type ListAppliedLimitClassesInternalServerError struct {
}
// NewListAppliedLimitClassesInternalServerError creates ListAppliedLimitClassesInternalServerError with default headers values
func NewListAppliedLimitClassesInternalServerError() *ListAppliedLimitClassesInternalServerError {
return &ListAppliedLimitClassesInternalServerError{}
}
// WriteResponse to the client
func (o *ListAppliedLimitClassesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) // Remove Content-Type on empty responses
rw.WriteHeader(500)
}
@@ -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"
)
// ListAppliedLimitClassesURL generates an URL for the list applied limit classes operation
type ListAppliedLimitClassesURL 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 *ListAppliedLimitClassesURL) WithBasePath(bp string) *ListAppliedLimitClassesURL {
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 *ListAppliedLimitClassesURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *ListAppliedLimitClassesURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/applied-limit-class/list"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v2"
}
_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 *ListAppliedLimitClassesURL) 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 *ListAppliedLimitClassesURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *ListAppliedLimitClassesURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on ListAppliedLimitClassesURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on ListAppliedLimitClassesURL")
}
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 *ListAppliedLimitClassesURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}
@@ -110,82 +110,3 @@ func (o *ListLimitClassesBody) UnmarshalBinary(b []byte) error {
*o = res
return nil
}
// ListLimitClassesOKBodyItems0 list limit classes o k body items0
//
// swagger:model ListLimitClassesOKBodyItems0
type ListLimitClassesOKBodyItems0 struct {
// backend mode
BackendMode string `json:"backendMode,omitempty"`
// created at
CreatedAt int64 `json:"createdAt,omitempty"`
// environments
Environments int64 `json:"environments,omitempty"`
// id
ID int64 `json:"id,omitempty"`
// label
Label string `json:"label,omitempty"`
// limit action
LimitAction string `json:"limitAction,omitempty"`
// period minutes
PeriodMinutes int64 `json:"periodMinutes,omitempty"`
// reserved shares
ReservedShares int64 `json:"reservedShares,omitempty"`
// rx bytes
RxBytes int64 `json:"rxBytes,omitempty"`
// share frontends
ShareFrontends int64 `json:"shareFrontends,omitempty"`
// shares
Shares int64 `json:"shares,omitempty"`
// total bytes
TotalBytes int64 `json:"totalBytes,omitempty"`
// tx bytes
TxBytes int64 `json:"txBytes,omitempty"`
// unique names
UniqueNames int64 `json:"uniqueNames,omitempty"`
// updated at
UpdatedAt int64 `json:"updatedAt,omitempty"`
}
// Validate validates this list limit classes o k body items0
func (o *ListLimitClassesOKBodyItems0) Validate(formats strfmt.Registry) error {
return nil
}
// ContextValidate validates this list limit classes o k body items0 based on context it is used
func (o *ListLimitClassesOKBodyItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *ListLimitClassesOKBodyItems0) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *ListLimitClassesOKBodyItems0) UnmarshalBinary(b []byte) error {
var res ListLimitClassesOKBodyItems0
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
@@ -9,6 +9,8 @@ import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/openziti/zrok/v2/rest_model_zrok"
)
// ListLimitClassesOKCode is the HTTP code returned for type ListLimitClassesOK
@@ -24,7 +26,7 @@ type ListLimitClassesOK struct {
/*
In: Body
*/
Payload []*ListLimitClassesOKBodyItems0 `json:"body,omitempty"`
Payload []*rest_model_zrok.LimitClass `json:"body,omitempty"`
}
// NewListLimitClassesOK creates ListLimitClassesOK with default headers values
@@ -34,13 +36,13 @@ func NewListLimitClassesOK() *ListLimitClassesOK {
}
// WithPayload adds the payload to the list limit classes o k response
func (o *ListLimitClassesOK) WithPayload(payload []*ListLimitClassesOKBodyItems0) *ListLimitClassesOK {
func (o *ListLimitClassesOK) WithPayload(payload []*rest_model_zrok.LimitClass) *ListLimitClassesOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the list limit classes o k response
func (o *ListLimitClassesOK) SetPayload(payload []*ListLimitClassesOKBodyItems0) {
func (o *ListLimitClassesOK) SetPayload(payload []*rest_model_zrok.LimitClass) {
o.Payload = payload
}
@@ -51,7 +53,7 @@ func (o *ListLimitClassesOK) WriteResponse(rw http.ResponseWriter, producer runt
payload := o.Payload
if payload == nil {
// return empty array
payload = make([]*ListLimitClassesOKBodyItems0, 0, 50)
payload = make([]*rest_model_zrok.LimitClass, 0, 50)
}
if err := producer.Produce(rw, payload); err != nil {
+16
View File
@@ -306,6 +306,13 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI {
return middleware.NotImplemented("operation share.ListAllNames has not yet been implemented")
}),
AdminListAppliedLimitClassesHandler: admin.ListAppliedLimitClassesHandlerFunc(func(params admin.ListAppliedLimitClassesParams, principal *rest_model_zrok.Principal) middleware.Responder {
_ = params
_ = principal
return middleware.NotImplemented("operation admin.ListAppliedLimitClasses has not yet been implemented")
}),
MetadataListEnvironmentsHandler: metadata.ListEnvironmentsHandlerFunc(func(params metadata.ListEnvironmentsParams, principal *rest_model_zrok.Principal) middleware.Responder {
_ = params
_ = principal
@@ -725,6 +732,8 @@ type ZrokAPI struct {
MetadataListAccessesHandler metadata.ListAccessesHandler
// ShareListAllNamesHandler sets the operation handler for the list all names operation
ShareListAllNamesHandler share.ListAllNamesHandler
// AdminListAppliedLimitClassesHandler sets the operation handler for the list applied limit classes operation
AdminListAppliedLimitClassesHandler admin.ListAppliedLimitClassesHandler
// MetadataListEnvironmentsHandler sets the operation handler for the list environments operation
MetadataListEnvironmentsHandler metadata.ListEnvironmentsHandler
// AdminListFrontendNamespaceMappingsHandler sets the operation handler for the list frontend namespace mappings operation
@@ -1003,6 +1012,9 @@ func (o *ZrokAPI) Validate() error {
if o.ShareListAllNamesHandler == nil {
unregistered = append(unregistered, "share.ListAllNamesHandler")
}
if o.AdminListAppliedLimitClassesHandler == nil {
unregistered = append(unregistered, "admin.ListAppliedLimitClassesHandler")
}
if o.MetadataListEnvironmentsHandler == nil {
unregistered = append(unregistered, "metadata.ListEnvironmentsHandler")
}
@@ -1380,6 +1392,10 @@ func (o *ZrokAPI) initHandlerCache() {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/share/names"] = share.NewListAllNames(o.context, o.ShareListAllNamesHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/applied-limit-class/list"] = admin.NewListAppliedLimitClasses(o.context, o.AdminListAppliedLimitClassesHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
@@ -41,9 +41,9 @@ models/GetSparklines200Response.ts
models/GetSparklinesRequest.ts
models/InviteRequest.ts
models/InviteTokenGenerateRequest.ts
models/LimitClass.ts
models/ListFrontendNamespaceMappings200ResponseInner.ts
models/ListFrontends200ResponseInner.ts
models/ListLimitClasses200ResponseInner.ts
models/ListLimitClassesRequest.ts
models/ListMemberships200Response.ts
models/ListMemberships200ResponseMembershipsInner.ts
+44 -6
View File
@@ -29,9 +29,9 @@ import type {
CreateOrganizationRequest,
DeleteIdentityRequest,
InviteTokenGenerateRequest,
LimitClass,
ListFrontendNamespaceMappings200ResponseInner,
ListFrontends200ResponseInner,
ListLimitClasses200ResponseInner,
ListLimitClassesRequest,
ListNamespaces200ResponseInner,
ListOrganizationMembers200Response,
@@ -73,12 +73,12 @@ import {
DeleteIdentityRequestToJSON,
InviteTokenGenerateRequestFromJSON,
InviteTokenGenerateRequestToJSON,
LimitClassFromJSON,
LimitClassToJSON,
ListFrontendNamespaceMappings200ResponseInnerFromJSON,
ListFrontendNamespaceMappings200ResponseInnerToJSON,
ListFrontends200ResponseInnerFromJSON,
ListFrontends200ResponseInnerToJSON,
ListLimitClasses200ResponseInnerFromJSON,
ListLimitClasses200ResponseInnerToJSON,
ListLimitClassesRequestFromJSON,
ListLimitClassesRequestToJSON,
ListNamespaces200ResponseInnerFromJSON,
@@ -171,6 +171,10 @@ export interface InviteTokenGenerateOperationRequest {
body?: InviteTokenGenerateRequest;
}
export interface ListAppliedLimitClassesRequest {
body?: Verify200Response;
}
export interface ListFrontendNamespaceMappingsRequest {
frontendToken: string;
}
@@ -782,6 +786,40 @@ export class AdminApi extends runtime.BaseAPI {
await this.inviteTokenGenerateRaw(requestParameters, initOverrides);
}
/**
*/
async listAppliedLimitClassesRaw(requestParameters: ListAppliedLimitClassesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LimitClass>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication
}
let urlPath = `/applied-limit-class/list`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: Verify200ResponseToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LimitClassFromJSON));
}
/**
*/
async listAppliedLimitClasses(requestParameters: ListAppliedLimitClassesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LimitClass>> {
const response = await this.listAppliedLimitClassesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async listFrontendNamespaceMappingsRaw(requestParameters: ListFrontendNamespaceMappingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ListFrontendNamespaceMappings200ResponseInner>>> {
@@ -854,7 +892,7 @@ export class AdminApi extends runtime.BaseAPI {
/**
*/
async listLimitClassesRaw(requestParameters: ListLimitClassesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ListLimitClasses200ResponseInner>>> {
async listLimitClassesRaw(requestParameters: ListLimitClassesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LimitClass>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
@@ -876,12 +914,12 @@ export class AdminApi extends runtime.BaseAPI {
body: ListLimitClassesRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ListLimitClasses200ResponseInnerFromJSON));
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LimitClassFromJSON));
}
/**
*/
async listLimitClasses(requestParameters: ListLimitClassesOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ListLimitClasses200ResponseInner>> {
async listLimitClasses(requestParameters: ListLimitClassesOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LimitClass>> {
const response = await this.listLimitClassesRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -16,113 +16,113 @@ import { mapValues } from '../runtime';
/**
*
* @export
* @interface ListLimitClasses200ResponseInner
* @interface LimitClass
*/
export interface ListLimitClasses200ResponseInner {
export interface LimitClass {
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
id?: number;
/**
*
* @type {string}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
label?: string;
/**
*
* @type {string}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
backendMode?: string;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
environments?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
shares?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
reservedShares?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
uniqueNames?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
shareFrontends?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
periodMinutes?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
rxBytes?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
txBytes?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
totalBytes?: number;
/**
*
* @type {string}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
limitAction?: string;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
createdAt?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
updatedAt?: number;
}
/**
* Check if a given object implements the ListLimitClasses200ResponseInner interface.
* Check if a given object implements the LimitClass interface.
*/
export function instanceOfListLimitClasses200ResponseInner(value: object): value is ListLimitClasses200ResponseInner {
export function instanceOfLimitClass(value: object): value is LimitClass {
return true;
}
export function ListLimitClasses200ResponseInnerFromJSON(json: any): ListLimitClasses200ResponseInner {
return ListLimitClasses200ResponseInnerFromJSONTyped(json, false);
export function LimitClassFromJSON(json: any): LimitClass {
return LimitClassFromJSONTyped(json, false);
}
export function ListLimitClasses200ResponseInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListLimitClasses200ResponseInner {
export function LimitClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): LimitClass {
if (json == null) {
return json;
}
@@ -146,11 +146,11 @@ export function ListLimitClasses200ResponseInnerFromJSONTyped(json: any, ignoreD
};
}
export function ListLimitClasses200ResponseInnerToJSON(json: any): ListLimitClasses200ResponseInner {
return ListLimitClasses200ResponseInnerToJSONTyped(json, false);
export function LimitClassToJSON(json: any): LimitClass {
return LimitClassToJSONTyped(json, false);
}
export function ListLimitClasses200ResponseInnerToJSONTyped(value?: ListLimitClasses200ResponseInner | null, ignoreDiscriminator: boolean = false): any {
export function LimitClassToJSONTyped(value?: LimitClass | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
+1 -1
View File
@@ -34,9 +34,9 @@ export * from './GetSparklines200Response';
export * from './GetSparklinesRequest';
export * from './InviteRequest';
export * from './InviteTokenGenerateRequest';
export * from './LimitClass';
export * from './ListFrontendNamespaceMappings200ResponseInner';
export * from './ListFrontends200ResponseInner';
export * from './ListLimitClasses200ResponseInner';
export * from './ListLimitClassesRequest';
export * from './ListMemberships200Response';
export * from './ListMemberships200ResponseMembershipsInner';
+3 -3
View File
@@ -39,9 +39,9 @@ docs/GetSparklines200Response.md
docs/GetSparklinesRequest.md
docs/InviteRequest.md
docs/InviteTokenGenerateRequest.md
docs/LimitClass.md
docs/ListFrontendNamespaceMappings200ResponseInner.md
docs/ListFrontends200ResponseInner.md
docs/ListLimitClasses200ResponseInner.md
docs/ListLimitClassesRequest.md
docs/ListMemberships200Response.md
docs/ListMemberships200ResponseMembershipsInner.md
@@ -137,9 +137,9 @@ test/test_get_sparklines200_response.py
test/test_get_sparklines_request.py
test/test_invite_request.py
test/test_invite_token_generate_request.py
test/test_limit_class.py
test/test_list_frontend_namespace_mappings200_response_inner.py
test/test_list_frontends200_response_inner.py
test/test_list_limit_classes200_response_inner.py
test/test_list_limit_classes_request.py
test/test_list_memberships200_response.py
test/test_list_memberships200_response_memberships_inner.py
@@ -241,9 +241,9 @@ zrok_api/models/get_sparklines200_response.py
zrok_api/models/get_sparklines_request.py
zrok_api/models/invite_request.py
zrok_api/models/invite_token_generate_request.py
zrok_api/models/limit_class.py
zrok_api/models/list_frontend_namespace_mappings200_response_inner.py
zrok_api/models/list_frontends200_response_inner.py
zrok_api/models/list_limit_classes200_response_inner.py
zrok_api/models/list_limit_classes_request.py
zrok_api/models/list_memberships200_response.py
zrok_api/models/list_memberships200_response_memberships_inner.py
+2 -1
View File
@@ -117,6 +117,7 @@ Class | Method | HTTP request | Description
*AdminApi* | [**delete_organization**](docs/AdminApi.md#delete_organization) | **DELETE** /organization |
*AdminApi* | [**grants**](docs/AdminApi.md#grants) | **POST** /grants |
*AdminApi* | [**invite_token_generate**](docs/AdminApi.md#invite_token_generate) | **POST** /invite/token/generate |
*AdminApi* | [**list_applied_limit_classes**](docs/AdminApi.md#list_applied_limit_classes) | **POST** /applied-limit-class/list |
*AdminApi* | [**list_frontend_namespace_mappings**](docs/AdminApi.md#list_frontend_namespace_mappings) | **GET** /frontend/namespace/mapping/{frontendToken} |
*AdminApi* | [**list_frontends**](docs/AdminApi.md#list_frontends) | **GET** /frontends |
*AdminApi* | [**list_limit_classes**](docs/AdminApi.md#list_limit_classes) | **POST** /limit-class/list |
@@ -211,9 +212,9 @@ Class | Method | HTTP request | Description
- [GetSparklinesRequest](docs/GetSparklinesRequest.md)
- [InviteRequest](docs/InviteRequest.md)
- [InviteTokenGenerateRequest](docs/InviteTokenGenerateRequest.md)
- [LimitClass](docs/LimitClass.md)
- [ListFrontendNamespaceMappings200ResponseInner](docs/ListFrontendNamespaceMappings200ResponseInner.md)
- [ListFrontends200ResponseInner](docs/ListFrontends200ResponseInner.md)
- [ListLimitClasses200ResponseInner](docs/ListLimitClasses200ResponseInner.md)
- [ListLimitClassesRequest](docs/ListLimitClassesRequest.md)
- [ListMemberships200Response](docs/ListMemberships200Response.md)
- [ListMemberships200ResponseMembershipsInner](docs/ListMemberships200ResponseMembershipsInner.md)
+82 -3
View File
@@ -21,6 +21,7 @@ Method | HTTP request | Description
[**delete_organization**](AdminApi.md#delete_organization) | **DELETE** /organization |
[**grants**](AdminApi.md#grants) | **POST** /grants |
[**invite_token_generate**](AdminApi.md#invite_token_generate) | **POST** /invite/token/generate |
[**list_applied_limit_classes**](AdminApi.md#list_applied_limit_classes) | **POST** /applied-limit-class/list |
[**list_frontend_namespace_mappings**](AdminApi.md#list_frontend_namespace_mappings) | **GET** /frontend/namespace/mapping/{frontendToken} |
[**list_frontends**](AdminApi.md#list_frontends) | **GET** /frontends |
[**list_limit_classes**](AdminApi.md#list_limit_classes) | **POST** /limit-class/list |
@@ -1324,6 +1325,84 @@ void (empty response body)
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_applied_limit_classes**
> List[LimitClass] list_applied_limit_classes(body=body)
### Example
* Api Key Authentication (key):
```python
import zrok_api
from zrok_api.models.limit_class import LimitClass
from zrok_api.models.verify200_response import Verify200Response
from zrok_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to /api/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = zrok_api.Configuration(
host = "/api/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: key
configuration.api_key['key'] = os.environ["API_KEY"]
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'
# Enter a context with an instance of the API client
with zrok_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = zrok_api.AdminApi(api_client)
body = zrok_api.Verify200Response() # Verify200Response | (optional)
try:
api_response = api_instance.list_applied_limit_classes(body=body)
print("The response of AdminApi->list_applied_limit_classes:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling AdminApi->list_applied_limit_classes: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Verify200Response**](Verify200Response.md)| | [optional]
### Return type
[**List[LimitClass]**](LimitClass.md)
### Authorization
[key](../README.md#key)
### HTTP request headers
- **Content-Type**: application/zrok.v1+json
- **Accept**: application/zrok.v1+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | applied limit classes | - |
**401** | unauthorized | - |
**404** | account not found | - |
**500** | internal server error | - |
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_frontend_namespace_mappings**
> List[ListFrontendNamespaceMappings200ResponseInner] list_frontend_namespace_mappings(frontend_token)
@@ -1474,7 +1553,7 @@ This endpoint does not need any parameter.
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **list_limit_classes**
> List[ListLimitClasses200ResponseInner] list_limit_classes(body=body)
> List[LimitClass] list_limit_classes(body=body)
### Example
@@ -1482,7 +1561,7 @@ This endpoint does not need any parameter.
```python
import zrok_api
from zrok_api.models.list_limit_classes200_response_inner import ListLimitClasses200ResponseInner
from zrok_api.models.limit_class import LimitClass
from zrok_api.models.list_limit_classes_request import ListLimitClassesRequest
from zrok_api.rest import ApiException
from pprint import pprint
@@ -1529,7 +1608,7 @@ Name | Type | Description | Notes
### Return type
[**List[ListLimitClasses200ResponseInner]**](ListLimitClasses200ResponseInner.md)
[**List[LimitClass]**](LimitClass.md)
### Authorization
@@ -1,4 +1,4 @@
# ListLimitClasses200ResponseInner
# LimitClass
## Properties
@@ -24,19 +24,19 @@ Name | Type | Description | Notes
## Example
```python
from zrok_api.models.list_limit_classes200_response_inner import ListLimitClasses200ResponseInner
from zrok_api.models.limit_class import LimitClass
# TODO update the JSON string below
json = "{}"
# create an instance of ListLimitClasses200ResponseInner from a JSON string
list_limit_classes200_response_inner_instance = ListLimitClasses200ResponseInner.from_json(json)
# create an instance of LimitClass from a JSON string
limit_class_instance = LimitClass.from_json(json)
# print the JSON string representation of the object
print(ListLimitClasses200ResponseInner.to_json())
print(LimitClass.to_json())
# convert the object into a dict
list_limit_classes200_response_inner_dict = list_limit_classes200_response_inner_instance.to_dict()
# create an instance of ListLimitClasses200ResponseInner from a dict
list_limit_classes200_response_inner_from_dict = ListLimitClasses200ResponseInner.from_dict(list_limit_classes200_response_inner_dict)
limit_class_dict = limit_class_instance.to_dict()
# create an instance of LimitClass from a dict
limit_class_from_dict = LimitClass.from_dict(limit_class_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
+6
View File
@@ -128,6 +128,12 @@ class TestAdminApi(unittest.TestCase):
"""
pass
def test_list_applied_limit_classes(self) -> None:
"""Test case for list_applied_limit_classes
"""
pass
def test_list_frontend_namespace_mappings(self) -> None:
"""Test case for list_frontend_namespace_mappings
@@ -14,10 +14,10 @@
import unittest
from zrok_api.models.list_limit_classes200_response_inner import ListLimitClasses200ResponseInner
from zrok_api.models.limit_class import LimitClass
class TestListLimitClasses200ResponseInner(unittest.TestCase):
"""ListLimitClasses200ResponseInner unit test stubs"""
class TestLimitClass(unittest.TestCase):
"""LimitClass unit test stubs"""
def setUp(self):
pass
@@ -25,16 +25,16 @@ class TestListLimitClasses200ResponseInner(unittest.TestCase):
def tearDown(self):
pass
def make_instance(self, include_optional) -> ListLimitClasses200ResponseInner:
"""Test ListLimitClasses200ResponseInner
def make_instance(self, include_optional) -> LimitClass:
"""Test LimitClass
include_optional is a boolean, when False only required
params are included, when True both required and
optional params are included """
# uncomment below to create an instance of `ListLimitClasses200ResponseInner`
# uncomment below to create an instance of `LimitClass`
"""
model = ListLimitClasses200ResponseInner()
model = LimitClass()
if include_optional:
return ListLimitClasses200ResponseInner(
return LimitClass(
id = 56,
label = '',
backend_mode = '',
@@ -52,12 +52,12 @@ class TestListLimitClasses200ResponseInner(unittest.TestCase):
updated_at = 56
)
else:
return ListLimitClasses200ResponseInner(
return LimitClass(
)
"""
def testListLimitClasses200ResponseInner(self):
"""Test ListLimitClasses200ResponseInner"""
def testLimitClass(self):
"""Test LimitClass"""
# inst_req_only = self.make_instance(include_optional=False)
# inst_req_and_optional = self.make_instance(include_optional=True)
+2 -2
View File
@@ -68,9 +68,9 @@ __all__ = [
"GetSparklinesRequest",
"InviteRequest",
"InviteTokenGenerateRequest",
"LimitClass",
"ListFrontendNamespaceMappings200ResponseInner",
"ListFrontends200ResponseInner",
"ListLimitClasses200ResponseInner",
"ListLimitClassesRequest",
"ListMemberships200Response",
"ListMemberships200ResponseMembershipsInner",
@@ -179,9 +179,9 @@ from zrok_api.models.get_sparklines200_response import GetSparklines200Response
from zrok_api.models.get_sparklines_request import GetSparklinesRequest as GetSparklinesRequest
from zrok_api.models.invite_request import InviteRequest as InviteRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest as InviteTokenGenerateRequest
from zrok_api.models.limit_class import LimitClass as LimitClass
from zrok_api.models.list_frontend_namespace_mappings200_response_inner import ListFrontendNamespaceMappings200ResponseInner as ListFrontendNamespaceMappings200ResponseInner
from zrok_api.models.list_frontends200_response_inner import ListFrontends200ResponseInner as ListFrontends200ResponseInner
from zrok_api.models.list_limit_classes200_response_inner import ListLimitClasses200ResponseInner as ListLimitClasses200ResponseInner
from zrok_api.models.list_limit_classes_request import ListLimitClassesRequest as ListLimitClassesRequest
from zrok_api.models.list_memberships200_response import ListMemberships200Response as ListMemberships200Response
from zrok_api.models.list_memberships200_response_memberships_inner import ListMemberships200ResponseMembershipsInner as ListMemberships200ResponseMembershipsInner
+286 -6
View File
@@ -32,9 +32,9 @@ from zrok_api.models.create_organization201_response import CreateOrganization20
from zrok_api.models.create_organization_request import CreateOrganizationRequest
from zrok_api.models.delete_identity_request import DeleteIdentityRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
from zrok_api.models.limit_class import LimitClass
from zrok_api.models.list_frontend_namespace_mappings200_response_inner import ListFrontendNamespaceMappings200ResponseInner
from zrok_api.models.list_frontends200_response_inner import ListFrontends200ResponseInner
from zrok_api.models.list_limit_classes200_response_inner import ListLimitClasses200ResponseInner
from zrok_api.models.list_limit_classes_request import ListLimitClassesRequest
from zrok_api.models.list_namespaces200_response_inner import ListNamespaces200ResponseInner
from zrok_api.models.list_organization_members200_response import ListOrganizationMembers200Response
@@ -4749,6 +4749,286 @@ class AdminApi:
@validate_call
def list_applied_limit_classes(
self,
body: Optional[Verify200Response] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[LimitClass]:
"""list_applied_limit_classes
:param body:
:type body: Verify200Response
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._list_applied_limit_classes_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[LimitClass]",
'401': None,
'404': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def list_applied_limit_classes_with_http_info(
self,
body: Optional[Verify200Response] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[LimitClass]]:
"""list_applied_limit_classes
:param body:
:type body: Verify200Response
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._list_applied_limit_classes_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[LimitClass]",
'401': None,
'404': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def list_applied_limit_classes_without_preload_content(
self,
body: Optional[Verify200Response] = None,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""list_applied_limit_classes
:param body:
:type body: Verify200Response
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._list_applied_limit_classes_serialize(
body=body,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[LimitClass]",
'401': None,
'404': None,
'500': None,
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _list_applied_limit_classes_serialize(
self,
body,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if body is not None:
_body_params = body
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/zrok.v1+json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/zrok.v1+json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'key'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/applied-limit-class/list',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def list_frontend_namespace_mappings(
self,
@@ -5281,7 +5561,7 @@ class AdminApi:
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> List[ListLimitClasses200ResponseInner]:
) -> List[LimitClass]:
"""list_limit_classes
@@ -5318,7 +5598,7 @@ class AdminApi:
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[ListLimitClasses200ResponseInner]",
'200': "List[LimitClass]",
'401': None,
'500': None,
}
@@ -5349,7 +5629,7 @@ class AdminApi:
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[List[ListLimitClasses200ResponseInner]]:
) -> ApiResponse[List[LimitClass]]:
"""list_limit_classes
@@ -5386,7 +5666,7 @@ class AdminApi:
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[ListLimitClasses200ResponseInner]",
'200': "List[LimitClass]",
'401': None,
'500': None,
}
@@ -5454,7 +5734,7 @@ class AdminApi:
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "List[ListLimitClasses200ResponseInner]",
'200': "List[LimitClass]",
'401': None,
'500': None,
}
+1 -1
View File
@@ -49,9 +49,9 @@ from zrok_api.models.get_sparklines200_response import GetSparklines200Response
from zrok_api.models.get_sparklines_request import GetSparklinesRequest
from zrok_api.models.invite_request import InviteRequest
from zrok_api.models.invite_token_generate_request import InviteTokenGenerateRequest
from zrok_api.models.limit_class import LimitClass
from zrok_api.models.list_frontend_namespace_mappings200_response_inner import ListFrontendNamespaceMappings200ResponseInner
from zrok_api.models.list_frontends200_response_inner import ListFrontends200ResponseInner
from zrok_api.models.list_limit_classes200_response_inner import ListLimitClasses200ResponseInner
from zrok_api.models.list_limit_classes_request import ListLimitClassesRequest
from zrok_api.models.list_memberships200_response import ListMemberships200Response
from zrok_api.models.list_memberships200_response_memberships_inner import ListMemberships200ResponseMembershipsInner
@@ -22,9 +22,9 @@ from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class ListLimitClasses200ResponseInner(BaseModel):
class LimitClass(BaseModel):
"""
ListLimitClasses200ResponseInner
LimitClass
""" # noqa: E501
id: Optional[StrictInt] = None
label: Optional[StrictStr] = None
@@ -61,7 +61,7 @@ class ListLimitClasses200ResponseInner(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of ListLimitClasses200ResponseInner from a JSON string"""
"""Create an instance of LimitClass from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@@ -86,7 +86,7 @@ class ListLimitClasses200ResponseInner(BaseModel):
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of ListLimitClasses200ResponseInner from a dict"""
"""Create an instance of LimitClass from a dict"""
if obj is None:
return None
+29 -32
View File
@@ -839,39 +839,36 @@
schema:
type: array
items:
type: object
properties:
id:
type: integer
label:
type: string
backendMode:
type: string
environments:
type: integer
shares:
type: integer
reservedShares:
type: integer
uniqueNames:
type: integer
shareFrontends:
type: integer
periodMinutes:
type: integer
rxBytes:
type: integer
txBytes:
type: integer
totalBytes:
type: integer
limitAction:
type: string
createdAt:
type: integer
updatedAt:
type: integer
$ref: "#/definitions/limitClass"
401:
description: unauthorized
500:
description: internal server error
/applied-limit-class/list:
post:
tags:
- admin
security:
- key: []
operationId: listAppliedLimitClasses
parameters:
- name: body
in: body
schema:
properties:
email:
type: string
responses:
200:
description: applied limit classes
schema:
type: array
items:
$ref: "#/definitions/limitClass"
401:
description: unauthorized
404:
description: account not found
500:
description: internal server error
+34
View File
@@ -187,6 +187,40 @@ frontends:
items:
$ref: "#/definitions/frontend"
limitClass:
type: object
properties:
id:
type: integer
label:
type: string
backendMode:
type: string
environments:
type: integer
shares:
type: integer
reservedShares:
type: integer
uniqueNames:
type: integer
shareFrontends:
type: integer
periodMinutes:
type: integer
rxBytes:
type: integer
txBytes:
type: integer
totalBytes:
type: integer
limitAction:
type: string
createdAt:
type: integer
updatedAt:
type: integer
metrics:
type: object
properties:
+63 -32
View File
@@ -1063,42 +1063,39 @@ paths:
schema:
type: array
items:
type: object
properties:
id:
type: integer
label:
type: string
backendMode:
type: string
environments:
type: integer
shares:
type: integer
reservedShares:
type: integer
uniqueNames:
type: integer
shareFrontends:
type: integer
periodMinutes:
type: integer
rxBytes:
type: integer
txBytes:
type: integer
totalBytes:
type: integer
limitAction:
type: string
createdAt:
type: integer
updatedAt:
type: integer
$ref: "#/definitions/limitClass"
401:
description: unauthorized
500:
description: internal server error
/applied-limit-class/list:
post:
tags:
- admin
security:
- key: []
operationId: listAppliedLimitClasses
parameters:
- name: body
in: body
schema:
properties:
email:
type: string
responses:
200:
description: applied limit classes
schema:
type: array
items:
$ref: "#/definitions/limitClass"
401:
description: unauthorized
404:
description: account not found
500:
description: internal server error
#
# agent.yml
#
@@ -2633,6 +2630,40 @@ definitions:
items:
$ref: "#/definitions/frontend"
limitClass:
type: object
properties:
id:
type: integer
label:
type: string
backendMode:
type: string
environments:
type: integer
shares:
type: integer
reservedShares:
type: integer
uniqueNames:
type: integer
shareFrontends:
type: integer
periodMinutes:
type: integer
rxBytes:
type: integer
txBytes:
type: integer
totalBytes:
type: integer
limitAction:
type: string
createdAt:
type: integer
updatedAt:
type: integer
metrics:
type: object
properties:
+1 -1
View File
@@ -41,9 +41,9 @@ models/GetSparklines200Response.ts
models/GetSparklinesRequest.ts
models/InviteRequest.ts
models/InviteTokenGenerateRequest.ts
models/LimitClass.ts
models/ListFrontendNamespaceMappings200ResponseInner.ts
models/ListFrontends200ResponseInner.ts
models/ListLimitClasses200ResponseInner.ts
models/ListLimitClassesRequest.ts
models/ListMemberships200Response.ts
models/ListMemberships200ResponseMembershipsInner.ts
+44 -6
View File
@@ -29,9 +29,9 @@ import type {
CreateOrganizationRequest,
DeleteIdentityRequest,
InviteTokenGenerateRequest,
LimitClass,
ListFrontendNamespaceMappings200ResponseInner,
ListFrontends200ResponseInner,
ListLimitClasses200ResponseInner,
ListLimitClassesRequest,
ListNamespaces200ResponseInner,
ListOrganizationMembers200Response,
@@ -73,12 +73,12 @@ import {
DeleteIdentityRequestToJSON,
InviteTokenGenerateRequestFromJSON,
InviteTokenGenerateRequestToJSON,
LimitClassFromJSON,
LimitClassToJSON,
ListFrontendNamespaceMappings200ResponseInnerFromJSON,
ListFrontendNamespaceMappings200ResponseInnerToJSON,
ListFrontends200ResponseInnerFromJSON,
ListFrontends200ResponseInnerToJSON,
ListLimitClasses200ResponseInnerFromJSON,
ListLimitClasses200ResponseInnerToJSON,
ListLimitClassesRequestFromJSON,
ListLimitClassesRequestToJSON,
ListNamespaces200ResponseInnerFromJSON,
@@ -171,6 +171,10 @@ export interface InviteTokenGenerateOperationRequest {
body?: InviteTokenGenerateRequest;
}
export interface ListAppliedLimitClassesRequest {
body?: Verify200Response;
}
export interface ListFrontendNamespaceMappingsRequest {
frontendToken: string;
}
@@ -782,6 +786,40 @@ export class AdminApi extends runtime.BaseAPI {
await this.inviteTokenGenerateRaw(requestParameters, initOverrides);
}
/**
*/
async listAppliedLimitClassesRaw(requestParameters: ListAppliedLimitClassesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LimitClass>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/zrok.v1+json';
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication
}
let urlPath = `/applied-limit-class/list`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: Verify200ResponseToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LimitClassFromJSON));
}
/**
*/
async listAppliedLimitClasses(requestParameters: ListAppliedLimitClassesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LimitClass>> {
const response = await this.listAppliedLimitClassesRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async listFrontendNamespaceMappingsRaw(requestParameters: ListFrontendNamespaceMappingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ListFrontendNamespaceMappings200ResponseInner>>> {
@@ -854,7 +892,7 @@ export class AdminApi extends runtime.BaseAPI {
/**
*/
async listLimitClassesRaw(requestParameters: ListLimitClassesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<ListLimitClasses200ResponseInner>>> {
async listLimitClassesRaw(requestParameters: ListLimitClassesOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LimitClass>>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
@@ -876,12 +914,12 @@ export class AdminApi extends runtime.BaseAPI {
body: ListLimitClassesRequestToJSON(requestParameters['body']),
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(ListLimitClasses200ResponseInnerFromJSON));
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LimitClassFromJSON));
}
/**
*/
async listLimitClasses(requestParameters: ListLimitClassesOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<ListLimitClasses200ResponseInner>> {
async listLimitClasses(requestParameters: ListLimitClassesOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LimitClass>> {
const response = await this.listLimitClassesRaw(requestParameters, initOverrides);
return await response.value();
}
@@ -16,113 +16,113 @@ import { mapValues } from '../runtime';
/**
*
* @export
* @interface ListLimitClasses200ResponseInner
* @interface LimitClass
*/
export interface ListLimitClasses200ResponseInner {
export interface LimitClass {
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
id?: number;
/**
*
* @type {string}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
label?: string;
/**
*
* @type {string}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
backendMode?: string;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
environments?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
shares?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
reservedShares?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
uniqueNames?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
shareFrontends?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
periodMinutes?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
rxBytes?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
txBytes?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
totalBytes?: number;
/**
*
* @type {string}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
limitAction?: string;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
createdAt?: number;
/**
*
* @type {number}
* @memberof ListLimitClasses200ResponseInner
* @memberof LimitClass
*/
updatedAt?: number;
}
/**
* Check if a given object implements the ListLimitClasses200ResponseInner interface.
* Check if a given object implements the LimitClass interface.
*/
export function instanceOfListLimitClasses200ResponseInner(value: object): value is ListLimitClasses200ResponseInner {
export function instanceOfLimitClass(value: object): value is LimitClass {
return true;
}
export function ListLimitClasses200ResponseInnerFromJSON(json: any): ListLimitClasses200ResponseInner {
return ListLimitClasses200ResponseInnerFromJSONTyped(json, false);
export function LimitClassFromJSON(json: any): LimitClass {
return LimitClassFromJSONTyped(json, false);
}
export function ListLimitClasses200ResponseInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListLimitClasses200ResponseInner {
export function LimitClassFromJSONTyped(json: any, ignoreDiscriminator: boolean): LimitClass {
if (json == null) {
return json;
}
@@ -146,11 +146,11 @@ export function ListLimitClasses200ResponseInnerFromJSONTyped(json: any, ignoreD
};
}
export function ListLimitClasses200ResponseInnerToJSON(json: any): ListLimitClasses200ResponseInner {
return ListLimitClasses200ResponseInnerToJSONTyped(json, false);
export function LimitClassToJSON(json: any): LimitClass {
return LimitClassToJSONTyped(json, false);
}
export function ListLimitClasses200ResponseInnerToJSONTyped(value?: ListLimitClasses200ResponseInner | null, ignoreDiscriminator: boolean = false): any {
export function LimitClassToJSONTyped(value?: LimitClass | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
+1 -1
View File
@@ -34,9 +34,9 @@ export * from './GetSparklines200Response';
export * from './GetSparklinesRequest';
export * from './InviteRequest';
export * from './InviteTokenGenerateRequest';
export * from './LimitClass';
export * from './ListFrontendNamespaceMappings200ResponseInner';
export * from './ListFrontends200ResponseInner';
export * from './ListLimitClasses200ResponseInner';
export * from './ListLimitClassesRequest';
export * from './ListMemberships200Response';
export * from './ListMemberships200ResponseMembershipsInner';