From 2cecf14143959fcd39796197dd50f869539cefa4 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Fri, 30 May 2025 11:46:37 -0400 Subject: [PATCH] new /agent/status api endpoint (#967) --- rest_client_zrok/account/account_client.go | 72 +++- .../account/change_password_responses.go | 23 +- rest_client_zrok/account/invite_responses.go | 19 +- rest_client_zrok/account/login_responses.go | 11 +- .../regenerate_account_token_responses.go | 15 +- .../account/register_responses.go | 21 +- .../reset_password_request_responses.go | 12 +- .../account/reset_password_responses.go | 19 +- rest_client_zrok/account/verify_responses.go | 15 +- .../add_organization_member_responses.go | 16 +- rest_client_zrok/admin/admin_client.go | 72 +++- .../admin/create_account_responses.go | 15 +- .../admin/create_frontend_responses.go | 24 +- .../admin/create_identity_responses.go | 15 +- .../admin/create_organization_responses.go | 15 +- .../admin/delete_frontend_responses.go | 16 +- .../admin/delete_organization_responses.go | 16 +- rest_client_zrok/admin/grants_responses.go | 16 +- .../admin/invite_token_generate_responses.go | 16 +- .../admin/list_frontends_responses.go | 15 +- .../list_organization_members_responses.go | 19 +- .../admin/list_organizations_responses.go | 15 +- .../remove_organization_member_responses.go | 16 +- .../admin/update_frontend_responses.go | 16 +- rest_client_zrok/agent/agent_client.go | 150 +++++++ .../agent/agent_status_parameters.go | 146 +++++++ .../agent/agent_status_responses.go | 379 ++++++++++++++++++ .../environment/disable_responses.go | 12 +- .../environment/enable_responses.go | 19 +- .../environment/environment_client.go | 72 +++- .../client_version_check_responses.go | 11 +- .../metadata/configuration_responses.go | 7 +- .../metadata/get_account_detail_responses.go | 11 +- .../metadata/get_account_metrics_responses.go | 15 +- .../get_environment_detail_responses.go | 19 +- .../get_environment_metrics_responses.go | 19 +- .../metadata/get_frontend_detail_responses.go | 19 +- .../metadata/get_share_detail_responses.go | 19 +- .../metadata/get_share_metrics_responses.go | 19 +- .../metadata/get_sparklines_responses.go | 15 +- .../metadata/list_memberships_responses.go | 11 +- .../metadata/list_org_members_responses.go | 15 +- rest_client_zrok/metadata/metadata_client.go | 72 +++- .../org_account_overview_responses.go | 15 +- .../metadata/overview_responses.go | 13 +- .../metadata/version_inventory_responses.go | 7 +- .../metadata/version_responses.go | 7 +- rest_client_zrok/share/access_responses.go | 19 +- rest_client_zrok/share/share_client.go | 72 +++- rest_client_zrok/share/share_responses.go | 29 +- rest_client_zrok/share/unaccess_responses.go | 16 +- rest_client_zrok/share/unshare_responses.go | 19 +- .../share/update_access_responses.go | 16 +- .../share/update_share_responses.go | 20 +- rest_client_zrok/zrok_client.go | 5 + rest_model_zrok/share_request.go | 8 +- rest_server_zrok/embedded_spec.go | 94 +++++ .../operations/admin/create_frontend.go | 2 +- .../operations/agent/agent_status.go | 219 ++++++++++ .../agent/agent_status_parameters.go | 74 ++++ .../agent/agent_status_responses.go | 107 +++++ .../agent/agent_status_urlbuilder.go | 87 ++++ rest_server_zrok/operations/zrok_api.go | 13 + rest_server_zrok/server.go | 2 +- .../sdk/src/api/.openapi-generator/FILES | 3 + sdk/nodejs/sdk/src/api/apis/AgentApi.ts | 68 ++++ sdk/nodejs/sdk/src/api/apis/index.ts | 1 + .../src/api/models/AgentStatus200Response.ts | 73 ++++ .../sdk/src/api/models/AgentStatusRequest.ts | 65 +++ sdk/nodejs/sdk/src/api/models/index.ts | 2 + sdk/python/src/.openapi-generator/FILES | 9 + sdk/python/src/README.md | 3 + sdk/python/src/docs/AgentApi.md | 86 ++++ sdk/python/src/docs/AgentStatus200Response.md | 29 ++ sdk/python/src/docs/AgentStatusRequest.md | 29 ++ sdk/python/src/test/test_agent_api.py | 37 ++ .../src/test/test_agent_status200_response.py | 69 ++++ .../src/test/test_agent_status_request.py | 51 +++ sdk/python/src/zrok_api/__init__.py | 3 + sdk/python/src/zrok_api/api/__init__.py | 1 + sdk/python/src/zrok_api/api/agent_api.py | 315 +++++++++++++++ sdk/python/src/zrok_api/models/__init__.py | 2 + .../models/agent_status200_response.py | 95 +++++ .../zrok_api/models/agent_status_request.py | 87 ++++ specs/zrok.yml | 31 ++ ui/src/api/.openapi-generator/FILES | 3 + ui/src/api/apis/AgentApi.ts | 68 ++++ ui/src/api/apis/index.ts | 1 + ui/src/api/models/AgentStatus200Response.ts | 73 ++++ ui/src/api/models/AgentStatusRequest.ts | 65 +++ ui/src/api/models/index.ts | 2 + 91 files changed, 3328 insertions(+), 326 deletions(-) create mode 100644 rest_client_zrok/agent/agent_client.go create mode 100644 rest_client_zrok/agent/agent_status_parameters.go create mode 100644 rest_client_zrok/agent/agent_status_responses.go create mode 100644 rest_server_zrok/operations/agent/agent_status.go create mode 100644 rest_server_zrok/operations/agent/agent_status_parameters.go create mode 100644 rest_server_zrok/operations/agent/agent_status_responses.go create mode 100644 rest_server_zrok/operations/agent/agent_status_urlbuilder.go create mode 100644 sdk/nodejs/sdk/src/api/apis/AgentApi.ts create mode 100644 sdk/nodejs/sdk/src/api/models/AgentStatus200Response.ts create mode 100644 sdk/nodejs/sdk/src/api/models/AgentStatusRequest.ts create mode 100644 sdk/python/src/docs/AgentApi.md create mode 100644 sdk/python/src/docs/AgentStatus200Response.md create mode 100644 sdk/python/src/docs/AgentStatusRequest.md create mode 100644 sdk/python/src/test/test_agent_api.py create mode 100644 sdk/python/src/test/test_agent_status200_response.py create mode 100644 sdk/python/src/test/test_agent_status_request.py create mode 100644 sdk/python/src/zrok_api/api/agent_api.py create mode 100644 sdk/python/src/zrok_api/models/agent_status200_response.py create mode 100644 sdk/python/src/zrok_api/models/agent_status_request.py create mode 100644 ui/src/api/apis/AgentApi.ts create mode 100644 ui/src/api/models/AgentStatus200Response.ts create mode 100644 ui/src/api/models/AgentStatusRequest.ts diff --git a/rest_client_zrok/account/account_client.go b/rest_client_zrok/account/account_client.go index 2f602875..5fda16b6 100644 --- a/rest_client_zrok/account/account_client.go +++ b/rest_client_zrok/account/account_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi return &Client{transport: transport, formats: formats} } +// New creates a new account API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new account API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + /* Client for account API */ @@ -25,9 +51,53 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) +// This client is generated with a few options you might find useful for your swagger spec. +// +// Feel free to add you own set of options. + +// WithContentType allows the client to force the Content-Type header +// to negotiate a specific Consumer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithContentType(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{mime} + } +} + +// WithContentTypeApplicationJSON sets the Content-Type header to "application/json". +func WithContentTypeApplicationJSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/json"} +} + +// WithContentTypeApplicationZrokV1JSON sets the Content-Type header to "application/zrok.v1+json". +func WithContentTypeApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/zrok.v1+json"} +} + +// WithAccept allows the client to force the Accept header +// to negotiate a specific Producer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithAccept(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{mime} + } +} + +// WithAcceptApplicationJSON sets the Accept header to "application/json". +func WithAcceptApplicationJSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/json"} +} + +// WithAcceptApplicationZrokV1JSON sets the Accept header to "application/zrok.v1+json". +func WithAcceptApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/zrok.v1+json"} +} + // ClientService is the interface for Client methods type ClientService interface { ChangePassword(params *ChangePasswordParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*ChangePasswordOK, error) diff --git a/rest_client_zrok/account/change_password_responses.go b/rest_client_zrok/account/change_password_responses.go index 4d3f9fc7..3d08dbc7 100644 --- a/rest_client_zrok/account/change_password_responses.go +++ b/rest_client_zrok/account/change_password_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -104,11 +105,11 @@ func (o *ChangePasswordOK) Code() int { } func (o *ChangePasswordOK) Error() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordOK ", 200) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordOK", 200) } func (o *ChangePasswordOK) String() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordOK ", 200) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordOK", 200) } func (o *ChangePasswordOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -160,11 +161,11 @@ func (o *ChangePasswordBadRequest) Code() int { } func (o *ChangePasswordBadRequest) Error() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordBadRequest ", 400) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordBadRequest", 400) } func (o *ChangePasswordBadRequest) String() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordBadRequest ", 400) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordBadRequest", 400) } func (o *ChangePasswordBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -216,11 +217,11 @@ func (o *ChangePasswordUnauthorized) Code() int { } func (o *ChangePasswordUnauthorized) Error() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnauthorized ", 401) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnauthorized", 401) } func (o *ChangePasswordUnauthorized) String() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnauthorized ", 401) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnauthorized", 401) } func (o *ChangePasswordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -273,11 +274,13 @@ func (o *ChangePasswordUnprocessableEntity) Code() int { } func (o *ChangePasswordUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnprocessableEntity %s", 422, payload) } func (o *ChangePasswordUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordUnprocessableEntity %s", 422, payload) } func (o *ChangePasswordUnprocessableEntity) GetPayload() rest_model_zrok.ErrorMessage { @@ -338,11 +341,11 @@ func (o *ChangePasswordInternalServerError) Code() int { } func (o *ChangePasswordInternalServerError) Error() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordInternalServerError ", 500) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordInternalServerError", 500) } func (o *ChangePasswordInternalServerError) String() string { - return fmt.Sprintf("[POST /changePassword][%d] changePasswordInternalServerError ", 500) + return fmt.Sprintf("[POST /changePassword][%d] changePasswordInternalServerError", 500) } func (o *ChangePasswordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/invite_responses.go b/rest_client_zrok/account/invite_responses.go index c009cc6d..10056ce2 100644 --- a/rest_client_zrok/account/invite_responses.go +++ b/rest_client_zrok/account/invite_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -98,11 +99,11 @@ func (o *InviteCreated) Code() int { } func (o *InviteCreated) Error() string { - return fmt.Sprintf("[POST /invite][%d] inviteCreated ", 201) + return fmt.Sprintf("[POST /invite][%d] inviteCreated", 201) } func (o *InviteCreated) String() string { - return fmt.Sprintf("[POST /invite][%d] inviteCreated ", 201) + return fmt.Sprintf("[POST /invite][%d] inviteCreated", 201) } func (o *InviteCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -155,11 +156,13 @@ func (o *InviteBadRequest) Code() int { } func (o *InviteBadRequest) Error() string { - return fmt.Sprintf("[POST /invite][%d] inviteBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /invite][%d] inviteBadRequest %s", 400, payload) } func (o *InviteBadRequest) String() string { - return fmt.Sprintf("[POST /invite][%d] inviteBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /invite][%d] inviteBadRequest %s", 400, payload) } func (o *InviteBadRequest) GetPayload() rest_model_zrok.ErrorMessage { @@ -220,11 +223,11 @@ func (o *InviteUnauthorized) Code() int { } func (o *InviteUnauthorized) Error() string { - return fmt.Sprintf("[POST /invite][%d] inviteUnauthorized ", 401) + return fmt.Sprintf("[POST /invite][%d] inviteUnauthorized", 401) } func (o *InviteUnauthorized) String() string { - return fmt.Sprintf("[POST /invite][%d] inviteUnauthorized ", 401) + return fmt.Sprintf("[POST /invite][%d] inviteUnauthorized", 401) } func (o *InviteUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *InviteInternalServerError) Code() int { } func (o *InviteInternalServerError) Error() string { - return fmt.Sprintf("[POST /invite][%d] inviteInternalServerError ", 500) + return fmt.Sprintf("[POST /invite][%d] inviteInternalServerError", 500) } func (o *InviteInternalServerError) String() string { - return fmt.Sprintf("[POST /invite][%d] inviteInternalServerError ", 500) + return fmt.Sprintf("[POST /invite][%d] inviteInternalServerError", 500) } func (o *InviteInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/login_responses.go b/rest_client_zrok/account/login_responses.go index 7a348ebc..d9987a43 100644 --- a/rest_client_zrok/account/login_responses.go +++ b/rest_client_zrok/account/login_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -85,11 +86,13 @@ func (o *LoginOK) Code() int { } func (o *LoginOK) Error() string { - return fmt.Sprintf("[POST /login][%d] loginOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /login][%d] loginOK %s", 200, payload) } func (o *LoginOK) String() string { - return fmt.Sprintf("[POST /login][%d] loginOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /login][%d] loginOK %s", 200, payload) } func (o *LoginOK) GetPayload() string { @@ -150,11 +153,11 @@ func (o *LoginUnauthorized) Code() int { } func (o *LoginUnauthorized) Error() string { - return fmt.Sprintf("[POST /login][%d] loginUnauthorized ", 401) + return fmt.Sprintf("[POST /login][%d] loginUnauthorized", 401) } func (o *LoginUnauthorized) String() string { - return fmt.Sprintf("[POST /login][%d] loginUnauthorized ", 401) + return fmt.Sprintf("[POST /login][%d] loginUnauthorized", 401) } func (o *LoginUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/regenerate_account_token_responses.go b/rest_client_zrok/account/regenerate_account_token_responses.go index a2d57bec..46f77056 100644 --- a/rest_client_zrok/account/regenerate_account_token_responses.go +++ b/rest_client_zrok/account/regenerate_account_token_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *RegenerateAccountTokenOK) Code() int { } func (o *RegenerateAccountTokenOK) Error() string { - return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenOK %s", 200, payload) } func (o *RegenerateAccountTokenOK) String() string { - return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenOK %s", 200, payload) } func (o *RegenerateAccountTokenOK) GetPayload() *RegenerateAccountTokenOKBody { @@ -158,11 +161,11 @@ func (o *RegenerateAccountTokenNotFound) Code() int { } func (o *RegenerateAccountTokenNotFound) Error() string { - return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenNotFound ", 404) + return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenNotFound", 404) } func (o *RegenerateAccountTokenNotFound) String() string { - return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenNotFound ", 404) + return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenNotFound", 404) } func (o *RegenerateAccountTokenNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *RegenerateAccountTokenInternalServerError) Code() int { } func (o *RegenerateAccountTokenInternalServerError) Error() string { - return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenInternalServerError ", 500) + return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenInternalServerError", 500) } func (o *RegenerateAccountTokenInternalServerError) String() string { - return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenInternalServerError ", 500) + return fmt.Sprintf("[POST /regenerateAccountToken][%d] regenerateAccountTokenInternalServerError", 500) } func (o *RegenerateAccountTokenInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/register_responses.go b/rest_client_zrok/account/register_responses.go index e283669f..031a0206 100644 --- a/rest_client_zrok/account/register_responses.go +++ b/rest_client_zrok/account/register_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -99,11 +100,13 @@ func (o *RegisterOK) Code() int { } func (o *RegisterOK) Error() string { - return fmt.Sprintf("[POST /register][%d] registerOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /register][%d] registerOK %s", 200, payload) } func (o *RegisterOK) String() string { - return fmt.Sprintf("[POST /register][%d] registerOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /register][%d] registerOK %s", 200, payload) } func (o *RegisterOK) GetPayload() *RegisterOKBody { @@ -166,11 +169,11 @@ func (o *RegisterNotFound) Code() int { } func (o *RegisterNotFound) Error() string { - return fmt.Sprintf("[POST /register][%d] registerNotFound ", 404) + return fmt.Sprintf("[POST /register][%d] registerNotFound", 404) } func (o *RegisterNotFound) String() string { - return fmt.Sprintf("[POST /register][%d] registerNotFound ", 404) + return fmt.Sprintf("[POST /register][%d] registerNotFound", 404) } func (o *RegisterNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -223,11 +226,13 @@ func (o *RegisterUnprocessableEntity) Code() int { } func (o *RegisterUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /register][%d] registerUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /register][%d] registerUnprocessableEntity %s", 422, payload) } func (o *RegisterUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /register][%d] registerUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /register][%d] registerUnprocessableEntity %s", 422, payload) } func (o *RegisterUnprocessableEntity) GetPayload() rest_model_zrok.ErrorMessage { @@ -288,11 +293,11 @@ func (o *RegisterInternalServerError) Code() int { } func (o *RegisterInternalServerError) Error() string { - return fmt.Sprintf("[POST /register][%d] registerInternalServerError ", 500) + return fmt.Sprintf("[POST /register][%d] registerInternalServerError", 500) } func (o *RegisterInternalServerError) String() string { - return fmt.Sprintf("[POST /register][%d] registerInternalServerError ", 500) + return fmt.Sprintf("[POST /register][%d] registerInternalServerError", 500) } func (o *RegisterInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/reset_password_request_responses.go b/rest_client_zrok/account/reset_password_request_responses.go index ac021614..d799e89e 100644 --- a/rest_client_zrok/account/reset_password_request_responses.go +++ b/rest_client_zrok/account/reset_password_request_responses.go @@ -89,11 +89,11 @@ func (o *ResetPasswordRequestCreated) Code() int { } func (o *ResetPasswordRequestCreated) Error() string { - return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestCreated ", 201) + return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestCreated", 201) } func (o *ResetPasswordRequestCreated) String() string { - return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestCreated ", 201) + return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestCreated", 201) } func (o *ResetPasswordRequestCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -145,11 +145,11 @@ func (o *ResetPasswordRequestBadRequest) Code() int { } func (o *ResetPasswordRequestBadRequest) Error() string { - return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestBadRequest ", 400) + return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestBadRequest", 400) } func (o *ResetPasswordRequestBadRequest) String() string { - return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestBadRequest ", 400) + return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestBadRequest", 400) } func (o *ResetPasswordRequestBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -201,11 +201,11 @@ func (o *ResetPasswordRequestInternalServerError) Code() int { } func (o *ResetPasswordRequestInternalServerError) Error() string { - return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestInternalServerError ", 500) + return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestInternalServerError", 500) } func (o *ResetPasswordRequestInternalServerError) String() string { - return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestInternalServerError ", 500) + return fmt.Sprintf("[POST /resetPasswordRequest][%d] resetPasswordRequestInternalServerError", 500) } func (o *ResetPasswordRequestInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/reset_password_responses.go b/rest_client_zrok/account/reset_password_responses.go index 7b095fdf..5c63b039 100644 --- a/rest_client_zrok/account/reset_password_responses.go +++ b/rest_client_zrok/account/reset_password_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -98,11 +99,11 @@ func (o *ResetPasswordOK) Code() int { } func (o *ResetPasswordOK) Error() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordOK ", 200) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordOK", 200) } func (o *ResetPasswordOK) String() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordOK ", 200) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordOK", 200) } func (o *ResetPasswordOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -154,11 +155,11 @@ func (o *ResetPasswordNotFound) Code() int { } func (o *ResetPasswordNotFound) Error() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordNotFound ", 404) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordNotFound", 404) } func (o *ResetPasswordNotFound) String() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordNotFound ", 404) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordNotFound", 404) } func (o *ResetPasswordNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -211,11 +212,13 @@ func (o *ResetPasswordUnprocessableEntity) Code() int { } func (o *ResetPasswordUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordUnprocessableEntity %s", 422, payload) } func (o *ResetPasswordUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordUnprocessableEntity %+v", 422, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordUnprocessableEntity %s", 422, payload) } func (o *ResetPasswordUnprocessableEntity) GetPayload() rest_model_zrok.ErrorMessage { @@ -276,11 +279,11 @@ func (o *ResetPasswordInternalServerError) Code() int { } func (o *ResetPasswordInternalServerError) Error() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordInternalServerError ", 500) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordInternalServerError", 500) } func (o *ResetPasswordInternalServerError) String() string { - return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordInternalServerError ", 500) + return fmt.Sprintf("[POST /resetPassword][%d] resetPasswordInternalServerError", 500) } func (o *ResetPasswordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/account/verify_responses.go b/rest_client_zrok/account/verify_responses.go index 13051959..c79e0088 100644 --- a/rest_client_zrok/account/verify_responses.go +++ b/rest_client_zrok/account/verify_responses.go @@ -7,6 +7,7 @@ package account import ( "context" + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *VerifyOK) Code() int { } func (o *VerifyOK) Error() string { - return fmt.Sprintf("[POST /verify][%d] verifyOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /verify][%d] verifyOK %s", 200, payload) } func (o *VerifyOK) String() string { - return fmt.Sprintf("[POST /verify][%d] verifyOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /verify][%d] verifyOK %s", 200, payload) } func (o *VerifyOK) GetPayload() *VerifyOKBody { @@ -158,11 +161,11 @@ func (o *VerifyNotFound) Code() int { } func (o *VerifyNotFound) Error() string { - return fmt.Sprintf("[POST /verify][%d] verifyNotFound ", 404) + return fmt.Sprintf("[POST /verify][%d] verifyNotFound", 404) } func (o *VerifyNotFound) String() string { - return fmt.Sprintf("[POST /verify][%d] verifyNotFound ", 404) + return fmt.Sprintf("[POST /verify][%d] verifyNotFound", 404) } func (o *VerifyNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *VerifyInternalServerError) Code() int { } func (o *VerifyInternalServerError) Error() string { - return fmt.Sprintf("[POST /verify][%d] verifyInternalServerError ", 500) + return fmt.Sprintf("[POST /verify][%d] verifyInternalServerError", 500) } func (o *VerifyInternalServerError) String() string { - return fmt.Sprintf("[POST /verify][%d] verifyInternalServerError ", 500) + return fmt.Sprintf("[POST /verify][%d] verifyInternalServerError", 500) } func (o *VerifyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/add_organization_member_responses.go b/rest_client_zrok/admin/add_organization_member_responses.go index da8500fa..a290cf70 100644 --- a/rest_client_zrok/admin/add_organization_member_responses.go +++ b/rest_client_zrok/admin/add_organization_member_responses.go @@ -95,11 +95,11 @@ func (o *AddOrganizationMemberCreated) Code() int { } func (o *AddOrganizationMemberCreated) Error() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberCreated ", 201) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberCreated", 201) } func (o *AddOrganizationMemberCreated) String() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberCreated ", 201) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberCreated", 201) } func (o *AddOrganizationMemberCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *AddOrganizationMemberUnauthorized) Code() int { } func (o *AddOrganizationMemberUnauthorized) Error() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberUnauthorized ", 401) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberUnauthorized", 401) } func (o *AddOrganizationMemberUnauthorized) String() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberUnauthorized ", 401) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberUnauthorized", 401) } func (o *AddOrganizationMemberUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *AddOrganizationMemberNotFound) Code() int { } func (o *AddOrganizationMemberNotFound) Error() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberNotFound ", 404) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberNotFound", 404) } func (o *AddOrganizationMemberNotFound) String() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberNotFound ", 404) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberNotFound", 404) } func (o *AddOrganizationMemberNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *AddOrganizationMemberInternalServerError) Code() int { } func (o *AddOrganizationMemberInternalServerError) Error() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberInternalServerError ", 500) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberInternalServerError", 500) } func (o *AddOrganizationMemberInternalServerError) String() string { - return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberInternalServerError ", 500) + return fmt.Sprintf("[POST /organization/add][%d] addOrganizationMemberInternalServerError", 500) } func (o *AddOrganizationMemberInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/admin_client.go b/rest_client_zrok/admin/admin_client.go index e8597a63..0bfa7ebe 100644 --- a/rest_client_zrok/admin/admin_client.go +++ b/rest_client_zrok/admin/admin_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi return &Client{transport: transport, formats: formats} } +// New creates a new admin API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new admin API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + /* Client for admin API */ @@ -25,9 +51,53 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) +// This client is generated with a few options you might find useful for your swagger spec. +// +// Feel free to add you own set of options. + +// WithContentType allows the client to force the Content-Type header +// to negotiate a specific Consumer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithContentType(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{mime} + } +} + +// WithContentTypeApplicationJSON sets the Content-Type header to "application/json". +func WithContentTypeApplicationJSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/json"} +} + +// WithContentTypeApplicationZrokV1JSON sets the Content-Type header to "application/zrok.v1+json". +func WithContentTypeApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/zrok.v1+json"} +} + +// WithAccept allows the client to force the Accept header +// to negotiate a specific Producer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithAccept(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{mime} + } +} + +// WithAcceptApplicationJSON sets the Accept header to "application/json". +func WithAcceptApplicationJSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/json"} +} + +// WithAcceptApplicationZrokV1JSON sets the Accept header to "application/zrok.v1+json". +func WithAcceptApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/zrok.v1+json"} +} + // ClientService is the interface for Client methods type ClientService interface { AddOrganizationMember(params *AddOrganizationMemberParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AddOrganizationMemberCreated, error) diff --git a/rest_client_zrok/admin/create_account_responses.go b/rest_client_zrok/admin/create_account_responses.go index 9f0f4f39..f64322f6 100644 --- a/rest_client_zrok/admin/create_account_responses.go +++ b/rest_client_zrok/admin/create_account_responses.go @@ -7,6 +7,7 @@ package admin import ( "context" + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *CreateAccountCreated) Code() int { } func (o *CreateAccountCreated) Error() string { - return fmt.Sprintf("[POST /account][%d] createAccountCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /account][%d] createAccountCreated %s", 201, payload) } func (o *CreateAccountCreated) String() string { - return fmt.Sprintf("[POST /account][%d] createAccountCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /account][%d] createAccountCreated %s", 201, payload) } func (o *CreateAccountCreated) GetPayload() *CreateAccountCreatedBody { @@ -158,11 +161,11 @@ func (o *CreateAccountUnauthorized) Code() int { } func (o *CreateAccountUnauthorized) Error() string { - return fmt.Sprintf("[POST /account][%d] createAccountUnauthorized ", 401) + return fmt.Sprintf("[POST /account][%d] createAccountUnauthorized", 401) } func (o *CreateAccountUnauthorized) String() string { - return fmt.Sprintf("[POST /account][%d] createAccountUnauthorized ", 401) + return fmt.Sprintf("[POST /account][%d] createAccountUnauthorized", 401) } func (o *CreateAccountUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *CreateAccountInternalServerError) Code() int { } func (o *CreateAccountInternalServerError) Error() string { - return fmt.Sprintf("[POST /account][%d] createAccountInternalServerError ", 500) + return fmt.Sprintf("[POST /account][%d] createAccountInternalServerError", 500) } func (o *CreateAccountInternalServerError) String() string { - return fmt.Sprintf("[POST /account][%d] createAccountInternalServerError ", 500) + return fmt.Sprintf("[POST /account][%d] createAccountInternalServerError", 500) } func (o *CreateAccountInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/create_frontend_responses.go b/rest_client_zrok/admin/create_frontend_responses.go index 367d6b5c..af456402 100644 --- a/rest_client_zrok/admin/create_frontend_responses.go +++ b/rest_client_zrok/admin/create_frontend_responses.go @@ -106,11 +106,13 @@ func (o *CreateFrontendCreated) Code() int { } func (o *CreateFrontendCreated) Error() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /frontend][%d] createFrontendCreated %s", 201, payload) } func (o *CreateFrontendCreated) String() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /frontend][%d] createFrontendCreated %s", 201, payload) } func (o *CreateFrontendCreated) GetPayload() *CreateFrontendCreatedBody { @@ -173,11 +175,11 @@ func (o *CreateFrontendBadRequest) Code() int { } func (o *CreateFrontendBadRequest) Error() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendBadRequest ", 400) + return fmt.Sprintf("[POST /frontend][%d] createFrontendBadRequest", 400) } func (o *CreateFrontendBadRequest) String() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendBadRequest ", 400) + return fmt.Sprintf("[POST /frontend][%d] createFrontendBadRequest", 400) } func (o *CreateFrontendBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -229,11 +231,11 @@ func (o *CreateFrontendUnauthorized) Code() int { } func (o *CreateFrontendUnauthorized) Error() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendUnauthorized ", 401) + return fmt.Sprintf("[POST /frontend][%d] createFrontendUnauthorized", 401) } func (o *CreateFrontendUnauthorized) String() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendUnauthorized ", 401) + return fmt.Sprintf("[POST /frontend][%d] createFrontendUnauthorized", 401) } func (o *CreateFrontendUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -285,11 +287,11 @@ func (o *CreateFrontendNotFound) Code() int { } func (o *CreateFrontendNotFound) Error() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendNotFound ", 404) + return fmt.Sprintf("[POST /frontend][%d] createFrontendNotFound", 404) } func (o *CreateFrontendNotFound) String() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendNotFound ", 404) + return fmt.Sprintf("[POST /frontend][%d] createFrontendNotFound", 404) } func (o *CreateFrontendNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -341,11 +343,11 @@ func (o *CreateFrontendInternalServerError) Code() int { } func (o *CreateFrontendInternalServerError) Error() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendInternalServerError ", 500) + return fmt.Sprintf("[POST /frontend][%d] createFrontendInternalServerError", 500) } func (o *CreateFrontendInternalServerError) String() string { - return fmt.Sprintf("[POST /frontend][%d] createFrontendInternalServerError ", 500) + return fmt.Sprintf("[POST /frontend][%d] createFrontendInternalServerError", 500) } func (o *CreateFrontendInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -360,7 +362,7 @@ swagger:model CreateFrontendBody type CreateFrontendBody struct { // permission mode - // Enum: [open closed] + // Enum: ["open","closed"] PermissionMode string `json:"permissionMode,omitempty"` // public name diff --git a/rest_client_zrok/admin/create_identity_responses.go b/rest_client_zrok/admin/create_identity_responses.go index 17c7457b..c1f0670f 100644 --- a/rest_client_zrok/admin/create_identity_responses.go +++ b/rest_client_zrok/admin/create_identity_responses.go @@ -7,6 +7,7 @@ package admin import ( "context" + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *CreateIdentityCreated) Code() int { } func (o *CreateIdentityCreated) Error() string { - return fmt.Sprintf("[POST /identity][%d] createIdentityCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /identity][%d] createIdentityCreated %s", 201, payload) } func (o *CreateIdentityCreated) String() string { - return fmt.Sprintf("[POST /identity][%d] createIdentityCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /identity][%d] createIdentityCreated %s", 201, payload) } func (o *CreateIdentityCreated) GetPayload() *CreateIdentityCreatedBody { @@ -158,11 +161,11 @@ func (o *CreateIdentityUnauthorized) Code() int { } func (o *CreateIdentityUnauthorized) Error() string { - return fmt.Sprintf("[POST /identity][%d] createIdentityUnauthorized ", 401) + return fmt.Sprintf("[POST /identity][%d] createIdentityUnauthorized", 401) } func (o *CreateIdentityUnauthorized) String() string { - return fmt.Sprintf("[POST /identity][%d] createIdentityUnauthorized ", 401) + return fmt.Sprintf("[POST /identity][%d] createIdentityUnauthorized", 401) } func (o *CreateIdentityUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *CreateIdentityInternalServerError) Code() int { } func (o *CreateIdentityInternalServerError) Error() string { - return fmt.Sprintf("[POST /identity][%d] createIdentityInternalServerError ", 500) + return fmt.Sprintf("[POST /identity][%d] createIdentityInternalServerError", 500) } func (o *CreateIdentityInternalServerError) String() string { - return fmt.Sprintf("[POST /identity][%d] createIdentityInternalServerError ", 500) + return fmt.Sprintf("[POST /identity][%d] createIdentityInternalServerError", 500) } func (o *CreateIdentityInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/create_organization_responses.go b/rest_client_zrok/admin/create_organization_responses.go index b31dffa6..fdca102b 100644 --- a/rest_client_zrok/admin/create_organization_responses.go +++ b/rest_client_zrok/admin/create_organization_responses.go @@ -7,6 +7,7 @@ package admin import ( "context" + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *CreateOrganizationCreated) Code() int { } func (o *CreateOrganizationCreated) Error() string { - return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated %s", 201, payload) } func (o *CreateOrganizationCreated) String() string { - return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /organization][%d] createOrganizationCreated %s", 201, payload) } func (o *CreateOrganizationCreated) GetPayload() *CreateOrganizationCreatedBody { @@ -158,11 +161,11 @@ func (o *CreateOrganizationUnauthorized) Code() int { } func (o *CreateOrganizationUnauthorized) Error() string { - return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized ", 401) + return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized", 401) } func (o *CreateOrganizationUnauthorized) String() string { - return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized ", 401) + return fmt.Sprintf("[POST /organization][%d] createOrganizationUnauthorized", 401) } func (o *CreateOrganizationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *CreateOrganizationInternalServerError) Code() int { } func (o *CreateOrganizationInternalServerError) Error() string { - return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError ", 500) + return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError", 500) } func (o *CreateOrganizationInternalServerError) String() string { - return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError ", 500) + return fmt.Sprintf("[POST /organization][%d] createOrganizationInternalServerError", 500) } func (o *CreateOrganizationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/delete_frontend_responses.go b/rest_client_zrok/admin/delete_frontend_responses.go index 235c2c19..b5bef8ba 100644 --- a/rest_client_zrok/admin/delete_frontend_responses.go +++ b/rest_client_zrok/admin/delete_frontend_responses.go @@ -95,11 +95,11 @@ func (o *DeleteFrontendOK) Code() int { } func (o *DeleteFrontendOK) Error() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendOK ", 200) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendOK", 200) } func (o *DeleteFrontendOK) String() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendOK ", 200) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendOK", 200) } func (o *DeleteFrontendOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *DeleteFrontendUnauthorized) Code() int { } func (o *DeleteFrontendUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendUnauthorized ", 401) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendUnauthorized", 401) } func (o *DeleteFrontendUnauthorized) String() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendUnauthorized ", 401) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendUnauthorized", 401) } func (o *DeleteFrontendUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *DeleteFrontendNotFound) Code() int { } func (o *DeleteFrontendNotFound) Error() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendNotFound ", 404) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendNotFound", 404) } func (o *DeleteFrontendNotFound) String() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendNotFound ", 404) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendNotFound", 404) } func (o *DeleteFrontendNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *DeleteFrontendInternalServerError) Code() int { } func (o *DeleteFrontendInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendInternalServerError ", 500) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendInternalServerError", 500) } func (o *DeleteFrontendInternalServerError) String() string { - return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendInternalServerError ", 500) + return fmt.Sprintf("[DELETE /frontend][%d] deleteFrontendInternalServerError", 500) } func (o *DeleteFrontendInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/delete_organization_responses.go b/rest_client_zrok/admin/delete_organization_responses.go index 7dbf9987..430b89f3 100644 --- a/rest_client_zrok/admin/delete_organization_responses.go +++ b/rest_client_zrok/admin/delete_organization_responses.go @@ -95,11 +95,11 @@ func (o *DeleteOrganizationOK) Code() int { } func (o *DeleteOrganizationOK) Error() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationOK ", 200) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationOK", 200) } func (o *DeleteOrganizationOK) String() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationOK ", 200) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationOK", 200) } func (o *DeleteOrganizationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *DeleteOrganizationUnauthorized) Code() int { } func (o *DeleteOrganizationUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationUnauthorized ", 401) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationUnauthorized", 401) } func (o *DeleteOrganizationUnauthorized) String() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationUnauthorized ", 401) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationUnauthorized", 401) } func (o *DeleteOrganizationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *DeleteOrganizationNotFound) Code() int { } func (o *DeleteOrganizationNotFound) Error() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationNotFound ", 404) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationNotFound", 404) } func (o *DeleteOrganizationNotFound) String() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationNotFound ", 404) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationNotFound", 404) } func (o *DeleteOrganizationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *DeleteOrganizationInternalServerError) Code() int { } func (o *DeleteOrganizationInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationInternalServerError ", 500) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationInternalServerError", 500) } func (o *DeleteOrganizationInternalServerError) String() string { - return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationInternalServerError ", 500) + return fmt.Sprintf("[DELETE /organization][%d] deleteOrganizationInternalServerError", 500) } func (o *DeleteOrganizationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/grants_responses.go b/rest_client_zrok/admin/grants_responses.go index a8b1ddb1..8f72c2de 100644 --- a/rest_client_zrok/admin/grants_responses.go +++ b/rest_client_zrok/admin/grants_responses.go @@ -95,11 +95,11 @@ func (o *GrantsOK) Code() int { } func (o *GrantsOK) Error() string { - return fmt.Sprintf("[POST /grants][%d] grantsOK ", 200) + return fmt.Sprintf("[POST /grants][%d] grantsOK", 200) } func (o *GrantsOK) String() string { - return fmt.Sprintf("[POST /grants][%d] grantsOK ", 200) + return fmt.Sprintf("[POST /grants][%d] grantsOK", 200) } func (o *GrantsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *GrantsUnauthorized) Code() int { } func (o *GrantsUnauthorized) Error() string { - return fmt.Sprintf("[POST /grants][%d] grantsUnauthorized ", 401) + return fmt.Sprintf("[POST /grants][%d] grantsUnauthorized", 401) } func (o *GrantsUnauthorized) String() string { - return fmt.Sprintf("[POST /grants][%d] grantsUnauthorized ", 401) + return fmt.Sprintf("[POST /grants][%d] grantsUnauthorized", 401) } func (o *GrantsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *GrantsNotFound) Code() int { } func (o *GrantsNotFound) Error() string { - return fmt.Sprintf("[POST /grants][%d] grantsNotFound ", 404) + return fmt.Sprintf("[POST /grants][%d] grantsNotFound", 404) } func (o *GrantsNotFound) String() string { - return fmt.Sprintf("[POST /grants][%d] grantsNotFound ", 404) + return fmt.Sprintf("[POST /grants][%d] grantsNotFound", 404) } func (o *GrantsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *GrantsInternalServerError) Code() int { } func (o *GrantsInternalServerError) Error() string { - return fmt.Sprintf("[POST /grants][%d] grantsInternalServerError ", 500) + return fmt.Sprintf("[POST /grants][%d] grantsInternalServerError", 500) } func (o *GrantsInternalServerError) String() string { - return fmt.Sprintf("[POST /grants][%d] grantsInternalServerError ", 500) + return fmt.Sprintf("[POST /grants][%d] grantsInternalServerError", 500) } func (o *GrantsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/invite_token_generate_responses.go b/rest_client_zrok/admin/invite_token_generate_responses.go index 1279f0a4..312043c2 100644 --- a/rest_client_zrok/admin/invite_token_generate_responses.go +++ b/rest_client_zrok/admin/invite_token_generate_responses.go @@ -95,11 +95,11 @@ func (o *InviteTokenGenerateCreated) Code() int { } func (o *InviteTokenGenerateCreated) Error() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateCreated ", 201) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateCreated", 201) } func (o *InviteTokenGenerateCreated) String() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateCreated ", 201) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateCreated", 201) } func (o *InviteTokenGenerateCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *InviteTokenGenerateBadRequest) Code() int { } func (o *InviteTokenGenerateBadRequest) Error() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateBadRequest ", 400) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateBadRequest", 400) } func (o *InviteTokenGenerateBadRequest) String() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateBadRequest ", 400) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateBadRequest", 400) } func (o *InviteTokenGenerateBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *InviteTokenGenerateUnauthorized) Code() int { } func (o *InviteTokenGenerateUnauthorized) Error() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateUnauthorized ", 401) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateUnauthorized", 401) } func (o *InviteTokenGenerateUnauthorized) String() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateUnauthorized ", 401) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateUnauthorized", 401) } func (o *InviteTokenGenerateUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *InviteTokenGenerateInternalServerError) Code() int { } func (o *InviteTokenGenerateInternalServerError) Error() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateInternalServerError ", 500) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateInternalServerError", 500) } func (o *InviteTokenGenerateInternalServerError) String() string { - return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateInternalServerError ", 500) + return fmt.Sprintf("[POST /invite/token/generate][%d] inviteTokenGenerateInternalServerError", 500) } func (o *InviteTokenGenerateInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/list_frontends_responses.go b/rest_client_zrok/admin/list_frontends_responses.go index d351c898..5ff04e11 100644 --- a/rest_client_zrok/admin/list_frontends_responses.go +++ b/rest_client_zrok/admin/list_frontends_responses.go @@ -7,6 +7,7 @@ package admin import ( "context" + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *ListFrontendsOK) Code() int { } func (o *ListFrontendsOK) Error() string { - return fmt.Sprintf("[GET /frontends][%d] listFrontendsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /frontends][%d] listFrontendsOK %s", 200, payload) } func (o *ListFrontendsOK) String() string { - return fmt.Sprintf("[GET /frontends][%d] listFrontendsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /frontends][%d] listFrontendsOK %s", 200, payload) } func (o *ListFrontendsOK) GetPayload() []*ListFrontendsOKBodyItems0 { @@ -156,11 +159,11 @@ func (o *ListFrontendsUnauthorized) Code() int { } func (o *ListFrontendsUnauthorized) Error() string { - return fmt.Sprintf("[GET /frontends][%d] listFrontendsUnauthorized ", 401) + return fmt.Sprintf("[GET /frontends][%d] listFrontendsUnauthorized", 401) } func (o *ListFrontendsUnauthorized) String() string { - return fmt.Sprintf("[GET /frontends][%d] listFrontendsUnauthorized ", 401) + return fmt.Sprintf("[GET /frontends][%d] listFrontendsUnauthorized", 401) } func (o *ListFrontendsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -212,11 +215,11 @@ func (o *ListFrontendsInternalServerError) Code() int { } func (o *ListFrontendsInternalServerError) Error() string { - return fmt.Sprintf("[GET /frontends][%d] listFrontendsInternalServerError ", 500) + return fmt.Sprintf("[GET /frontends][%d] listFrontendsInternalServerError", 500) } func (o *ListFrontendsInternalServerError) String() string { - return fmt.Sprintf("[GET /frontends][%d] listFrontendsInternalServerError ", 500) + return fmt.Sprintf("[GET /frontends][%d] listFrontendsInternalServerError", 500) } func (o *ListFrontendsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/list_organization_members_responses.go b/rest_client_zrok/admin/list_organization_members_responses.go index dfc0a42c..f6bb8887 100644 --- a/rest_client_zrok/admin/list_organization_members_responses.go +++ b/rest_client_zrok/admin/list_organization_members_responses.go @@ -7,6 +7,7 @@ package admin import ( "context" + "encoding/json" "fmt" "io" "strconv" @@ -99,11 +100,13 @@ func (o *ListOrganizationMembersOK) Code() int { } func (o *ListOrganizationMembersOK) Error() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersOK %s", 200, payload) } func (o *ListOrganizationMembersOK) String() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersOK %s", 200, payload) } func (o *ListOrganizationMembersOK) GetPayload() *ListOrganizationMembersOKBody { @@ -166,11 +169,11 @@ func (o *ListOrganizationMembersUnauthorized) Code() int { } func (o *ListOrganizationMembersUnauthorized) Error() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersUnauthorized ", 401) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersUnauthorized", 401) } func (o *ListOrganizationMembersUnauthorized) String() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersUnauthorized ", 401) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersUnauthorized", 401) } func (o *ListOrganizationMembersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -222,11 +225,11 @@ func (o *ListOrganizationMembersNotFound) Code() int { } func (o *ListOrganizationMembersNotFound) Error() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersNotFound ", 404) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersNotFound", 404) } func (o *ListOrganizationMembersNotFound) String() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersNotFound ", 404) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersNotFound", 404) } func (o *ListOrganizationMembersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -278,11 +281,11 @@ func (o *ListOrganizationMembersInternalServerError) Code() int { } func (o *ListOrganizationMembersInternalServerError) Error() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersInternalServerError ", 500) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersInternalServerError", 500) } func (o *ListOrganizationMembersInternalServerError) String() string { - return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersInternalServerError ", 500) + return fmt.Sprintf("[POST /organization/list][%d] listOrganizationMembersInternalServerError", 500) } func (o *ListOrganizationMembersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/list_organizations_responses.go b/rest_client_zrok/admin/list_organizations_responses.go index 01055621..34cb742f 100644 --- a/rest_client_zrok/admin/list_organizations_responses.go +++ b/rest_client_zrok/admin/list_organizations_responses.go @@ -7,6 +7,7 @@ package admin import ( "context" + "encoding/json" "fmt" "io" "strconv" @@ -93,11 +94,13 @@ func (o *ListOrganizationsOK) Code() int { } func (o *ListOrganizationsOK) Error() string { - return fmt.Sprintf("[GET /organizations][%d] listOrganizationsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /organizations][%d] listOrganizationsOK %s", 200, payload) } func (o *ListOrganizationsOK) String() string { - return fmt.Sprintf("[GET /organizations][%d] listOrganizationsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /organizations][%d] listOrganizationsOK %s", 200, payload) } func (o *ListOrganizationsOK) GetPayload() *ListOrganizationsOKBody { @@ -160,11 +163,11 @@ func (o *ListOrganizationsUnauthorized) Code() int { } func (o *ListOrganizationsUnauthorized) Error() string { - return fmt.Sprintf("[GET /organizations][%d] listOrganizationsUnauthorized ", 401) + return fmt.Sprintf("[GET /organizations][%d] listOrganizationsUnauthorized", 401) } func (o *ListOrganizationsUnauthorized) String() string { - return fmt.Sprintf("[GET /organizations][%d] listOrganizationsUnauthorized ", 401) + return fmt.Sprintf("[GET /organizations][%d] listOrganizationsUnauthorized", 401) } func (o *ListOrganizationsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -216,11 +219,11 @@ func (o *ListOrganizationsInternalServerError) Code() int { } func (o *ListOrganizationsInternalServerError) Error() string { - return fmt.Sprintf("[GET /organizations][%d] listOrganizationsInternalServerError ", 500) + return fmt.Sprintf("[GET /organizations][%d] listOrganizationsInternalServerError", 500) } func (o *ListOrganizationsInternalServerError) String() string { - return fmt.Sprintf("[GET /organizations][%d] listOrganizationsInternalServerError ", 500) + return fmt.Sprintf("[GET /organizations][%d] listOrganizationsInternalServerError", 500) } func (o *ListOrganizationsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/remove_organization_member_responses.go b/rest_client_zrok/admin/remove_organization_member_responses.go index 115b20b8..46c269fd 100644 --- a/rest_client_zrok/admin/remove_organization_member_responses.go +++ b/rest_client_zrok/admin/remove_organization_member_responses.go @@ -95,11 +95,11 @@ func (o *RemoveOrganizationMemberOK) Code() int { } func (o *RemoveOrganizationMemberOK) Error() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberOK ", 200) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberOK", 200) } func (o *RemoveOrganizationMemberOK) String() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberOK ", 200) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberOK", 200) } func (o *RemoveOrganizationMemberOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *RemoveOrganizationMemberUnauthorized) Code() int { } func (o *RemoveOrganizationMemberUnauthorized) Error() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberUnauthorized ", 401) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberUnauthorized", 401) } func (o *RemoveOrganizationMemberUnauthorized) String() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberUnauthorized ", 401) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberUnauthorized", 401) } func (o *RemoveOrganizationMemberUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *RemoveOrganizationMemberNotFound) Code() int { } func (o *RemoveOrganizationMemberNotFound) Error() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberNotFound ", 404) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberNotFound", 404) } func (o *RemoveOrganizationMemberNotFound) String() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberNotFound ", 404) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberNotFound", 404) } func (o *RemoveOrganizationMemberNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *RemoveOrganizationMemberInternalServerError) Code() int { } func (o *RemoveOrganizationMemberInternalServerError) Error() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberInternalServerError ", 500) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberInternalServerError", 500) } func (o *RemoveOrganizationMemberInternalServerError) String() string { - return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberInternalServerError ", 500) + return fmt.Sprintf("[POST /organization/remove][%d] removeOrganizationMemberInternalServerError", 500) } func (o *RemoveOrganizationMemberInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/admin/update_frontend_responses.go b/rest_client_zrok/admin/update_frontend_responses.go index 943e37b8..466ba857 100644 --- a/rest_client_zrok/admin/update_frontend_responses.go +++ b/rest_client_zrok/admin/update_frontend_responses.go @@ -95,11 +95,11 @@ func (o *UpdateFrontendOK) Code() int { } func (o *UpdateFrontendOK) Error() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendOK ", 200) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendOK", 200) } func (o *UpdateFrontendOK) String() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendOK ", 200) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendOK", 200) } func (o *UpdateFrontendOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *UpdateFrontendUnauthorized) Code() int { } func (o *UpdateFrontendUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendUnauthorized ", 401) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendUnauthorized", 401) } func (o *UpdateFrontendUnauthorized) String() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendUnauthorized ", 401) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendUnauthorized", 401) } func (o *UpdateFrontendUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *UpdateFrontendNotFound) Code() int { } func (o *UpdateFrontendNotFound) Error() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendNotFound ", 404) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendNotFound", 404) } func (o *UpdateFrontendNotFound) String() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendNotFound ", 404) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendNotFound", 404) } func (o *UpdateFrontendNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *UpdateFrontendInternalServerError) Code() int { } func (o *UpdateFrontendInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendInternalServerError ", 500) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendInternalServerError", 500) } func (o *UpdateFrontendInternalServerError) String() string { - return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendInternalServerError ", 500) + return fmt.Sprintf("[PATCH /frontend][%d] updateFrontendInternalServerError", 500) } func (o *UpdateFrontendInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/agent/agent_client.go b/rest_client_zrok/agent/agent_client.go new file mode 100644 index 00000000..bc39092b --- /dev/null +++ b/rest_client_zrok/agent/agent_client.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// New creates a new agent API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +// New creates a new agent API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new agent API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + +/* +Client for agent API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption may be used to customize the behavior of Client methods. +type ClientOption func(*runtime.ClientOperation) + +// This client is generated with a few options you might find useful for your swagger spec. +// +// Feel free to add you own set of options. + +// WithContentType allows the client to force the Content-Type header +// to negotiate a specific Consumer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithContentType(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{mime} + } +} + +// WithContentTypeApplicationJSON sets the Content-Type header to "application/json". +func WithContentTypeApplicationJSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/json"} +} + +// WithContentTypeApplicationZrokV1JSON sets the Content-Type header to "application/zrok.v1+json". +func WithContentTypeApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/zrok.v1+json"} +} + +// WithAccept allows the client to force the Accept header +// to negotiate a specific Producer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithAccept(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{mime} + } +} + +// WithAcceptApplicationJSON sets the Accept header to "application/json". +func WithAcceptApplicationJSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/json"} +} + +// WithAcceptApplicationZrokV1JSON sets the Accept header to "application/zrok.v1+json". +func WithAcceptApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/zrok.v1+json"} +} + +// ClientService is the interface for Client methods +type ClientService interface { + AgentStatus(params *AgentStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AgentStatusOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +AgentStatus agent status API +*/ +func (a *Client) AgentStatus(params *AgentStatusParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AgentStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAgentStatusParams() + } + op := &runtime.ClientOperation{ + ID: "agentStatus", + Method: "POST", + PathPattern: "/agent/status", + ProducesMediaTypes: []string{"application/zrok.v1+json"}, + ConsumesMediaTypes: []string{"application/zrok.v1+json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &AgentStatusReader{formats: a.formats}, + AuthInfo: authInfo, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AgentStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for agentStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/rest_client_zrok/agent/agent_status_parameters.go b/rest_client_zrok/agent/agent_status_parameters.go new file mode 100644 index 00000000..4debdd2c --- /dev/null +++ b/rest_client_zrok/agent/agent_status_parameters.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// 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" +) + +// NewAgentStatusParams creates a new AgentStatusParams 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 NewAgentStatusParams() *AgentStatusParams { + return &AgentStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAgentStatusParamsWithTimeout creates a new AgentStatusParams object +// with the ability to set a timeout on a request. +func NewAgentStatusParamsWithTimeout(timeout time.Duration) *AgentStatusParams { + return &AgentStatusParams{ + timeout: timeout, + } +} + +// NewAgentStatusParamsWithContext creates a new AgentStatusParams object +// with the ability to set a context for a request. +func NewAgentStatusParamsWithContext(ctx context.Context) *AgentStatusParams { + return &AgentStatusParams{ + Context: ctx, + } +} + +// NewAgentStatusParamsWithHTTPClient creates a new AgentStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewAgentStatusParamsWithHTTPClient(client *http.Client) *AgentStatusParams { + return &AgentStatusParams{ + HTTPClient: client, + } +} + +/* +AgentStatusParams contains all the parameters to send to the API endpoint + + for the agent status operation. + + Typically these are written to a http.Request. +*/ +type AgentStatusParams struct { + + // Body. + Body AgentStatusBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the agent status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AgentStatusParams) WithDefaults() *AgentStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the agent status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AgentStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the agent status params +func (o *AgentStatusParams) WithTimeout(timeout time.Duration) *AgentStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the agent status params +func (o *AgentStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the agent status params +func (o *AgentStatusParams) WithContext(ctx context.Context) *AgentStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the agent status params +func (o *AgentStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the agent status params +func (o *AgentStatusParams) WithHTTPClient(client *http.Client) *AgentStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the agent status params +func (o *AgentStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the agent status params +func (o *AgentStatusParams) WithBody(body AgentStatusBody) *AgentStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the agent status params +func (o *AgentStatusParams) SetBody(body AgentStatusBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AgentStatusParams) 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 +} diff --git a/rest_client_zrok/agent/agent_status_responses.go b/rest_client_zrok/agent/agent_status_responses.go new file mode 100644 index 00000000..835c4cc3 --- /dev/null +++ b/rest_client_zrok/agent/agent_status_responses.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// 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" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/openziti/zrok/rest_model_zrok" +) + +// AgentStatusReader is a Reader for the AgentStatus structure. +type AgentStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AgentStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAgentStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewAgentStatusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewAgentStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /agent/status] agentStatus", response, response.Code()) + } +} + +// NewAgentStatusOK creates a AgentStatusOK with default headers values +func NewAgentStatusOK() *AgentStatusOK { + return &AgentStatusOK{} +} + +/* +AgentStatusOK describes a response with status code 200, with default header values. + +ok +*/ +type AgentStatusOK struct { + Payload *AgentStatusOKBody +} + +// IsSuccess returns true when this agent status o k response has a 2xx status code +func (o *AgentStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this agent status o k response has a 3xx status code +func (o *AgentStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this agent status o k response has a 4xx status code +func (o *AgentStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this agent status o k response has a 5xx status code +func (o *AgentStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this agent status o k response a status code equal to that given +func (o *AgentStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the agent status o k response +func (o *AgentStatusOK) Code() int { + return 200 +} + +func (o *AgentStatusOK) Error() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /agent/status][%d] agentStatusOK %s", 200, payload) +} + +func (o *AgentStatusOK) String() string { + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /agent/status][%d] agentStatusOK %s", 200, payload) +} + +func (o *AgentStatusOK) GetPayload() *AgentStatusOKBody { + return o.Payload +} + +func (o *AgentStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(AgentStatusOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAgentStatusUnauthorized creates a AgentStatusUnauthorized with default headers values +func NewAgentStatusUnauthorized() *AgentStatusUnauthorized { + return &AgentStatusUnauthorized{} +} + +/* +AgentStatusUnauthorized describes a response with status code 401, with default header values. + +unauthorized +*/ +type AgentStatusUnauthorized struct { +} + +// IsSuccess returns true when this agent status unauthorized response has a 2xx status code +func (o *AgentStatusUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this agent status unauthorized response has a 3xx status code +func (o *AgentStatusUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this agent status unauthorized response has a 4xx status code +func (o *AgentStatusUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this agent status unauthorized response has a 5xx status code +func (o *AgentStatusUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this agent status unauthorized response a status code equal to that given +func (o *AgentStatusUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the agent status unauthorized response +func (o *AgentStatusUnauthorized) Code() int { + return 401 +} + +func (o *AgentStatusUnauthorized) Error() string { + return fmt.Sprintf("[POST /agent/status][%d] agentStatusUnauthorized", 401) +} + +func (o *AgentStatusUnauthorized) String() string { + return fmt.Sprintf("[POST /agent/status][%d] agentStatusUnauthorized", 401) +} + +func (o *AgentStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewAgentStatusInternalServerError creates a AgentStatusInternalServerError with default headers values +func NewAgentStatusInternalServerError() *AgentStatusInternalServerError { + return &AgentStatusInternalServerError{} +} + +/* +AgentStatusInternalServerError describes a response with status code 500, with default header values. + +internal server error +*/ +type AgentStatusInternalServerError struct { +} + +// IsSuccess returns true when this agent status internal server error response has a 2xx status code +func (o *AgentStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this agent status internal server error response has a 3xx status code +func (o *AgentStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this agent status internal server error response has a 4xx status code +func (o *AgentStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this agent status internal server error response has a 5xx status code +func (o *AgentStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this agent status internal server error response a status code equal to that given +func (o *AgentStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the agent status internal server error response +func (o *AgentStatusInternalServerError) Code() int { + return 500 +} + +func (o *AgentStatusInternalServerError) Error() string { + return fmt.Sprintf("[POST /agent/status][%d] agentStatusInternalServerError", 500) +} + +func (o *AgentStatusInternalServerError) String() string { + return fmt.Sprintf("[POST /agent/status][%d] agentStatusInternalServerError", 500) +} + +func (o *AgentStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +/* +AgentStatusBody agent status body +swagger:model AgentStatusBody +*/ +type AgentStatusBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` +} + +// Validate validates this agent status body +func (o *AgentStatusBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this agent status body based on context it is used +func (o *AgentStatusBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AgentStatusBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AgentStatusBody) UnmarshalBinary(b []byte) error { + var res AgentStatusBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AgentStatusOKBody agent status o k body +swagger:model AgentStatusOKBody +*/ +type AgentStatusOKBody struct { + + // shares + Shares []*rest_model_zrok.Share `json:"shares"` +} + +// Validate validates this agent status o k body +func (o *AgentStatusOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateShares(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AgentStatusOKBody) validateShares(formats strfmt.Registry) error { + if swag.IsZero(o.Shares) { // not required + return nil + } + + for i := 0; i < len(o.Shares); i++ { + if swag.IsZero(o.Shares[i]) { // not required + continue + } + + if o.Shares[i] != nil { + if err := o.Shares[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this agent status o k body based on the context it is used +func (o *AgentStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateShares(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AgentStatusOKBody) contextValidateShares(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Shares); i++ { + + if o.Shares[i] != nil { + + if swag.IsZero(o.Shares[i]) { // not required + return nil + } + + if err := o.Shares[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AgentStatusOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AgentStatusOKBody) UnmarshalBinary(b []byte) error { + var res AgentStatusOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_client_zrok/environment/disable_responses.go b/rest_client_zrok/environment/disable_responses.go index e31ae99c..e7c251e2 100644 --- a/rest_client_zrok/environment/disable_responses.go +++ b/rest_client_zrok/environment/disable_responses.go @@ -89,11 +89,11 @@ func (o *DisableOK) Code() int { } func (o *DisableOK) Error() string { - return fmt.Sprintf("[POST /disable][%d] disableOK ", 200) + return fmt.Sprintf("[POST /disable][%d] disableOK", 200) } func (o *DisableOK) String() string { - return fmt.Sprintf("[POST /disable][%d] disableOK ", 200) + return fmt.Sprintf("[POST /disable][%d] disableOK", 200) } func (o *DisableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -145,11 +145,11 @@ func (o *DisableUnauthorized) Code() int { } func (o *DisableUnauthorized) Error() string { - return fmt.Sprintf("[POST /disable][%d] disableUnauthorized ", 401) + return fmt.Sprintf("[POST /disable][%d] disableUnauthorized", 401) } func (o *DisableUnauthorized) String() string { - return fmt.Sprintf("[POST /disable][%d] disableUnauthorized ", 401) + return fmt.Sprintf("[POST /disable][%d] disableUnauthorized", 401) } func (o *DisableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -201,11 +201,11 @@ func (o *DisableInternalServerError) Code() int { } func (o *DisableInternalServerError) Error() string { - return fmt.Sprintf("[POST /disable][%d] disableInternalServerError ", 500) + return fmt.Sprintf("[POST /disable][%d] disableInternalServerError", 500) } func (o *DisableInternalServerError) String() string { - return fmt.Sprintf("[POST /disable][%d] disableInternalServerError ", 500) + return fmt.Sprintf("[POST /disable][%d] disableInternalServerError", 500) } func (o *DisableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/environment/enable_responses.go b/rest_client_zrok/environment/enable_responses.go index e846e122..08cf9569 100644 --- a/rest_client_zrok/environment/enable_responses.go +++ b/rest_client_zrok/environment/enable_responses.go @@ -7,6 +7,7 @@ package environment import ( "context" + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *EnableCreated) Code() int { } func (o *EnableCreated) Error() string { - return fmt.Sprintf("[POST /enable][%d] enableCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /enable][%d] enableCreated %s", 201, payload) } func (o *EnableCreated) String() string { - return fmt.Sprintf("[POST /enable][%d] enableCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /enable][%d] enableCreated %s", 201, payload) } func (o *EnableCreated) GetPayload() *EnableCreatedBody { @@ -164,11 +167,11 @@ func (o *EnableUnauthorized) Code() int { } func (o *EnableUnauthorized) Error() string { - return fmt.Sprintf("[POST /enable][%d] enableUnauthorized ", 401) + return fmt.Sprintf("[POST /enable][%d] enableUnauthorized", 401) } func (o *EnableUnauthorized) String() string { - return fmt.Sprintf("[POST /enable][%d] enableUnauthorized ", 401) + return fmt.Sprintf("[POST /enable][%d] enableUnauthorized", 401) } func (o *EnableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *EnableNotFound) Code() int { } func (o *EnableNotFound) Error() string { - return fmt.Sprintf("[POST /enable][%d] enableNotFound ", 404) + return fmt.Sprintf("[POST /enable][%d] enableNotFound", 404) } func (o *EnableNotFound) String() string { - return fmt.Sprintf("[POST /enable][%d] enableNotFound ", 404) + return fmt.Sprintf("[POST /enable][%d] enableNotFound", 404) } func (o *EnableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *EnableInternalServerError) Code() int { } func (o *EnableInternalServerError) Error() string { - return fmt.Sprintf("[POST /enable][%d] enableInternalServerError ", 500) + return fmt.Sprintf("[POST /enable][%d] enableInternalServerError", 500) } func (o *EnableInternalServerError) String() string { - return fmt.Sprintf("[POST /enable][%d] enableInternalServerError ", 500) + return fmt.Sprintf("[POST /enable][%d] enableInternalServerError", 500) } func (o *EnableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/environment/environment_client.go b/rest_client_zrok/environment/environment_client.go index f8463b6e..20db54be 100644 --- a/rest_client_zrok/environment/environment_client.go +++ b/rest_client_zrok/environment/environment_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi return &Client{transport: transport, formats: formats} } +// New creates a new environment API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new environment API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + /* Client for environment API */ @@ -25,9 +51,53 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) +// This client is generated with a few options you might find useful for your swagger spec. +// +// Feel free to add you own set of options. + +// WithContentType allows the client to force the Content-Type header +// to negotiate a specific Consumer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithContentType(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{mime} + } +} + +// WithContentTypeApplicationJSON sets the Content-Type header to "application/json". +func WithContentTypeApplicationJSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/json"} +} + +// WithContentTypeApplicationZrokV1JSON sets the Content-Type header to "application/zrok.v1+json". +func WithContentTypeApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/zrok.v1+json"} +} + +// WithAccept allows the client to force the Accept header +// to negotiate a specific Producer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithAccept(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{mime} + } +} + +// WithAcceptApplicationJSON sets the Accept header to "application/json". +func WithAcceptApplicationJSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/json"} +} + +// WithAcceptApplicationZrokV1JSON sets the Accept header to "application/zrok.v1+json". +func WithAcceptApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/zrok.v1+json"} +} + // ClientService is the interface for Client methods type ClientService interface { Disable(params *DisableParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*DisableOK, error) diff --git a/rest_client_zrok/metadata/client_version_check_responses.go b/rest_client_zrok/metadata/client_version_check_responses.go index d179f9e5..94d4e41c 100644 --- a/rest_client_zrok/metadata/client_version_check_responses.go +++ b/rest_client_zrok/metadata/client_version_check_responses.go @@ -7,6 +7,7 @@ package metadata import ( "context" + "encoding/json" "fmt" "io" @@ -84,11 +85,11 @@ func (o *ClientVersionCheckOK) Code() int { } func (o *ClientVersionCheckOK) Error() string { - return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckOK ", 200) + return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckOK", 200) } func (o *ClientVersionCheckOK) String() string { - return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckOK ", 200) + return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckOK", 200) } func (o *ClientVersionCheckOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -141,11 +142,13 @@ func (o *ClientVersionCheckBadRequest) Code() int { } func (o *ClientVersionCheckBadRequest) Error() string { - return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckBadRequest %s", 400, payload) } func (o *ClientVersionCheckBadRequest) String() string { - return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckBadRequest %+v", 400, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /clientVersionCheck][%d] clientVersionCheckBadRequest %s", 400, payload) } func (o *ClientVersionCheckBadRequest) GetPayload() string { diff --git a/rest_client_zrok/metadata/configuration_responses.go b/rest_client_zrok/metadata/configuration_responses.go index 792cd003..aad3cff1 100644 --- a/rest_client_zrok/metadata/configuration_responses.go +++ b/rest_client_zrok/metadata/configuration_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -79,11 +80,13 @@ func (o *ConfigurationOK) Code() int { } func (o *ConfigurationOK) Error() string { - return fmt.Sprintf("[GET /configuration][%d] configurationOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /configuration][%d] configurationOK %s", 200, payload) } func (o *ConfigurationOK) String() string { - return fmt.Sprintf("[GET /configuration][%d] configurationOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /configuration][%d] configurationOK %s", 200, payload) } func (o *ConfigurationOK) GetPayload() *rest_model_zrok.Configuration { diff --git a/rest_client_zrok/metadata/get_account_detail_responses.go b/rest_client_zrok/metadata/get_account_detail_responses.go index 119c3335..ac9253f7 100644 --- a/rest_client_zrok/metadata/get_account_detail_responses.go +++ b/rest_client_zrok/metadata/get_account_detail_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -85,11 +86,13 @@ func (o *GetAccountDetailOK) Code() int { } func (o *GetAccountDetailOK) Error() string { - return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailOK %s", 200, payload) } func (o *GetAccountDetailOK) String() string { - return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailOK %s", 200, payload) } func (o *GetAccountDetailOK) GetPayload() rest_model_zrok.Environments { @@ -150,11 +153,11 @@ func (o *GetAccountDetailInternalServerError) Code() int { } func (o *GetAccountDetailInternalServerError) Error() string { - return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailInternalServerError", 500) } func (o *GetAccountDetailInternalServerError) String() string { - return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/account][%d] getAccountDetailInternalServerError", 500) } func (o *GetAccountDetailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_account_metrics_responses.go b/rest_client_zrok/metadata/get_account_metrics_responses.go index 6cc34746..fee26dc0 100644 --- a/rest_client_zrok/metadata/get_account_metrics_responses.go +++ b/rest_client_zrok/metadata/get_account_metrics_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *GetAccountMetricsOK) Code() int { } func (o *GetAccountMetricsOK) Error() string { - return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsOK %s", 200, payload) } func (o *GetAccountMetricsOK) String() string { - return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsOK %s", 200, payload) } func (o *GetAccountMetricsOK) GetPayload() *rest_model_zrok.Metrics { @@ -158,11 +161,11 @@ func (o *GetAccountMetricsBadRequest) Code() int { } func (o *GetAccountMetricsBadRequest) Error() string { - return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsBadRequest ", 400) + return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsBadRequest", 400) } func (o *GetAccountMetricsBadRequest) String() string { - return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsBadRequest ", 400) + return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsBadRequest", 400) } func (o *GetAccountMetricsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *GetAccountMetricsInternalServerError) Code() int { } func (o *GetAccountMetricsInternalServerError) Error() string { - return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsInternalServerError ", 500) + return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsInternalServerError", 500) } func (o *GetAccountMetricsInternalServerError) String() string { - return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsInternalServerError ", 500) + return fmt.Sprintf("[GET /metrics/account][%d] getAccountMetricsInternalServerError", 500) } func (o *GetAccountMetricsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_environment_detail_responses.go b/rest_client_zrok/metadata/get_environment_detail_responses.go index 7247746c..536f30bc 100644 --- a/rest_client_zrok/metadata/get_environment_detail_responses.go +++ b/rest_client_zrok/metadata/get_environment_detail_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *GetEnvironmentDetailOK) Code() int { } func (o *GetEnvironmentDetailOK) Error() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailOK %s", 200, payload) } func (o *GetEnvironmentDetailOK) String() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailOK %s", 200, payload) } func (o *GetEnvironmentDetailOK) GetPayload() *rest_model_zrok.EnvironmentAndResources { @@ -164,11 +167,11 @@ func (o *GetEnvironmentDetailUnauthorized) Code() int { } func (o *GetEnvironmentDetailUnauthorized) Error() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailUnauthorized ", 401) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailUnauthorized", 401) } func (o *GetEnvironmentDetailUnauthorized) String() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailUnauthorized ", 401) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailUnauthorized", 401) } func (o *GetEnvironmentDetailUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *GetEnvironmentDetailNotFound) Code() int { } func (o *GetEnvironmentDetailNotFound) Error() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailNotFound ", 404) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailNotFound", 404) } func (o *GetEnvironmentDetailNotFound) String() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailNotFound ", 404) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailNotFound", 404) } func (o *GetEnvironmentDetailNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *GetEnvironmentDetailInternalServerError) Code() int { } func (o *GetEnvironmentDetailInternalServerError) Error() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailInternalServerError", 500) } func (o *GetEnvironmentDetailInternalServerError) String() string { - return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/environment/{envZId}][%d] getEnvironmentDetailInternalServerError", 500) } func (o *GetEnvironmentDetailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_environment_metrics_responses.go b/rest_client_zrok/metadata/get_environment_metrics_responses.go index 0e331725..6e9e5a9f 100644 --- a/rest_client_zrok/metadata/get_environment_metrics_responses.go +++ b/rest_client_zrok/metadata/get_environment_metrics_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *GetEnvironmentMetricsOK) Code() int { } func (o *GetEnvironmentMetricsOK) Error() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsOK %s", 200, payload) } func (o *GetEnvironmentMetricsOK) String() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsOK %s", 200, payload) } func (o *GetEnvironmentMetricsOK) GetPayload() *rest_model_zrok.Metrics { @@ -164,11 +167,11 @@ func (o *GetEnvironmentMetricsBadRequest) Code() int { } func (o *GetEnvironmentMetricsBadRequest) Error() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsBadRequest ", 400) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsBadRequest", 400) } func (o *GetEnvironmentMetricsBadRequest) String() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsBadRequest ", 400) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsBadRequest", 400) } func (o *GetEnvironmentMetricsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *GetEnvironmentMetricsUnauthorized) Code() int { } func (o *GetEnvironmentMetricsUnauthorized) Error() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsUnauthorized ", 401) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsUnauthorized", 401) } func (o *GetEnvironmentMetricsUnauthorized) String() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsUnauthorized ", 401) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsUnauthorized", 401) } func (o *GetEnvironmentMetricsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *GetEnvironmentMetricsInternalServerError) Code() int { } func (o *GetEnvironmentMetricsInternalServerError) Error() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsInternalServerError ", 500) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsInternalServerError", 500) } func (o *GetEnvironmentMetricsInternalServerError) String() string { - return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsInternalServerError ", 500) + return fmt.Sprintf("[GET /metrics/environment/{envId}][%d] getEnvironmentMetricsInternalServerError", 500) } func (o *GetEnvironmentMetricsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_frontend_detail_responses.go b/rest_client_zrok/metadata/get_frontend_detail_responses.go index 70d44977..d4a8df4a 100644 --- a/rest_client_zrok/metadata/get_frontend_detail_responses.go +++ b/rest_client_zrok/metadata/get_frontend_detail_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *GetFrontendDetailOK) Code() int { } func (o *GetFrontendDetailOK) Error() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailOK %s", 200, payload) } func (o *GetFrontendDetailOK) String() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailOK %s", 200, payload) } func (o *GetFrontendDetailOK) GetPayload() *rest_model_zrok.Frontend { @@ -164,11 +167,11 @@ func (o *GetFrontendDetailUnauthorized) Code() int { } func (o *GetFrontendDetailUnauthorized) Error() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailUnauthorized ", 401) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailUnauthorized", 401) } func (o *GetFrontendDetailUnauthorized) String() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailUnauthorized ", 401) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailUnauthorized", 401) } func (o *GetFrontendDetailUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *GetFrontendDetailNotFound) Code() int { } func (o *GetFrontendDetailNotFound) Error() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailNotFound ", 404) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailNotFound", 404) } func (o *GetFrontendDetailNotFound) String() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailNotFound ", 404) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailNotFound", 404) } func (o *GetFrontendDetailNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *GetFrontendDetailInternalServerError) Code() int { } func (o *GetFrontendDetailInternalServerError) Error() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailInternalServerError", 500) } func (o *GetFrontendDetailInternalServerError) String() string { - return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/frontend/{frontendId}][%d] getFrontendDetailInternalServerError", 500) } func (o *GetFrontendDetailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_share_detail_responses.go b/rest_client_zrok/metadata/get_share_detail_responses.go index f319df42..04aab98f 100644 --- a/rest_client_zrok/metadata/get_share_detail_responses.go +++ b/rest_client_zrok/metadata/get_share_detail_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *GetShareDetailOK) Code() int { } func (o *GetShareDetailOK) Error() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailOK %s", 200, payload) } func (o *GetShareDetailOK) String() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailOK %s", 200, payload) } func (o *GetShareDetailOK) GetPayload() *rest_model_zrok.Share { @@ -164,11 +167,11 @@ func (o *GetShareDetailUnauthorized) Code() int { } func (o *GetShareDetailUnauthorized) Error() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailUnauthorized ", 401) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailUnauthorized", 401) } func (o *GetShareDetailUnauthorized) String() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailUnauthorized ", 401) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailUnauthorized", 401) } func (o *GetShareDetailUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *GetShareDetailNotFound) Code() int { } func (o *GetShareDetailNotFound) Error() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailNotFound ", 404) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailNotFound", 404) } func (o *GetShareDetailNotFound) String() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailNotFound ", 404) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailNotFound", 404) } func (o *GetShareDetailNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *GetShareDetailInternalServerError) Code() int { } func (o *GetShareDetailInternalServerError) Error() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailInternalServerError", 500) } func (o *GetShareDetailInternalServerError) String() string { - return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailInternalServerError ", 500) + return fmt.Sprintf("[GET /detail/share/{shareToken}][%d] getShareDetailInternalServerError", 500) } func (o *GetShareDetailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_share_metrics_responses.go b/rest_client_zrok/metadata/get_share_metrics_responses.go index 242760ef..9b14fbe0 100644 --- a/rest_client_zrok/metadata/get_share_metrics_responses.go +++ b/rest_client_zrok/metadata/get_share_metrics_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *GetShareMetricsOK) Code() int { } func (o *GetShareMetricsOK) Error() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsOK %s", 200, payload) } func (o *GetShareMetricsOK) String() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsOK %s", 200, payload) } func (o *GetShareMetricsOK) GetPayload() *rest_model_zrok.Metrics { @@ -164,11 +167,11 @@ func (o *GetShareMetricsBadRequest) Code() int { } func (o *GetShareMetricsBadRequest) Error() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsBadRequest ", 400) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsBadRequest", 400) } func (o *GetShareMetricsBadRequest) String() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsBadRequest ", 400) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsBadRequest", 400) } func (o *GetShareMetricsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *GetShareMetricsUnauthorized) Code() int { } func (o *GetShareMetricsUnauthorized) Error() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsUnauthorized ", 401) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsUnauthorized", 401) } func (o *GetShareMetricsUnauthorized) String() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsUnauthorized ", 401) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsUnauthorized", 401) } func (o *GetShareMetricsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *GetShareMetricsInternalServerError) Code() int { } func (o *GetShareMetricsInternalServerError) Error() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsInternalServerError ", 500) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsInternalServerError", 500) } func (o *GetShareMetricsInternalServerError) String() string { - return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsInternalServerError ", 500) + return fmt.Sprintf("[GET /metrics/share/{shareToken}][%d] getShareMetricsInternalServerError", 500) } func (o *GetShareMetricsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/get_sparklines_responses.go b/rest_client_zrok/metadata/get_sparklines_responses.go index 65747107..00baa63e 100644 --- a/rest_client_zrok/metadata/get_sparklines_responses.go +++ b/rest_client_zrok/metadata/get_sparklines_responses.go @@ -7,6 +7,7 @@ package metadata import ( "context" + "encoding/json" "fmt" "io" "strconv" @@ -95,11 +96,13 @@ func (o *GetSparklinesOK) Code() int { } func (o *GetSparklinesOK) Error() string { - return fmt.Sprintf("[POST /sparklines][%d] getSparklinesOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /sparklines][%d] getSparklinesOK %s", 200, payload) } func (o *GetSparklinesOK) String() string { - return fmt.Sprintf("[POST /sparklines][%d] getSparklinesOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /sparklines][%d] getSparklinesOK %s", 200, payload) } func (o *GetSparklinesOK) GetPayload() *GetSparklinesOKBody { @@ -162,11 +165,11 @@ func (o *GetSparklinesUnauthorized) Code() int { } func (o *GetSparklinesUnauthorized) Error() string { - return fmt.Sprintf("[POST /sparklines][%d] getSparklinesUnauthorized ", 401) + return fmt.Sprintf("[POST /sparklines][%d] getSparklinesUnauthorized", 401) } func (o *GetSparklinesUnauthorized) String() string { - return fmt.Sprintf("[POST /sparklines][%d] getSparklinesUnauthorized ", 401) + return fmt.Sprintf("[POST /sparklines][%d] getSparklinesUnauthorized", 401) } func (o *GetSparklinesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -218,11 +221,11 @@ func (o *GetSparklinesInternalServerError) Code() int { } func (o *GetSparklinesInternalServerError) Error() string { - return fmt.Sprintf("[POST /sparklines][%d] getSparklinesInternalServerError ", 500) + return fmt.Sprintf("[POST /sparklines][%d] getSparklinesInternalServerError", 500) } func (o *GetSparklinesInternalServerError) String() string { - return fmt.Sprintf("[POST /sparklines][%d] getSparklinesInternalServerError ", 500) + return fmt.Sprintf("[POST /sparklines][%d] getSparklinesInternalServerError", 500) } func (o *GetSparklinesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/list_memberships_responses.go b/rest_client_zrok/metadata/list_memberships_responses.go index 2ea41233..1dbf9624 100644 --- a/rest_client_zrok/metadata/list_memberships_responses.go +++ b/rest_client_zrok/metadata/list_memberships_responses.go @@ -7,6 +7,7 @@ package metadata import ( "context" + "encoding/json" "fmt" "io" "strconv" @@ -87,11 +88,13 @@ func (o *ListMembershipsOK) Code() int { } func (o *ListMembershipsOK) Error() string { - return fmt.Sprintf("[GET /memberships][%d] listMembershipsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /memberships][%d] listMembershipsOK %s", 200, payload) } func (o *ListMembershipsOK) String() string { - return fmt.Sprintf("[GET /memberships][%d] listMembershipsOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /memberships][%d] listMembershipsOK %s", 200, payload) } func (o *ListMembershipsOK) GetPayload() *ListMembershipsOKBody { @@ -154,11 +157,11 @@ func (o *ListMembershipsInternalServerError) Code() int { } func (o *ListMembershipsInternalServerError) Error() string { - return fmt.Sprintf("[GET /memberships][%d] listMembershipsInternalServerError ", 500) + return fmt.Sprintf("[GET /memberships][%d] listMembershipsInternalServerError", 500) } func (o *ListMembershipsInternalServerError) String() string { - return fmt.Sprintf("[GET /memberships][%d] listMembershipsInternalServerError ", 500) + return fmt.Sprintf("[GET /memberships][%d] listMembershipsInternalServerError", 500) } func (o *ListMembershipsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/list_org_members_responses.go b/rest_client_zrok/metadata/list_org_members_responses.go index 138ef025..7a28a4d8 100644 --- a/rest_client_zrok/metadata/list_org_members_responses.go +++ b/rest_client_zrok/metadata/list_org_members_responses.go @@ -7,6 +7,7 @@ package metadata import ( "context" + "encoding/json" "fmt" "io" "strconv" @@ -93,11 +94,13 @@ func (o *ListOrgMembersOK) Code() int { } func (o *ListOrgMembersOK) Error() string { - return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersOK %s", 200, payload) } func (o *ListOrgMembersOK) String() string { - return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersOK %s", 200, payload) } func (o *ListOrgMembersOK) GetPayload() *ListOrgMembersOKBody { @@ -160,11 +163,11 @@ func (o *ListOrgMembersNotFound) Code() int { } func (o *ListOrgMembersNotFound) Error() string { - return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersNotFound ", 404) + return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersNotFound", 404) } func (o *ListOrgMembersNotFound) String() string { - return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersNotFound ", 404) + return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersNotFound", 404) } func (o *ListOrgMembersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -216,11 +219,11 @@ func (o *ListOrgMembersInternalServerError) Code() int { } func (o *ListOrgMembersInternalServerError) Error() string { - return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersInternalServerError ", 500) + return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersInternalServerError", 500) } func (o *ListOrgMembersInternalServerError) String() string { - return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersInternalServerError ", 500) + return fmt.Sprintf("[GET /members/{organizationToken}][%d] listOrgMembersInternalServerError", 500) } func (o *ListOrgMembersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/metadata_client.go b/rest_client_zrok/metadata/metadata_client.go index 4682edbb..2871fe05 100644 --- a/rest_client_zrok/metadata/metadata_client.go +++ b/rest_client_zrok/metadata/metadata_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi return &Client{transport: transport, formats: formats} } +// New creates a new metadata API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new metadata API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + /* Client for metadata API */ @@ -25,9 +51,53 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) +// This client is generated with a few options you might find useful for your swagger spec. +// +// Feel free to add you own set of options. + +// WithContentType allows the client to force the Content-Type header +// to negotiate a specific Consumer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithContentType(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{mime} + } +} + +// WithContentTypeApplicationJSON sets the Content-Type header to "application/json". +func WithContentTypeApplicationJSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/json"} +} + +// WithContentTypeApplicationZrokV1JSON sets the Content-Type header to "application/zrok.v1+json". +func WithContentTypeApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/zrok.v1+json"} +} + +// WithAccept allows the client to force the Accept header +// to negotiate a specific Producer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithAccept(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{mime} + } +} + +// WithAcceptApplicationJSON sets the Accept header to "application/json". +func WithAcceptApplicationJSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/json"} +} + +// WithAcceptApplicationZrokV1JSON sets the Accept header to "application/zrok.v1+json". +func WithAcceptApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/zrok.v1+json"} +} + // ClientService is the interface for Client methods type ClientService interface { ClientVersionCheck(params *ClientVersionCheckParams, opts ...ClientOption) (*ClientVersionCheckOK, error) diff --git a/rest_client_zrok/metadata/org_account_overview_responses.go b/rest_client_zrok/metadata/org_account_overview_responses.go index 11f69a0e..6fa4ba93 100644 --- a/rest_client_zrok/metadata/org_account_overview_responses.go +++ b/rest_client_zrok/metadata/org_account_overview_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -91,11 +92,13 @@ func (o *OrgAccountOverviewOK) Code() int { } func (o *OrgAccountOverviewOK) Error() string { - return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewOK %s", 200, payload) } func (o *OrgAccountOverviewOK) String() string { - return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewOK %s", 200, payload) } func (o *OrgAccountOverviewOK) GetPayload() *rest_model_zrok.Overview { @@ -158,11 +161,11 @@ func (o *OrgAccountOverviewNotFound) Code() int { } func (o *OrgAccountOverviewNotFound) Error() string { - return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewNotFound ", 404) + return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewNotFound", 404) } func (o *OrgAccountOverviewNotFound) String() string { - return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewNotFound ", 404) + return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewNotFound", 404) } func (o *OrgAccountOverviewNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -214,11 +217,11 @@ func (o *OrgAccountOverviewInternalServerError) Code() int { } func (o *OrgAccountOverviewInternalServerError) Error() string { - return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewInternalServerError ", 500) + return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewInternalServerError", 500) } func (o *OrgAccountOverviewInternalServerError) String() string { - return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewInternalServerError ", 500) + return fmt.Sprintf("[GET /overview/{organizationToken}/{accountEmail}][%d] orgAccountOverviewInternalServerError", 500) } func (o *OrgAccountOverviewInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/metadata/overview_responses.go b/rest_client_zrok/metadata/overview_responses.go index 9b3b6be4..f6ff75c3 100644 --- a/rest_client_zrok/metadata/overview_responses.go +++ b/rest_client_zrok/metadata/overview_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -85,11 +86,13 @@ func (o *OverviewOK) Code() int { } func (o *OverviewOK) Error() string { - return fmt.Sprintf("[GET /overview][%d] overviewOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /overview][%d] overviewOK %s", 200, payload) } func (o *OverviewOK) String() string { - return fmt.Sprintf("[GET /overview][%d] overviewOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /overview][%d] overviewOK %s", 200, payload) } func (o *OverviewOK) GetPayload() *rest_model_zrok.Overview { @@ -153,11 +156,13 @@ func (o *OverviewInternalServerError) Code() int { } func (o *OverviewInternalServerError) Error() string { - return fmt.Sprintf("[GET /overview][%d] overviewInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /overview][%d] overviewInternalServerError %s", 500, payload) } func (o *OverviewInternalServerError) String() string { - return fmt.Sprintf("[GET /overview][%d] overviewInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /overview][%d] overviewInternalServerError %s", 500, payload) } func (o *OverviewInternalServerError) GetPayload() rest_model_zrok.ErrorMessage { diff --git a/rest_client_zrok/metadata/version_inventory_responses.go b/rest_client_zrok/metadata/version_inventory_responses.go index 258dfebc..9080d4d5 100644 --- a/rest_client_zrok/metadata/version_inventory_responses.go +++ b/rest_client_zrok/metadata/version_inventory_responses.go @@ -7,6 +7,7 @@ package metadata import ( "context" + "encoding/json" "fmt" "io" @@ -79,11 +80,13 @@ func (o *VersionInventoryOK) Code() int { } func (o *VersionInventoryOK) Error() string { - return fmt.Sprintf("[GET /versions][%d] versionInventoryOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /versions][%d] versionInventoryOK %s", 200, payload) } func (o *VersionInventoryOK) String() string { - return fmt.Sprintf("[GET /versions][%d] versionInventoryOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /versions][%d] versionInventoryOK %s", 200, payload) } func (o *VersionInventoryOK) GetPayload() *VersionInventoryOKBody { diff --git a/rest_client_zrok/metadata/version_responses.go b/rest_client_zrok/metadata/version_responses.go index de978ab5..0a917227 100644 --- a/rest_client_zrok/metadata/version_responses.go +++ b/rest_client_zrok/metadata/version_responses.go @@ -6,6 +6,7 @@ package metadata // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -79,11 +80,13 @@ func (o *VersionOK) Code() int { } func (o *VersionOK) Error() string { - return fmt.Sprintf("[GET /version][%d] versionOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /version][%d] versionOK %s", 200, payload) } func (o *VersionOK) String() string { - return fmt.Sprintf("[GET /version][%d] versionOK %+v", 200, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[GET /version][%d] versionOK %s", 200, payload) } func (o *VersionOK) GetPayload() rest_model_zrok.Version { diff --git a/rest_client_zrok/share/access_responses.go b/rest_client_zrok/share/access_responses.go index 6e476af5..30f275d8 100644 --- a/rest_client_zrok/share/access_responses.go +++ b/rest_client_zrok/share/access_responses.go @@ -7,6 +7,7 @@ package share import ( "context" + "encoding/json" "fmt" "io" @@ -97,11 +98,13 @@ func (o *AccessCreated) Code() int { } func (o *AccessCreated) Error() string { - return fmt.Sprintf("[POST /access][%d] accessCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /access][%d] accessCreated %s", 201, payload) } func (o *AccessCreated) String() string { - return fmt.Sprintf("[POST /access][%d] accessCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /access][%d] accessCreated %s", 201, payload) } func (o *AccessCreated) GetPayload() *AccessCreatedBody { @@ -164,11 +167,11 @@ func (o *AccessUnauthorized) Code() int { } func (o *AccessUnauthorized) Error() string { - return fmt.Sprintf("[POST /access][%d] accessUnauthorized ", 401) + return fmt.Sprintf("[POST /access][%d] accessUnauthorized", 401) } func (o *AccessUnauthorized) String() string { - return fmt.Sprintf("[POST /access][%d] accessUnauthorized ", 401) + return fmt.Sprintf("[POST /access][%d] accessUnauthorized", 401) } func (o *AccessUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -220,11 +223,11 @@ func (o *AccessNotFound) Code() int { } func (o *AccessNotFound) Error() string { - return fmt.Sprintf("[POST /access][%d] accessNotFound ", 404) + return fmt.Sprintf("[POST /access][%d] accessNotFound", 404) } func (o *AccessNotFound) String() string { - return fmt.Sprintf("[POST /access][%d] accessNotFound ", 404) + return fmt.Sprintf("[POST /access][%d] accessNotFound", 404) } func (o *AccessNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -276,11 +279,11 @@ func (o *AccessInternalServerError) Code() int { } func (o *AccessInternalServerError) Error() string { - return fmt.Sprintf("[POST /access][%d] accessInternalServerError ", 500) + return fmt.Sprintf("[POST /access][%d] accessInternalServerError", 500) } func (o *AccessInternalServerError) String() string { - return fmt.Sprintf("[POST /access][%d] accessInternalServerError ", 500) + return fmt.Sprintf("[POST /access][%d] accessInternalServerError", 500) } func (o *AccessInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/share/share_client.go b/rest_client_zrok/share/share_client.go index 48acfa17..7476a930 100644 --- a/rest_client_zrok/share/share_client.go +++ b/rest_client_zrok/share/share_client.go @@ -9,6 +9,7 @@ import ( "fmt" "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" ) @@ -17,6 +18,31 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientServi return &Client{transport: transport, formats: formats} } +// New creates a new share API client with basic auth credentials. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - user: user for basic authentication header. +// - password: password for basic authentication header. +func NewClientWithBasicAuth(host, basePath, scheme, user, password string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BasicAuth(user, password) + return &Client{transport: transport, formats: strfmt.Default} +} + +// New creates a new share API client with a bearer token for authentication. +// It takes the following parameters: +// - host: http host (github.com). +// - basePath: any base path for the API client ("/v1", "/v3"). +// - scheme: http scheme ("http", "https"). +// - bearerToken: bearer token for Bearer authentication header. +func NewClientWithBearerToken(host, basePath, scheme, bearerToken string) ClientService { + transport := httptransport.New(host, basePath, []string{scheme}) + transport.DefaultAuthentication = httptransport.BearerToken(bearerToken) + return &Client{transport: transport, formats: strfmt.Default} +} + /* Client for share API */ @@ -25,9 +51,53 @@ type Client struct { formats strfmt.Registry } -// ClientOption is the option for Client methods +// ClientOption may be used to customize the behavior of Client methods. type ClientOption func(*runtime.ClientOperation) +// This client is generated with a few options you might find useful for your swagger spec. +// +// Feel free to add you own set of options. + +// WithContentType allows the client to force the Content-Type header +// to negotiate a specific Consumer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithContentType(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{mime} + } +} + +// WithContentTypeApplicationJSON sets the Content-Type header to "application/json". +func WithContentTypeApplicationJSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/json"} +} + +// WithContentTypeApplicationZrokV1JSON sets the Content-Type header to "application/zrok.v1+json". +func WithContentTypeApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ConsumesMediaTypes = []string{"application/zrok.v1+json"} +} + +// WithAccept allows the client to force the Accept header +// to negotiate a specific Producer from the server. +// +// You may use this option to set arbitrary extensions to your MIME media type. +func WithAccept(mime string) ClientOption { + return func(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{mime} + } +} + +// WithAcceptApplicationJSON sets the Accept header to "application/json". +func WithAcceptApplicationJSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/json"} +} + +// WithAcceptApplicationZrokV1JSON sets the Accept header to "application/zrok.v1+json". +func WithAcceptApplicationZrokV1JSON(r *runtime.ClientOperation) { + r.ProducesMediaTypes = []string{"application/zrok.v1+json"} +} + // ClientService is the interface for Client methods type ClientService interface { Access(params *AccessParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*AccessCreated, error) diff --git a/rest_client_zrok/share/share_responses.go b/rest_client_zrok/share/share_responses.go index 8af0e374..f7dfe691 100644 --- a/rest_client_zrok/share/share_responses.go +++ b/rest_client_zrok/share/share_responses.go @@ -6,6 +6,7 @@ package share // Editing this file might prove futile when you re-run the swagger generate command import ( + "encoding/json" "fmt" "io" @@ -109,11 +110,13 @@ func (o *ShareCreated) Code() int { } func (o *ShareCreated) Error() string { - return fmt.Sprintf("[POST /share][%d] shareCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /share][%d] shareCreated %s", 201, payload) } func (o *ShareCreated) String() string { - return fmt.Sprintf("[POST /share][%d] shareCreated %+v", 201, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /share][%d] shareCreated %s", 201, payload) } func (o *ShareCreated) GetPayload() *rest_model_zrok.ShareResponse { @@ -176,11 +179,11 @@ func (o *ShareUnauthorized) Code() int { } func (o *ShareUnauthorized) Error() string { - return fmt.Sprintf("[POST /share][%d] shareUnauthorized ", 401) + return fmt.Sprintf("[POST /share][%d] shareUnauthorized", 401) } func (o *ShareUnauthorized) String() string { - return fmt.Sprintf("[POST /share][%d] shareUnauthorized ", 401) + return fmt.Sprintf("[POST /share][%d] shareUnauthorized", 401) } func (o *ShareUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -232,11 +235,11 @@ func (o *ShareNotFound) Code() int { } func (o *ShareNotFound) Error() string { - return fmt.Sprintf("[POST /share][%d] shareNotFound ", 404) + return fmt.Sprintf("[POST /share][%d] shareNotFound", 404) } func (o *ShareNotFound) String() string { - return fmt.Sprintf("[POST /share][%d] shareNotFound ", 404) + return fmt.Sprintf("[POST /share][%d] shareNotFound", 404) } func (o *ShareNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -288,11 +291,11 @@ func (o *ShareConflict) Code() int { } func (o *ShareConflict) Error() string { - return fmt.Sprintf("[POST /share][%d] shareConflict ", 409) + return fmt.Sprintf("[POST /share][%d] shareConflict", 409) } func (o *ShareConflict) String() string { - return fmt.Sprintf("[POST /share][%d] shareConflict ", 409) + return fmt.Sprintf("[POST /share][%d] shareConflict", 409) } func (o *ShareConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -344,11 +347,11 @@ func (o *ShareUnprocessableEntity) Code() int { } func (o *ShareUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /share][%d] shareUnprocessableEntity ", 422) + return fmt.Sprintf("[POST /share][%d] shareUnprocessableEntity", 422) } func (o *ShareUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /share][%d] shareUnprocessableEntity ", 422) + return fmt.Sprintf("[POST /share][%d] shareUnprocessableEntity", 422) } func (o *ShareUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -401,11 +404,13 @@ func (o *ShareInternalServerError) Code() int { } func (o *ShareInternalServerError) Error() string { - return fmt.Sprintf("[POST /share][%d] shareInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /share][%d] shareInternalServerError %s", 500, payload) } func (o *ShareInternalServerError) String() string { - return fmt.Sprintf("[POST /share][%d] shareInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[POST /share][%d] shareInternalServerError %s", 500, payload) } func (o *ShareInternalServerError) GetPayload() rest_model_zrok.ErrorMessage { diff --git a/rest_client_zrok/share/unaccess_responses.go b/rest_client_zrok/share/unaccess_responses.go index 2f5579bf..66a174b3 100644 --- a/rest_client_zrok/share/unaccess_responses.go +++ b/rest_client_zrok/share/unaccess_responses.go @@ -95,11 +95,11 @@ func (o *UnaccessOK) Code() int { } func (o *UnaccessOK) Error() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessOK ", 200) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessOK", 200) } func (o *UnaccessOK) String() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessOK ", 200) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessOK", 200) } func (o *UnaccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *UnaccessUnauthorized) Code() int { } func (o *UnaccessUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessUnauthorized ", 401) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessUnauthorized", 401) } func (o *UnaccessUnauthorized) String() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessUnauthorized ", 401) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessUnauthorized", 401) } func (o *UnaccessUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *UnaccessNotFound) Code() int { } func (o *UnaccessNotFound) Error() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessNotFound ", 404) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessNotFound", 404) } func (o *UnaccessNotFound) String() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessNotFound ", 404) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessNotFound", 404) } func (o *UnaccessNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *UnaccessInternalServerError) Code() int { } func (o *UnaccessInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessInternalServerError ", 500) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessInternalServerError", 500) } func (o *UnaccessInternalServerError) String() string { - return fmt.Sprintf("[DELETE /unaccess][%d] unaccessInternalServerError ", 500) + return fmt.Sprintf("[DELETE /unaccess][%d] unaccessInternalServerError", 500) } func (o *UnaccessInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/share/unshare_responses.go b/rest_client_zrok/share/unshare_responses.go index 7e1d1d62..40a2e1c2 100644 --- a/rest_client_zrok/share/unshare_responses.go +++ b/rest_client_zrok/share/unshare_responses.go @@ -7,6 +7,7 @@ package share import ( "context" + "encoding/json" "fmt" "io" @@ -98,11 +99,11 @@ func (o *UnshareOK) Code() int { } func (o *UnshareOK) Error() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareOK ", 200) + return fmt.Sprintf("[DELETE /unshare][%d] unshareOK", 200) } func (o *UnshareOK) String() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareOK ", 200) + return fmt.Sprintf("[DELETE /unshare][%d] unshareOK", 200) } func (o *UnshareOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -154,11 +155,11 @@ func (o *UnshareUnauthorized) Code() int { } func (o *UnshareUnauthorized) Error() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareUnauthorized ", 401) + return fmt.Sprintf("[DELETE /unshare][%d] unshareUnauthorized", 401) } func (o *UnshareUnauthorized) String() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareUnauthorized ", 401) + return fmt.Sprintf("[DELETE /unshare][%d] unshareUnauthorized", 401) } func (o *UnshareUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -210,11 +211,11 @@ func (o *UnshareNotFound) Code() int { } func (o *UnshareNotFound) Error() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareNotFound ", 404) + return fmt.Sprintf("[DELETE /unshare][%d] unshareNotFound", 404) } func (o *UnshareNotFound) String() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareNotFound ", 404) + return fmt.Sprintf("[DELETE /unshare][%d] unshareNotFound", 404) } func (o *UnshareNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -267,11 +268,13 @@ func (o *UnshareInternalServerError) Code() int { } func (o *UnshareInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /unshare][%d] unshareInternalServerError %s", 500, payload) } func (o *UnshareInternalServerError) String() string { - return fmt.Sprintf("[DELETE /unshare][%d] unshareInternalServerError %+v", 500, o.Payload) + payload, _ := json.Marshal(o.Payload) + return fmt.Sprintf("[DELETE /unshare][%d] unshareInternalServerError %s", 500, payload) } func (o *UnshareInternalServerError) GetPayload() rest_model_zrok.ErrorMessage { diff --git a/rest_client_zrok/share/update_access_responses.go b/rest_client_zrok/share/update_access_responses.go index 08ccbb97..082a94d5 100644 --- a/rest_client_zrok/share/update_access_responses.go +++ b/rest_client_zrok/share/update_access_responses.go @@ -95,11 +95,11 @@ func (o *UpdateAccessOK) Code() int { } func (o *UpdateAccessOK) Error() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessOK ", 200) + return fmt.Sprintf("[PATCH /access][%d] updateAccessOK", 200) } func (o *UpdateAccessOK) String() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessOK ", 200) + return fmt.Sprintf("[PATCH /access][%d] updateAccessOK", 200) } func (o *UpdateAccessOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -151,11 +151,11 @@ func (o *UpdateAccessUnauthorized) Code() int { } func (o *UpdateAccessUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessUnauthorized ", 401) + return fmt.Sprintf("[PATCH /access][%d] updateAccessUnauthorized", 401) } func (o *UpdateAccessUnauthorized) String() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessUnauthorized ", 401) + return fmt.Sprintf("[PATCH /access][%d] updateAccessUnauthorized", 401) } func (o *UpdateAccessUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -207,11 +207,11 @@ func (o *UpdateAccessNotFound) Code() int { } func (o *UpdateAccessNotFound) Error() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessNotFound ", 404) + return fmt.Sprintf("[PATCH /access][%d] updateAccessNotFound", 404) } func (o *UpdateAccessNotFound) String() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessNotFound ", 404) + return fmt.Sprintf("[PATCH /access][%d] updateAccessNotFound", 404) } func (o *UpdateAccessNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -263,11 +263,11 @@ func (o *UpdateAccessInternalServerError) Code() int { } func (o *UpdateAccessInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessInternalServerError ", 500) + return fmt.Sprintf("[PATCH /access][%d] updateAccessInternalServerError", 500) } func (o *UpdateAccessInternalServerError) String() string { - return fmt.Sprintf("[PATCH /access][%d] updateAccessInternalServerError ", 500) + return fmt.Sprintf("[PATCH /access][%d] updateAccessInternalServerError", 500) } func (o *UpdateAccessInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/share/update_share_responses.go b/rest_client_zrok/share/update_share_responses.go index 0478efa8..4654914c 100644 --- a/rest_client_zrok/share/update_share_responses.go +++ b/rest_client_zrok/share/update_share_responses.go @@ -101,11 +101,11 @@ func (o *UpdateShareOK) Code() int { } func (o *UpdateShareOK) Error() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareOK ", 200) + return fmt.Sprintf("[PATCH /share][%d] updateShareOK", 200) } func (o *UpdateShareOK) String() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareOK ", 200) + return fmt.Sprintf("[PATCH /share][%d] updateShareOK", 200) } func (o *UpdateShareOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -157,11 +157,11 @@ func (o *UpdateShareBadRequest) Code() int { } func (o *UpdateShareBadRequest) Error() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareBadRequest ", 400) + return fmt.Sprintf("[PATCH /share][%d] updateShareBadRequest", 400) } func (o *UpdateShareBadRequest) String() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareBadRequest ", 400) + return fmt.Sprintf("[PATCH /share][%d] updateShareBadRequest", 400) } func (o *UpdateShareBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -213,11 +213,11 @@ func (o *UpdateShareUnauthorized) Code() int { } func (o *UpdateShareUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareUnauthorized ", 401) + return fmt.Sprintf("[PATCH /share][%d] updateShareUnauthorized", 401) } func (o *UpdateShareUnauthorized) String() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareUnauthorized ", 401) + return fmt.Sprintf("[PATCH /share][%d] updateShareUnauthorized", 401) } func (o *UpdateShareUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -269,11 +269,11 @@ func (o *UpdateShareNotFound) Code() int { } func (o *UpdateShareNotFound) Error() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareNotFound ", 404) + return fmt.Sprintf("[PATCH /share][%d] updateShareNotFound", 404) } func (o *UpdateShareNotFound) String() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareNotFound ", 404) + return fmt.Sprintf("[PATCH /share][%d] updateShareNotFound", 404) } func (o *UpdateShareNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { @@ -325,11 +325,11 @@ func (o *UpdateShareInternalServerError) Code() int { } func (o *UpdateShareInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareInternalServerError ", 500) + return fmt.Sprintf("[PATCH /share][%d] updateShareInternalServerError", 500) } func (o *UpdateShareInternalServerError) String() string { - return fmt.Sprintf("[PATCH /share][%d] updateShareInternalServerError ", 500) + return fmt.Sprintf("[PATCH /share][%d] updateShareInternalServerError", 500) } func (o *UpdateShareInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { diff --git a/rest_client_zrok/zrok_client.go b/rest_client_zrok/zrok_client.go index a4200e67..a2db90c7 100644 --- a/rest_client_zrok/zrok_client.go +++ b/rest_client_zrok/zrok_client.go @@ -12,6 +12,7 @@ import ( "github.com/openziti/zrok/rest_client_zrok/account" "github.com/openziti/zrok/rest_client_zrok/admin" + "github.com/openziti/zrok/rest_client_zrok/agent" "github.com/openziti/zrok/rest_client_zrok/environment" "github.com/openziti/zrok/rest_client_zrok/metadata" "github.com/openziti/zrok/rest_client_zrok/share" @@ -61,6 +62,7 @@ func New(transport runtime.ClientTransport, formats strfmt.Registry) *Zrok { cli.Transport = transport cli.Account = account.New(transport, formats) cli.Admin = admin.New(transport, formats) + cli.Agent = agent.New(transport, formats) cli.Environment = environment.New(transport, formats) cli.Metadata = metadata.New(transport, formats) cli.Share = share.New(transport, formats) @@ -112,6 +114,8 @@ type Zrok struct { Admin admin.ClientService + Agent agent.ClientService + Environment environment.ClientService Metadata metadata.ClientService @@ -126,6 +130,7 @@ func (c *Zrok) SetTransport(transport runtime.ClientTransport) { c.Transport = transport c.Account.SetTransport(transport) c.Admin.SetTransport(transport) + c.Agent.SetTransport(transport) c.Environment.SetTransport(transport) c.Metadata.SetTransport(transport) c.Share.SetTransport(transport) diff --git a/rest_model_zrok/share_request.go b/rest_model_zrok/share_request.go index c440d6bc..b4e5c309 100644 --- a/rest_model_zrok/share_request.go +++ b/rest_model_zrok/share_request.go @@ -31,7 +31,7 @@ type ShareRequest struct { AuthUsers []*AuthUser `json:"authUsers"` // backend mode - // Enum: [proxy web tcpTunnel udpTunnel caddy drive socks vpn] + // Enum: ["proxy","web","tcpTunnel","udpTunnel","caddy","drive","socks","vpn"] BackendMode string `json:"backendMode,omitempty"` // backend proxy endpoint @@ -50,18 +50,18 @@ type ShareRequest struct { OauthEmailDomains []string `json:"oauthEmailDomains"` // oauth provider - // Enum: [github google] + // Enum: ["github","google"] OauthProvider string `json:"oauthProvider,omitempty"` // permission mode - // Enum: [open closed] + // Enum: ["open","closed"] PermissionMode string `json:"permissionMode,omitempty"` // reserved Reserved bool `json:"reserved,omitempty"` // share mode - // Enum: [public private] + // Enum: ["public","private"] ShareMode string `json:"shareMode,omitempty"` // unique name diff --git a/rest_server_zrok/embedded_spec.go b/rest_server_zrok/embedded_spec.go index 539561bf..b88f2f8f 100644 --- a/rest_server_zrok/embedded_spec.go +++ b/rest_server_zrok/embedded_spec.go @@ -185,6 +185,53 @@ func init() { } } }, + "/agent/status": { + "post": { + "security": [ + { + "key": [] + } + ], + "tags": [ + "agent" + ], + "operationId": "agentStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "properties": { + "envZId": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "properties": { + "shares": { + "type": "array", + "items": { + "$ref": "#/definitions/share" + } + } + } + } + }, + "401": { + "description": "unauthorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, "/changePassword": { "post": { "security": [ @@ -2496,6 +2543,53 @@ func init() { } } }, + "/agent/status": { + "post": { + "security": [ + { + "key": [] + } + ], + "tags": [ + "agent" + ], + "operationId": "agentStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "properties": { + "envZId": { + "type": "string" + } + } + } + } + ], + "responses": { + "200": { + "description": "ok", + "schema": { + "properties": { + "shares": { + "type": "array", + "items": { + "$ref": "#/definitions/share" + } + } + } + } + }, + "401": { + "description": "unauthorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, "/changePassword": { "post": { "security": [ diff --git a/rest_server_zrok/operations/admin/create_frontend.go b/rest_server_zrok/operations/admin/create_frontend.go index dd2a15aa..3c9ac02e 100644 --- a/rest_server_zrok/operations/admin/create_frontend.go +++ b/rest_server_zrok/operations/admin/create_frontend.go @@ -82,7 +82,7 @@ func (o *CreateFrontend) ServeHTTP(rw http.ResponseWriter, r *http.Request) { type CreateFrontendBody struct { // permission mode - // Enum: [open closed] + // Enum: ["open","closed"] PermissionMode string `json:"permissionMode,omitempty"` // public name diff --git a/rest_server_zrok/operations/agent/agent_status.go b/rest_server_zrok/operations/agent/agent_status.go new file mode 100644 index 00000000..cae83c0f --- /dev/null +++ b/rest_server_zrok/operations/agent/agent_status.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/openziti/zrok/rest_model_zrok" +) + +// AgentStatusHandlerFunc turns a function with the right signature into a agent status handler +type AgentStatusHandlerFunc func(AgentStatusParams, *rest_model_zrok.Principal) middleware.Responder + +// Handle executing the request and returning a response +func (fn AgentStatusHandlerFunc) Handle(params AgentStatusParams, principal *rest_model_zrok.Principal) middleware.Responder { + return fn(params, principal) +} + +// AgentStatusHandler interface for that can handle valid agent status params +type AgentStatusHandler interface { + Handle(AgentStatusParams, *rest_model_zrok.Principal) middleware.Responder +} + +// NewAgentStatus creates a new http.Handler for the agent status operation +func NewAgentStatus(ctx *middleware.Context, handler AgentStatusHandler) *AgentStatus { + return &AgentStatus{Context: ctx, Handler: handler} +} + +/* + AgentStatus swagger:route POST /agent/status agent agentStatus + +AgentStatus agent status API +*/ +type AgentStatus struct { + Context *middleware.Context + Handler AgentStatusHandler +} + +func (o *AgentStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewAgentStatusParams() + 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) + +} + +// AgentStatusBody agent status body +// +// swagger:model AgentStatusBody +type AgentStatusBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` +} + +// Validate validates this agent status body +func (o *AgentStatusBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this agent status body based on context it is used +func (o *AgentStatusBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AgentStatusBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AgentStatusBody) UnmarshalBinary(b []byte) error { + var res AgentStatusBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +// AgentStatusOKBody agent status o k body +// +// swagger:model AgentStatusOKBody +type AgentStatusOKBody struct { + + // shares + Shares []*rest_model_zrok.Share `json:"shares"` +} + +// Validate validates this agent status o k body +func (o *AgentStatusOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateShares(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AgentStatusOKBody) validateShares(formats strfmt.Registry) error { + if swag.IsZero(o.Shares) { // not required + return nil + } + + for i := 0; i < len(o.Shares); i++ { + if swag.IsZero(o.Shares[i]) { // not required + continue + } + + if o.Shares[i] != nil { + if err := o.Shares[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this agent status o k body based on the context it is used +func (o *AgentStatusOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateShares(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AgentStatusOKBody) contextValidateShares(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(o.Shares); i++ { + + if o.Shares[i] != nil { + + if swag.IsZero(o.Shares[i]) { // not required + return nil + } + + if err := o.Shares[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentStatusOK" + "." + "shares" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AgentStatusOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AgentStatusOKBody) UnmarshalBinary(b []byte) error { + var res AgentStatusOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_server_zrok/operations/agent/agent_status_parameters.go b/rest_server_zrok/operations/agent/agent_status_parameters.go new file mode 100644 index 00000000..7663128e --- /dev/null +++ b/rest_server_zrok/operations/agent/agent_status_parameters.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// 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" +) + +// NewAgentStatusParams creates a new AgentStatusParams object +// +// There are no default values defined in the spec. +func NewAgentStatusParams() AgentStatusParams { + + return AgentStatusParams{} +} + +// AgentStatusParams contains all the bound params for the agent status operation +// typically these are obtained from a http.Request +// +// swagger:parameters agentStatus +type AgentStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body AgentStatusBody +} + +// 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 NewAgentStatusParams() beforehand. +func (o *AgentStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body AgentStatusBody + 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 +} diff --git a/rest_server_zrok/operations/agent/agent_status_responses.go b/rest_server_zrok/operations/agent/agent_status_responses.go new file mode 100644 index 00000000..54010c37 --- /dev/null +++ b/rest_server_zrok/operations/agent/agent_status_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// 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" +) + +// AgentStatusOKCode is the HTTP code returned for type AgentStatusOK +const AgentStatusOKCode int = 200 + +/* +AgentStatusOK ok + +swagger:response agentStatusOK +*/ +type AgentStatusOK struct { + + /* + In: Body + */ + Payload *AgentStatusOKBody `json:"body,omitempty"` +} + +// NewAgentStatusOK creates AgentStatusOK with default headers values +func NewAgentStatusOK() *AgentStatusOK { + + return &AgentStatusOK{} +} + +// WithPayload adds the payload to the agent status o k response +func (o *AgentStatusOK) WithPayload(payload *AgentStatusOKBody) *AgentStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the agent status o k response +func (o *AgentStatusOK) SetPayload(payload *AgentStatusOKBody) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AgentStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AgentStatusUnauthorizedCode is the HTTP code returned for type AgentStatusUnauthorized +const AgentStatusUnauthorizedCode int = 401 + +/* +AgentStatusUnauthorized unauthorized + +swagger:response agentStatusUnauthorized +*/ +type AgentStatusUnauthorized struct { +} + +// NewAgentStatusUnauthorized creates AgentStatusUnauthorized with default headers values +func NewAgentStatusUnauthorized() *AgentStatusUnauthorized { + + return &AgentStatusUnauthorized{} +} + +// WriteResponse to the client +func (o *AgentStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// AgentStatusInternalServerErrorCode is the HTTP code returned for type AgentStatusInternalServerError +const AgentStatusInternalServerErrorCode int = 500 + +/* +AgentStatusInternalServerError internal server error + +swagger:response agentStatusInternalServerError +*/ +type AgentStatusInternalServerError struct { +} + +// NewAgentStatusInternalServerError creates AgentStatusInternalServerError with default headers values +func NewAgentStatusInternalServerError() *AgentStatusInternalServerError { + + return &AgentStatusInternalServerError{} +} + +// WriteResponse to the client +func (o *AgentStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/rest_server_zrok/operations/agent/agent_status_urlbuilder.go b/rest_server_zrok/operations/agent/agent_status_urlbuilder.go new file mode 100644 index 00000000..61350c00 --- /dev/null +++ b/rest_server_zrok/operations/agent/agent_status_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package agent + +// 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" +) + +// AgentStatusURL generates an URL for the agent status operation +type AgentStatusURL 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 *AgentStatusURL) WithBasePath(bp string) *AgentStatusURL { + 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 *AgentStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *AgentStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/agent/status" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/api/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *AgentStatusURL) 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 *AgentStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *AgentStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on AgentStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on AgentStatusURL") + } + + 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 *AgentStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/rest_server_zrok/operations/zrok_api.go b/rest_server_zrok/operations/zrok_api.go index d2945bea..ec505ebb 100644 --- a/rest_server_zrok/operations/zrok_api.go +++ b/rest_server_zrok/operations/zrok_api.go @@ -22,6 +22,7 @@ import ( "github.com/openziti/zrok/rest_model_zrok" "github.com/openziti/zrok/rest_server_zrok/operations/account" "github.com/openziti/zrok/rest_server_zrok/operations/admin" + "github.com/openziti/zrok/rest_server_zrok/operations/agent" "github.com/openziti/zrok/rest_server_zrok/operations/environment" "github.com/openziti/zrok/rest_server_zrok/operations/metadata" "github.com/openziti/zrok/rest_server_zrok/operations/share" @@ -55,6 +56,9 @@ func NewZrokAPI(spec *loads.Document) *ZrokAPI { AdminAddOrganizationMemberHandler: admin.AddOrganizationMemberHandlerFunc(func(params admin.AddOrganizationMemberParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation admin.AddOrganizationMember has not yet been implemented") }), + AgentAgentStatusHandler: agent.AgentStatusHandlerFunc(func(params agent.AgentStatusParams, principal *rest_model_zrok.Principal) middleware.Responder { + return middleware.NotImplemented("operation agent.AgentStatus has not yet been implemented") + }), AccountChangePasswordHandler: account.ChangePasswordHandlerFunc(func(params account.ChangePasswordParams, principal *rest_model_zrok.Principal) middleware.Responder { return middleware.NotImplemented("operation account.ChangePassword has not yet been implemented") }), @@ -241,6 +245,8 @@ type ZrokAPI struct { ShareAccessHandler share.AccessHandler // AdminAddOrganizationMemberHandler sets the operation handler for the add organization member operation AdminAddOrganizationMemberHandler admin.AddOrganizationMemberHandler + // AgentAgentStatusHandler sets the operation handler for the agent status operation + AgentAgentStatusHandler agent.AgentStatusHandler // AccountChangePasswordHandler sets the operation handler for the change password operation AccountChangePasswordHandler account.ChangePasswordHandler // MetadataClientVersionCheckHandler sets the operation handler for the client version check operation @@ -416,6 +422,9 @@ func (o *ZrokAPI) Validate() error { if o.AdminAddOrganizationMemberHandler == nil { unregistered = append(unregistered, "admin.AddOrganizationMemberHandler") } + if o.AgentAgentStatusHandler == nil { + unregistered = append(unregistered, "agent.AgentStatusHandler") + } if o.AccountChangePasswordHandler == nil { unregistered = append(unregistered, "account.ChangePasswordHandler") } @@ -658,6 +667,10 @@ func (o *ZrokAPI) initHandlerCache() { if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) } + o.handlers["POST"]["/agent/status"] = agent.NewAgentStatus(o.context, o.AgentAgentStatusHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } o.handlers["POST"]["/changePassword"] = account.NewChangePassword(o.context, o.AccountChangePasswordHandler) if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) diff --git a/rest_server_zrok/server.go b/rest_server_zrok/server.go index d07438f0..56c64b79 100644 --- a/rest_server_zrok/server.go +++ b/rest_server_zrok/server.go @@ -80,7 +80,7 @@ type Server struct { ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"30s"` httpServerL net.Listener TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` diff --git a/sdk/nodejs/sdk/src/api/.openapi-generator/FILES b/sdk/nodejs/sdk/src/api/.openapi-generator/FILES index 34dc76aa..780fe3a0 100644 --- a/sdk/nodejs/sdk/src/api/.openapi-generator/FILES +++ b/sdk/nodejs/sdk/src/api/.openapi-generator/FILES @@ -1,6 +1,7 @@ .openapi-generator-ignore apis/AccountApi.ts apis/AdminApi.ts +apis/AgentApi.ts apis/EnvironmentApi.ts apis/MetadataApi.ts apis/ShareApi.ts @@ -9,6 +10,8 @@ index.ts models/Access201Response.ts models/AccessRequest.ts models/AddOrganizationMemberRequest.ts +models/AgentStatus200Response.ts +models/AgentStatusRequest.ts models/AuthUser.ts models/ChangePasswordRequest.ts models/ClientVersionCheckRequest.ts diff --git a/sdk/nodejs/sdk/src/api/apis/AgentApi.ts b/sdk/nodejs/sdk/src/api/apis/AgentApi.ts new file mode 100644 index 00000000..9c6dcf4d --- /dev/null +++ b/sdk/nodejs/sdk/src/api/apis/AgentApi.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AgentStatus200Response, + AgentStatusRequest, +} from '../models/index'; +import { + AgentStatus200ResponseFromJSON, + AgentStatus200ResponseToJSON, + AgentStatusRequestFromJSON, + AgentStatusRequestToJSON, +} from '../models/index'; + +export interface AgentStatusOperationRequest { + body?: AgentStatusRequest; +} + +/** + * + */ +export class AgentApi extends runtime.BaseAPI { + + /** + */ + async agentStatusRaw(requestParameters: AgentStatusOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/agent/status`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AgentStatusRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AgentStatus200ResponseFromJSON(jsonValue)); + } + + /** + */ + async agentStatus(requestParameters: AgentStatusOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.agentStatusRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/sdk/nodejs/sdk/src/api/apis/index.ts b/sdk/nodejs/sdk/src/api/apis/index.ts index 15996902..d7771684 100644 --- a/sdk/nodejs/sdk/src/api/apis/index.ts +++ b/sdk/nodejs/sdk/src/api/apis/index.ts @@ -2,6 +2,7 @@ /* eslint-disable */ export * from './AccountApi'; export * from './AdminApi'; +export * from './AgentApi'; export * from './EnvironmentApi'; export * from './MetadataApi'; export * from './ShareApi'; diff --git a/sdk/nodejs/sdk/src/api/models/AgentStatus200Response.ts b/sdk/nodejs/sdk/src/api/models/AgentStatus200Response.ts new file mode 100644 index 00000000..a8fa0894 --- /dev/null +++ b/sdk/nodejs/sdk/src/api/models/AgentStatus200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Share } from './Share'; +import { + ShareFromJSON, + ShareFromJSONTyped, + ShareToJSON, + ShareToJSONTyped, +} from './Share'; + +/** + * + * @export + * @interface AgentStatus200Response + */ +export interface AgentStatus200Response { + /** + * + * @type {Array} + * @memberof AgentStatus200Response + */ + shares?: Array; +} + +/** + * Check if a given object implements the AgentStatus200Response interface. + */ +export function instanceOfAgentStatus200Response(value: object): value is AgentStatus200Response { + return true; +} + +export function AgentStatus200ResponseFromJSON(json: any): AgentStatus200Response { + return AgentStatus200ResponseFromJSONTyped(json, false); +} + +export function AgentStatus200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentStatus200Response { + if (json == null) { + return json; + } + return { + + 'shares': json['shares'] == null ? undefined : ((json['shares'] as Array).map(ShareFromJSON)), + }; +} + +export function AgentStatus200ResponseToJSON(json: any): AgentStatus200Response { + return AgentStatus200ResponseToJSONTyped(json, false); +} + +export function AgentStatus200ResponseToJSONTyped(value?: AgentStatus200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'shares': value['shares'] == null ? undefined : ((value['shares'] as Array).map(ShareToJSON)), + }; +} + diff --git a/sdk/nodejs/sdk/src/api/models/AgentStatusRequest.ts b/sdk/nodejs/sdk/src/api/models/AgentStatusRequest.ts new file mode 100644 index 00000000..70d56e15 --- /dev/null +++ b/sdk/nodejs/sdk/src/api/models/AgentStatusRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AgentStatusRequest + */ +export interface AgentStatusRequest { + /** + * + * @type {string} + * @memberof AgentStatusRequest + */ + envZId?: string; +} + +/** + * Check if a given object implements the AgentStatusRequest interface. + */ +export function instanceOfAgentStatusRequest(value: object): value is AgentStatusRequest { + return true; +} + +export function AgentStatusRequestFromJSON(json: any): AgentStatusRequest { + return AgentStatusRequestFromJSONTyped(json, false); +} + +export function AgentStatusRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentStatusRequest { + if (json == null) { + return json; + } + return { + + 'envZId': json['envZId'] == null ? undefined : json['envZId'], + }; +} + +export function AgentStatusRequestToJSON(json: any): AgentStatusRequest { + return AgentStatusRequestToJSONTyped(json, false); +} + +export function AgentStatusRequestToJSONTyped(value?: AgentStatusRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'envZId': value['envZId'], + }; +} + diff --git a/sdk/nodejs/sdk/src/api/models/index.ts b/sdk/nodejs/sdk/src/api/models/index.ts index 5dec33a2..8245f12f 100644 --- a/sdk/nodejs/sdk/src/api/models/index.ts +++ b/sdk/nodejs/sdk/src/api/models/index.ts @@ -3,6 +3,8 @@ export * from './Access201Response'; export * from './AccessRequest'; export * from './AddOrganizationMemberRequest'; +export * from './AgentStatus200Response'; +export * from './AgentStatusRequest'; export * from './AuthUser'; export * from './ChangePasswordRequest'; export * from './ClientVersionCheckRequest'; diff --git a/sdk/python/src/.openapi-generator/FILES b/sdk/python/src/.openapi-generator/FILES index 5294bfba..dba0b56f 100644 --- a/sdk/python/src/.openapi-generator/FILES +++ b/sdk/python/src/.openapi-generator/FILES @@ -5,6 +5,9 @@ docs/AccessRequest.md docs/AccountApi.md docs/AddOrganizationMemberRequest.md docs/AdminApi.md +docs/AgentApi.md +docs/AgentStatus200Response.md +docs/AgentStatusRequest.md docs/AuthUser.md docs/ChangePasswordRequest.md docs/ClientVersionCheckRequest.md @@ -64,6 +67,9 @@ test/test_access_request.py test/test_account_api.py test/test_add_organization_member_request.py test/test_admin_api.py +test/test_agent_api.py +test/test_agent_status200_response.py +test/test_agent_status_request.py test/test_auth_user.py test/test_change_password_request.py test/test_client_version_check_request.py @@ -119,6 +125,7 @@ zrok_api/__init__.py zrok_api/api/__init__.py zrok_api/api/account_api.py zrok_api/api/admin_api.py +zrok_api/api/agent_api.py zrok_api/api/environment_api.py zrok_api/api/metadata_api.py zrok_api/api/share_api.py @@ -130,6 +137,8 @@ zrok_api/models/__init__.py zrok_api/models/access201_response.py zrok_api/models/access_request.py zrok_api/models/add_organization_member_request.py +zrok_api/models/agent_status200_response.py +zrok_api/models/agent_status_request.py zrok_api/models/auth_user.py zrok_api/models/change_password_request.py zrok_api/models/client_version_check_request.py diff --git a/sdk/python/src/README.md b/sdk/python/src/README.md index 25ad2fe6..e0b0c2da 100644 --- a/sdk/python/src/README.md +++ b/sdk/python/src/README.md @@ -114,6 +114,7 @@ Class | Method | HTTP request | Description *AdminApi* | [**list_organizations**](docs/AdminApi.md#list_organizations) | **GET** /organizations | *AdminApi* | [**remove_organization_member**](docs/AdminApi.md#remove_organization_member) | **POST** /organization/remove | *AdminApi* | [**update_frontend**](docs/AdminApi.md#update_frontend) | **PATCH** /frontend | +*AgentApi* | [**agent_status**](docs/AgentApi.md#agent_status) | **POST** /agent/status | *EnvironmentApi* | [**disable**](docs/EnvironmentApi.md#disable) | **POST** /disable | *EnvironmentApi* | [**enable**](docs/EnvironmentApi.md#enable) | **POST** /enable | *MetadataApi* | [**client_version_check**](docs/MetadataApi.md#client_version_check) | **POST** /clientVersionCheck | @@ -145,6 +146,8 @@ Class | Method | HTTP request | Description - [Access201Response](docs/Access201Response.md) - [AccessRequest](docs/AccessRequest.md) - [AddOrganizationMemberRequest](docs/AddOrganizationMemberRequest.md) + - [AgentStatus200Response](docs/AgentStatus200Response.md) + - [AgentStatusRequest](docs/AgentStatusRequest.md) - [AuthUser](docs/AuthUser.md) - [ChangePasswordRequest](docs/ChangePasswordRequest.md) - [ClientVersionCheckRequest](docs/ClientVersionCheckRequest.md) diff --git a/sdk/python/src/docs/AgentApi.md b/sdk/python/src/docs/AgentApi.md new file mode 100644 index 00000000..66b7f64c --- /dev/null +++ b/sdk/python/src/docs/AgentApi.md @@ -0,0 +1,86 @@ +# zrok_api.AgentApi + +All URIs are relative to */api/v1* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**agent_status**](AgentApi.md#agent_status) | **POST** /agent/status | + + +# **agent_status** +> AgentStatus200Response agent_status(body=body) + +### Example + +* Api Key Authentication (key): + +```python +import zrok_api +from zrok_api.models.agent_status200_response import AgentStatus200Response +from zrok_api.models.agent_status_request import AgentStatusRequest +from zrok_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to /api/v1 +# See configuration.py for a list of all supported configuration parameters. +configuration = zrok_api.Configuration( + host = "/api/v1" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: key +configuration.api_key['key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['key'] = 'Bearer' + +# Enter a context with an instance of the API client +with zrok_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = zrok_api.AgentApi(api_client) + body = zrok_api.AgentStatusRequest() # AgentStatusRequest | (optional) + + try: + api_response = api_instance.agent_status(body=body) + print("The response of AgentApi->agent_status:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AgentApi->agent_status: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**AgentStatusRequest**](AgentStatusRequest.md)| | [optional] + +### Return type + +[**AgentStatus200Response**](AgentStatus200Response.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** | ok | - | +**401** | unauthorized | - | +**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) + diff --git a/sdk/python/src/docs/AgentStatus200Response.md b/sdk/python/src/docs/AgentStatus200Response.md new file mode 100644 index 00000000..361f872d --- /dev/null +++ b/sdk/python/src/docs/AgentStatus200Response.md @@ -0,0 +1,29 @@ +# AgentStatus200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**shares** | [**List[Share]**](Share.md) | | [optional] + +## Example + +```python +from zrok_api.models.agent_status200_response import AgentStatus200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentStatus200Response from a JSON string +agent_status200_response_instance = AgentStatus200Response.from_json(json) +# print the JSON string representation of the object +print(AgentStatus200Response.to_json()) + +# convert the object into a dict +agent_status200_response_dict = agent_status200_response_instance.to_dict() +# create an instance of AgentStatus200Response from a dict +agent_status200_response_from_dict = AgentStatus200Response.from_dict(agent_status200_response_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) + + diff --git a/sdk/python/src/docs/AgentStatusRequest.md b/sdk/python/src/docs/AgentStatusRequest.md new file mode 100644 index 00000000..4c31fdfe --- /dev/null +++ b/sdk/python/src/docs/AgentStatusRequest.md @@ -0,0 +1,29 @@ +# AgentStatusRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**env_zid** | **str** | | [optional] + +## Example + +```python +from zrok_api.models.agent_status_request import AgentStatusRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentStatusRequest from a JSON string +agent_status_request_instance = AgentStatusRequest.from_json(json) +# print the JSON string representation of the object +print(AgentStatusRequest.to_json()) + +# convert the object into a dict +agent_status_request_dict = agent_status_request_instance.to_dict() +# create an instance of AgentStatusRequest from a dict +agent_status_request_from_dict = AgentStatusRequest.from_dict(agent_status_request_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) + + diff --git a/sdk/python/src/test/test_agent_api.py b/sdk/python/src/test/test_agent_api.py new file mode 100644 index 00000000..9fddd5d0 --- /dev/null +++ b/sdk/python/src/test/test_agent_api.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from zrok_api.api.agent_api import AgentApi + + +class TestAgentApi(unittest.TestCase): + """AgentApi unit test stubs""" + + def setUp(self) -> None: + self.api = AgentApi() + + def tearDown(self) -> None: + pass + + def test_agent_status(self) -> None: + """Test case for agent_status + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/sdk/python/src/test/test_agent_status200_response.py b/sdk/python/src/test/test_agent_status200_response.py new file mode 100644 index 00000000..821c4da8 --- /dev/null +++ b/sdk/python/src/test/test_agent_status200_response.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from zrok_api.models.agent_status200_response import AgentStatus200Response + +class TestAgentStatus200Response(unittest.TestCase): + """AgentStatus200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentStatus200Response: + """Test AgentStatus200Response + 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 `AgentStatus200Response` + """ + model = AgentStatus200Response() + if include_optional: + return AgentStatus200Response( + shares = [ + zrok_api.models.share.share( + share_token = '', + z_id = '', + share_mode = '', + backend_mode = '', + frontend_selection = '', + frontend_endpoint = '', + backend_proxy_endpoint = '', + reserved = True, + activity = [ + zrok_api.models.spark_data_sample.sparkDataSample( + rx = 1.337, + tx = 1.337, ) + ], + limited = True, + created_at = 56, + updated_at = 56, ) + ] + ) + else: + return AgentStatus200Response( + ) + """ + + def testAgentStatus200Response(self): + """Test AgentStatus200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/sdk/python/src/test/test_agent_status_request.py b/sdk/python/src/test/test_agent_status_request.py new file mode 100644 index 00000000..702b4e64 --- /dev/null +++ b/sdk/python/src/test/test_agent_status_request.py @@ -0,0 +1,51 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from zrok_api.models.agent_status_request import AgentStatusRequest + +class TestAgentStatusRequest(unittest.TestCase): + """AgentStatusRequest unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> AgentStatusRequest: + """Test AgentStatusRequest + 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 `AgentStatusRequest` + """ + model = AgentStatusRequest() + if include_optional: + return AgentStatusRequest( + env_zid = '' + ) + else: + return AgentStatusRequest( + ) + """ + + def testAgentStatusRequest(self): + """Test AgentStatusRequest""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/sdk/python/src/zrok_api/__init__.py b/sdk/python/src/zrok_api/__init__.py index bf54fba9..e952bf25 100644 --- a/sdk/python/src/zrok_api/__init__.py +++ b/sdk/python/src/zrok_api/__init__.py @@ -19,6 +19,7 @@ __version__ = "1.0.0" # import apis into sdk package from zrok_api.api.account_api import AccountApi from zrok_api.api.admin_api import AdminApi +from zrok_api.api.agent_api import AgentApi from zrok_api.api.environment_api import EnvironmentApi from zrok_api.api.metadata_api import MetadataApi from zrok_api.api.share_api import ShareApi @@ -38,6 +39,8 @@ from zrok_api.exceptions import ApiException from zrok_api.models.access201_response import Access201Response from zrok_api.models.access_request import AccessRequest from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest +from zrok_api.models.agent_status200_response import AgentStatus200Response +from zrok_api.models.agent_status_request import AgentStatusRequest from zrok_api.models.auth_user import AuthUser from zrok_api.models.change_password_request import ChangePasswordRequest from zrok_api.models.client_version_check_request import ClientVersionCheckRequest diff --git a/sdk/python/src/zrok_api/api/__init__.py b/sdk/python/src/zrok_api/api/__init__.py index 714f0a37..4b84cb06 100644 --- a/sdk/python/src/zrok_api/api/__init__.py +++ b/sdk/python/src/zrok_api/api/__init__.py @@ -3,6 +3,7 @@ # import apis into api package from zrok_api.api.account_api import AccountApi from zrok_api.api.admin_api import AdminApi +from zrok_api.api.agent_api import AgentApi from zrok_api.api.environment_api import EnvironmentApi from zrok_api.api.metadata_api import MetadataApi from zrok_api.api.share_api import ShareApi diff --git a/sdk/python/src/zrok_api/api/agent_api.py b/sdk/python/src/zrok_api/api/agent_api.py new file mode 100644 index 00000000..a6d1aafe --- /dev/null +++ b/sdk/python/src/zrok_api/api/agent_api.py @@ -0,0 +1,315 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from typing import Optional +from zrok_api.models.agent_status200_response import AgentStatus200Response +from zrok_api.models.agent_status_request import AgentStatusRequest + +from zrok_api.api_client import ApiClient, RequestSerialized +from zrok_api.api_response import ApiResponse +from zrok_api.rest import RESTResponseType + + +class AgentApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def agent_status( + self, + body: Optional[AgentStatusRequest] = 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, + ) -> AgentStatus200Response: + """agent_status + + + :param body: + :type body: AgentStatusRequest + :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._agent_status_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': "AgentStatus200Response", + '401': 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 agent_status_with_http_info( + self, + body: Optional[AgentStatusRequest] = 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[AgentStatus200Response]: + """agent_status + + + :param body: + :type body: AgentStatusRequest + :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._agent_status_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': "AgentStatus200Response", + '401': 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 agent_status_without_preload_content( + self, + body: Optional[AgentStatusRequest] = 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: + """agent_status + + + :param body: + :type body: AgentStatusRequest + :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._agent_status_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': "AgentStatus200Response", + '401': None, + '500': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _agent_status_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='/agent/status', + 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 + ) + + diff --git a/sdk/python/src/zrok_api/models/__init__.py b/sdk/python/src/zrok_api/models/__init__.py index c4f5e3c4..c2b91565 100644 --- a/sdk/python/src/zrok_api/models/__init__.py +++ b/sdk/python/src/zrok_api/models/__init__.py @@ -17,6 +17,8 @@ from zrok_api.models.access201_response import Access201Response from zrok_api.models.access_request import AccessRequest from zrok_api.models.add_organization_member_request import AddOrganizationMemberRequest +from zrok_api.models.agent_status200_response import AgentStatus200Response +from zrok_api.models.agent_status_request import AgentStatusRequest from zrok_api.models.auth_user import AuthUser from zrok_api.models.change_password_request import ChangePasswordRequest from zrok_api.models.client_version_check_request import ClientVersionCheckRequest diff --git a/sdk/python/src/zrok_api/models/agent_status200_response.py b/sdk/python/src/zrok_api/models/agent_status200_response.py new file mode 100644 index 00000000..c2c30b3d --- /dev/null +++ b/sdk/python/src/zrok_api/models/agent_status200_response.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from zrok_api.models.share import Share +from typing import Optional, Set +from typing_extensions import Self + +class AgentStatus200Response(BaseModel): + """ + AgentStatus200Response + """ # noqa: E501 + shares: Optional[List[Share]] = None + __properties: ClassVar[List[str]] = ["shares"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentStatus200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in shares (list) + _items = [] + if self.shares: + for _item_shares in self.shares: + if _item_shares: + _items.append(_item_shares.to_dict()) + _dict['shares'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentStatus200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "shares": [Share.from_dict(_item) for _item in obj["shares"]] if obj.get("shares") is not None else None + }) + return _obj + + diff --git a/sdk/python/src/zrok_api/models/agent_status_request.py b/sdk/python/src/zrok_api/models/agent_status_request.py new file mode 100644 index 00000000..dc487f93 --- /dev/null +++ b/sdk/python/src/zrok_api/models/agent_status_request.py @@ -0,0 +1,87 @@ +# coding: utf-8 + +""" + zrok + + zrok client access + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AgentStatusRequest(BaseModel): + """ + AgentStatusRequest + """ # noqa: E501 + env_zid: Optional[StrictStr] = Field(default=None, alias="envZId") + __properties: ClassVar[List[str]] = ["envZId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentStatusRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentStatusRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "envZId": obj.get("envZId") + }) + return _obj + + diff --git a/specs/zrok.yml b/specs/zrok.yml index 6ee86fb4..4b7f0ad2 100644 --- a/specs/zrok.yml +++ b/specs/zrok.yml @@ -613,6 +613,37 @@ paths: 500: description: internal server error + # + # agent + # + /agent/status: + post: + tags: + - agent + security: + - key: [] + operationId: agentStatus + parameters: + - name: body + in: body + schema: + properties: + envZId: + type: string + responses: + 200: + description: ok + schema: + properties: + shares: + type: array + items: + $ref: "#/definitions/share" + 401: + description: unauthorized + 500: + description: internal server error + # # environment # diff --git a/ui/src/api/.openapi-generator/FILES b/ui/src/api/.openapi-generator/FILES index 34dc76aa..780fe3a0 100644 --- a/ui/src/api/.openapi-generator/FILES +++ b/ui/src/api/.openapi-generator/FILES @@ -1,6 +1,7 @@ .openapi-generator-ignore apis/AccountApi.ts apis/AdminApi.ts +apis/AgentApi.ts apis/EnvironmentApi.ts apis/MetadataApi.ts apis/ShareApi.ts @@ -9,6 +10,8 @@ index.ts models/Access201Response.ts models/AccessRequest.ts models/AddOrganizationMemberRequest.ts +models/AgentStatus200Response.ts +models/AgentStatusRequest.ts models/AuthUser.ts models/ChangePasswordRequest.ts models/ClientVersionCheckRequest.ts diff --git a/ui/src/api/apis/AgentApi.ts b/ui/src/api/apis/AgentApi.ts new file mode 100644 index 00000000..9c6dcf4d --- /dev/null +++ b/ui/src/api/apis/AgentApi.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AgentStatus200Response, + AgentStatusRequest, +} from '../models/index'; +import { + AgentStatus200ResponseFromJSON, + AgentStatus200ResponseToJSON, + AgentStatusRequestFromJSON, + AgentStatusRequestToJSON, +} from '../models/index'; + +export interface AgentStatusOperationRequest { + body?: AgentStatusRequest; +} + +/** + * + */ +export class AgentApi extends runtime.BaseAPI { + + /** + */ + async agentStatusRaw(requestParameters: AgentStatusOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/zrok.v1+json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["x-token"] = await this.configuration.apiKey("x-token"); // key authentication + } + + const response = await this.request({ + path: `/agent/status`, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AgentStatusRequestToJSON(requestParameters['body']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AgentStatus200ResponseFromJSON(jsonValue)); + } + + /** + */ + async agentStatus(requestParameters: AgentStatusOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.agentStatusRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/ui/src/api/apis/index.ts b/ui/src/api/apis/index.ts index 15996902..d7771684 100644 --- a/ui/src/api/apis/index.ts +++ b/ui/src/api/apis/index.ts @@ -2,6 +2,7 @@ /* eslint-disable */ export * from './AccountApi'; export * from './AdminApi'; +export * from './AgentApi'; export * from './EnvironmentApi'; export * from './MetadataApi'; export * from './ShareApi'; diff --git a/ui/src/api/models/AgentStatus200Response.ts b/ui/src/api/models/AgentStatus200Response.ts new file mode 100644 index 00000000..a8fa0894 --- /dev/null +++ b/ui/src/api/models/AgentStatus200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Share } from './Share'; +import { + ShareFromJSON, + ShareFromJSONTyped, + ShareToJSON, + ShareToJSONTyped, +} from './Share'; + +/** + * + * @export + * @interface AgentStatus200Response + */ +export interface AgentStatus200Response { + /** + * + * @type {Array} + * @memberof AgentStatus200Response + */ + shares?: Array; +} + +/** + * Check if a given object implements the AgentStatus200Response interface. + */ +export function instanceOfAgentStatus200Response(value: object): value is AgentStatus200Response { + return true; +} + +export function AgentStatus200ResponseFromJSON(json: any): AgentStatus200Response { + return AgentStatus200ResponseFromJSONTyped(json, false); +} + +export function AgentStatus200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentStatus200Response { + if (json == null) { + return json; + } + return { + + 'shares': json['shares'] == null ? undefined : ((json['shares'] as Array).map(ShareFromJSON)), + }; +} + +export function AgentStatus200ResponseToJSON(json: any): AgentStatus200Response { + return AgentStatus200ResponseToJSONTyped(json, false); +} + +export function AgentStatus200ResponseToJSONTyped(value?: AgentStatus200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'shares': value['shares'] == null ? undefined : ((value['shares'] as Array).map(ShareToJSON)), + }; +} + diff --git a/ui/src/api/models/AgentStatusRequest.ts b/ui/src/api/models/AgentStatusRequest.ts new file mode 100644 index 00000000..70d56e15 --- /dev/null +++ b/ui/src/api/models/AgentStatusRequest.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * zrok + * zrok client access + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AgentStatusRequest + */ +export interface AgentStatusRequest { + /** + * + * @type {string} + * @memberof AgentStatusRequest + */ + envZId?: string; +} + +/** + * Check if a given object implements the AgentStatusRequest interface. + */ +export function instanceOfAgentStatusRequest(value: object): value is AgentStatusRequest { + return true; +} + +export function AgentStatusRequestFromJSON(json: any): AgentStatusRequest { + return AgentStatusRequestFromJSONTyped(json, false); +} + +export function AgentStatusRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AgentStatusRequest { + if (json == null) { + return json; + } + return { + + 'envZId': json['envZId'] == null ? undefined : json['envZId'], + }; +} + +export function AgentStatusRequestToJSON(json: any): AgentStatusRequest { + return AgentStatusRequestToJSONTyped(json, false); +} + +export function AgentStatusRequestToJSONTyped(value?: AgentStatusRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'envZId': value['envZId'], + }; +} + diff --git a/ui/src/api/models/index.ts b/ui/src/api/models/index.ts index 5dec33a2..8245f12f 100644 --- a/ui/src/api/models/index.ts +++ b/ui/src/api/models/index.ts @@ -3,6 +3,8 @@ export * from './Access201Response'; export * from './AccessRequest'; export * from './AddOrganizationMemberRequest'; +export * from './AgentStatus200Response'; +export * from './AgentStatusRequest'; export * from './AuthUser'; export * from './ChangePasswordRequest'; export * from './ClientVersionCheckRequest';