350 lines
9.1 KiB
Go
350 lines
9.1 KiB
Go
package universe
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"fmt"
|
|
"io"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/runtime"
|
|
"github.com/go-openapi/validate"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// GetUniverseGroupsGroupIDReader is a Reader for the GetUniverseGroupsGroupID structure.
|
|
type GetUniverseGroupsGroupIDReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *GetUniverseGroupsGroupIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 200:
|
|
result := NewGetUniverseGroupsGroupIDOK()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 404:
|
|
result := NewGetUniverseGroupsGroupIDNotFound()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewGetUniverseGroupsGroupIDInternalServerError()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
default:
|
|
return nil, runtime.NewAPIError("unknown error", response, response.Code())
|
|
}
|
|
}
|
|
|
|
// NewGetUniverseGroupsGroupIDOK creates a GetUniverseGroupsGroupIDOK with default headers values
|
|
func NewGetUniverseGroupsGroupIDOK() *GetUniverseGroupsGroupIDOK {
|
|
return &GetUniverseGroupsGroupIDOK{}
|
|
}
|
|
|
|
/*GetUniverseGroupsGroupIDOK handles this case with default header values.
|
|
|
|
Information about an item group
|
|
*/
|
|
type GetUniverseGroupsGroupIDOK struct {
|
|
/*The caching mechanism used
|
|
*/
|
|
CacheControl string
|
|
/*The language used in the response
|
|
*/
|
|
ContentLanguage string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
Expires string
|
|
/*RFC7231 formatted datetime string
|
|
*/
|
|
LastModified string
|
|
|
|
Payload GetUniverseGroupsGroupIDOKBody
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOK) Error() string {
|
|
return fmt.Sprintf("[GET /universe/groups/{group_id}/][%d] getUniverseGroupsGroupIdOK %+v", 200, o.Payload)
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response header Cache-Control
|
|
o.CacheControl = response.GetHeader("Cache-Control")
|
|
|
|
// response header Content-Language
|
|
o.ContentLanguage = response.GetHeader("Content-Language")
|
|
|
|
// response header Expires
|
|
o.Expires = response.GetHeader("Expires")
|
|
|
|
// response header Last-Modified
|
|
o.LastModified = response.GetHeader("Last-Modified")
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetUniverseGroupsGroupIDNotFound creates a GetUniverseGroupsGroupIDNotFound with default headers values
|
|
func NewGetUniverseGroupsGroupIDNotFound() *GetUniverseGroupsGroupIDNotFound {
|
|
return &GetUniverseGroupsGroupIDNotFound{}
|
|
}
|
|
|
|
/*GetUniverseGroupsGroupIDNotFound handles this case with default header values.
|
|
|
|
Group not found
|
|
*/
|
|
type GetUniverseGroupsGroupIDNotFound struct {
|
|
Payload GetUniverseGroupsGroupIDNotFoundBody
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDNotFound) Error() string {
|
|
return fmt.Sprintf("[GET /universe/groups/{group_id}/][%d] getUniverseGroupsGroupIdNotFound %+v", 404, o.Payload)
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// NewGetUniverseGroupsGroupIDInternalServerError creates a GetUniverseGroupsGroupIDInternalServerError with default headers values
|
|
func NewGetUniverseGroupsGroupIDInternalServerError() *GetUniverseGroupsGroupIDInternalServerError {
|
|
return &GetUniverseGroupsGroupIDInternalServerError{}
|
|
}
|
|
|
|
/*GetUniverseGroupsGroupIDInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type GetUniverseGroupsGroupIDInternalServerError struct {
|
|
Payload GetUniverseGroupsGroupIDInternalServerErrorBody
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDInternalServerError) Error() string {
|
|
return fmt.Sprintf("[GET /universe/groups/{group_id}/][%d] getUniverseGroupsGroupIdInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
|
|
|
|
// response payload
|
|
if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetUniverseGroupsGroupIDInternalServerErrorBody get_universe_groups_group_id_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model GetUniverseGroupsGroupIDInternalServerErrorBody
|
|
*/
|
|
type GetUniverseGroupsGroupIDInternalServerErrorBody struct {
|
|
|
|
// get_universe_groups_group_id_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get universe groups group ID internal server error body
|
|
func (o *GetUniverseGroupsGroupIDInternalServerErrorBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateError(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDInternalServerErrorBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdInternalServerError"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetUniverseGroupsGroupIDNotFoundBody get_universe_groups_group_id_not_found
|
|
//
|
|
// Not found
|
|
swagger:model GetUniverseGroupsGroupIDNotFoundBody
|
|
*/
|
|
type GetUniverseGroupsGroupIDNotFoundBody struct {
|
|
|
|
// get_universe_groups_group_id_404_not_found
|
|
//
|
|
// Not found message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
// Validate validates this get universe groups group ID not found body
|
|
func (o *GetUniverseGroupsGroupIDNotFoundBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateError(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDNotFoundBody) validateError(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdNotFound"+"."+"error", "body", o.Error); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
/*GetUniverseGroupsGroupIDOKBody get_universe_groups_group_id_ok
|
|
//
|
|
// 200 ok object
|
|
swagger:model GetUniverseGroupsGroupIDOKBody
|
|
*/
|
|
type GetUniverseGroupsGroupIDOKBody struct {
|
|
|
|
// get_universe_groups_group_id_category_id
|
|
//
|
|
// category_id number
|
|
// Required: true
|
|
CategoryID *float32 `json:"category_id"`
|
|
|
|
// get_universe_groups_group_id_group_id
|
|
//
|
|
// group_id integer
|
|
// Required: true
|
|
GroupID *int32 `json:"group_id"`
|
|
|
|
// get_universe_groups_group_id_name
|
|
//
|
|
// name string
|
|
// Required: true
|
|
Name *string `json:"name"`
|
|
|
|
// get_universe_groups_group_id_published
|
|
//
|
|
// published boolean
|
|
// Required: true
|
|
Published *bool `json:"published"`
|
|
|
|
// get_universe_groups_group_id_types
|
|
//
|
|
// types array
|
|
// Required: true
|
|
Types []int32 `json:"types"`
|
|
}
|
|
|
|
// Validate validates this get universe groups group ID o k body
|
|
func (o *GetUniverseGroupsGroupIDOKBody) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := o.validateCategoryID(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateGroupID(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateName(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validatePublished(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := o.validateTypes(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOKBody) validateCategoryID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdOK"+"."+"category_id", "body", o.CategoryID); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOKBody) validateGroupID(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdOK"+"."+"group_id", "body", o.GroupID); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOKBody) validateName(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdOK"+"."+"name", "body", o.Name); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOKBody) validatePublished(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdOK"+"."+"published", "body", o.Published); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (o *GetUniverseGroupsGroupIDOKBody) validateTypes(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("getUniverseGroupsGroupIdOK"+"."+"types", "body", o.Types); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|