6691 lines
151 KiB
Go
6691 lines
151 KiB
Go
// Code generated by ogen, DO NOT EDIT.
|
|
|
|
package ogent
|
|
|
|
import (
|
|
"io"
|
|
"mime"
|
|
"net/http"
|
|
|
|
"github.com/go-faster/errors"
|
|
"github.com/go-faster/jx"
|
|
|
|
"github.com/ogen-go/ogen/ogenerrors"
|
|
"github.com/ogen-go/ogen/validate"
|
|
)
|
|
|
|
func decodeCreateCardResponse(resp *http.Response) (res CreateCardRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response CardCreate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeCreateGroupResponse(resp *http.Response) (res CreateGroupRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response GroupCreate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeCreateMaResponse(resp *http.Response) (res CreateMaRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response MaCreate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeCreateSevResponse(resp *http.Response) (res CreateSevRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response SevCreate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeCreateUeResponse(resp *http.Response) (res CreateUeRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UeCreate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeCreateUserResponse(resp *http.Response) (res CreateUserRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UserCreate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDeleteCardResponse(resp *http.Response) (res DeleteCardRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DeleteCardNoContent{}, nil
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDeleteGroupResponse(resp *http.Response) (res DeleteGroupRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DeleteGroupNoContent{}, nil
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDeleteMaResponse(resp *http.Response) (res DeleteMaRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DeleteMaNoContent{}, nil
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDeleteSevResponse(resp *http.Response) (res DeleteSevRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DeleteSevNoContent{}, nil
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDeleteUeResponse(resp *http.Response) (res DeleteUeRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DeleteUeNoContent{}, nil
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDeleteUserResponse(resp *http.Response) (res DeleteUserRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DeleteUserNoContent{}, nil
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDrawDoneResponse(resp *http.Response) (res *DrawDoneNoContent, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DrawDoneNoContent{}, nil
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeDrawStartResponse(resp *http.Response) (res *DrawStartNoContent, err error) {
|
|
switch resp.StatusCode {
|
|
case 204:
|
|
// Code 204.
|
|
return &DrawStartNoContent{}, nil
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListCardResponse(resp *http.Response) (res ListCardRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListCardOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListGroupResponse(resp *http.Response) (res ListGroupRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListGroupOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListGroupUsersResponse(resp *http.Response) (res ListGroupUsersRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListGroupUsersOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListMaResponse(resp *http.Response) (res ListMaRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListMaOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListSevResponse(resp *http.Response) (res ListSevRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListSevOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListUeResponse(resp *http.Response) (res ListUeRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListUeOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListUserResponse(resp *http.Response) (res ListUserRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListUserOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListUserCardResponse(resp *http.Response) (res ListUserCardRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListUserCardOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListUserMaResponse(resp *http.Response) (res ListUserMaRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListUserMaOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListUserSevResponse(resp *http.Response) (res ListUserSevRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListUserSevOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeListUserUeResponse(resp *http.Response) (res ListUserUeRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response ListUserUeOKApplicationJSON
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadCardResponse(resp *http.Response) (res ReadCardRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response CardRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadCardOwnerResponse(resp *http.Response) (res ReadCardOwnerRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response CardOwnerRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadGroupResponse(resp *http.Response) (res ReadGroupRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response GroupRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadMaResponse(resp *http.Response) (res ReadMaRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response MaRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadMaOwnerResponse(resp *http.Response) (res ReadMaOwnerRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response MaOwnerRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadSevResponse(resp *http.Response) (res ReadSevRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response SevRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadSevOwnerResponse(resp *http.Response) (res ReadSevOwnerRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response SevOwnerRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadUeResponse(resp *http.Response) (res ReadUeRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UeRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadUeOwnerResponse(resp *http.Response) (res ReadUeOwnerRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UeOwnerRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeReadUserResponse(resp *http.Response) (res ReadUserRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UserRead
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeUpdateCardResponse(resp *http.Response) (res UpdateCardRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response CardUpdate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeUpdateGroupResponse(resp *http.Response) (res UpdateGroupRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response GroupUpdate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeUpdateMaResponse(resp *http.Response) (res UpdateMaRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response MaUpdate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeUpdateSevResponse(resp *http.Response) (res UpdateSevRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response SevUpdate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeUpdateUeResponse(resp *http.Response) (res UpdateUeRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UeUpdate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|
|
|
|
func decodeUpdateUserResponse(resp *http.Response) (res UpdateUserRes, err error) {
|
|
switch resp.StatusCode {
|
|
case 200:
|
|
// Code 200.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response UserUpdate
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 400:
|
|
// Code 400.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R400
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 404:
|
|
// Code 404.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R404
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 409:
|
|
// Code 409.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R409
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
case 500:
|
|
// Code 500.
|
|
ct, _, err := mime.ParseMediaType(resp.Header.Get("Content-Type"))
|
|
if err != nil {
|
|
return res, errors.Wrap(err, "parse media type")
|
|
}
|
|
switch {
|
|
case ct == "application/json":
|
|
buf, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
d := jx.DecodeBytes(buf)
|
|
|
|
var response R500
|
|
if err := func() error {
|
|
if err := response.Decode(d); err != nil {
|
|
return err
|
|
}
|
|
if err := d.Skip(); err != io.EOF {
|
|
return errors.New("unexpected trailing data")
|
|
}
|
|
return nil
|
|
}(); err != nil {
|
|
err = &ogenerrors.DecodeBodyError{
|
|
ContentType: ct,
|
|
Body: buf,
|
|
Err: err,
|
|
}
|
|
return res, err
|
|
}
|
|
return &response, nil
|
|
default:
|
|
return res, validate.InvalidContentType(ct)
|
|
}
|
|
}
|
|
return res, validate.UnexpectedStatusCode(resp.StatusCode)
|
|
}
|