2024-11-26 01:22:45 +00:00
|
|
|
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
|
|
|
|
package api
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
|
|
|
|
"github.com/go-faster/errors"
|
|
|
|
|
|
|
|
"github.com/ogen-go/ogen/conv"
|
|
|
|
"github.com/ogen-go/ogen/middleware"
|
|
|
|
"github.com/ogen-go/ogen/ogenerrors"
|
|
|
|
"github.com/ogen-go/ogen/uri"
|
|
|
|
"github.com/ogen-go/ogen/validate"
|
|
|
|
)
|
|
|
|
|
2024-11-28 01:46:54 +00:00
|
|
|
// ActionSubmissionRejectParams is parameters of actionSubmissionReject operation.
|
|
|
|
type ActionSubmissionRejectParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-28 01:46:54 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackActionSubmissionRejectParams(packed middleware.Parameters) (params ActionSubmissionRejectParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeActionSubmissionRejectParams(args [1]string, argsEscaped bool, r *http.Request) (params ActionSubmissionRejectParams, _ error) {
|
|
|
|
// Decode path: SubmissionID.
|
|
|
|
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: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.SubmissionID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActionSubmissionRequestChangesParams is parameters of actionSubmissionRequestChanges operation.
|
|
|
|
type ActionSubmissionRequestChangesParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-28 01:46:54 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackActionSubmissionRequestChangesParams(packed middleware.Parameters) (params ActionSubmissionRequestChangesParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeActionSubmissionRequestChangesParams(args [1]string, argsEscaped bool, r *http.Request) (params ActionSubmissionRequestChangesParams, _ error) {
|
|
|
|
// Decode path: SubmissionID.
|
|
|
|
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: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.SubmissionID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActionSubmissionRevokeParams is parameters of actionSubmissionRevoke operation.
|
|
|
|
type ActionSubmissionRevokeParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-28 01:46:54 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackActionSubmissionRevokeParams(packed middleware.Parameters) (params ActionSubmissionRevokeParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeActionSubmissionRevokeParams(args [1]string, argsEscaped bool, r *http.Request) (params ActionSubmissionRevokeParams, _ error) {
|
|
|
|
// Decode path: SubmissionID.
|
|
|
|
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: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.SubmissionID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActionSubmissionSubmitParams is parameters of actionSubmissionSubmit operation.
|
|
|
|
type ActionSubmissionSubmitParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-28 01:46:54 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackActionSubmissionSubmitParams(packed middleware.Parameters) (params ActionSubmissionSubmitParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeActionSubmissionSubmitParams(args [1]string, argsEscaped bool, r *http.Request) (params ActionSubmissionSubmitParams, _ error) {
|
|
|
|
// Decode path: SubmissionID.
|
|
|
|
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: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.SubmissionID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-14 19:55:56 +00:00
|
|
|
// ActionSubmissionTriggerUploadParams is parameters of actionSubmissionTriggerUpload operation.
|
|
|
|
type ActionSubmissionTriggerUploadParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-28 01:46:54 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
2024-12-14 19:55:56 +00:00
|
|
|
func unpackActionSubmissionTriggerUploadParams(packed middleware.Parameters) (params ActionSubmissionTriggerUploadParams) {
|
2024-11-28 01:46:54 +00:00
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
2024-12-14 19:55:56 +00:00
|
|
|
func decodeActionSubmissionTriggerUploadParams(args [1]string, argsEscaped bool, r *http.Request) (params ActionSubmissionTriggerUploadParams, _ error) {
|
2024-11-28 01:46:54 +00:00
|
|
|
// Decode path: SubmissionID.
|
|
|
|
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: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.SubmissionID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActionSubmissionTriggerValidateParams is parameters of actionSubmissionTriggerValidate operation.
|
|
|
|
type ActionSubmissionTriggerValidateParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-28 01:46:54 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackActionSubmissionTriggerValidateParams(packed middleware.Parameters) (params ActionSubmissionTriggerValidateParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeActionSubmissionTriggerValidateParams(args [1]string, argsEscaped bool, r *http.Request) (params ActionSubmissionTriggerValidateParams, _ error) {
|
|
|
|
// Decode path: SubmissionID.
|
|
|
|
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: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.SubmissionID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-06 00:36:15 +00:00
|
|
|
// DeleteScriptParams is parameters of deleteScript operation.
|
|
|
|
type DeleteScriptParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a script.
|
2024-12-06 00:36:15 +00:00
|
|
|
ScriptID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackDeleteScriptParams(packed middleware.Parameters) (params DeleteScriptParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ScriptID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.ScriptID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeDeleteScriptParams(args [1]string, argsEscaped bool, r *http.Request) (params DeleteScriptParams, _ error) {
|
|
|
|
// Decode path: ScriptID.
|
|
|
|
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: "ScriptID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.ScriptID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "ScriptID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeleteScriptPolicyParams is parameters of deleteScriptPolicy operation.
|
|
|
|
type DeleteScriptPolicyParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a script policy.
|
2024-12-06 00:36:15 +00:00
|
|
|
ScriptPolicyID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackDeleteScriptPolicyParams(packed middleware.Parameters) (params DeleteScriptPolicyParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ScriptPolicyID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.ScriptPolicyID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeDeleteScriptPolicyParams(args [1]string, argsEscaped bool, r *http.Request) (params DeleteScriptPolicyParams, _ error) {
|
|
|
|
// Decode path: ScriptPolicyID.
|
|
|
|
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: "ScriptPolicyID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.ScriptPolicyID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "ScriptPolicyID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetScriptParams is parameters of getScript operation.
|
|
|
|
type GetScriptParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a script.
|
2024-12-06 00:36:15 +00:00
|
|
|
ScriptID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackGetScriptParams(packed middleware.Parameters) (params GetScriptParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ScriptID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.ScriptID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeGetScriptParams(args [1]string, argsEscaped bool, r *http.Request) (params GetScriptParams, _ error) {
|
|
|
|
// Decode path: ScriptID.
|
|
|
|
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: "ScriptID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.ScriptID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "ScriptID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetScriptPolicyParams is parameters of getScriptPolicy operation.
|
|
|
|
type GetScriptPolicyParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a script policy.
|
2024-12-06 00:36:15 +00:00
|
|
|
ScriptPolicyID int64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackGetScriptPolicyParams(packed middleware.Parameters) (params GetScriptPolicyParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ScriptPolicyID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.ScriptPolicyID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeGetScriptPolicyParams(args [1]string, argsEscaped bool, r *http.Request) (params GetScriptPolicyParams, _ error) {
|
|
|
|
// Decode path: ScriptPolicyID.
|
|
|
|
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: "ScriptPolicyID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.ScriptPolicyID = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "ScriptPolicyID",
|
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
// GetSubmissionParams is parameters of getSubmission operation.
|
|
|
|
type GetSubmissionParams struct {
|
2024-12-10 06:06:33 +00:00
|
|
|
// The unique identifier for a submission.
|
2024-11-26 20:39:10 +00:00
|
|
|
SubmissionID int64
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
func unpackGetSubmissionParams(packed middleware.Parameters) (params GetSubmissionParams) {
|
2024-11-26 01:22:45 +00:00
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
2024-11-26 20:39:10 +00:00
|
|
|
Name: "SubmissionID",
|
2024-11-26 01:22:45 +00:00
|
|
|
In: "path",
|
|
|
|
}
|
2024-11-26 20:39:10 +00:00
|
|
|
params.SubmissionID = packed[key].(int64)
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
func decodeGetSubmissionParams(args [1]string, argsEscaped bool, r *http.Request) (params GetSubmissionParams, _ error) {
|
|
|
|
// Decode path: SubmissionID.
|
2024-11-26 01:22:45 +00:00
|
|
|
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{
|
2024-11-26 20:39:10 +00:00
|
|
|
Param: "SubmissionID",
|
2024-11-26 01:22:45 +00:00
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
params.SubmissionID = c
|
2024-11-26 01:22:45 +00:00
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
2024-11-26 20:39:10 +00:00
|
|
|
Name: "SubmissionID",
|
2024-11-26 01:22:45 +00:00
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-18 05:36:40 +00:00
|
|
|
// ListScriptPolicyParams is parameters of listScriptPolicy operation.
|
|
|
|
type ListScriptPolicyParams struct {
|
|
|
|
Page int32
|
|
|
|
Limit int32
|
|
|
|
FromScriptHash OptString
|
|
|
|
ToScriptID OptInt64
|
|
|
|
Policy OptInt32
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackListScriptPolicyParams(packed middleware.Parameters) (params ListScriptPolicyParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Page",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.Page = packed[key].(int32)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Limit",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.Limit = packed[key].(int32)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "FromScriptHash",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.FromScriptHash = v.(OptString)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ToScriptID",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.ToScriptID = v.(OptInt64)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Policy",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.Policy = v.(OptInt32)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeListScriptPolicyParams(args [0]string, argsEscaped bool, r *http.Request) (params ListScriptPolicyParams, _ error) {
|
|
|
|
q := uri.NewQueryDecoder(r.URL.Query())
|
|
|
|
// Decode query: Page.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Page",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.Page = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.Int{
|
|
|
|
MinSet: true,
|
|
|
|
Min: 1,
|
|
|
|
MaxSet: false,
|
|
|
|
Max: 0,
|
|
|
|
MinExclusive: false,
|
|
|
|
MaxExclusive: false,
|
|
|
|
MultipleOfSet: false,
|
|
|
|
MultipleOf: 0,
|
|
|
|
}).Validate(int64(params.Page)); err != nil {
|
|
|
|
return errors.Wrap(err, "int")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Page",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Limit.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Limit",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.Limit = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.Int{
|
|
|
|
MinSet: true,
|
|
|
|
Min: 1,
|
|
|
|
MaxSet: true,
|
|
|
|
Max: 100,
|
|
|
|
MinExclusive: false,
|
|
|
|
MaxExclusive: false,
|
|
|
|
MultipleOfSet: false,
|
|
|
|
MultipleOf: 0,
|
|
|
|
}).Validate(int64(params.Limit)); err != nil {
|
|
|
|
return errors.Wrap(err, "int")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Limit",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: FromScriptHash.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "FromScriptHash",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotFromScriptHashVal string
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToString(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotFromScriptHashVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.FromScriptHash.SetTo(paramsDotFromScriptHashVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if value, ok := params.FromScriptHash.Get(); ok {
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.String{
|
|
|
|
MinLength: 16,
|
|
|
|
MinLengthSet: true,
|
|
|
|
MaxLength: 16,
|
|
|
|
MaxLengthSet: true,
|
|
|
|
Email: false,
|
|
|
|
Hostname: false,
|
|
|
|
Regex: nil,
|
|
|
|
}).Validate(string(value)); err != nil {
|
|
|
|
return errors.Wrap(err, "string")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "FromScriptHash",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: ToScriptID.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "ToScriptID",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotToScriptIDVal int64
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotToScriptIDVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.ToScriptID.SetTo(paramsDotToScriptIDVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "ToScriptID",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Policy.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Policy",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotPolicyVal int32
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotPolicyVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.Policy.SetTo(paramsDotPolicyVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Policy",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-18 23:06:39 +00:00
|
|
|
// ListScriptsParams is parameters of listScripts operation.
|
|
|
|
type ListScriptsParams struct {
|
|
|
|
Page int32
|
|
|
|
Limit int32
|
|
|
|
Hash OptString
|
|
|
|
Name OptString
|
|
|
|
Source OptString
|
|
|
|
SubmissionID OptInt64
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackListScriptsParams(packed middleware.Parameters) (params ListScriptsParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Page",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.Page = packed[key].(int32)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Limit",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.Limit = packed[key].(int32)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Hash",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.Hash = v.(OptString)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Name",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.Name = v.(OptString)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Source",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.Source = v.(OptString)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.SubmissionID = v.(OptInt64)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeListScriptsParams(args [0]string, argsEscaped bool, r *http.Request) (params ListScriptsParams, _ error) {
|
|
|
|
q := uri.NewQueryDecoder(r.URL.Query())
|
|
|
|
// Decode query: Page.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Page",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.Page = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.Int{
|
|
|
|
MinSet: true,
|
|
|
|
Min: 1,
|
|
|
|
MaxSet: false,
|
|
|
|
Max: 0,
|
|
|
|
MinExclusive: false,
|
|
|
|
MaxExclusive: false,
|
|
|
|
MultipleOfSet: false,
|
|
|
|
MultipleOf: 0,
|
|
|
|
}).Validate(int64(params.Page)); err != nil {
|
|
|
|
return errors.Wrap(err, "int")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Page",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Limit.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Limit",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.Limit = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.Int{
|
|
|
|
MinSet: true,
|
|
|
|
Min: 1,
|
|
|
|
MaxSet: true,
|
|
|
|
Max: 100,
|
|
|
|
MinExclusive: false,
|
|
|
|
MaxExclusive: false,
|
|
|
|
MultipleOfSet: false,
|
|
|
|
MultipleOf: 0,
|
|
|
|
}).Validate(int64(params.Limit)); err != nil {
|
|
|
|
return errors.Wrap(err, "int")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Limit",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Hash.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Hash",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotHashVal string
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToString(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotHashVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.Hash.SetTo(paramsDotHashVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if value, ok := params.Hash.Get(); ok {
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.String{
|
|
|
|
MinLength: 16,
|
|
|
|
MinLengthSet: true,
|
|
|
|
MaxLength: 16,
|
|
|
|
MaxLengthSet: true,
|
|
|
|
Email: false,
|
|
|
|
Hostname: false,
|
|
|
|
Regex: nil,
|
|
|
|
}).Validate(string(value)); err != nil {
|
|
|
|
return errors.Wrap(err, "string")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Hash",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Name.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Name",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotNameVal string
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToString(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotNameVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.Name.SetTo(paramsDotNameVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if value, ok := params.Name.Get(); ok {
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.String{
|
|
|
|
MinLength: 0,
|
|
|
|
MinLengthSet: false,
|
|
|
|
MaxLength: 128,
|
|
|
|
MaxLengthSet: true,
|
|
|
|
Email: false,
|
|
|
|
Hostname: false,
|
|
|
|
Regex: nil,
|
|
|
|
}).Validate(string(value)); err != nil {
|
|
|
|
return errors.Wrap(err, "string")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Name",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Source.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Source",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotSourceVal string
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToString(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotSourceVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.Source.SetTo(paramsDotSourceVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if value, ok := params.Source.Get(); ok {
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.String{
|
|
|
|
MinLength: 0,
|
|
|
|
MinLengthSet: false,
|
|
|
|
MaxLength: 1048576,
|
|
|
|
MaxLengthSet: true,
|
|
|
|
Email: false,
|
|
|
|
Hostname: false,
|
|
|
|
Regex: nil,
|
|
|
|
}).Validate(string(value)); err != nil {
|
|
|
|
return errors.Wrap(err, "string")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Source",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: SubmissionID.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotSubmissionIDVal int64
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotSubmissionIDVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.SubmissionID.SetTo(paramsDotSubmissionIDVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-18 05:36:40 +00:00
|
|
|
// ListSubmissionsParams is parameters of listSubmissions operation.
|
|
|
|
type ListSubmissionsParams struct {
|
|
|
|
Page int32
|
|
|
|
Limit int32
|
|
|
|
DisplayName OptString
|
|
|
|
Creator OptString
|
|
|
|
GameID OptInt32
|
|
|
|
}
|
|
|
|
|
|
|
|
func unpackListSubmissionsParams(packed middleware.Parameters) (params ListSubmissionsParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Page",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.Page = packed[key].(int32)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Limit",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.Limit = packed[key].(int32)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "DisplayName",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.DisplayName = v.(OptString)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "Creator",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.Creator = v.(OptString)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "GameID",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
if v, ok := packed[key]; ok {
|
|
|
|
params.GameID = v.(OptInt32)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeListSubmissionsParams(args [0]string, argsEscaped bool, r *http.Request) (params ListSubmissionsParams, _ error) {
|
|
|
|
q := uri.NewQueryDecoder(r.URL.Query())
|
|
|
|
// Decode query: Page.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Page",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.Page = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.Int{
|
|
|
|
MinSet: true,
|
|
|
|
Min: 1,
|
|
|
|
MaxSet: false,
|
|
|
|
Max: 0,
|
|
|
|
MinExclusive: false,
|
|
|
|
MaxExclusive: false,
|
|
|
|
MultipleOfSet: false,
|
|
|
|
MultipleOf: 0,
|
|
|
|
}).Validate(int64(params.Page)); err != nil {
|
|
|
|
return errors.Wrap(err, "int")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Page",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Limit.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Limit",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.Limit = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.Int{
|
|
|
|
MinSet: true,
|
|
|
|
Min: 1,
|
|
|
|
MaxSet: true,
|
|
|
|
Max: 100,
|
|
|
|
MinExclusive: false,
|
|
|
|
MaxExclusive: false,
|
|
|
|
MultipleOfSet: false,
|
|
|
|
MultipleOf: 0,
|
|
|
|
}).Validate(int64(params.Limit)); err != nil {
|
|
|
|
return errors.Wrap(err, "int")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Limit",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: DisplayName.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "DisplayName",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotDisplayNameVal string
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToString(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotDisplayNameVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.DisplayName.SetTo(paramsDotDisplayNameVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if value, ok := params.DisplayName.Get(); ok {
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.String{
|
|
|
|
MinLength: 0,
|
|
|
|
MinLengthSet: false,
|
|
|
|
MaxLength: 128,
|
|
|
|
MaxLengthSet: true,
|
|
|
|
Email: false,
|
|
|
|
Hostname: false,
|
|
|
|
Regex: nil,
|
|
|
|
}).Validate(string(value)); err != nil {
|
|
|
|
return errors.Wrap(err, "string")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "DisplayName",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: Creator.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "Creator",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotCreatorVal string
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToString(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotCreatorVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.Creator.SetTo(paramsDotCreatorVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
if err := func() error {
|
|
|
|
if value, ok := params.Creator.Get(); ok {
|
|
|
|
if err := func() error {
|
|
|
|
if err := (validate.String{
|
|
|
|
MinLength: 0,
|
|
|
|
MinLengthSet: false,
|
|
|
|
MaxLength: 128,
|
|
|
|
MaxLengthSet: true,
|
|
|
|
Email: false,
|
|
|
|
Hostname: false,
|
|
|
|
Regex: nil,
|
|
|
|
}).Validate(string(value)); err != nil {
|
|
|
|
return errors.Wrap(err, "string")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "Creator",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Decode query: GameID.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "GameID",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
var paramsDotGameIDVal int32
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt32(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
paramsDotGameIDVal = c
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
params.GameID.SetTo(paramsDotGameIDVal)
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "GameID",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
// SetSubmissionCompletedParams is parameters of setSubmissionCompleted operation.
|
|
|
|
type SetSubmissionCompletedParams struct {
|
|
|
|
// The unique identifier for a submission.
|
2024-11-26 20:39:10 +00:00
|
|
|
SubmissionID int64
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func unpackSetSubmissionCompletedParams(packed middleware.Parameters) (params SetSubmissionCompletedParams) {
|
2024-11-26 20:39:10 +00:00
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
|
|
|
}
|
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func decodeSetSubmissionCompletedParams(args [1]string, argsEscaped bool, r *http.Request) (params SetSubmissionCompletedParams, _ error) {
|
2024-11-26 20:39:10 +00:00
|
|
|
// Decode path: SubmissionID.
|
2024-11-26 01:22:45 +00:00
|
|
|
if err := func() error {
|
2024-11-26 20:39:10 +00:00
|
|
|
param := args[0]
|
|
|
|
if argsEscaped {
|
|
|
|
unescaped, err := url.PathUnescape(args[0])
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "unescape path")
|
|
|
|
}
|
|
|
|
param = unescaped
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
2024-11-26 20:39:10 +00:00
|
|
|
if len(param) > 0 {
|
|
|
|
d := uri.NewPathDecoder(uri.PathDecoderConfig{
|
|
|
|
Param: "SubmissionID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
2024-11-26 01:22:45 +00:00
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
if err := func() error {
|
2024-11-26 01:22:45 +00:00
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
c, err := conv.ToInt64(val)
|
2024-11-26 01:22:45 +00:00
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-11-26 20:39:10 +00:00
|
|
|
params.SubmissionID = c
|
2024-11-26 01:22:45 +00:00
|
|
|
return nil
|
2024-11-26 20:39:10 +00:00
|
|
|
}(); err != nil {
|
2024-11-26 01:22:45 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
2024-11-26 20:39:10 +00:00
|
|
|
Name: "SubmissionID",
|
|
|
|
In: "path",
|
2024-11-26 01:22:45 +00:00
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
// UpdateScriptParams is parameters of updateScript operation.
|
|
|
|
type UpdateScriptParams struct {
|
|
|
|
// The unique identifier for a script.
|
|
|
|
ScriptID int64
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func unpackUpdateScriptParams(packed middleware.Parameters) (params UpdateScriptParams) {
|
2024-11-26 01:22:45 +00:00
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
2024-12-10 06:06:33 +00:00
|
|
|
Name: "ScriptID",
|
2024-11-26 20:39:10 +00:00
|
|
|
In: "path",
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
params.ScriptID = packed[key].(int64)
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func decodeUpdateScriptParams(args [1]string, argsEscaped bool, r *http.Request) (params UpdateScriptParams, _ error) {
|
|
|
|
// Decode path: ScriptID.
|
2024-11-26 20:39:10 +00:00
|
|
|
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{
|
2024-12-10 06:06:33 +00:00
|
|
|
Param: "ScriptID",
|
2024-11-26 20:39:10 +00:00
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
params.ScriptID = c
|
2024-11-26 20:39:10 +00:00
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
2024-12-10 06:06:33 +00:00
|
|
|
Name: "ScriptID",
|
2024-11-26 20:39:10 +00:00
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
return params, nil
|
|
|
|
}
|
2024-11-26 20:39:10 +00:00
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
// UpdateScriptPolicyParams is parameters of updateScriptPolicy operation.
|
|
|
|
type UpdateScriptPolicyParams struct {
|
|
|
|
// The unique identifier for a script policy.
|
|
|
|
ScriptPolicyID int64
|
|
|
|
}
|
2024-11-26 20:39:10 +00:00
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func unpackUpdateScriptPolicyParams(packed middleware.Parameters) (params UpdateScriptPolicyParams) {
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ScriptPolicyID",
|
|
|
|
In: "path",
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
params.ScriptPolicyID = packed[key].(int64)
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
|
|
|
func decodeUpdateScriptPolicyParams(args [1]string, argsEscaped bool, r *http.Request) (params UpdateScriptPolicyParams, _ error) {
|
|
|
|
// Decode path: ScriptPolicyID.
|
2024-11-26 01:22:45 +00:00
|
|
|
if err := func() error {
|
2024-12-10 06:06:33 +00:00
|
|
|
param := args[0]
|
|
|
|
if argsEscaped {
|
|
|
|
unescaped, err := url.PathUnescape(args[0])
|
|
|
|
if err != nil {
|
|
|
|
return errors.Wrap(err, "unescape path")
|
|
|
|
}
|
|
|
|
param = unescaped
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
if len(param) > 0 {
|
|
|
|
d := uri.NewPathDecoder(uri.PathDecoderConfig{
|
|
|
|
Param: "ScriptPolicyID",
|
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
2024-11-26 01:22:45 +00:00
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
if err := func() error {
|
2024-11-26 20:39:10 +00:00
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
2024-11-26 01:22:45 +00:00
|
|
|
return err
|
|
|
|
}
|
2024-11-26 20:39:10 +00:00
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
params.ScriptPolicyID = c
|
2024-11-26 01:22:45 +00:00
|
|
|
return nil
|
2024-12-10 06:06:33 +00:00
|
|
|
}(); err != nil {
|
2024-11-26 01:22:45 +00:00
|
|
|
return err
|
|
|
|
}
|
2024-11-26 20:39:10 +00:00
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
2024-11-26 01:22:45 +00:00
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
2024-12-10 06:06:33 +00:00
|
|
|
Name: "ScriptPolicyID",
|
|
|
|
In: "path",
|
2024-11-26 01:22:45 +00:00
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|
2024-12-06 00:36:15 +00:00
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
// UpdateSubmissionModelParams is parameters of updateSubmissionModel operation.
|
|
|
|
type UpdateSubmissionModelParams struct {
|
|
|
|
// The unique identifier for a submission.
|
|
|
|
SubmissionID int64
|
|
|
|
ModelID int64
|
|
|
|
VersionID int64
|
2024-12-06 00:36:15 +00:00
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func unpackUpdateSubmissionModelParams(packed middleware.Parameters) (params UpdateSubmissionModelParams) {
|
2024-12-06 00:36:15 +00:00
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
2024-12-10 06:06:33 +00:00
|
|
|
Name: "SubmissionID",
|
2024-12-06 00:36:15 +00:00
|
|
|
In: "path",
|
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
params.SubmissionID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "ModelID",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.ModelID = packed[key].(int64)
|
|
|
|
}
|
|
|
|
{
|
|
|
|
key := middleware.ParameterKey{
|
|
|
|
Name: "VersionID",
|
|
|
|
In: "query",
|
|
|
|
}
|
|
|
|
params.VersionID = packed[key].(int64)
|
2024-12-06 00:36:15 +00:00
|
|
|
}
|
|
|
|
return params
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
func decodeUpdateSubmissionModelParams(args [1]string, argsEscaped bool, r *http.Request) (params UpdateSubmissionModelParams, _ error) {
|
|
|
|
q := uri.NewQueryDecoder(r.URL.Query())
|
|
|
|
// Decode path: SubmissionID.
|
2024-12-06 00:36:15 +00:00
|
|
|
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{
|
2024-12-10 06:06:33 +00:00
|
|
|
Param: "SubmissionID",
|
2024-12-06 00:36:15 +00:00
|
|
|
Value: param,
|
|
|
|
Style: uri.PathStyleSimple,
|
|
|
|
Explode: false,
|
|
|
|
})
|
|
|
|
|
|
|
|
if err := func() error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
params.SubmissionID = c
|
2024-12-06 00:36:15 +00:00
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
2024-12-10 06:06:33 +00:00
|
|
|
Name: "SubmissionID",
|
2024-12-06 00:36:15 +00:00
|
|
|
In: "path",
|
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
// Decode query: ModelID.
|
|
|
|
if err := func() error {
|
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "ModelID",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
|
|
|
}
|
2024-12-06 00:36:15 +00:00
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
2024-12-06 00:36:15 +00:00
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
params.ModelID = c
|
|
|
|
return nil
|
|
|
|
}); err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
|
|
|
Name: "ModelID",
|
|
|
|
In: "query",
|
|
|
|
Err: err,
|
2024-12-06 00:36:15 +00:00
|
|
|
}
|
|
|
|
}
|
2024-12-10 06:06:33 +00:00
|
|
|
// Decode query: VersionID.
|
2024-12-06 00:36:15 +00:00
|
|
|
if err := func() error {
|
2024-12-10 06:06:33 +00:00
|
|
|
cfg := uri.QueryParameterDecodingConfig{
|
|
|
|
Name: "VersionID",
|
|
|
|
Style: uri.QueryStyleForm,
|
|
|
|
Explode: true,
|
2024-12-06 00:36:15 +00:00
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
if err := q.HasParam(cfg); err == nil {
|
|
|
|
if err := q.DecodeParam(cfg, func(d uri.Decoder) error {
|
2024-12-06 00:36:15 +00:00
|
|
|
val, err := d.DecodeValue()
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
c, err := conv.ToInt64(val)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2024-12-10 06:06:33 +00:00
|
|
|
params.VersionID = c
|
2024-12-06 00:36:15 +00:00
|
|
|
return nil
|
2024-12-10 06:06:33 +00:00
|
|
|
}); err != nil {
|
2024-12-06 00:36:15 +00:00
|
|
|
return err
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return validate.ErrFieldRequired
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}(); err != nil {
|
|
|
|
return params, &ogenerrors.DecodeParamError{
|
2024-12-10 06:06:33 +00:00
|
|
|
Name: "VersionID",
|
|
|
|
In: "query",
|
2024-12-06 00:36:15 +00:00
|
|
|
Err: err,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return params, nil
|
|
|
|
}
|