github.com/cilium/cilium@v1.16.2/api/v1/client/service/put_service_id_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright Authors of Cilium
     4  // SPDX-License-Identifier: Apache-2.0
     5  
     6  package service
     7  
     8  // This file was generated by the swagger tool.
     9  // Editing this file might prove futile when you re-run the swagger generate command
    10  
    11  import (
    12  	"fmt"
    13  	"io"
    14  
    15  	"github.com/go-openapi/runtime"
    16  	"github.com/go-openapi/strfmt"
    17  
    18  	"github.com/cilium/cilium/api/v1/models"
    19  )
    20  
    21  // PutServiceIDReader is a Reader for the PutServiceID structure.
    22  type PutServiceIDReader struct {
    23  	formats strfmt.Registry
    24  }
    25  
    26  // ReadResponse reads a server response into the received o.
    27  func (o *PutServiceIDReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    28  	switch response.Code() {
    29  	case 200:
    30  		result := NewPutServiceIDOK()
    31  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    32  			return nil, err
    33  		}
    34  		return result, nil
    35  	case 201:
    36  		result := NewPutServiceIDCreated()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return result, nil
    41  	case 403:
    42  		result := NewPutServiceIDForbidden()
    43  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    44  			return nil, err
    45  		}
    46  		return nil, result
    47  	case 460:
    48  		result := NewPutServiceIDInvalidFrontend()
    49  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    50  			return nil, err
    51  		}
    52  		return nil, result
    53  	case 461:
    54  		result := NewPutServiceIDInvalidBackend()
    55  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    56  			return nil, err
    57  		}
    58  		return nil, result
    59  	case 500:
    60  		result := NewPutServiceIDFailure()
    61  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    62  			return nil, err
    63  		}
    64  		return nil, result
    65  	case 501:
    66  		result := NewPutServiceIDUpdateBackendFailure()
    67  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    68  			return nil, err
    69  		}
    70  		return nil, result
    71  	default:
    72  		return nil, runtime.NewAPIError("[PUT /service/{id}] PutServiceID", response, response.Code())
    73  	}
    74  }
    75  
    76  // NewPutServiceIDOK creates a PutServiceIDOK with default headers values
    77  func NewPutServiceIDOK() *PutServiceIDOK {
    78  	return &PutServiceIDOK{}
    79  }
    80  
    81  /*
    82  PutServiceIDOK describes a response with status code 200, with default header values.
    83  
    84  Updated
    85  */
    86  type PutServiceIDOK struct {
    87  }
    88  
    89  // IsSuccess returns true when this put service Id o k response has a 2xx status code
    90  func (o *PutServiceIDOK) IsSuccess() bool {
    91  	return true
    92  }
    93  
    94  // IsRedirect returns true when this put service Id o k response has a 3xx status code
    95  func (o *PutServiceIDOK) IsRedirect() bool {
    96  	return false
    97  }
    98  
    99  // IsClientError returns true when this put service Id o k response has a 4xx status code
   100  func (o *PutServiceIDOK) IsClientError() bool {
   101  	return false
   102  }
   103  
   104  // IsServerError returns true when this put service Id o k response has a 5xx status code
   105  func (o *PutServiceIDOK) IsServerError() bool {
   106  	return false
   107  }
   108  
   109  // IsCode returns true when this put service Id o k response a status code equal to that given
   110  func (o *PutServiceIDOK) IsCode(code int) bool {
   111  	return code == 200
   112  }
   113  
   114  // Code gets the status code for the put service Id o k response
   115  func (o *PutServiceIDOK) Code() int {
   116  	return 200
   117  }
   118  
   119  func (o *PutServiceIDOK) Error() string {
   120  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdOK ", 200)
   121  }
   122  
   123  func (o *PutServiceIDOK) String() string {
   124  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdOK ", 200)
   125  }
   126  
   127  func (o *PutServiceIDOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   128  
   129  	return nil
   130  }
   131  
   132  // NewPutServiceIDCreated creates a PutServiceIDCreated with default headers values
   133  func NewPutServiceIDCreated() *PutServiceIDCreated {
   134  	return &PutServiceIDCreated{}
   135  }
   136  
   137  /*
   138  PutServiceIDCreated describes a response with status code 201, with default header values.
   139  
   140  Created
   141  */
   142  type PutServiceIDCreated struct {
   143  }
   144  
   145  // IsSuccess returns true when this put service Id created response has a 2xx status code
   146  func (o *PutServiceIDCreated) IsSuccess() bool {
   147  	return true
   148  }
   149  
   150  // IsRedirect returns true when this put service Id created response has a 3xx status code
   151  func (o *PutServiceIDCreated) IsRedirect() bool {
   152  	return false
   153  }
   154  
   155  // IsClientError returns true when this put service Id created response has a 4xx status code
   156  func (o *PutServiceIDCreated) IsClientError() bool {
   157  	return false
   158  }
   159  
   160  // IsServerError returns true when this put service Id created response has a 5xx status code
   161  func (o *PutServiceIDCreated) IsServerError() bool {
   162  	return false
   163  }
   164  
   165  // IsCode returns true when this put service Id created response a status code equal to that given
   166  func (o *PutServiceIDCreated) IsCode(code int) bool {
   167  	return code == 201
   168  }
   169  
   170  // Code gets the status code for the put service Id created response
   171  func (o *PutServiceIDCreated) Code() int {
   172  	return 201
   173  }
   174  
   175  func (o *PutServiceIDCreated) Error() string {
   176  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdCreated ", 201)
   177  }
   178  
   179  func (o *PutServiceIDCreated) String() string {
   180  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdCreated ", 201)
   181  }
   182  
   183  func (o *PutServiceIDCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   184  
   185  	return nil
   186  }
   187  
   188  // NewPutServiceIDForbidden creates a PutServiceIDForbidden with default headers values
   189  func NewPutServiceIDForbidden() *PutServiceIDForbidden {
   190  	return &PutServiceIDForbidden{}
   191  }
   192  
   193  /*
   194  PutServiceIDForbidden describes a response with status code 403, with default header values.
   195  
   196  Forbidden
   197  */
   198  type PutServiceIDForbidden struct {
   199  }
   200  
   201  // IsSuccess returns true when this put service Id forbidden response has a 2xx status code
   202  func (o *PutServiceIDForbidden) IsSuccess() bool {
   203  	return false
   204  }
   205  
   206  // IsRedirect returns true when this put service Id forbidden response has a 3xx status code
   207  func (o *PutServiceIDForbidden) IsRedirect() bool {
   208  	return false
   209  }
   210  
   211  // IsClientError returns true when this put service Id forbidden response has a 4xx status code
   212  func (o *PutServiceIDForbidden) IsClientError() bool {
   213  	return true
   214  }
   215  
   216  // IsServerError returns true when this put service Id forbidden response has a 5xx status code
   217  func (o *PutServiceIDForbidden) IsServerError() bool {
   218  	return false
   219  }
   220  
   221  // IsCode returns true when this put service Id forbidden response a status code equal to that given
   222  func (o *PutServiceIDForbidden) IsCode(code int) bool {
   223  	return code == 403
   224  }
   225  
   226  // Code gets the status code for the put service Id forbidden response
   227  func (o *PutServiceIDForbidden) Code() int {
   228  	return 403
   229  }
   230  
   231  func (o *PutServiceIDForbidden) Error() string {
   232  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdForbidden ", 403)
   233  }
   234  
   235  func (o *PutServiceIDForbidden) String() string {
   236  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdForbidden ", 403)
   237  }
   238  
   239  func (o *PutServiceIDForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   240  
   241  	return nil
   242  }
   243  
   244  // NewPutServiceIDInvalidFrontend creates a PutServiceIDInvalidFrontend with default headers values
   245  func NewPutServiceIDInvalidFrontend() *PutServiceIDInvalidFrontend {
   246  	return &PutServiceIDInvalidFrontend{}
   247  }
   248  
   249  /*
   250  PutServiceIDInvalidFrontend describes a response with status code 460, with default header values.
   251  
   252  Invalid frontend in service configuration
   253  */
   254  type PutServiceIDInvalidFrontend struct {
   255  	Payload models.Error
   256  }
   257  
   258  // IsSuccess returns true when this put service Id invalid frontend response has a 2xx status code
   259  func (o *PutServiceIDInvalidFrontend) IsSuccess() bool {
   260  	return false
   261  }
   262  
   263  // IsRedirect returns true when this put service Id invalid frontend response has a 3xx status code
   264  func (o *PutServiceIDInvalidFrontend) IsRedirect() bool {
   265  	return false
   266  }
   267  
   268  // IsClientError returns true when this put service Id invalid frontend response has a 4xx status code
   269  func (o *PutServiceIDInvalidFrontend) IsClientError() bool {
   270  	return true
   271  }
   272  
   273  // IsServerError returns true when this put service Id invalid frontend response has a 5xx status code
   274  func (o *PutServiceIDInvalidFrontend) IsServerError() bool {
   275  	return false
   276  }
   277  
   278  // IsCode returns true when this put service Id invalid frontend response a status code equal to that given
   279  func (o *PutServiceIDInvalidFrontend) IsCode(code int) bool {
   280  	return code == 460
   281  }
   282  
   283  // Code gets the status code for the put service Id invalid frontend response
   284  func (o *PutServiceIDInvalidFrontend) Code() int {
   285  	return 460
   286  }
   287  
   288  func (o *PutServiceIDInvalidFrontend) Error() string {
   289  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdInvalidFrontend  %+v", 460, o.Payload)
   290  }
   291  
   292  func (o *PutServiceIDInvalidFrontend) String() string {
   293  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdInvalidFrontend  %+v", 460, o.Payload)
   294  }
   295  
   296  func (o *PutServiceIDInvalidFrontend) GetPayload() models.Error {
   297  	return o.Payload
   298  }
   299  
   300  func (o *PutServiceIDInvalidFrontend) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   301  
   302  	// response payload
   303  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   304  		return err
   305  	}
   306  
   307  	return nil
   308  }
   309  
   310  // NewPutServiceIDInvalidBackend creates a PutServiceIDInvalidBackend with default headers values
   311  func NewPutServiceIDInvalidBackend() *PutServiceIDInvalidBackend {
   312  	return &PutServiceIDInvalidBackend{}
   313  }
   314  
   315  /*
   316  PutServiceIDInvalidBackend describes a response with status code 461, with default header values.
   317  
   318  Invalid backend in service configuration
   319  */
   320  type PutServiceIDInvalidBackend struct {
   321  	Payload models.Error
   322  }
   323  
   324  // IsSuccess returns true when this put service Id invalid backend response has a 2xx status code
   325  func (o *PutServiceIDInvalidBackend) IsSuccess() bool {
   326  	return false
   327  }
   328  
   329  // IsRedirect returns true when this put service Id invalid backend response has a 3xx status code
   330  func (o *PutServiceIDInvalidBackend) IsRedirect() bool {
   331  	return false
   332  }
   333  
   334  // IsClientError returns true when this put service Id invalid backend response has a 4xx status code
   335  func (o *PutServiceIDInvalidBackend) IsClientError() bool {
   336  	return true
   337  }
   338  
   339  // IsServerError returns true when this put service Id invalid backend response has a 5xx status code
   340  func (o *PutServiceIDInvalidBackend) IsServerError() bool {
   341  	return false
   342  }
   343  
   344  // IsCode returns true when this put service Id invalid backend response a status code equal to that given
   345  func (o *PutServiceIDInvalidBackend) IsCode(code int) bool {
   346  	return code == 461
   347  }
   348  
   349  // Code gets the status code for the put service Id invalid backend response
   350  func (o *PutServiceIDInvalidBackend) Code() int {
   351  	return 461
   352  }
   353  
   354  func (o *PutServiceIDInvalidBackend) Error() string {
   355  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdInvalidBackend  %+v", 461, o.Payload)
   356  }
   357  
   358  func (o *PutServiceIDInvalidBackend) String() string {
   359  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdInvalidBackend  %+v", 461, o.Payload)
   360  }
   361  
   362  func (o *PutServiceIDInvalidBackend) GetPayload() models.Error {
   363  	return o.Payload
   364  }
   365  
   366  func (o *PutServiceIDInvalidBackend) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   367  
   368  	// response payload
   369  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   370  		return err
   371  	}
   372  
   373  	return nil
   374  }
   375  
   376  // NewPutServiceIDFailure creates a PutServiceIDFailure with default headers values
   377  func NewPutServiceIDFailure() *PutServiceIDFailure {
   378  	return &PutServiceIDFailure{}
   379  }
   380  
   381  /*
   382  PutServiceIDFailure describes a response with status code 500, with default header values.
   383  
   384  Error while creating service
   385  */
   386  type PutServiceIDFailure struct {
   387  	Payload models.Error
   388  }
   389  
   390  // IsSuccess returns true when this put service Id failure response has a 2xx status code
   391  func (o *PutServiceIDFailure) IsSuccess() bool {
   392  	return false
   393  }
   394  
   395  // IsRedirect returns true when this put service Id failure response has a 3xx status code
   396  func (o *PutServiceIDFailure) IsRedirect() bool {
   397  	return false
   398  }
   399  
   400  // IsClientError returns true when this put service Id failure response has a 4xx status code
   401  func (o *PutServiceIDFailure) IsClientError() bool {
   402  	return false
   403  }
   404  
   405  // IsServerError returns true when this put service Id failure response has a 5xx status code
   406  func (o *PutServiceIDFailure) IsServerError() bool {
   407  	return true
   408  }
   409  
   410  // IsCode returns true when this put service Id failure response a status code equal to that given
   411  func (o *PutServiceIDFailure) IsCode(code int) bool {
   412  	return code == 500
   413  }
   414  
   415  // Code gets the status code for the put service Id failure response
   416  func (o *PutServiceIDFailure) Code() int {
   417  	return 500
   418  }
   419  
   420  func (o *PutServiceIDFailure) Error() string {
   421  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdFailure  %+v", 500, o.Payload)
   422  }
   423  
   424  func (o *PutServiceIDFailure) String() string {
   425  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdFailure  %+v", 500, o.Payload)
   426  }
   427  
   428  func (o *PutServiceIDFailure) GetPayload() models.Error {
   429  	return o.Payload
   430  }
   431  
   432  func (o *PutServiceIDFailure) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   433  
   434  	// response payload
   435  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   436  		return err
   437  	}
   438  
   439  	return nil
   440  }
   441  
   442  // NewPutServiceIDUpdateBackendFailure creates a PutServiceIDUpdateBackendFailure with default headers values
   443  func NewPutServiceIDUpdateBackendFailure() *PutServiceIDUpdateBackendFailure {
   444  	return &PutServiceIDUpdateBackendFailure{}
   445  }
   446  
   447  /*
   448  PutServiceIDUpdateBackendFailure describes a response with status code 501, with default header values.
   449  
   450  Error while updating backend states
   451  */
   452  type PutServiceIDUpdateBackendFailure struct {
   453  	Payload models.Error
   454  }
   455  
   456  // IsSuccess returns true when this put service Id update backend failure response has a 2xx status code
   457  func (o *PutServiceIDUpdateBackendFailure) IsSuccess() bool {
   458  	return false
   459  }
   460  
   461  // IsRedirect returns true when this put service Id update backend failure response has a 3xx status code
   462  func (o *PutServiceIDUpdateBackendFailure) IsRedirect() bool {
   463  	return false
   464  }
   465  
   466  // IsClientError returns true when this put service Id update backend failure response has a 4xx status code
   467  func (o *PutServiceIDUpdateBackendFailure) IsClientError() bool {
   468  	return false
   469  }
   470  
   471  // IsServerError returns true when this put service Id update backend failure response has a 5xx status code
   472  func (o *PutServiceIDUpdateBackendFailure) IsServerError() bool {
   473  	return true
   474  }
   475  
   476  // IsCode returns true when this put service Id update backend failure response a status code equal to that given
   477  func (o *PutServiceIDUpdateBackendFailure) IsCode(code int) bool {
   478  	return code == 501
   479  }
   480  
   481  // Code gets the status code for the put service Id update backend failure response
   482  func (o *PutServiceIDUpdateBackendFailure) Code() int {
   483  	return 501
   484  }
   485  
   486  func (o *PutServiceIDUpdateBackendFailure) Error() string {
   487  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdUpdateBackendFailure  %+v", 501, o.Payload)
   488  }
   489  
   490  func (o *PutServiceIDUpdateBackendFailure) String() string {
   491  	return fmt.Sprintf("[PUT /service/{id}][%d] putServiceIdUpdateBackendFailure  %+v", 501, o.Payload)
   492  }
   493  
   494  func (o *PutServiceIDUpdateBackendFailure) GetPayload() models.Error {
   495  	return o.Payload
   496  }
   497  
   498  func (o *PutServiceIDUpdateBackendFailure) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   499  
   500  	// response payload
   501  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   502  		return err
   503  	}
   504  
   505  	return nil
   506  }