mirror of
https://github.com/openziti/zrok.git
synced 2025-08-17 19:31:12 +02:00
support for 'patch' access (frontend) to update description (for bind address) (#834)
This commit is contained in:
@@ -38,6 +38,8 @@ type ClientService interface {
|
||||
|
||||
Unshare(params *UnshareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UnshareOK, error)
|
||||
|
||||
UpdateAccess(params *UpdateAccessParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAccessOK, error)
|
||||
|
||||
UpdateShare(params *UpdateShareParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateShareOK, error)
|
||||
|
||||
SetTransport(transport runtime.ClientTransport)
|
||||
@@ -199,6 +201,45 @@ func (a *Client) Unshare(params *UnshareParams, authInfo runtime.ClientAuthInfoW
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateAccess update access API
|
||||
*/
|
||||
func (a *Client) UpdateAccess(params *UpdateAccessParams, authInfo runtime.ClientAuthInfoWriter, opts ...ClientOption) (*UpdateAccessOK, error) {
|
||||
// TODO: Validate the params before sending
|
||||
if params == nil {
|
||||
params = NewUpdateAccessParams()
|
||||
}
|
||||
op := &runtime.ClientOperation{
|
||||
ID: "updateAccess",
|
||||
Method: "PATCH",
|
||||
PathPattern: "/access",
|
||||
ProducesMediaTypes: []string{"application/zrok.v1+json"},
|
||||
ConsumesMediaTypes: []string{"application/zrok.v1+json"},
|
||||
Schemes: []string{"http"},
|
||||
Params: params,
|
||||
Reader: &UpdateAccessReader{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.(*UpdateAccessOK)
|
||||
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 updateAccess: API contract not enforced by server. Client expected to get an error, but got: %T", result)
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
/*
|
||||
UpdateShare update share API
|
||||
*/
|
||||
|
Reference in New Issue
Block a user