support for 'patch' access (frontend) to update description (for bind address) (#834)

This commit is contained in:
Michael Quigley
2025-02-04 22:16:02 -05:00
parent c9c60b4dd1
commit 2a49705a48
26 changed files with 1545 additions and 0 deletions

View File

@@ -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
*/