...

Source file src/github.com/sigstore/rekor/pkg/generated/client/entries/search_log_query_parameters.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  	"context"
    26  	"net/http"
    27  	"time"
    28  
    29  	"github.com/go-openapi/errors"
    30  	"github.com/go-openapi/runtime"
    31  	cr "github.com/go-openapi/runtime/client"
    32  	"github.com/go-openapi/strfmt"
    33  
    34  	"github.com/sigstore/rekor/pkg/generated/models"
    35  )
    36  
    37  // NewSearchLogQueryParams creates a new SearchLogQueryParams object,
    38  // with the default timeout for this client.
    39  //
    40  // Default values are not hydrated, since defaults are normally applied by the API server side.
    41  //
    42  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    43  func NewSearchLogQueryParams() *SearchLogQueryParams {
    44  	return &SearchLogQueryParams{
    45  		timeout: cr.DefaultTimeout,
    46  	}
    47  }
    48  
    49  // NewSearchLogQueryParamsWithTimeout creates a new SearchLogQueryParams object
    50  // with the ability to set a timeout on a request.
    51  func NewSearchLogQueryParamsWithTimeout(timeout time.Duration) *SearchLogQueryParams {
    52  	return &SearchLogQueryParams{
    53  		timeout: timeout,
    54  	}
    55  }
    56  
    57  // NewSearchLogQueryParamsWithContext creates a new SearchLogQueryParams object
    58  // with the ability to set a context for a request.
    59  func NewSearchLogQueryParamsWithContext(ctx context.Context) *SearchLogQueryParams {
    60  	return &SearchLogQueryParams{
    61  		Context: ctx,
    62  	}
    63  }
    64  
    65  // NewSearchLogQueryParamsWithHTTPClient creates a new SearchLogQueryParams object
    66  // with the ability to set a custom HTTPClient for a request.
    67  func NewSearchLogQueryParamsWithHTTPClient(client *http.Client) *SearchLogQueryParams {
    68  	return &SearchLogQueryParams{
    69  		HTTPClient: client,
    70  	}
    71  }
    72  
    73  /*
    74  SearchLogQueryParams contains all the parameters to send to the API endpoint
    75  
    76  	for the search log query operation.
    77  
    78  	Typically these are written to a http.Request.
    79  */
    80  type SearchLogQueryParams struct {
    81  
    82  	// Entry.
    83  	Entry *models.SearchLogQuery
    84  
    85  	timeout    time.Duration
    86  	Context    context.Context
    87  	HTTPClient *http.Client
    88  }
    89  
    90  // WithDefaults hydrates default values in the search log query params (not the query body).
    91  //
    92  // All values with no default are reset to their zero value.
    93  func (o *SearchLogQueryParams) WithDefaults() *SearchLogQueryParams {
    94  	o.SetDefaults()
    95  	return o
    96  }
    97  
    98  // SetDefaults hydrates default values in the search log query params (not the query body).
    99  //
   100  // All values with no default are reset to their zero value.
   101  func (o *SearchLogQueryParams) SetDefaults() {
   102  	// no default values defined for this parameter
   103  }
   104  
   105  // WithTimeout adds the timeout to the search log query params
   106  func (o *SearchLogQueryParams) WithTimeout(timeout time.Duration) *SearchLogQueryParams {
   107  	o.SetTimeout(timeout)
   108  	return o
   109  }
   110  
   111  // SetTimeout adds the timeout to the search log query params
   112  func (o *SearchLogQueryParams) SetTimeout(timeout time.Duration) {
   113  	o.timeout = timeout
   114  }
   115  
   116  // WithContext adds the context to the search log query params
   117  func (o *SearchLogQueryParams) WithContext(ctx context.Context) *SearchLogQueryParams {
   118  	o.SetContext(ctx)
   119  	return o
   120  }
   121  
   122  // SetContext adds the context to the search log query params
   123  func (o *SearchLogQueryParams) SetContext(ctx context.Context) {
   124  	o.Context = ctx
   125  }
   126  
   127  // WithHTTPClient adds the HTTPClient to the search log query params
   128  func (o *SearchLogQueryParams) WithHTTPClient(client *http.Client) *SearchLogQueryParams {
   129  	o.SetHTTPClient(client)
   130  	return o
   131  }
   132  
   133  // SetHTTPClient adds the HTTPClient to the search log query params
   134  func (o *SearchLogQueryParams) SetHTTPClient(client *http.Client) {
   135  	o.HTTPClient = client
   136  }
   137  
   138  // WithEntry adds the entry to the search log query params
   139  func (o *SearchLogQueryParams) WithEntry(entry *models.SearchLogQuery) *SearchLogQueryParams {
   140  	o.SetEntry(entry)
   141  	return o
   142  }
   143  
   144  // SetEntry adds the entry to the search log query params
   145  func (o *SearchLogQueryParams) SetEntry(entry *models.SearchLogQuery) {
   146  	o.Entry = entry
   147  }
   148  
   149  // WriteToRequest writes these params to a swagger request
   150  func (o *SearchLogQueryParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   151  
   152  	if err := r.SetTimeout(o.timeout); err != nil {
   153  		return err
   154  	}
   155  	var res []error
   156  	if o.Entry != nil {
   157  		if err := r.SetBodyParam(o.Entry); err != nil {
   158  			return err
   159  		}
   160  	}
   161  
   162  	if len(res) > 0 {
   163  		return errors.CompositeValidationError(res...)
   164  	}
   165  	return nil
   166  }
   167  

View as plain text