lib/api/sf-gate/sf_gate_client/subscriptions/put_subscriptions_responses.go

230 lines
6.5 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// All Code Copyright(c) 2018-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package subscriptions
// 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"
"github.com/go-openapi/strfmt"
"code.tnxs.net/taxnexus/lib/api/sf-gate/sf_gate_models"
)
// PutSubscriptionsReader is a Reader for the PutSubscriptions structure.
type PutSubscriptionsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PutSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPutSubscriptionsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPutSubscriptionsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPutSubscriptionsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPutSubscriptionsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPutSubscriptionsInternalServerError()
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())
}
}
// NewPutSubscriptionsOK creates a PutSubscriptionsOK with default headers values
func NewPutSubscriptionsOK() *PutSubscriptionsOK {
return &PutSubscriptionsOK{}
}
/*PutSubscriptionsOK handles this case with default header values.
An array of Subscription Objects
*/
type PutSubscriptionsOK struct {
Payload *sf_gate_models.SubscriptionResponse
}
func (o *PutSubscriptionsOK) Error() string {
return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsOK %+v", 200, o.Payload)
}
func (o *PutSubscriptionsOK) GetPayload() *sf_gate_models.SubscriptionResponse {
return o.Payload
}
func (o *PutSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.SubscriptionResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutSubscriptionsUnauthorized creates a PutSubscriptionsUnauthorized with default headers values
func NewPutSubscriptionsUnauthorized() *PutSubscriptionsUnauthorized {
return &PutSubscriptionsUnauthorized{}
}
/*PutSubscriptionsUnauthorized handles this case with default header values.
Access unauthorized, invalid API-KEY was used
*/
type PutSubscriptionsUnauthorized struct {
Payload *sf_gate_models.Error
}
func (o *PutSubscriptionsUnauthorized) Error() string {
return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsUnauthorized %+v", 401, o.Payload)
}
func (o *PutSubscriptionsUnauthorized) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PutSubscriptionsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutSubscriptionsForbidden creates a PutSubscriptionsForbidden with default headers values
func NewPutSubscriptionsForbidden() *PutSubscriptionsForbidden {
return &PutSubscriptionsForbidden{}
}
/*PutSubscriptionsForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type PutSubscriptionsForbidden struct {
Payload *sf_gate_models.Error
}
func (o *PutSubscriptionsForbidden) Error() string {
return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsForbidden %+v", 403, o.Payload)
}
func (o *PutSubscriptionsForbidden) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PutSubscriptionsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutSubscriptionsNotFound creates a PutSubscriptionsNotFound with default headers values
func NewPutSubscriptionsNotFound() *PutSubscriptionsNotFound {
return &PutSubscriptionsNotFound{}
}
/*PutSubscriptionsNotFound handles this case with default header values.
Resource was not found
*/
type PutSubscriptionsNotFound struct {
Payload *sf_gate_models.Error
}
func (o *PutSubscriptionsNotFound) Error() string {
return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsNotFound %+v", 404, o.Payload)
}
func (o *PutSubscriptionsNotFound) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PutSubscriptionsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPutSubscriptionsInternalServerError creates a PutSubscriptionsInternalServerError with default headers values
func NewPutSubscriptionsInternalServerError() *PutSubscriptionsInternalServerError {
return &PutSubscriptionsInternalServerError{}
}
/*PutSubscriptionsInternalServerError handles this case with default header values.
Server Internal Error
*/
type PutSubscriptionsInternalServerError struct {
Payload *sf_gate_models.Error
}
func (o *PutSubscriptionsInternalServerError) Error() string {
return fmt.Sprintf("[PUT /subscriptions][%d] putSubscriptionsInternalServerError %+v", 500, o.Payload)
}
func (o *PutSubscriptionsInternalServerError) GetPayload() *sf_gate_models.Error {
return o.Payload
}
func (o *PutSubscriptionsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(sf_gate_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}