// Code generated by go-swagger; DO NOT EDIT. package common // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" "github.com/go-openapi/swag" strfmt "github.com/go-openapi/strfmt" ) // NewUnsubscribeParams creates a new UnsubscribeParams object // with the default values initialized. func NewUnsubscribeParams() *UnsubscribeParams { var () return &UnsubscribeParams{ timeout: cr.DefaultTimeout, } } // NewUnsubscribeParamsWithTimeout creates a new UnsubscribeParams object // with the default values initialized, and the ability to set a timeout on a request func NewUnsubscribeParamsWithTimeout(timeout time.Duration) *UnsubscribeParams { var () return &UnsubscribeParams{ timeout: timeout, } } // NewUnsubscribeParamsWithContext creates a new UnsubscribeParams object // with the default values initialized, and the ability to set a context for a request func NewUnsubscribeParamsWithContext(ctx context.Context) *UnsubscribeParams { var () return &UnsubscribeParams{ Context: ctx, } } // NewUnsubscribeParamsWithHTTPClient creates a new UnsubscribeParams object // with the default values initialized, and the ability to set a custom HTTPClient for a request func NewUnsubscribeParamsWithHTTPClient(client *http.Client) *UnsubscribeParams { var () return &UnsubscribeParams{ HTTPClient: client, } } /*UnsubscribeParams contains all the parameters to send to the API endpoint for the unsubscribe operation typically these are written to a http.Request */ type UnsubscribeParams struct { /*SubscriptionID The subscriptionId to be unsubscribed */ SubscriptionID int64 timeout time.Duration Context context.Context HTTPClient *http.Client } // WithTimeout adds the timeout to the unsubscribe params func (o *UnsubscribeParams) WithTimeout(timeout time.Duration) *UnsubscribeParams { o.SetTimeout(timeout) return o } // SetTimeout adds the timeout to the unsubscribe params func (o *UnsubscribeParams) SetTimeout(timeout time.Duration) { o.timeout = timeout } // WithContext adds the context to the unsubscribe params func (o *UnsubscribeParams) WithContext(ctx context.Context) *UnsubscribeParams { o.SetContext(ctx) return o } // SetContext adds the context to the unsubscribe params func (o *UnsubscribeParams) SetContext(ctx context.Context) { o.Context = ctx } // WithHTTPClient adds the HTTPClient to the unsubscribe params func (o *UnsubscribeParams) WithHTTPClient(client *http.Client) *UnsubscribeParams { o.SetHTTPClient(client) return o } // SetHTTPClient adds the HTTPClient to the unsubscribe params func (o *UnsubscribeParams) SetHTTPClient(client *http.Client) { o.HTTPClient = client } // WithSubscriptionID adds the subscriptionID to the unsubscribe params func (o *UnsubscribeParams) WithSubscriptionID(subscriptionID int64) *UnsubscribeParams { o.SetSubscriptionID(subscriptionID) return o } // SetSubscriptionID adds the subscriptionId to the unsubscribe params func (o *UnsubscribeParams) SetSubscriptionID(subscriptionID int64) { o.SubscriptionID = subscriptionID } // WriteToRequest writes these params to a swagger request func (o *UnsubscribeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { if err := r.SetTimeout(o.timeout); err != nil { return err } var res []error // path param subscriptionId if err := r.SetPathParam("subscriptionId", swag.FormatInt64(o.SubscriptionID)); err != nil { return err } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil }