2021-01-08 17:40:28 +00:00
// Code generated by go-swagger; DO NOT EDIT.
2021-01-19 16:58:40 +00:00
// All Code Copyright(c) 2018-2021 by Taxnexus, Inc.
2021-01-08 17:40:28 +00:00
// 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"
2021-01-10 17:03:26 +00:00
"code.tnxs.net/taxnexus/lib/api/auth0/auth0_models"
2021-01-08 17:40:28 +00:00
)
// 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 :
2021-02-09 16:56:57 +00:00
return nil , runtime . NewAPIError ( "response status code does not match any response statuses defined for this endpoint in the swagger spec" , response , response . Code ( ) )
2021-01-08 17:40:28 +00:00
}
}
// NewPostCredentialsOK creates a PostCredentialsOK with default headers values
func NewPostCredentialsOK ( ) * PostCredentialsOK {
return & PostCredentialsOK { }
}
2021-02-09 16:56:57 +00:00
/ * PostCredentialsOK describes a response with status code 200 , with default header values .
2021-01-08 17:40:28 +00:00
Credentials response from Auth0
* /
type PostCredentialsOK struct {
Payload * auth0_models . CredentialsResponse
}
func ( o * PostCredentialsOK ) Error ( ) 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 { }
}
2021-02-09 16:56:57 +00:00
/ * PostCredentialsUnauthorized describes a response with status code 401 , with default header values .
2021-01-08 17:40:28 +00:00
Access Unauthorized , invalid API - KEY was used
* /
type PostCredentialsUnauthorized struct {
Payload * auth0_models . Error
}
func ( o * PostCredentialsUnauthorized ) Error ( ) 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 { }
}
2021-02-09 16:56:57 +00:00
/ * PostCredentialsForbidden describes a response with status code 403 , with default header values .
2021-01-08 17:40:28 +00:00
Access forbidden , account lacks access
* /
type PostCredentialsForbidden struct {
Payload * auth0_models . Error
}
func ( o * PostCredentialsForbidden ) Error ( ) 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 { }
}
2021-02-09 16:56:57 +00:00
/ * PostCredentialsNotFound describes a response with status code 404 , with default header values .
2021-01-08 17:40:28 +00:00
Resource was not found
* /
type PostCredentialsNotFound struct {
Payload * auth0_models . Error
}
func ( o * PostCredentialsNotFound ) Error ( ) 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 { }
}
2021-02-09 16:56:57 +00:00
/ * PostCredentialsUnprocessableEntity describes a response with status code 422 , with default header values .
2021-01-08 17:40:28 +00:00
Unprocessable Entity , likely a bad parameter
* /
type PostCredentialsUnprocessableEntity struct {
Payload * auth0_models . Error
}
func ( o * PostCredentialsUnprocessableEntity ) Error ( ) 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 { }
}
2021-02-09 16:56:57 +00:00
/ * PostCredentialsInternalServerError describes a response with status code 500 , with default header values .
2021-01-08 17:40:28 +00:00
Server Internal Error
* /
type PostCredentialsInternalServerError struct {
Payload * auth0_models . Error
}
func ( o * PostCredentialsInternalServerError ) Error ( ) 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
}