157 lines
5.2 KiB
Go
157 lines
5.2 KiB
Go
package contacts
|
|
|
|
// 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/runtime"
|
|
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
)
|
|
|
|
// PostCharactersCharacterIDContactsReader is a Reader for the PostCharactersCharacterIDContacts structure.
|
|
type PostCharactersCharacterIDContactsReader struct {
|
|
formats strfmt.Registry
|
|
}
|
|
|
|
// ReadResponse reads a server response into the received o.
|
|
func (o *PostCharactersCharacterIDContactsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
|
|
switch response.Code() {
|
|
|
|
case 201:
|
|
result := NewPostCharactersCharacterIDContactsCreated()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return result, nil
|
|
|
|
case 403:
|
|
result := NewPostCharactersCharacterIDContactsForbidden()
|
|
if err := result.readResponse(response, consumer, o.formats); err != nil {
|
|
return nil, err
|
|
}
|
|
return nil, result
|
|
|
|
case 500:
|
|
result := NewPostCharactersCharacterIDContactsInternalServerError()
|
|
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())
|
|
}
|
|
}
|
|
|
|
// NewPostCharactersCharacterIDContactsCreated creates a PostCharactersCharacterIDContactsCreated with default headers values
|
|
func NewPostCharactersCharacterIDContactsCreated() *PostCharactersCharacterIDContactsCreated {
|
|
return &PostCharactersCharacterIDContactsCreated{}
|
|
}
|
|
|
|
/*PostCharactersCharacterIDContactsCreated handles this case with default header values.
|
|
|
|
A list of contact ids that successfully created
|
|
*/
|
|
type PostCharactersCharacterIDContactsCreated struct {
|
|
Payload []int32
|
|
}
|
|
|
|
func (o *PostCharactersCharacterIDContactsCreated) Error() string {
|
|
return fmt.Sprintf("[POST /characters/{character_id}/contacts/][%d] postCharactersCharacterIdContactsCreated %+v", 201, o.Payload)
|
|
}
|
|
|
|
func (o *PostCharactersCharacterIDContactsCreated) 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
|
|
}
|
|
|
|
// NewPostCharactersCharacterIDContactsForbidden creates a PostCharactersCharacterIDContactsForbidden with default headers values
|
|
func NewPostCharactersCharacterIDContactsForbidden() *PostCharactersCharacterIDContactsForbidden {
|
|
return &PostCharactersCharacterIDContactsForbidden{}
|
|
}
|
|
|
|
/*PostCharactersCharacterIDContactsForbidden handles this case with default header values.
|
|
|
|
Forbidden
|
|
*/
|
|
type PostCharactersCharacterIDContactsForbidden struct {
|
|
Payload PostCharactersCharacterIDContactsForbiddenBody
|
|
}
|
|
|
|
func (o *PostCharactersCharacterIDContactsForbidden) Error() string {
|
|
return fmt.Sprintf("[POST /characters/{character_id}/contacts/][%d] postCharactersCharacterIdContactsForbidden %+v", 403, o.Payload)
|
|
}
|
|
|
|
func (o *PostCharactersCharacterIDContactsForbidden) 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
|
|
}
|
|
|
|
// NewPostCharactersCharacterIDContactsInternalServerError creates a PostCharactersCharacterIDContactsInternalServerError with default headers values
|
|
func NewPostCharactersCharacterIDContactsInternalServerError() *PostCharactersCharacterIDContactsInternalServerError {
|
|
return &PostCharactersCharacterIDContactsInternalServerError{}
|
|
}
|
|
|
|
/*PostCharactersCharacterIDContactsInternalServerError handles this case with default header values.
|
|
|
|
Internal server error
|
|
*/
|
|
type PostCharactersCharacterIDContactsInternalServerError struct {
|
|
Payload PostCharactersCharacterIDContactsInternalServerErrorBody
|
|
}
|
|
|
|
func (o *PostCharactersCharacterIDContactsInternalServerError) Error() string {
|
|
return fmt.Sprintf("[POST /characters/{character_id}/contacts/][%d] postCharactersCharacterIdContactsInternalServerError %+v", 500, o.Payload)
|
|
}
|
|
|
|
func (o *PostCharactersCharacterIDContactsInternalServerError) 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
|
|
}
|
|
|
|
/*PostCharactersCharacterIDContactsInternalServerErrorBody post_characters_character_id_contacts_internal_server_error
|
|
//
|
|
// Internal server error
|
|
swagger:model PostCharactersCharacterIDContactsInternalServerErrorBody
|
|
*/
|
|
type PostCharactersCharacterIDContactsInternalServerErrorBody struct {
|
|
|
|
// post_characters_character_id_contacts_500_internal_server_error
|
|
//
|
|
// Internal server error message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|
|
|
|
/*PostCharactersCharacterIDContactsForbiddenBody post_characters_character_id_contacts_forbidden
|
|
//
|
|
// Forbidden
|
|
swagger:model PostCharactersCharacterIDContactsForbiddenBody
|
|
*/
|
|
type PostCharactersCharacterIDContactsForbiddenBody struct {
|
|
|
|
// post_characters_character_id_contacts_403_forbidden
|
|
//
|
|
// Forbidden message
|
|
// Required: true
|
|
Error *string `json:"error"`
|
|
}
|