...

Source file src/github.com/sigstore/timestamp-authority/pkg/generated/client/timestamp/get_timestamp_response_parameters.go

Documentation: github.com/sigstore/timestamp-authority/pkg/generated/client/timestamp

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright 2022 The Sigstore Authors.
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //     http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  //
    17  
    18  package timestamp
    19  
    20  // This file was generated by the swagger tool.
    21  // Editing this file might prove futile when you re-run the swagger generate command
    22  
    23  import (
    24  	"context"
    25  	"io"
    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  
    35  // NewGetTimestampResponseParams creates a new GetTimestampResponseParams object,
    36  // with the default timeout for this client.
    37  //
    38  // Default values are not hydrated, since defaults are normally applied by the API server side.
    39  //
    40  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    41  func NewGetTimestampResponseParams() *GetTimestampResponseParams {
    42  	return &GetTimestampResponseParams{
    43  		timeout: cr.DefaultTimeout,
    44  	}
    45  }
    46  
    47  // NewGetTimestampResponseParamsWithTimeout creates a new GetTimestampResponseParams object
    48  // with the ability to set a timeout on a request.
    49  func NewGetTimestampResponseParamsWithTimeout(timeout time.Duration) *GetTimestampResponseParams {
    50  	return &GetTimestampResponseParams{
    51  		timeout: timeout,
    52  	}
    53  }
    54  
    55  // NewGetTimestampResponseParamsWithContext creates a new GetTimestampResponseParams object
    56  // with the ability to set a context for a request.
    57  func NewGetTimestampResponseParamsWithContext(ctx context.Context) *GetTimestampResponseParams {
    58  	return &GetTimestampResponseParams{
    59  		Context: ctx,
    60  	}
    61  }
    62  
    63  // NewGetTimestampResponseParamsWithHTTPClient creates a new GetTimestampResponseParams object
    64  // with the ability to set a custom HTTPClient for a request.
    65  func NewGetTimestampResponseParamsWithHTTPClient(client *http.Client) *GetTimestampResponseParams {
    66  	return &GetTimestampResponseParams{
    67  		HTTPClient: client,
    68  	}
    69  }
    70  
    71  /*
    72  GetTimestampResponseParams contains all the parameters to send to the API endpoint
    73  
    74  	for the get timestamp response operation.
    75  
    76  	Typically these are written to a http.Request.
    77  */
    78  type GetTimestampResponseParams struct {
    79  
    80  	// Request.
    81  	//
    82  	// Format: binary
    83  	Request io.ReadCloser
    84  
    85  	timeout    time.Duration
    86  	Context    context.Context
    87  	HTTPClient *http.Client
    88  }
    89  
    90  // WithDefaults hydrates default values in the get timestamp response params (not the query body).
    91  //
    92  // All values with no default are reset to their zero value.
    93  func (o *GetTimestampResponseParams) WithDefaults() *GetTimestampResponseParams {
    94  	o.SetDefaults()
    95  	return o
    96  }
    97  
    98  // SetDefaults hydrates default values in the get timestamp response params (not the query body).
    99  //
   100  // All values with no default are reset to their zero value.
   101  func (o *GetTimestampResponseParams) SetDefaults() {
   102  	// no default values defined for this parameter
   103  }
   104  
   105  // WithTimeout adds the timeout to the get timestamp response params
   106  func (o *GetTimestampResponseParams) WithTimeout(timeout time.Duration) *GetTimestampResponseParams {
   107  	o.SetTimeout(timeout)
   108  	return o
   109  }
   110  
   111  // SetTimeout adds the timeout to the get timestamp response params
   112  func (o *GetTimestampResponseParams) SetTimeout(timeout time.Duration) {
   113  	o.timeout = timeout
   114  }
   115  
   116  // WithContext adds the context to the get timestamp response params
   117  func (o *GetTimestampResponseParams) WithContext(ctx context.Context) *GetTimestampResponseParams {
   118  	o.SetContext(ctx)
   119  	return o
   120  }
   121  
   122  // SetContext adds the context to the get timestamp response params
   123  func (o *GetTimestampResponseParams) SetContext(ctx context.Context) {
   124  	o.Context = ctx
   125  }
   126  
   127  // WithHTTPClient adds the HTTPClient to the get timestamp response params
   128  func (o *GetTimestampResponseParams) WithHTTPClient(client *http.Client) *GetTimestampResponseParams {
   129  	o.SetHTTPClient(client)
   130  	return o
   131  }
   132  
   133  // SetHTTPClient adds the HTTPClient to the get timestamp response params
   134  func (o *GetTimestampResponseParams) SetHTTPClient(client *http.Client) {
   135  	o.HTTPClient = client
   136  }
   137  
   138  // WithRequest adds the request to the get timestamp response params
   139  func (o *GetTimestampResponseParams) WithRequest(request io.ReadCloser) *GetTimestampResponseParams {
   140  	o.SetRequest(request)
   141  	return o
   142  }
   143  
   144  // SetRequest adds the request to the get timestamp response params
   145  func (o *GetTimestampResponseParams) SetRequest(request io.ReadCloser) {
   146  	o.Request = request
   147  }
   148  
   149  // WriteToRequest writes these params to a swagger request
   150  func (o *GetTimestampResponseParams) 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.Request != nil {
   157  		if err := r.SetBodyParam(o.Request); 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