From 835171056c18c1557f5b95065c312cdfaa672e97 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Tue, 4 Feb 2025 11:02:13 -0500 Subject: [PATCH] unshare and unaccess lint removal (#834) --- cmd/zrok/accessPrivate.go | 11 +- cmd/zrok/release.go | 9 +- cmd/zrok/testLoopPublic.go | 10 +- rest_client_zrok/share/unaccess_parameters.go | 14 +- rest_client_zrok/share/unaccess_responses.go | 46 +++++ rest_client_zrok/share/unshare_parameters.go | 14 +- rest_client_zrok/share/unshare_responses.go | 46 +++++ rest_server_zrok/embedded_spec.go | 104 +++++------ rest_server_zrok/operations/share/unaccess.go | 46 +++++ .../operations/share/unaccess_parameters.go | 8 +- rest_server_zrok/operations/share/unshare.go | 46 +++++ .../operations/share/unshare_parameters.go | 8 +- sdk/golang/sdk/access.go | 9 +- sdk/golang/sdk/share.go | 6 +- sdk/python/sdk/zrok/zrok_api/__init__.py | 4 +- sdk/python/sdk/zrok/zrok_api/api/share_api.py | 8 +- .../sdk/zrok/zrok_api/models/__init__.py | 4 +- .../sdk/zrok/zrok_api/models/unaccess_body.py | 162 ++++++++++++++++++ .../sdk/zrok/zrok_api/models/unshare_body.py | 162 ++++++++++++++++++ specs/zrok.yml | 37 ++-- 20 files changed, 606 insertions(+), 148 deletions(-) create mode 100644 sdk/python/sdk/zrok/zrok_api/models/unaccess_body.py create mode 100644 sdk/python/sdk/zrok/zrok_api/models/unshare_body.py diff --git a/cmd/zrok/accessPrivate.go b/cmd/zrok/accessPrivate.go index caec1989..0b3eaaf9 100644 --- a/cmd/zrok/accessPrivate.go +++ b/cmd/zrok/accessPrivate.go @@ -20,7 +20,6 @@ import ( "github.com/openziti/zrok/environment/env_core" "github.com/openziti/zrok/rest_client_zrok" "github.com/openziti/zrok/rest_client_zrok/share" - "github.com/openziti/zrok/rest_model_zrok" "github.com/openziti/zrok/tui" "github.com/openziti/zrok/util" "github.com/sirupsen/logrus" @@ -121,7 +120,7 @@ func (cmd *accessPrivateCommand) accessLocal(args []string, root env_core.Root) req := share.NewAccessParams() req.Body.ShrToken = shrToken req.Body.EnvZID = root.Environment().ZitiIdentity - + accessResp, err := zrok.Share.Access(req, auth) if err != nil { cmd.error(err) @@ -321,11 +320,9 @@ func (cmd *accessPrivateCommand) error(err error) { func (cmd *accessPrivateCommand) shutdown(frontendName, envZId, shrToken string, zrok *rest_client_zrok.Zrok, auth runtime.ClientAuthInfoWriter) { logrus.Infof("shutting down '%v'", shrToken) req := share.NewUnaccessParams() - req.Body = &rest_model_zrok.UnaccessRequest{ - FrontendToken: frontendName, - ShrToken: shrToken, - EnvZID: envZId, - } + req.Body.FrontendToken = frontendName + req.Body.ShrToken = shrToken + req.Body.EnvZID = envZId if _, err := zrok.Share.Unaccess(req, auth); err == nil { logrus.Debugf("shutdown complete") } else { diff --git a/cmd/zrok/release.go b/cmd/zrok/release.go index f68ec68a..ce9949c8 100644 --- a/cmd/zrok/release.go +++ b/cmd/zrok/release.go @@ -4,7 +4,6 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/openziti/zrok/environment" "github.com/openziti/zrok/rest_client_zrok/share" - "github.com/openziti/zrok/rest_model_zrok" "github.com/openziti/zrok/tui" "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -53,11 +52,9 @@ func (cmd *releaseCommand) run(_ *cobra.Command, args []string) { auth := httptransport.APIKeyAuth("X-TOKEN", "header", env.Environment().Token) req := share.NewUnshareParams() - req.Body = &rest_model_zrok.UnshareRequest{ - EnvZID: env.Environment().ZitiIdentity, - ShrToken: shrToken, - Reserved: true, - } + req.Body.EnvZID = env.Environment().ZitiIdentity + req.Body.ShrToken = shrToken + req.Body.Reserved = true if _, err := zrok.Share.Unshare(req, auth); err != nil { if !panicInstead { tui.Error("error releasing share", err) diff --git a/cmd/zrok/testLoopPublic.go b/cmd/zrok/testLoopPublic.go index a47ef721..ec947030 100644 --- a/cmd/zrok/testLoopPublic.go +++ b/cmd/zrok/testLoopPublic.go @@ -281,12 +281,10 @@ func (l *looper) shutdown() { } } - untunnelReq := share.NewUnshareParams() - untunnelReq.Body = &rest_model_zrok.UnshareRequest{ - EnvZID: l.env.ZitiIdentity, - ShrToken: l.shrToken, - } - if _, err := l.zrok.Share.Unshare(untunnelReq, l.auth); err != nil { + req := share.NewUnshareParams() + req.Body.EnvZID = l.env.ZitiIdentity + req.Body.ShrToken = l.shrToken + if _, err := l.zrok.Share.Unshare(req, l.auth); err != nil { logrus.Errorf("error shutting down looper #%d: %v", l.id, err) } } diff --git a/rest_client_zrok/share/unaccess_parameters.go b/rest_client_zrok/share/unaccess_parameters.go index b2c0bc2a..7dc101f1 100644 --- a/rest_client_zrok/share/unaccess_parameters.go +++ b/rest_client_zrok/share/unaccess_parameters.go @@ -14,8 +14,6 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - - "github.com/openziti/zrok/rest_model_zrok" ) // NewUnaccessParams creates a new UnaccessParams object, @@ -64,7 +62,7 @@ UnaccessParams contains all the parameters to send to the API endpoint type UnaccessParams struct { // Body. - Body *rest_model_zrok.UnaccessRequest + Body UnaccessBody timeout time.Duration Context context.Context @@ -120,13 +118,13 @@ func (o *UnaccessParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the unaccess params -func (o *UnaccessParams) WithBody(body *rest_model_zrok.UnaccessRequest) *UnaccessParams { +func (o *UnaccessParams) WithBody(body UnaccessBody) *UnaccessParams { o.SetBody(body) return o } // SetBody adds the body to the unaccess params -func (o *UnaccessParams) SetBody(body *rest_model_zrok.UnaccessRequest) { +func (o *UnaccessParams) SetBody(body UnaccessBody) { o.Body = body } @@ -137,10 +135,8 @@ func (o *UnaccessParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regi return err } var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } + if err := r.SetBodyParam(o.Body); err != nil { + return err } if len(res) > 0 { diff --git a/rest_client_zrok/share/unaccess_responses.go b/rest_client_zrok/share/unaccess_responses.go index cf0ce393..1ac752ee 100644 --- a/rest_client_zrok/share/unaccess_responses.go +++ b/rest_client_zrok/share/unaccess_responses.go @@ -6,10 +6,12 @@ package share // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" ) // UnaccessReader is a Reader for the Unaccess structure. @@ -272,3 +274,47 @@ func (o *UnaccessInternalServerError) readResponse(response runtime.ClientRespon return nil } + +/* +UnaccessBody unaccess body +swagger:model UnaccessBody +*/ +type UnaccessBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` + + // frontend token + FrontendToken string `json:"frontendToken,omitempty"` + + // shr token + ShrToken string `json:"shrToken,omitempty"` +} + +// Validate validates this unaccess body +func (o *UnaccessBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this unaccess body based on context it is used +func (o *UnaccessBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UnaccessBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UnaccessBody) UnmarshalBinary(b []byte) error { + var res UnaccessBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_client_zrok/share/unshare_parameters.go b/rest_client_zrok/share/unshare_parameters.go index 457173a5..c4feba0e 100644 --- a/rest_client_zrok/share/unshare_parameters.go +++ b/rest_client_zrok/share/unshare_parameters.go @@ -14,8 +14,6 @@ import ( "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/strfmt" - - "github.com/openziti/zrok/rest_model_zrok" ) // NewUnshareParams creates a new UnshareParams object, @@ -64,7 +62,7 @@ UnshareParams contains all the parameters to send to the API endpoint type UnshareParams struct { // Body. - Body *rest_model_zrok.UnshareRequest + Body UnshareBody timeout time.Duration Context context.Context @@ -120,13 +118,13 @@ func (o *UnshareParams) SetHTTPClient(client *http.Client) { } // WithBody adds the body to the unshare params -func (o *UnshareParams) WithBody(body *rest_model_zrok.UnshareRequest) *UnshareParams { +func (o *UnshareParams) WithBody(body UnshareBody) *UnshareParams { o.SetBody(body) return o } // SetBody adds the body to the unshare params -func (o *UnshareParams) SetBody(body *rest_model_zrok.UnshareRequest) { +func (o *UnshareParams) SetBody(body UnshareBody) { o.Body = body } @@ -137,10 +135,8 @@ func (o *UnshareParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Regis return err } var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } + if err := r.SetBodyParam(o.Body); err != nil { + return err } if len(res) > 0 { diff --git a/rest_client_zrok/share/unshare_responses.go b/rest_client_zrok/share/unshare_responses.go index 71910bf5..beed049b 100644 --- a/rest_client_zrok/share/unshare_responses.go +++ b/rest_client_zrok/share/unshare_responses.go @@ -6,11 +6,13 @@ package share // Editing this file might prove futile when you re-run the swagger generate command import ( + "context" "fmt" "io" "github.com/go-openapi/runtime" "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" "github.com/openziti/zrok/rest_model_zrok" ) @@ -285,3 +287,47 @@ func (o *UnshareInternalServerError) readResponse(response runtime.ClientRespons return nil } + +/* +UnshareBody unshare body +swagger:model UnshareBody +*/ +type UnshareBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` + + // reserved + Reserved bool `json:"reserved,omitempty"` + + // shr token + ShrToken string `json:"shrToken,omitempty"` +} + +// Validate validates this unshare body +func (o *UnshareBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this unshare body based on context it is used +func (o *UnshareBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UnshareBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UnshareBody) UnmarshalBinary(b []byte) error { + var res UnshareBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_server_zrok/embedded_spec.go b/rest_server_zrok/embedded_spec.go index c3d2f8c8..c6f76678 100644 --- a/rest_server_zrok/embedded_spec.go +++ b/rest_server_zrok/embedded_spec.go @@ -1727,7 +1727,17 @@ func init() { "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/unaccessRequest" + "properties": { + "envZId": { + "type": "string" + }, + "frontendToken": { + "type": "string" + }, + "shrToken": { + "type": "string" + } + } } } ], @@ -1763,7 +1773,17 @@ func init() { "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/unshareRequest" + "properties": { + "envZId": { + "type": "string" + }, + "reserved": { + "type": "boolean" + }, + "shrToken": { + "type": "string" + } + } } } ], @@ -2205,34 +2225,6 @@ func init() { } } }, - "unaccessRequest": { - "type": "object", - "properties": { - "envZId": { - "type": "string" - }, - "frontendToken": { - "type": "string" - }, - "shrToken": { - "type": "string" - } - } - }, - "unshareRequest": { - "type": "object", - "properties": { - "envZId": { - "type": "string" - }, - "reserved": { - "type": "boolean" - }, - "shrToken": { - "type": "string" - } - } - }, "version": { "type": "string" } @@ -3904,7 +3896,17 @@ func init() { "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/unaccessRequest" + "properties": { + "envZId": { + "type": "string" + }, + "frontendToken": { + "type": "string" + }, + "shrToken": { + "type": "string" + } + } } } ], @@ -3940,7 +3942,17 @@ func init() { "name": "body", "in": "body", "schema": { - "$ref": "#/definitions/unshareRequest" + "properties": { + "envZId": { + "type": "string" + }, + "reserved": { + "type": "boolean" + }, + "shrToken": { + "type": "string" + } + } } } ], @@ -4438,34 +4450,6 @@ func init() { } } }, - "unaccessRequest": { - "type": "object", - "properties": { - "envZId": { - "type": "string" - }, - "frontendToken": { - "type": "string" - }, - "shrToken": { - "type": "string" - } - } - }, - "unshareRequest": { - "type": "object", - "properties": { - "envZId": { - "type": "string" - }, - "reserved": { - "type": "boolean" - }, - "shrToken": { - "type": "string" - } - } - }, "version": { "type": "string" } diff --git a/rest_server_zrok/operations/share/unaccess.go b/rest_server_zrok/operations/share/unaccess.go index 7003a681..329ac32f 100644 --- a/rest_server_zrok/operations/share/unaccess.go +++ b/rest_server_zrok/operations/share/unaccess.go @@ -6,9 +6,12 @@ package share // Editing this file might prove futile when you re-run the generate command import ( + "context" "net/http" "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" "github.com/openziti/zrok/rest_model_zrok" ) @@ -69,3 +72,46 @@ func (o *Unaccess) ServeHTTP(rw http.ResponseWriter, r *http.Request) { o.Context.Respond(rw, r, route.Produces, route, res) } + +// UnaccessBody unaccess body +// +// swagger:model UnaccessBody +type UnaccessBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` + + // frontend token + FrontendToken string `json:"frontendToken,omitempty"` + + // shr token + ShrToken string `json:"shrToken,omitempty"` +} + +// Validate validates this unaccess body +func (o *UnaccessBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this unaccess body based on context it is used +func (o *UnaccessBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UnaccessBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UnaccessBody) UnmarshalBinary(b []byte) error { + var res UnaccessBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_server_zrok/operations/share/unaccess_parameters.go b/rest_server_zrok/operations/share/unaccess_parameters.go index 5685787a..93185fd1 100644 --- a/rest_server_zrok/operations/share/unaccess_parameters.go +++ b/rest_server_zrok/operations/share/unaccess_parameters.go @@ -12,8 +12,6 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/validate" - - "github.com/openziti/zrok/rest_model_zrok" ) // NewUnaccessParams creates a new UnaccessParams object @@ -36,7 +34,7 @@ type UnaccessParams struct { /* In: body */ - Body *rest_model_zrok.UnaccessRequest + Body UnaccessBody } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -50,7 +48,7 @@ func (o *UnaccessParams) BindRequest(r *http.Request, route *middleware.MatchedR if runtime.HasBody(r) { defer r.Body.Close() - var body rest_model_zrok.UnaccessRequest + var body UnaccessBody if err := route.Consumer.Consume(r.Body, &body); err != nil { res = append(res, errors.NewParseError("body", "body", "", err)) } else { @@ -65,7 +63,7 @@ func (o *UnaccessParams) BindRequest(r *http.Request, route *middleware.MatchedR } if len(res) == 0 { - o.Body = &body + o.Body = body } } } diff --git a/rest_server_zrok/operations/share/unshare.go b/rest_server_zrok/operations/share/unshare.go index 2d2907aa..292dcf3c 100644 --- a/rest_server_zrok/operations/share/unshare.go +++ b/rest_server_zrok/operations/share/unshare.go @@ -6,9 +6,12 @@ package share // Editing this file might prove futile when you re-run the generate command import ( + "context" "net/http" "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" "github.com/openziti/zrok/rest_model_zrok" ) @@ -69,3 +72,46 @@ func (o *Unshare) ServeHTTP(rw http.ResponseWriter, r *http.Request) { o.Context.Respond(rw, r, route.Produces, route, res) } + +// UnshareBody unshare body +// +// swagger:model UnshareBody +type UnshareBody struct { + + // env z Id + EnvZID string `json:"envZId,omitempty"` + + // reserved + Reserved bool `json:"reserved,omitempty"` + + // shr token + ShrToken string `json:"shrToken,omitempty"` +} + +// Validate validates this unshare body +func (o *UnshareBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this unshare body based on context it is used +func (o *UnshareBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UnshareBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UnshareBody) UnmarshalBinary(b []byte) error { + var res UnshareBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/rest_server_zrok/operations/share/unshare_parameters.go b/rest_server_zrok/operations/share/unshare_parameters.go index 16182936..f808f9ab 100644 --- a/rest_server_zrok/operations/share/unshare_parameters.go +++ b/rest_server_zrok/operations/share/unshare_parameters.go @@ -12,8 +12,6 @@ import ( "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/validate" - - "github.com/openziti/zrok/rest_model_zrok" ) // NewUnshareParams creates a new UnshareParams object @@ -36,7 +34,7 @@ type UnshareParams struct { /* In: body */ - Body *rest_model_zrok.UnshareRequest + Body UnshareBody } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -50,7 +48,7 @@ func (o *UnshareParams) BindRequest(r *http.Request, route *middleware.MatchedRo if runtime.HasBody(r) { defer r.Body.Close() - var body rest_model_zrok.UnshareRequest + var body UnshareBody if err := route.Consumer.Consume(r.Body, &body); err != nil { res = append(res, errors.NewParseError("body", "body", "", err)) } else { @@ -65,7 +63,7 @@ func (o *UnshareParams) BindRequest(r *http.Request, route *middleware.MatchedRo } if len(res) == 0 { - o.Body = &body + o.Body = body } } } diff --git a/sdk/golang/sdk/access.go b/sdk/golang/sdk/access.go index e9729245..9e06db94 100644 --- a/sdk/golang/sdk/access.go +++ b/sdk/golang/sdk/access.go @@ -4,7 +4,6 @@ import ( httptransport "github.com/go-openapi/runtime/client" "github.com/openziti/zrok/environment/env_core" "github.com/openziti/zrok/rest_client_zrok/share" - "github.com/openziti/zrok/rest_model_zrok" "github.com/pkg/errors" ) @@ -33,11 +32,9 @@ func CreateAccess(root env_core.Root, request *AccessRequest) (*Access, error) { func DeleteAccess(root env_core.Root, acc *Access) error { out := share.NewUnaccessParams() - out.Body = &rest_model_zrok.UnaccessRequest{ - FrontendToken: acc.Token, - ShrToken: acc.ShareToken, - EnvZID: root.Environment().ZitiIdentity, - } + out.Body.FrontendToken = acc.Token + out.Body.ShrToken = acc.ShareToken + out.Body.EnvZID = root.Environment().ZitiIdentity zrok, err := root.Client() if err != nil { diff --git a/sdk/golang/sdk/share.go b/sdk/golang/sdk/share.go index 386cb601..22e22d06 100644 --- a/sdk/golang/sdk/share.go +++ b/sdk/golang/sdk/share.go @@ -97,10 +97,8 @@ func newPublicShare(root env_core.Root, request *ShareRequest) *share.ShareParam func DeleteShare(root env_core.Root, shr *Share) error { req := share.NewUnshareParams() - req.Body = &rest_model_zrok.UnshareRequest{ - EnvZID: root.Environment().ZitiIdentity, - ShrToken: shr.Token, - } + req.Body.EnvZID = root.Environment().ZitiIdentity + req.Body.ShrToken = shr.Token zrok, err := root.Client() if err != nil { diff --git a/sdk/python/sdk/zrok/zrok_api/__init__.py b/sdk/python/sdk/zrok/zrok_api/__init__.py index 440fc09a..5a792553 100644 --- a/sdk/python/sdk/zrok/zrok_api/__init__.py +++ b/sdk/python/sdk/zrok/zrok_api/__init__.py @@ -79,7 +79,7 @@ from zrok_api.models.spark_data import SparkData from zrok_api.models.spark_data_sample import SparkDataSample from zrok_api.models.sparklines_body import SparklinesBody from zrok_api.models.token_generate_body import TokenGenerateBody -from zrok_api.models.unaccess_request import UnaccessRequest -from zrok_api.models.unshare_request import UnshareRequest +from zrok_api.models.unaccess_body import UnaccessBody +from zrok_api.models.unshare_body import UnshareBody from zrok_api.models.verify_body import VerifyBody from zrok_api.models.version import Version diff --git a/sdk/python/sdk/zrok/zrok_api/api/share_api.py b/sdk/python/sdk/zrok/zrok_api/api/share_api.py index a21c3aaf..39593dac 100644 --- a/sdk/python/sdk/zrok/zrok_api/api/share_api.py +++ b/sdk/python/sdk/zrok/zrok_api/api/share_api.py @@ -227,7 +227,7 @@ class ShareApi(object): >>> result = thread.get() :param async_req bool - :param UnaccessRequest body: + :param UnaccessBody body: :return: None If the method is called asynchronously, returns the request thread. @@ -248,7 +248,7 @@ class ShareApi(object): >>> result = thread.get() :param async_req bool - :param UnaccessRequest body: + :param UnaccessBody body: :return: None If the method is called asynchronously, returns the request thread. @@ -316,7 +316,7 @@ class ShareApi(object): >>> result = thread.get() :param async_req bool - :param UnshareRequest body: + :param UnshareBody body: :return: None If the method is called asynchronously, returns the request thread. @@ -337,7 +337,7 @@ class ShareApi(object): >>> result = thread.get() :param async_req bool - :param UnshareRequest body: + :param UnshareBody body: :return: None If the method is called asynchronously, returns the request thread. diff --git a/sdk/python/sdk/zrok/zrok_api/models/__init__.py b/sdk/python/sdk/zrok/zrok_api/models/__init__.py index 0b58da08..6dedc92c 100644 --- a/sdk/python/sdk/zrok/zrok_api/models/__init__.py +++ b/sdk/python/sdk/zrok/zrok_api/models/__init__.py @@ -69,7 +69,7 @@ from zrok_api.models.spark_data import SparkData from zrok_api.models.spark_data_sample import SparkDataSample from zrok_api.models.sparklines_body import SparklinesBody from zrok_api.models.token_generate_body import TokenGenerateBody -from zrok_api.models.unaccess_request import UnaccessRequest -from zrok_api.models.unshare_request import UnshareRequest +from zrok_api.models.unaccess_body import UnaccessBody +from zrok_api.models.unshare_body import UnshareBody from zrok_api.models.verify_body import VerifyBody from zrok_api.models.version import Version diff --git a/sdk/python/sdk/zrok/zrok_api/models/unaccess_body.py b/sdk/python/sdk/zrok/zrok_api/models/unaccess_body.py new file mode 100644 index 00000000..b29248b9 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/unaccess_body.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + zrok + + zrok client access # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnaccessBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'frontend_token': 'str', + 'env_zid': 'str', + 'shr_token': 'str' + } + + attribute_map = { + 'frontend_token': 'frontendToken', + 'env_zid': 'envZId', + 'shr_token': 'shrToken' + } + + def __init__(self, frontend_token=None, env_zid=None, shr_token=None): # noqa: E501 + """UnaccessBody - a model defined in Swagger""" # noqa: E501 + self._frontend_token = None + self._env_zid = None + self._shr_token = None + self.discriminator = None + if frontend_token is not None: + self.frontend_token = frontend_token + if env_zid is not None: + self.env_zid = env_zid + if shr_token is not None: + self.shr_token = shr_token + + @property + def frontend_token(self): + """Gets the frontend_token of this UnaccessBody. # noqa: E501 + + + :return: The frontend_token of this UnaccessBody. # noqa: E501 + :rtype: str + """ + return self._frontend_token + + @frontend_token.setter + def frontend_token(self, frontend_token): + """Sets the frontend_token of this UnaccessBody. + + + :param frontend_token: The frontend_token of this UnaccessBody. # noqa: E501 + :type: str + """ + + self._frontend_token = frontend_token + + @property + def env_zid(self): + """Gets the env_zid of this UnaccessBody. # noqa: E501 + + + :return: The env_zid of this UnaccessBody. # noqa: E501 + :rtype: str + """ + return self._env_zid + + @env_zid.setter + def env_zid(self, env_zid): + """Sets the env_zid of this UnaccessBody. + + + :param env_zid: The env_zid of this UnaccessBody. # noqa: E501 + :type: str + """ + + self._env_zid = env_zid + + @property + def shr_token(self): + """Gets the shr_token of this UnaccessBody. # noqa: E501 + + + :return: The shr_token of this UnaccessBody. # noqa: E501 + :rtype: str + """ + return self._shr_token + + @shr_token.setter + def shr_token(self, shr_token): + """Sets the shr_token of this UnaccessBody. + + + :param shr_token: The shr_token of this UnaccessBody. # noqa: E501 + :type: str + """ + + self._shr_token = shr_token + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UnaccessBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnaccessBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/sdk/python/sdk/zrok/zrok_api/models/unshare_body.py b/sdk/python/sdk/zrok/zrok_api/models/unshare_body.py new file mode 100644 index 00000000..59ffd8f2 --- /dev/null +++ b/sdk/python/sdk/zrok/zrok_api/models/unshare_body.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + zrok + + zrok client access # noqa: E501 + + OpenAPI spec version: 1.0.0 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class UnshareBody(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'env_zid': 'str', + 'shr_token': 'str', + 'reserved': 'bool' + } + + attribute_map = { + 'env_zid': 'envZId', + 'shr_token': 'shrToken', + 'reserved': 'reserved' + } + + def __init__(self, env_zid=None, shr_token=None, reserved=None): # noqa: E501 + """UnshareBody - a model defined in Swagger""" # noqa: E501 + self._env_zid = None + self._shr_token = None + self._reserved = None + self.discriminator = None + if env_zid is not None: + self.env_zid = env_zid + if shr_token is not None: + self.shr_token = shr_token + if reserved is not None: + self.reserved = reserved + + @property + def env_zid(self): + """Gets the env_zid of this UnshareBody. # noqa: E501 + + + :return: The env_zid of this UnshareBody. # noqa: E501 + :rtype: str + """ + return self._env_zid + + @env_zid.setter + def env_zid(self, env_zid): + """Sets the env_zid of this UnshareBody. + + + :param env_zid: The env_zid of this UnshareBody. # noqa: E501 + :type: str + """ + + self._env_zid = env_zid + + @property + def shr_token(self): + """Gets the shr_token of this UnshareBody. # noqa: E501 + + + :return: The shr_token of this UnshareBody. # noqa: E501 + :rtype: str + """ + return self._shr_token + + @shr_token.setter + def shr_token(self, shr_token): + """Sets the shr_token of this UnshareBody. + + + :param shr_token: The shr_token of this UnshareBody. # noqa: E501 + :type: str + """ + + self._shr_token = shr_token + + @property + def reserved(self): + """Gets the reserved of this UnshareBody. # noqa: E501 + + + :return: The reserved of this UnshareBody. # noqa: E501 + :rtype: bool + """ + return self._reserved + + @reserved.setter + def reserved(self, reserved): + """Sets the reserved of this UnshareBody. + + + :param reserved: The reserved of this UnshareBody. # noqa: E501 + :type: bool + """ + + self._reserved = reserved + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(UnshareBody, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnshareBody): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/specs/zrok.yml b/specs/zrok.yml index bd8de819..38315bcd 100644 --- a/specs/zrok.yml +++ b/specs/zrok.yml @@ -1102,7 +1102,13 @@ paths: - name: body in: body schema: - $ref: "#/definitions/unaccessRequest" + properties: + frontendToken: + type: string + envZId: + type: string + shrToken: + type: string responses: 200: description: access removed @@ -1124,7 +1130,13 @@ paths: - name: body in: body schema: - $ref: "#/definitions/unshareRequest" + properties: + envZId: + type: string + shrToken: + type: string + reserved: + type: boolean responses: 200: description: share removed @@ -1138,7 +1150,6 @@ paths: $ref: "#/definitions/errorMessage" definitions: - authUser: type: object properties: @@ -1384,26 +1395,6 @@ definitions: tx: type: number - unaccessRequest: - type: object - properties: - frontendToken: - type: string - envZId: - type: string - shrToken: - type: string - - unshareRequest: - type: object - properties: - envZId: - type: string - shrToken: - type: string - reserved: - type: boolean - version: type: string