2024-11-26 01:22:45 +00:00
|
|
|
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
|
|
|
|
package api
|
2024-11-27 23:38:17 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"bytes"
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/go-faster/jx"
|
|
|
|
|
|
|
|
ht "github.com/ogen-go/ogen/http"
|
|
|
|
)
|
|
|
|
|
2024-12-06 00:36:15 +00:00
|
|
|
func encodeCreateScriptRequest(
|
|
|
|
req OptScriptCreate,
|
|
|
|
r *http.Request,
|
|
|
|
) error {
|
|
|
|
const contentType = "application/json"
|
|
|
|
if !req.Set {
|
|
|
|
// Keep request with empty body if value is not set.
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
e := new(jx.Encoder)
|
|
|
|
{
|
|
|
|
if req.Set {
|
|
|
|
req.Encode(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
encoded := e.Bytes()
|
|
|
|
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func encodeCreateScriptPolicyRequest(
|
|
|
|
req OptScriptPolicyCreate,
|
|
|
|
r *http.Request,
|
|
|
|
) error {
|
|
|
|
const contentType = "application/json"
|
|
|
|
if !req.Set {
|
|
|
|
// Keep request with empty body if value is not set.
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
e := new(jx.Encoder)
|
|
|
|
{
|
|
|
|
if req.Set {
|
|
|
|
req.Encode(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
encoded := e.Bytes()
|
|
|
|
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2024-11-27 23:38:17 +00:00
|
|
|
func encodeCreateSubmissionRequest(
|
|
|
|
req OptSubmissionCreate,
|
|
|
|
r *http.Request,
|
|
|
|
) error {
|
|
|
|
const contentType = "application/json"
|
|
|
|
if !req.Set {
|
|
|
|
// Keep request with empty body if value is not set.
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
e := new(jx.Encoder)
|
|
|
|
{
|
|
|
|
if req.Set {
|
|
|
|
req.Encode(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
encoded := e.Bytes()
|
|
|
|
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-06 00:36:15 +00:00
|
|
|
|
|
|
|
func encodeUpdateScriptRequest(
|
|
|
|
req OptScriptUpdate,
|
|
|
|
r *http.Request,
|
|
|
|
) error {
|
|
|
|
const contentType = "application/json"
|
|
|
|
if !req.Set {
|
|
|
|
// Keep request with empty body if value is not set.
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
e := new(jx.Encoder)
|
|
|
|
{
|
|
|
|
if req.Set {
|
|
|
|
req.Encode(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
encoded := e.Bytes()
|
|
|
|
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func encodeUpdateScriptPolicyRequest(
|
|
|
|
req OptScriptPolicyUpdate,
|
|
|
|
r *http.Request,
|
|
|
|
) error {
|
|
|
|
const contentType = "application/json"
|
|
|
|
if !req.Set {
|
|
|
|
// Keep request with empty body if value is not set.
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
e := new(jx.Encoder)
|
|
|
|
{
|
|
|
|
if req.Set {
|
|
|
|
req.Encode(e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
encoded := e.Bytes()
|
|
|
|
ht.SetBody(r, bytes.NewReader(encoded), contentType)
|
|
|
|
return nil
|
|
|
|
}
|