lib/api/auth0/auth0_client/auth/post_credentials_responses.go

478 lines
15 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed
package auth
// 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/vernonkeenan/lib/api/auth0/auth0_models"
)
// PostCredentialsReader is a Reader for the PostCredentials structure.
type PostCredentialsReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *PostCredentialsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewPostCredentialsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewPostCredentialsUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewPostCredentialsForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewPostCredentialsNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 422:
result := NewPostCredentialsUnprocessableEntity()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewPostCredentialsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
default:
return nil, runtime.NewAPIError("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code())
}
}
// NewPostCredentialsOK creates a PostCredentialsOK with default headers values
func NewPostCredentialsOK() *PostCredentialsOK {
return &PostCredentialsOK{}
}
/*
PostCredentialsOK describes a response with status code 200, with default header values.
Credentials response from Auth0
*/
type PostCredentialsOK struct {
Payload *auth0_models.CredentialsResponse
}
// IsSuccess returns true when this post credentials o k response has a 2xx status code
func (o *PostCredentialsOK) IsSuccess() bool {
return true
}
// IsRedirect returns true when this post credentials o k response has a 3xx status code
func (o *PostCredentialsOK) IsRedirect() bool {
return false
}
// IsClientError returns true when this post credentials o k response has a 4xx status code
func (o *PostCredentialsOK) IsClientError() bool {
return false
}
// IsServerError returns true when this post credentials o k response has a 5xx status code
func (o *PostCredentialsOK) IsServerError() bool {
return false
}
// IsCode returns true when this post credentials o k response a status code equal to that given
func (o *PostCredentialsOK) IsCode(code int) bool {
return code == 200
}
// Code gets the status code for the post credentials o k response
func (o *PostCredentialsOK) Code() int {
return 200
}
func (o *PostCredentialsOK) Error() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsOK %+v", 200, o.Payload)
}
func (o *PostCredentialsOK) String() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsOK %+v", 200, o.Payload)
}
func (o *PostCredentialsOK) GetPayload() *auth0_models.CredentialsResponse {
return o.Payload
}
func (o *PostCredentialsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.CredentialsResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCredentialsUnauthorized creates a PostCredentialsUnauthorized with default headers values
func NewPostCredentialsUnauthorized() *PostCredentialsUnauthorized {
return &PostCredentialsUnauthorized{}
}
/*
PostCredentialsUnauthorized describes a response with status code 401, with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type PostCredentialsUnauthorized struct {
Payload *auth0_models.Error
}
// IsSuccess returns true when this post credentials unauthorized response has a 2xx status code
func (o *PostCredentialsUnauthorized) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post credentials unauthorized response has a 3xx status code
func (o *PostCredentialsUnauthorized) IsRedirect() bool {
return false
}
// IsClientError returns true when this post credentials unauthorized response has a 4xx status code
func (o *PostCredentialsUnauthorized) IsClientError() bool {
return true
}
// IsServerError returns true when this post credentials unauthorized response has a 5xx status code
func (o *PostCredentialsUnauthorized) IsServerError() bool {
return false
}
// IsCode returns true when this post credentials unauthorized response a status code equal to that given
func (o *PostCredentialsUnauthorized) IsCode(code int) bool {
return code == 401
}
// Code gets the status code for the post credentials unauthorized response
func (o *PostCredentialsUnauthorized) Code() int {
return 401
}
func (o *PostCredentialsUnauthorized) Error() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnauthorized %+v", 401, o.Payload)
}
func (o *PostCredentialsUnauthorized) String() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnauthorized %+v", 401, o.Payload)
}
func (o *PostCredentialsUnauthorized) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *PostCredentialsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCredentialsForbidden creates a PostCredentialsForbidden with default headers values
func NewPostCredentialsForbidden() *PostCredentialsForbidden {
return &PostCredentialsForbidden{}
}
/*
PostCredentialsForbidden describes a response with status code 403, with default header values.
Access forbidden, account lacks access
*/
type PostCredentialsForbidden struct {
Payload *auth0_models.Error
}
// IsSuccess returns true when this post credentials forbidden response has a 2xx status code
func (o *PostCredentialsForbidden) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post credentials forbidden response has a 3xx status code
func (o *PostCredentialsForbidden) IsRedirect() bool {
return false
}
// IsClientError returns true when this post credentials forbidden response has a 4xx status code
func (o *PostCredentialsForbidden) IsClientError() bool {
return true
}
// IsServerError returns true when this post credentials forbidden response has a 5xx status code
func (o *PostCredentialsForbidden) IsServerError() bool {
return false
}
// IsCode returns true when this post credentials forbidden response a status code equal to that given
func (o *PostCredentialsForbidden) IsCode(code int) bool {
return code == 403
}
// Code gets the status code for the post credentials forbidden response
func (o *PostCredentialsForbidden) Code() int {
return 403
}
func (o *PostCredentialsForbidden) Error() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsForbidden %+v", 403, o.Payload)
}
func (o *PostCredentialsForbidden) String() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsForbidden %+v", 403, o.Payload)
}
func (o *PostCredentialsForbidden) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *PostCredentialsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCredentialsNotFound creates a PostCredentialsNotFound with default headers values
func NewPostCredentialsNotFound() *PostCredentialsNotFound {
return &PostCredentialsNotFound{}
}
/*
PostCredentialsNotFound describes a response with status code 404, with default header values.
Resource was not found
*/
type PostCredentialsNotFound struct {
Payload *auth0_models.Error
}
// IsSuccess returns true when this post credentials not found response has a 2xx status code
func (o *PostCredentialsNotFound) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post credentials not found response has a 3xx status code
func (o *PostCredentialsNotFound) IsRedirect() bool {
return false
}
// IsClientError returns true when this post credentials not found response has a 4xx status code
func (o *PostCredentialsNotFound) IsClientError() bool {
return true
}
// IsServerError returns true when this post credentials not found response has a 5xx status code
func (o *PostCredentialsNotFound) IsServerError() bool {
return false
}
// IsCode returns true when this post credentials not found response a status code equal to that given
func (o *PostCredentialsNotFound) IsCode(code int) bool {
return code == 404
}
// Code gets the status code for the post credentials not found response
func (o *PostCredentialsNotFound) Code() int {
return 404
}
func (o *PostCredentialsNotFound) Error() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsNotFound %+v", 404, o.Payload)
}
func (o *PostCredentialsNotFound) String() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsNotFound %+v", 404, o.Payload)
}
func (o *PostCredentialsNotFound) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *PostCredentialsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCredentialsUnprocessableEntity creates a PostCredentialsUnprocessableEntity with default headers values
func NewPostCredentialsUnprocessableEntity() *PostCredentialsUnprocessableEntity {
return &PostCredentialsUnprocessableEntity{}
}
/*
PostCredentialsUnprocessableEntity describes a response with status code 422, with default header values.
Unprocessable Entity, likely a bad parameter
*/
type PostCredentialsUnprocessableEntity struct {
Payload *auth0_models.Error
}
// IsSuccess returns true when this post credentials unprocessable entity response has a 2xx status code
func (o *PostCredentialsUnprocessableEntity) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post credentials unprocessable entity response has a 3xx status code
func (o *PostCredentialsUnprocessableEntity) IsRedirect() bool {
return false
}
// IsClientError returns true when this post credentials unprocessable entity response has a 4xx status code
func (o *PostCredentialsUnprocessableEntity) IsClientError() bool {
return true
}
// IsServerError returns true when this post credentials unprocessable entity response has a 5xx status code
func (o *PostCredentialsUnprocessableEntity) IsServerError() bool {
return false
}
// IsCode returns true when this post credentials unprocessable entity response a status code equal to that given
func (o *PostCredentialsUnprocessableEntity) IsCode(code int) bool {
return code == 422
}
// Code gets the status code for the post credentials unprocessable entity response
func (o *PostCredentialsUnprocessableEntity) Code() int {
return 422
}
func (o *PostCredentialsUnprocessableEntity) Error() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCredentialsUnprocessableEntity) String() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsUnprocessableEntity %+v", 422, o.Payload)
}
func (o *PostCredentialsUnprocessableEntity) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *PostCredentialsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewPostCredentialsInternalServerError creates a PostCredentialsInternalServerError with default headers values
func NewPostCredentialsInternalServerError() *PostCredentialsInternalServerError {
return &PostCredentialsInternalServerError{}
}
/*
PostCredentialsInternalServerError describes a response with status code 500, with default header values.
Server Internal Error
*/
type PostCredentialsInternalServerError struct {
Payload *auth0_models.Error
}
// IsSuccess returns true when this post credentials internal server error response has a 2xx status code
func (o *PostCredentialsInternalServerError) IsSuccess() bool {
return false
}
// IsRedirect returns true when this post credentials internal server error response has a 3xx status code
func (o *PostCredentialsInternalServerError) IsRedirect() bool {
return false
}
// IsClientError returns true when this post credentials internal server error response has a 4xx status code
func (o *PostCredentialsInternalServerError) IsClientError() bool {
return false
}
// IsServerError returns true when this post credentials internal server error response has a 5xx status code
func (o *PostCredentialsInternalServerError) IsServerError() bool {
return true
}
// IsCode returns true when this post credentials internal server error response a status code equal to that given
func (o *PostCredentialsInternalServerError) IsCode(code int) bool {
return code == 500
}
// Code gets the status code for the post credentials internal server error response
func (o *PostCredentialsInternalServerError) Code() int {
return 500
}
func (o *PostCredentialsInternalServerError) Error() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsInternalServerError %+v", 500, o.Payload)
}
func (o *PostCredentialsInternalServerError) String() string {
return fmt.Sprintf("[POST /oauth/token][%d] postCredentialsInternalServerError %+v", 500, o.Payload)
}
func (o *PostCredentialsInternalServerError) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *PostCredentialsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.Error)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}