openapi-internal: optionally change TargetAssetID on upload
This commit is contained in:
@@ -255,6 +255,27 @@ func (c *Client) sendActionSubmissionUploaded(ctx context.Context, params Action
|
||||
pathParts[2] = "/status/validator-uploaded"
|
||||
uri.AddPathParts(u, pathParts[:]...)
|
||||
|
||||
stage = "EncodeQueryParams"
|
||||
q := uri.NewQueryEncoder()
|
||||
{
|
||||
// Encode "TargetAssetID" parameter.
|
||||
cfg := uri.QueryParameterEncodingConfig{
|
||||
Name: "TargetAssetID",
|
||||
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
|
||||
}); err != nil {
|
||||
return res, errors.Wrap(err, "encode query")
|
||||
}
|
||||
}
|
||||
u.RawQuery = q.Values().Encode()
|
||||
|
||||
stage = "EncodeRequest"
|
||||
r, err := ht.NewRequest(ctx, "POST", u)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user