lib/api/auth0/auth0_client/user/get_user_roles_responses.go

230 lines
6.3 KiB
Go
Raw Permalink Normal View History

2021-08-05 19:37:53 +00:00
// 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 user
// 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"
)
// GetUserRolesReader is a Reader for the GetUserRoles structure.
type GetUserRolesReader struct {
formats strfmt.Registry
}
// ReadResponse reads a server response into the received o.
func (o *GetUserRolesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
case 200:
result := NewGetUserRolesOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
case 401:
result := NewGetUserRolesUnauthorized()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 403:
result := NewGetUserRolesForbidden()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 404:
result := NewGetUserRolesNotFound()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
case 500:
result := NewGetUserRolesInternalServerError()
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())
}
}
// NewGetUserRolesOK creates a GetUserRolesOK with default headers values
func NewGetUserRolesOK() *GetUserRolesOK {
return &GetUserRolesOK{}
}
/*GetUserRolesOK handles this case with default header values.
Taxnexus Response with User objects
*/
type GetUserRolesOK struct {
Payload *auth0_models.RoleResponse
}
func (o *GetUserRolesOK) Error() string {
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesOK %+v", 200, o.Payload)
}
func (o *GetUserRolesOK) GetPayload() *auth0_models.RoleResponse {
return o.Payload
}
func (o *GetUserRolesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
o.Payload = new(auth0_models.RoleResponse)
// response payload
if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
return err
}
return nil
}
// NewGetUserRolesUnauthorized creates a GetUserRolesUnauthorized with default headers values
func NewGetUserRolesUnauthorized() *GetUserRolesUnauthorized {
return &GetUserRolesUnauthorized{}
}
/*GetUserRolesUnauthorized handles this case with default header values.
Access Unauthorized, invalid API-KEY was used
*/
type GetUserRolesUnauthorized struct {
Payload *auth0_models.Error
}
func (o *GetUserRolesUnauthorized) Error() string {
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesUnauthorized %+v", 401, o.Payload)
}
func (o *GetUserRolesUnauthorized) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *GetUserRolesUnauthorized) 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
}
// NewGetUserRolesForbidden creates a GetUserRolesForbidden with default headers values
func NewGetUserRolesForbidden() *GetUserRolesForbidden {
return &GetUserRolesForbidden{}
}
/*GetUserRolesForbidden handles this case with default header values.
Access forbidden, account lacks access
*/
type GetUserRolesForbidden struct {
Payload *auth0_models.Error
}
func (o *GetUserRolesForbidden) Error() string {
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesForbidden %+v", 403, o.Payload)
}
func (o *GetUserRolesForbidden) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *GetUserRolesForbidden) 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
}
// NewGetUserRolesNotFound creates a GetUserRolesNotFound with default headers values
func NewGetUserRolesNotFound() *GetUserRolesNotFound {
return &GetUserRolesNotFound{}
}
/*GetUserRolesNotFound handles this case with default header values.
Resource was not found
*/
type GetUserRolesNotFound struct {
Payload *auth0_models.Error
}
func (o *GetUserRolesNotFound) Error() string {
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesNotFound %+v", 404, o.Payload)
}
func (o *GetUserRolesNotFound) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *GetUserRolesNotFound) 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
}
// NewGetUserRolesInternalServerError creates a GetUserRolesInternalServerError with default headers values
func NewGetUserRolesInternalServerError() *GetUserRolesInternalServerError {
return &GetUserRolesInternalServerError{}
}
/*GetUserRolesInternalServerError handles this case with default header values.
Server Internal Error
*/
type GetUserRolesInternalServerError struct {
Payload *auth0_models.Error
}
func (o *GetUserRolesInternalServerError) Error() string {
return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesInternalServerError %+v", 500, o.Payload)
}
func (o *GetUserRolesInternalServerError) GetPayload() *auth0_models.Error {
return o.Payload
}
func (o *GetUserRolesInternalServerError) 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
}