frostfs-rest-gw/gen/models/storage_group_put_body.go

93 lines
2.3 KiB
Go
Raw Normal View History

// 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"
)
// StorageGroupPutBody storage group put body
// Example: {"lifetime":100,"members":["8N3o7Dtr6T1xteCt6eRwhpmJ7JhME58Hyu1dvaswuTDd"],"name":"my-storage-group"}
//
// swagger:model StorageGroupPutBody
type StorageGroupPutBody struct {
// Lifetime in epochs for storage group.
// Required: true
Lifetime *int64 `json:"lifetime"`
// Object identifiers to be placed into storage group. Must be unique.
// Required: true
Members []string `json:"members"`
// Name of storage group. It will be the value of the `FileName` attribute in storage group object.
Name string `json:"name,omitempty"`
}
// Validate validates this storage group put body
func (m *StorageGroupPutBody) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLifetime(formats); err != nil {
res = append(res, err)
}
if err := m.validateMembers(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *StorageGroupPutBody) validateLifetime(formats strfmt.Registry) error {
if err := validate.Required("lifetime", "body", m.Lifetime); err != nil {
return err
}
return nil
}
func (m *StorageGroupPutBody) validateMembers(formats strfmt.Registry) error {
if err := validate.Required("members", "body", m.Members); err != nil {
return err
}
return nil
}
// ContextValidate validates this storage group put body based on context it is used
func (m *StorageGroupPutBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *StorageGroupPutBody) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *StorageGroupPutBody) UnmarshalBinary(b []byte) error {
var res StorageGroupPutBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}