...

Source file src/github.com/sigstore/rekor/pkg/generated/restapi/operations/index/search_index_responses.go

Documentation: github.com/sigstore/rekor/pkg/generated/restapi/operations/index

     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 index
    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  	"net/http"
    26  
    27  	"github.com/go-openapi/runtime"
    28  
    29  	"github.com/sigstore/rekor/pkg/generated/models"
    30  )
    31  
    32  // SearchIndexOKCode is the HTTP code returned for type SearchIndexOK
    33  const SearchIndexOKCode int = 200
    34  
    35  /*
    36  SearchIndexOK Returns zero or more entry UUIDs from the transparency log based on search query
    37  
    38  swagger:response searchIndexOK
    39  */
    40  type SearchIndexOK struct {
    41  
    42  	/*
    43  	  In: Body
    44  	*/
    45  	Payload []string `json:"body,omitempty"`
    46  }
    47  
    48  // NewSearchIndexOK creates SearchIndexOK with default headers values
    49  func NewSearchIndexOK() *SearchIndexOK {
    50  
    51  	return &SearchIndexOK{}
    52  }
    53  
    54  // WithPayload adds the payload to the search index o k response
    55  func (o *SearchIndexOK) WithPayload(payload []string) *SearchIndexOK {
    56  	o.Payload = payload
    57  	return o
    58  }
    59  
    60  // SetPayload sets the payload to the search index o k response
    61  func (o *SearchIndexOK) SetPayload(payload []string) {
    62  	o.Payload = payload
    63  }
    64  
    65  // WriteResponse to the client
    66  func (o *SearchIndexOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
    67  
    68  	rw.WriteHeader(200)
    69  	payload := o.Payload
    70  	if payload == nil {
    71  		// return empty array
    72  		payload = make([]string, 0, 50)
    73  	}
    74  
    75  	if err := producer.Produce(rw, payload); err != nil {
    76  		panic(err) // let the recovery middleware deal with this
    77  	}
    78  }
    79  
    80  // SearchIndexBadRequestCode is the HTTP code returned for type SearchIndexBadRequest
    81  const SearchIndexBadRequestCode int = 400
    82  
    83  /*
    84  SearchIndexBadRequest The content supplied to the server was invalid
    85  
    86  swagger:response searchIndexBadRequest
    87  */
    88  type SearchIndexBadRequest struct {
    89  
    90  	/*
    91  	  In: Body
    92  	*/
    93  	Payload *models.Error `json:"body,omitempty"`
    94  }
    95  
    96  // NewSearchIndexBadRequest creates SearchIndexBadRequest with default headers values
    97  func NewSearchIndexBadRequest() *SearchIndexBadRequest {
    98  
    99  	return &SearchIndexBadRequest{}
   100  }
   101  
   102  // WithPayload adds the payload to the search index bad request response
   103  func (o *SearchIndexBadRequest) WithPayload(payload *models.Error) *SearchIndexBadRequest {
   104  	o.Payload = payload
   105  	return o
   106  }
   107  
   108  // SetPayload sets the payload to the search index bad request response
   109  func (o *SearchIndexBadRequest) SetPayload(payload *models.Error) {
   110  	o.Payload = payload
   111  }
   112  
   113  // WriteResponse to the client
   114  func (o *SearchIndexBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   115  
   116  	rw.WriteHeader(400)
   117  	if o.Payload != nil {
   118  		payload := o.Payload
   119  		if err := producer.Produce(rw, payload); err != nil {
   120  			panic(err) // let the recovery middleware deal with this
   121  		}
   122  	}
   123  }
   124  
   125  /*
   126  SearchIndexDefault There was an internal error in the server while processing the request
   127  
   128  swagger:response searchIndexDefault
   129  */
   130  type SearchIndexDefault struct {
   131  	_statusCode int
   132  
   133  	/*
   134  	  In: Body
   135  	*/
   136  	Payload *models.Error `json:"body,omitempty"`
   137  }
   138  
   139  // NewSearchIndexDefault creates SearchIndexDefault with default headers values
   140  func NewSearchIndexDefault(code int) *SearchIndexDefault {
   141  	if code <= 0 {
   142  		code = 500
   143  	}
   144  
   145  	return &SearchIndexDefault{
   146  		_statusCode: code,
   147  	}
   148  }
   149  
   150  // WithStatusCode adds the status to the search index default response
   151  func (o *SearchIndexDefault) WithStatusCode(code int) *SearchIndexDefault {
   152  	o._statusCode = code
   153  	return o
   154  }
   155  
   156  // SetStatusCode sets the status to the search index default response
   157  func (o *SearchIndexDefault) SetStatusCode(code int) {
   158  	o._statusCode = code
   159  }
   160  
   161  // WithPayload adds the payload to the search index default response
   162  func (o *SearchIndexDefault) WithPayload(payload *models.Error) *SearchIndexDefault {
   163  	o.Payload = payload
   164  	return o
   165  }
   166  
   167  // SetPayload sets the payload to the search index default response
   168  func (o *SearchIndexDefault) SetPayload(payload *models.Error) {
   169  	o.Payload = payload
   170  }
   171  
   172  // WriteResponse to the client
   173  func (o *SearchIndexDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
   174  
   175  	rw.WriteHeader(o._statusCode)
   176  	if o.Payload != nil {
   177  		payload := o.Payload
   178  		if err := producer.Produce(rw, payload); err != nil {
   179  			panic(err) // let the recovery middleware deal with this
   180  		}
   181  	}
   182  }
   183  

View as plain text