openapi-internal: generate

This commit is contained in:
Quaternions 2025-03-31 15:42:12 -07:00
parent 0b64440975
commit e5e85db1fd
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131
3 changed files with 23 additions and 33 deletions

@ -312,18 +312,15 @@ func (c *Client) sendActionSubmissionUploaded(ctx context.Context, params Action
stage = "EncodeQueryParams"
q := uri.NewQueryEncoder()
{
// Encode "TargetAssetID" parameter.
// Encode "UploadedAssetID" parameter.
cfg := uri.QueryParameterEncodingConfig{
Name: "TargetAssetID",
Name: "UploadedAssetID",
Style: uri.QueryStyleForm,
Explode: true,
}
if err := q.EncodeParam(cfg, func(e uri.Encoder) error {
if val, ok := params.TargetAssetID.Get(); ok {
return e.EncodeValue(conv.Int64ToString(val))
}
return nil
return e.EncodeValue(conv.Int64ToString(params.UploadedAssetID))
}); err != nil {
return res, errors.Wrap(err, "encode query")
}

@ -282,9 +282,9 @@ func (s *Server) handleActionSubmissionUploadedRequest(args [1]string, argsEscap
In: "path",
}: params.SubmissionID,
{
Name: "TargetAssetID",
Name: "UploadedAssetID",
In: "query",
}: params.TargetAssetID,
}: params.UploadedAssetID,
},
Raw: r,
}

@ -145,8 +145,8 @@ func decodeActionSubmissionAcceptedParams(args [1]string, argsEscaped bool, r *h
// ActionSubmissionUploadedParams is parameters of actionSubmissionUploaded operation.
type ActionSubmissionUploadedParams struct {
// The unique identifier for a submission.
SubmissionID int64
TargetAssetID OptInt64
SubmissionID int64
UploadedAssetID int64
}
func unpackActionSubmissionUploadedParams(packed middleware.Parameters) (params ActionSubmissionUploadedParams) {
@ -159,12 +159,10 @@ func unpackActionSubmissionUploadedParams(packed middleware.Parameters) (params
}
{
key := middleware.ParameterKey{
Name: "TargetAssetID",
Name: "UploadedAssetID",
In: "query",
}
if v, ok := packed[key]; ok {
params.TargetAssetID = v.(OptInt64)
}
params.UploadedAssetID = packed[key].(int64)
}
return params
}
@ -216,43 +214,38 @@ func decodeActionSubmissionUploadedParams(args [1]string, argsEscaped bool, r *h
Err: err,
}
}
// Decode query: TargetAssetID.
// Decode query: UploadedAssetID.
if err := func() error {
cfg := uri.QueryParameterDecodingConfig{
Name: "TargetAssetID",
Name: "UploadedAssetID",
Style: uri.QueryStyleForm,
Explode: true,
}
if err := q.HasParam(cfg); err == nil {
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
var paramsDotTargetAssetIDVal int64
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToInt64(val)
if err != nil {
return err
}
paramsDotTargetAssetIDVal = c
return nil
}(); err != nil {
val, err := d.DecodeValue()
if err != nil {
return err
}
params.TargetAssetID.SetTo(paramsDotTargetAssetIDVal)
c, err := conv.ToInt64(val)
if err != nil {
return err
}
params.UploadedAssetID = c
return nil
}); err != nil {
return err
}
} else {
return err
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "TargetAssetID",
Name: "UploadedAssetID",
In: "query",
Err: err,
}