openapi: generate

This commit is contained in:
Quaternions 2025-01-13 05:01:04 -08:00
parent 8e223d432e
commit a39e2892ef
3 changed files with 72 additions and 0 deletions

@ -2419,6 +2419,23 @@ func (c *Client) sendListSubmissions(ctx context.Context, params ListSubmissions
return res, errors.Wrap(err, "encode query")
}
}
{
// Encode "Sort" parameter.
cfg := uri.QueryParameterEncodingConfig{
Name: "Sort",
Style: uri.QueryStyleForm,
Explode: true,
}
if err := q.EncodeParam(cfg, func(e uri.Encoder) error {
if val, ok := params.Sort.Get(); ok {
return e.EncodeValue(conv.Int32ToString(val))
}
return nil
}); err != nil {
return res, errors.Wrap(err, "encode query")
}
}
u.RawQuery = q.Values().Encode()
stage = "EncodeRequest"

@ -3346,6 +3346,10 @@ func (s *Server) handleListSubmissionsRequest(args [0]string, argsEscaped bool,
Name: "GameID",
In: "query",
}: params.GameID,
{
Name: "Sort",
In: "query",
}: params.Sort,
},
Raw: r,
}

@ -1467,6 +1467,7 @@ type ListSubmissionsParams struct {
DisplayName OptString
Creator OptString
GameID OptInt32
Sort OptInt32
}
func unpackListSubmissionsParams(packed middleware.Parameters) (params ListSubmissionsParams) {
@ -1511,6 +1512,15 @@ func unpackListSubmissionsParams(packed middleware.Parameters) (params ListSubmi
params.GameID = v.(OptInt32)
}
}
{
key := middleware.ParameterKey{
Name: "Sort",
In: "query",
}
if v, ok := packed[key]; ok {
params.Sort = v.(OptInt32)
}
}
return params
}
@ -1791,6 +1801,47 @@ func decodeListSubmissionsParams(args [0]string, argsEscaped bool, r *http.Reque
Err: err,
}
}
// Decode query: Sort.
if err := func() error {
cfg := uri.QueryParameterDecodingConfig{
Name: "Sort",
Style: uri.QueryStyleForm,
Explode: true,
}
if err := q.HasParam(cfg); err == nil {
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
var paramsDotSortVal int32
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToInt32(val)
if err != nil {
return err
}
paramsDotSortVal = c
return nil
}(); err != nil {
return err
}
params.Sort.SetTo(paramsDotSortVal)
return nil
}); err != nil {
return err
}
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "Sort",
In: "query",
Err: err,
}
}
return params, nil
}