// 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("response status code does not match any response statuses defined for this endpoint in the swagger spec", response, response.Code()) } } // NewGetUserRolesOK creates a GetUserRolesOK with default headers values func NewGetUserRolesOK() *GetUserRolesOK { return &GetUserRolesOK{} } /* GetUserRolesOK describes a response with status code 200, with default header values. Taxnexus Response with User objects */ type GetUserRolesOK struct { Payload *auth0_models.RoleResponse } // IsSuccess returns true when this get user roles o k response has a 2xx status code func (o *GetUserRolesOK) IsSuccess() bool { return true } // IsRedirect returns true when this get user roles o k response has a 3xx status code func (o *GetUserRolesOK) IsRedirect() bool { return false } // IsClientError returns true when this get user roles o k response has a 4xx status code func (o *GetUserRolesOK) IsClientError() bool { return false } // IsServerError returns true when this get user roles o k response has a 5xx status code func (o *GetUserRolesOK) IsServerError() bool { return false } // IsCode returns true when this get user roles o k response a status code equal to that given func (o *GetUserRolesOK) IsCode(code int) bool { return code == 200 } // Code gets the status code for the get user roles o k response func (o *GetUserRolesOK) Code() int { return 200 } func (o *GetUserRolesOK) Error() string { return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesOK %+v", 200, o.Payload) } func (o *GetUserRolesOK) String() 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 describes a response with status code 401, with default header values. Access Unauthorized, invalid API-KEY was used */ type GetUserRolesUnauthorized struct { Payload *auth0_models.Error } // IsSuccess returns true when this get user roles unauthorized response has a 2xx status code func (o *GetUserRolesUnauthorized) IsSuccess() bool { return false } // IsRedirect returns true when this get user roles unauthorized response has a 3xx status code func (o *GetUserRolesUnauthorized) IsRedirect() bool { return false } // IsClientError returns true when this get user roles unauthorized response has a 4xx status code func (o *GetUserRolesUnauthorized) IsClientError() bool { return true } // IsServerError returns true when this get user roles unauthorized response has a 5xx status code func (o *GetUserRolesUnauthorized) IsServerError() bool { return false } // IsCode returns true when this get user roles unauthorized response a status code equal to that given func (o *GetUserRolesUnauthorized) IsCode(code int) bool { return code == 401 } // Code gets the status code for the get user roles unauthorized response func (o *GetUserRolesUnauthorized) Code() int { return 401 } func (o *GetUserRolesUnauthorized) Error() string { return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesUnauthorized %+v", 401, o.Payload) } func (o *GetUserRolesUnauthorized) String() 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 describes a response with status code 403, with default header values. Access forbidden, account lacks access */ type GetUserRolesForbidden struct { Payload *auth0_models.Error } // IsSuccess returns true when this get user roles forbidden response has a 2xx status code func (o *GetUserRolesForbidden) IsSuccess() bool { return false } // IsRedirect returns true when this get user roles forbidden response has a 3xx status code func (o *GetUserRolesForbidden) IsRedirect() bool { return false } // IsClientError returns true when this get user roles forbidden response has a 4xx status code func (o *GetUserRolesForbidden) IsClientError() bool { return true } // IsServerError returns true when this get user roles forbidden response has a 5xx status code func (o *GetUserRolesForbidden) IsServerError() bool { return false } // IsCode returns true when this get user roles forbidden response a status code equal to that given func (o *GetUserRolesForbidden) IsCode(code int) bool { return code == 403 } // Code gets the status code for the get user roles forbidden response func (o *GetUserRolesForbidden) Code() int { return 403 } func (o *GetUserRolesForbidden) Error() string { return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesForbidden %+v", 403, o.Payload) } func (o *GetUserRolesForbidden) String() 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 describes a response with status code 404, with default header values. Resource was not found */ type GetUserRolesNotFound struct { Payload *auth0_models.Error } // IsSuccess returns true when this get user roles not found response has a 2xx status code func (o *GetUserRolesNotFound) IsSuccess() bool { return false } // IsRedirect returns true when this get user roles not found response has a 3xx status code func (o *GetUserRolesNotFound) IsRedirect() bool { return false } // IsClientError returns true when this get user roles not found response has a 4xx status code func (o *GetUserRolesNotFound) IsClientError() bool { return true } // IsServerError returns true when this get user roles not found response has a 5xx status code func (o *GetUserRolesNotFound) IsServerError() bool { return false } // IsCode returns true when this get user roles not found response a status code equal to that given func (o *GetUserRolesNotFound) IsCode(code int) bool { return code == 404 } // Code gets the status code for the get user roles not found response func (o *GetUserRolesNotFound) Code() int { return 404 } func (o *GetUserRolesNotFound) Error() string { return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesNotFound %+v", 404, o.Payload) } func (o *GetUserRolesNotFound) String() 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 describes a response with status code 500, with default header values. Server Internal Error */ type GetUserRolesInternalServerError struct { Payload *auth0_models.Error } // IsSuccess returns true when this get user roles internal server error response has a 2xx status code func (o *GetUserRolesInternalServerError) IsSuccess() bool { return false } // IsRedirect returns true when this get user roles internal server error response has a 3xx status code func (o *GetUserRolesInternalServerError) IsRedirect() bool { return false } // IsClientError returns true when this get user roles internal server error response has a 4xx status code func (o *GetUserRolesInternalServerError) IsClientError() bool { return false } // IsServerError returns true when this get user roles internal server error response has a 5xx status code func (o *GetUserRolesInternalServerError) IsServerError() bool { return true } // IsCode returns true when this get user roles internal server error response a status code equal to that given func (o *GetUserRolesInternalServerError) IsCode(code int) bool { return code == 500 } // Code gets the status code for the get user roles internal server error response func (o *GetUserRolesInternalServerError) Code() int { return 500 } func (o *GetUserRolesInternalServerError) Error() string { return fmt.Sprintf("[GET /api/v2/users/{userId}/roles][%d] getUserRolesInternalServerError %+v", 500, o.Payload) } func (o *GetUserRolesInternalServerError) String() 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 }