...

Source file src/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_responses.go

Documentation: github.com/sigstore/rekor/pkg/generated/client/entries

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  //
     4  // Copyright 2021 The Sigstore Authors.
     5  //
     6  // Licensed under the Apache License, Version 2.0 (the "License");
     7  // you may not use this file except in compliance with the License.
     8  // You may obtain a copy of the License at
     9  //
    10  //     http://www.apache.org/licenses/LICENSE-2.0
    11  //
    12  // Unless required by applicable law or agreed to in writing, software
    13  // distributed under the License is distributed on an "AS IS" BASIS,
    14  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  // See the License for the specific language governing permissions and
    16  // limitations under the License.
    17  //
    18  
    19  package entries
    20  
    21  // This file was generated by the swagger tool.
    22  // Editing this file might prove futile when you re-run the swagger generate command
    23  
    24  import (
    25  	"fmt"
    26  	"io"
    27  
    28  	"github.com/go-openapi/runtime"
    29  	"github.com/go-openapi/strfmt"
    30  
    31  	"github.com/sigstore/rekor/pkg/generated/models"
    32  )
    33  
    34  // SearchLogQueryReader is a Reader for the SearchLogQuery structure.
    35  type SearchLogQueryReader struct {
    36  	formats strfmt.Registry
    37  }
    38  
    39  // ReadResponse reads a server response into the received o.
    40  func (o *SearchLogQueryReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    41  	switch response.Code() {
    42  	case 200:
    43  		result := NewSearchLogQueryOK()
    44  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    45  			return nil, err
    46  		}
    47  		return result, nil
    48  	case 400:
    49  		result := NewSearchLogQueryBadRequest()
    50  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    51  			return nil, err
    52  		}
    53  		return nil, result
    54  	case 422:
    55  		result := NewSearchLogQueryUnprocessableEntity()
    56  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    57  			return nil, err
    58  		}
    59  		return nil, result
    60  	default:
    61  		result := NewSearchLogQueryDefault(response.Code())
    62  		if err := result.readResponse(response, consumer, o.formats); err != nil {
    63  			return nil, err
    64  		}
    65  		if response.Code()/100 == 2 {
    66  			return result, nil
    67  		}
    68  		return nil, result
    69  	}
    70  }
    71  
    72  // NewSearchLogQueryOK creates a SearchLogQueryOK with default headers values
    73  func NewSearchLogQueryOK() *SearchLogQueryOK {
    74  	return &SearchLogQueryOK{}
    75  }
    76  
    77  /*
    78  SearchLogQueryOK describes a response with status code 200, with default header values.
    79  
    80  Returns zero or more entries from the transparency log, according to how many were included in request query
    81  */
    82  type SearchLogQueryOK struct {
    83  	Payload []models.LogEntry
    84  }
    85  
    86  // IsSuccess returns true when this search log query o k response has a 2xx status code
    87  func (o *SearchLogQueryOK) IsSuccess() bool {
    88  	return true
    89  }
    90  
    91  // IsRedirect returns true when this search log query o k response has a 3xx status code
    92  func (o *SearchLogQueryOK) IsRedirect() bool {
    93  	return false
    94  }
    95  
    96  // IsClientError returns true when this search log query o k response has a 4xx status code
    97  func (o *SearchLogQueryOK) IsClientError() bool {
    98  	return false
    99  }
   100  
   101  // IsServerError returns true when this search log query o k response has a 5xx status code
   102  func (o *SearchLogQueryOK) IsServerError() bool {
   103  	return false
   104  }
   105  
   106  // IsCode returns true when this search log query o k response a status code equal to that given
   107  func (o *SearchLogQueryOK) IsCode(code int) bool {
   108  	return code == 200
   109  }
   110  
   111  // Code gets the status code for the search log query o k response
   112  func (o *SearchLogQueryOK) Code() int {
   113  	return 200
   114  }
   115  
   116  func (o *SearchLogQueryOK) Error() string {
   117  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQueryOK  %+v", 200, o.Payload)
   118  }
   119  
   120  func (o *SearchLogQueryOK) String() string {
   121  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQueryOK  %+v", 200, o.Payload)
   122  }
   123  
   124  func (o *SearchLogQueryOK) GetPayload() []models.LogEntry {
   125  	return o.Payload
   126  }
   127  
   128  func (o *SearchLogQueryOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   129  
   130  	// response payload
   131  	if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
   132  		return err
   133  	}
   134  
   135  	return nil
   136  }
   137  
   138  // NewSearchLogQueryBadRequest creates a SearchLogQueryBadRequest with default headers values
   139  func NewSearchLogQueryBadRequest() *SearchLogQueryBadRequest {
   140  	return &SearchLogQueryBadRequest{}
   141  }
   142  
   143  /*
   144  SearchLogQueryBadRequest describes a response with status code 400, with default header values.
   145  
   146  The content supplied to the server was invalid
   147  */
   148  type SearchLogQueryBadRequest struct {
   149  	Payload *models.Error
   150  }
   151  
   152  // IsSuccess returns true when this search log query bad request response has a 2xx status code
   153  func (o *SearchLogQueryBadRequest) IsSuccess() bool {
   154  	return false
   155  }
   156  
   157  // IsRedirect returns true when this search log query bad request response has a 3xx status code
   158  func (o *SearchLogQueryBadRequest) IsRedirect() bool {
   159  	return false
   160  }
   161  
   162  // IsClientError returns true when this search log query bad request response has a 4xx status code
   163  func (o *SearchLogQueryBadRequest) IsClientError() bool {
   164  	return true
   165  }
   166  
   167  // IsServerError returns true when this search log query bad request response has a 5xx status code
   168  func (o *SearchLogQueryBadRequest) IsServerError() bool {
   169  	return false
   170  }
   171  
   172  // IsCode returns true when this search log query bad request response a status code equal to that given
   173  func (o *SearchLogQueryBadRequest) IsCode(code int) bool {
   174  	return code == 400
   175  }
   176  
   177  // Code gets the status code for the search log query bad request response
   178  func (o *SearchLogQueryBadRequest) Code() int {
   179  	return 400
   180  }
   181  
   182  func (o *SearchLogQueryBadRequest) Error() string {
   183  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQueryBadRequest  %+v", 400, o.Payload)
   184  }
   185  
   186  func (o *SearchLogQueryBadRequest) String() string {
   187  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQueryBadRequest  %+v", 400, o.Payload)
   188  }
   189  
   190  func (o *SearchLogQueryBadRequest) GetPayload() *models.Error {
   191  	return o.Payload
   192  }
   193  
   194  func (o *SearchLogQueryBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   195  
   196  	o.Payload = new(models.Error)
   197  
   198  	// response payload
   199  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   200  		return err
   201  	}
   202  
   203  	return nil
   204  }
   205  
   206  // NewSearchLogQueryUnprocessableEntity creates a SearchLogQueryUnprocessableEntity with default headers values
   207  func NewSearchLogQueryUnprocessableEntity() *SearchLogQueryUnprocessableEntity {
   208  	return &SearchLogQueryUnprocessableEntity{}
   209  }
   210  
   211  /*
   212  SearchLogQueryUnprocessableEntity describes a response with status code 422, with default header values.
   213  
   214  The server understood the request but is unable to process the contained instructions
   215  */
   216  type SearchLogQueryUnprocessableEntity struct {
   217  	Payload *models.Error
   218  }
   219  
   220  // IsSuccess returns true when this search log query unprocessable entity response has a 2xx status code
   221  func (o *SearchLogQueryUnprocessableEntity) IsSuccess() bool {
   222  	return false
   223  }
   224  
   225  // IsRedirect returns true when this search log query unprocessable entity response has a 3xx status code
   226  func (o *SearchLogQueryUnprocessableEntity) IsRedirect() bool {
   227  	return false
   228  }
   229  
   230  // IsClientError returns true when this search log query unprocessable entity response has a 4xx status code
   231  func (o *SearchLogQueryUnprocessableEntity) IsClientError() bool {
   232  	return true
   233  }
   234  
   235  // IsServerError returns true when this search log query unprocessable entity response has a 5xx status code
   236  func (o *SearchLogQueryUnprocessableEntity) IsServerError() bool {
   237  	return false
   238  }
   239  
   240  // IsCode returns true when this search log query unprocessable entity response a status code equal to that given
   241  func (o *SearchLogQueryUnprocessableEntity) IsCode(code int) bool {
   242  	return code == 422
   243  }
   244  
   245  // Code gets the status code for the search log query unprocessable entity response
   246  func (o *SearchLogQueryUnprocessableEntity) Code() int {
   247  	return 422
   248  }
   249  
   250  func (o *SearchLogQueryUnprocessableEntity) Error() string {
   251  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQueryUnprocessableEntity  %+v", 422, o.Payload)
   252  }
   253  
   254  func (o *SearchLogQueryUnprocessableEntity) String() string {
   255  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQueryUnprocessableEntity  %+v", 422, o.Payload)
   256  }
   257  
   258  func (o *SearchLogQueryUnprocessableEntity) GetPayload() *models.Error {
   259  	return o.Payload
   260  }
   261  
   262  func (o *SearchLogQueryUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   263  
   264  	o.Payload = new(models.Error)
   265  
   266  	// response payload
   267  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   268  		return err
   269  	}
   270  
   271  	return nil
   272  }
   273  
   274  // NewSearchLogQueryDefault creates a SearchLogQueryDefault with default headers values
   275  func NewSearchLogQueryDefault(code int) *SearchLogQueryDefault {
   276  	return &SearchLogQueryDefault{
   277  		_statusCode: code,
   278  	}
   279  }
   280  
   281  /*
   282  SearchLogQueryDefault describes a response with status code -1, with default header values.
   283  
   284  There was an internal error in the server while processing the request
   285  */
   286  type SearchLogQueryDefault struct {
   287  	_statusCode int
   288  
   289  	Payload *models.Error
   290  }
   291  
   292  // IsSuccess returns true when this search log query default response has a 2xx status code
   293  func (o *SearchLogQueryDefault) IsSuccess() bool {
   294  	return o._statusCode/100 == 2
   295  }
   296  
   297  // IsRedirect returns true when this search log query default response has a 3xx status code
   298  func (o *SearchLogQueryDefault) IsRedirect() bool {
   299  	return o._statusCode/100 == 3
   300  }
   301  
   302  // IsClientError returns true when this search log query default response has a 4xx status code
   303  func (o *SearchLogQueryDefault) IsClientError() bool {
   304  	return o._statusCode/100 == 4
   305  }
   306  
   307  // IsServerError returns true when this search log query default response has a 5xx status code
   308  func (o *SearchLogQueryDefault) IsServerError() bool {
   309  	return o._statusCode/100 == 5
   310  }
   311  
   312  // IsCode returns true when this search log query default response a status code equal to that given
   313  func (o *SearchLogQueryDefault) IsCode(code int) bool {
   314  	return o._statusCode == code
   315  }
   316  
   317  // Code gets the status code for the search log query default response
   318  func (o *SearchLogQueryDefault) Code() int {
   319  	return o._statusCode
   320  }
   321  
   322  func (o *SearchLogQueryDefault) Error() string {
   323  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQuery default  %+v", o._statusCode, o.Payload)
   324  }
   325  
   326  func (o *SearchLogQueryDefault) String() string {
   327  	return fmt.Sprintf("[POST /api/v1/log/entries/retrieve][%d] searchLogQuery default  %+v", o._statusCode, o.Payload)
   328  }
   329  
   330  func (o *SearchLogQueryDefault) GetPayload() *models.Error {
   331  	return o.Payload
   332  }
   333  
   334  func (o *SearchLogQueryDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
   335  
   336  	o.Payload = new(models.Error)
   337  
   338  	// response payload
   339  	if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
   340  		return err
   341  	}
   342  
   343  	return nil
   344  }
   345  

View as plain text