07786dd94b
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
72 lines
1.8 KiB
Go
72 lines
1.8 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
package models
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/strfmt"
|
|
"github.com/go-openapi/swag"
|
|
"github.com/go-openapi/validate"
|
|
)
|
|
|
|
// BinaryBearer Bearer token for object operations that is represented in binary form.
|
|
// Example: {"token":"ChIKDAoAGggIARABIgIIAxoCCGQSZgohA+J5jFWFMiOpyvMZBu9wwPTKsWsG0q206kVe63iuWP/wEkEE4SIV0QngnKppDf54QezUKmar7UQby6HzufT5yVIOvj7QEqZnOavrKW0chCeCwP0khda/j9k00ct6NMEDxQFW+g=="}
|
|
//
|
|
// swagger:model BinaryBearer
|
|
type BinaryBearer struct {
|
|
|
|
// Base64 encoded bearer token.
|
|
// Required: true
|
|
Token *string `json:"token"`
|
|
}
|
|
|
|
// Validate validates this binary bearer
|
|
func (m *BinaryBearer) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateToken(formats); err != nil {
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *BinaryBearer) validateToken(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("token", "body", m.Token); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// ContextValidate validates this binary bearer based on context it is used
|
|
func (m *BinaryBearer) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
|
return nil
|
|
}
|
|
|
|
// MarshalBinary interface implementation
|
|
func (m *BinaryBearer) MarshalBinary() ([]byte, error) {
|
|
if m == nil {
|
|
return nil, nil
|
|
}
|
|
return swag.WriteJSON(m)
|
|
}
|
|
|
|
// UnmarshalBinary interface implementation
|
|
func (m *BinaryBearer) UnmarshalBinary(b []byte) error {
|
|
var res BinaryBearer
|
|
if err := swag.ReadJSON(b, &res); err != nil {
|
|
return err
|
|
}
|
|
*m = res
|
|
return nil
|
|
}
|