1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
11 "github.com/go-openapi/runtime"
12 "github.com/go-openapi/strfmt"
15 // UnsubscribeReader is a Reader for the Unsubscribe structure.
16 type UnsubscribeReader struct {
17 formats strfmt.Registry
20 // ReadResponse reads a server response into the received o.
21 func (o *UnsubscribeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
22 switch response.Code() {
24 result := NewUnsubscribeNoContent()
25 if err := result.readResponse(response, consumer, o.formats); err != nil {
30 result := NewUnsubscribeBadRequest()
31 if err := result.readResponse(response, consumer, o.formats); err != nil {
36 result := NewUnsubscribeInternalServerError()
37 if err := result.readResponse(response, consumer, o.formats); err != nil {
43 return nil, runtime.NewAPIError("unknown error", response, response.Code())
47 // NewUnsubscribeNoContent creates a UnsubscribeNoContent with default headers values
48 func NewUnsubscribeNoContent() *UnsubscribeNoContent {
49 return &UnsubscribeNoContent{}
52 /*UnsubscribeNoContent handles this case with default header values.
54 Operation done successfully
56 type UnsubscribeNoContent struct {
59 func (o *UnsubscribeNoContent) Error() string {
60 return fmt.Sprintf("[DELETE /subscriptions/{subscriptionId}][%d] unsubscribeNoContent ", 204)
63 func (o *UnsubscribeNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
68 // NewUnsubscribeBadRequest creates a UnsubscribeBadRequest with default headers values
69 func NewUnsubscribeBadRequest() *UnsubscribeBadRequest {
70 return &UnsubscribeBadRequest{}
73 /*UnsubscribeBadRequest handles this case with default header values.
75 Invalid subscriptionId supplied
77 type UnsubscribeBadRequest struct {
80 func (o *UnsubscribeBadRequest) Error() string {
81 return fmt.Sprintf("[DELETE /subscriptions/{subscriptionId}][%d] unsubscribeBadRequest ", 400)
84 func (o *UnsubscribeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
89 // NewUnsubscribeInternalServerError creates a UnsubscribeInternalServerError with default headers values
90 func NewUnsubscribeInternalServerError() *UnsubscribeInternalServerError {
91 return &UnsubscribeInternalServerError{}
94 /*UnsubscribeInternalServerError handles this case with default header values.
98 type UnsubscribeInternalServerError struct {
101 func (o *UnsubscribeInternalServerError) Error() string {
102 return fmt.Sprintf("[DELETE /subscriptions/{subscriptionId}][%d] unsubscribeInternalServerError ", 500)
105 func (o *UnsubscribeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {