openapi: generate

This commit is contained in:
2025-04-02 13:02:40 -07:00
committed by Quaternions
parent 722ac5178f
commit 493c6d084a
12 changed files with 877 additions and 0 deletions

@ -1467,6 +1467,72 @@ func decodeGetMapfixParams(args [1]string, argsEscaped bool, r *http.Request) (p
return params, nil
}
// GetOperationParams is parameters of getOperation operation.
type GetOperationParams struct {
// The unique identifier for a long-running operation.
OperationID int32
}
func unpackGetOperationParams(packed middleware.Parameters) (params GetOperationParams) {
{
key := middleware.ParameterKey{
Name: "OperationID",
In: "path",
}
params.OperationID = packed[key].(int32)
}
return params
}
func decodeGetOperationParams(args [1]string, argsEscaped bool, r *http.Request) (params GetOperationParams, _ error) {
// Decode path: OperationID.
if err := func() error {
param := args[0]
if argsEscaped {
unescaped, err := url.PathUnescape(args[0])
if err != nil {
return errors.Wrap(err, "unescape path")
}
param = unescaped
}
if len(param) > 0 {
d := uri.NewPathDecoder(uri.PathDecoderConfig{
Param: "OperationID",
Value: param,
Style: uri.PathStyleSimple,
Explode: false,
})
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToInt32(val)
if err != nil {
return err
}
params.OperationID = c
return nil
}(); err != nil {
return err
}
} else {
return validate.ErrFieldRequired
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "OperationID",
In: "path",
Err: err,
}
}
return params, nil
}
// GetScriptParams is parameters of getScript operation.
type GetScriptParams struct {
// The unique identifier for a script.