github.com/looshlee/beatles@v0.0.0-20220727174639-742810ab631c/api/v1/client/policy/get_identity_responses.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  package policy
     4  
     5  // This file was generated by the swagger tool.
     6  // Editing this file might prove futile when you re-run the swagger generate command
     7  
     8  import (
     9  	"fmt"
    10  	"io"
    11  
    12  	"github.com/go-openapi/runtime"
    13  
    14  	strfmt "github.com/go-openapi/strfmt"
    15  
    16  	models "github.com/cilium/cilium/api/v1/models"
    17  )
    18  
    19  // GetIdentityReader is a Reader for the GetIdentity structure.
    20  type GetIdentityReader struct {
    21  	formats strfmt.Registry
    22  }
    23  
    24  // ReadResponse reads a server response into the received o.
    25  func (o *GetIdentityReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    26  	switch response.Code() {
    27  
    28  	case 200:
    29  		result := NewGetIdentityOK()
    30  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    31  			return nil, err
    32  		}
    33  		return result, nil
    34  
    35  	case 404:
    36  		result := NewGetIdentityNotFound()
    37  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    38  			return nil, err
    39  		}
    40  		return nil, result
    41  
    42  	case 520:
    43  		result := NewGetIdentityUnreachable()
    44  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    45  			return nil, err
    46  		}
    47  		return nil, result
    48  
    49  	case 521:
    50  		result := NewGetIdentityInvalidStorageFormat()
    51  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    52  			return nil, err
    53  		}
    54  		return nil, result
    55  
    56  	default:
    57  		return nil, runtime.NewAPIError("unknown error", response, response.Code())
    58  	}
    59  }
    60  
    61  // NewGetIdentityOK creates a GetIdentityOK with default headers values
    62  func NewGetIdentityOK() *GetIdentityOK {
    63  	return &GetIdentityOK{}
    64  }
    65  
    66  /*GetIdentityOK handles this case with default header values.
    67  
    68  Success
    69  */
    70  type GetIdentityOK struct {
    71  	Payload []*models.Identity
    72  }
    73  
    74  func (o *GetIdentityOK) Error() string {
    75  	return fmt.Sprintf("[GET /identity][%d] getIdentityOK  %+v", 200, o.Payload)
    76  }
    77  
    78  func (o *GetIdentityOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
    79  
    80  	// response payload
    81  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
    82  		return err
    83  	}
    84  
    85  	return nil
    86  }
    87  
    88  // NewGetIdentityNotFound creates a GetIdentityNotFound with default headers values
    89  func NewGetIdentityNotFound() *GetIdentityNotFound {
    90  	return &GetIdentityNotFound{}
    91  }
    92  
    93  /*GetIdentityNotFound handles this case with default header values.
    94  
    95  Identities with provided parameters not found
    96  */
    97  type GetIdentityNotFound struct {
    98  }
    99  
   100  func (o *GetIdentityNotFound) Error() string {
   101  	return fmt.Sprintf("[GET /identity][%d] getIdentityNotFound ", 404)
   102  }
   103  
   104  func (o *GetIdentityNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   105  
   106  	return nil
   107  }
   108  
   109  // NewGetIdentityUnreachable creates a GetIdentityUnreachable with default headers values
   110  func NewGetIdentityUnreachable() *GetIdentityUnreachable {
   111  	return &GetIdentityUnreachable{}
   112  }
   113  
   114  /*GetIdentityUnreachable handles this case with default header values.
   115  
   116  Identity storage unreachable. Likely a network problem.
   117  */
   118  type GetIdentityUnreachable struct {
   119  	Payload models.Error
   120  }
   121  
   122  func (o *GetIdentityUnreachable) Error() string {
   123  	return fmt.Sprintf("[GET /identity][%d] getIdentityUnreachable  %+v", 520, o.Payload)
   124  }
   125  
   126  func (o *GetIdentityUnreachable) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   127  
   128  	// response payload
   129  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   130  		return err
   131  	}
   132  
   133  	return nil
   134  }
   135  
   136  // NewGetIdentityInvalidStorageFormat creates a GetIdentityInvalidStorageFormat with default headers values
   137  func NewGetIdentityInvalidStorageFormat() *GetIdentityInvalidStorageFormat {
   138  	return &GetIdentityInvalidStorageFormat{}
   139  }
   140  
   141  /*GetIdentityInvalidStorageFormat handles this case with default header values.
   142  
   143  Invalid identity format in storage
   144  */
   145  type GetIdentityInvalidStorageFormat struct {
   146  	Payload models.Error
   147  }
   148  
   149  func (o *GetIdentityInvalidStorageFormat) Error() string {
   150  	return fmt.Sprintf("[GET /identity][%d] getIdentityInvalidStorageFormat  %+v", 521, o.Payload)
   151  }
   152  
   153  func (o *GetIdentityInvalidStorageFormat) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   154  
   155  	// response payload
   156  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   157  		return err
   158  	}
   159  
   160  	return nil
   161  }