// Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license" file accompanying this file. This file is distributed // on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing // permissions and limitations under the License. // Code generated by go-swagger; DO NOT EDIT. package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "net/http" "time" "golang.org/x/net/context" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" strfmt "github.com/go-openapi/strfmt" ) // NewStreamTasksParams creates a new StreamTasksParams object // with the default values initialized. func NewStreamTasksParams() *StreamTasksParams { var () return &StreamTasksParams{ timeout: cr.DefaultTimeout, } } // NewStreamTasksParamsWithTimeout creates a new StreamTasksParams object // with the default values initialized, and the ability to set a timeout on a request func NewStreamTasksParamsWithTimeout(timeout time.Duration) *StreamTasksParams { var () return &StreamTasksParams{ timeout: timeout, } } // NewStreamTasksParamsWithContext creates a new StreamTasksParams object // with the default values initialized, and the ability to set a context for a request func NewStreamTasksParamsWithContext(ctx context.Context) *StreamTasksParams { var () return &StreamTasksParams{ Context: ctx, } } // NewStreamTasksParamsWithHTTPClient creates a new StreamTasksParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request func NewStreamTasksParamsWithHTTPClient(client *http.Client) *StreamTasksParams { var () return &StreamTasksParams{ HTTPClient: client, } } /*StreamTasksParams contains all the parameters to send to the API endpoint for the stream tasks operation typically these are written to a http.Request */ type StreamTasksParams struct { /*EntityVersion Entity version to start streaming from */ EntityVersion *string timeout time.Duration Context context.Context HTTPClient *http.Client } // WithTimeout adds the timeout to the stream tasks params func (o *StreamTasksParams) WithTimeout(timeout time.Duration) *StreamTasksParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the stream tasks params func (o *StreamTasksParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the stream tasks params func (o *StreamTasksParams) WithContext(ctx context.Context) *StreamTasksParams { o.SetContext(ctx) return o } // SetContext adds the context to the stream tasks params func (o *StreamTasksParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the stream tasks params func (o *StreamTasksParams) WithHTTPClient(client *http.Client) *StreamTasksParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the stream tasks params func (o *StreamTasksParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithEntityVersion adds the entityVersion to the stream tasks params func (o *StreamTasksParams) WithEntityVersion(entityVersion *string) *StreamTasksParams { o.SetEntityVersion(entityVersion) return o } // SetEntityVersion adds the entityVersion to the stream tasks params func (o *StreamTasksParams) SetEntityVersion(entityVersion *string) { o.EntityVersion = entityVersion } // WriteToRequest writes these params to a swagger request func (o *StreamTasksParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error if o.EntityVersion != nil { // query param entityVersion var qrEntityVersion string if o.EntityVersion != nil { qrEntityVersion = *o.EntityVersion } qEntityVersion := qrEntityVersion if qEntityVersion != "" { if err := r.SetQueryParam("entityVersion", qEntityVersion); err != nil { return err } } } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }