1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
13 "github.com/go-openapi/errors"
14 "github.com/go-openapi/runtime"
15 cr "github.com/go-openapi/runtime/client"
16 "github.com/go-openapi/swag"
18 strfmt "github.com/go-openapi/strfmt"
21 // NewUnsubscribeParams creates a new UnsubscribeParams object
22 // with the default values initialized.
23 func NewUnsubscribeParams() *UnsubscribeParams {
25 return &UnsubscribeParams{
27 timeout: cr.DefaultTimeout,
31 // NewUnsubscribeParamsWithTimeout creates a new UnsubscribeParams object
32 // with the default values initialized, and the ability to set a timeout on a request
33 func NewUnsubscribeParamsWithTimeout(timeout time.Duration) *UnsubscribeParams {
35 return &UnsubscribeParams{
41 // NewUnsubscribeParamsWithContext creates a new UnsubscribeParams object
42 // with the default values initialized, and the ability to set a context for a request
43 func NewUnsubscribeParamsWithContext(ctx context.Context) *UnsubscribeParams {
45 return &UnsubscribeParams{
51 // NewUnsubscribeParamsWithHTTPClient creates a new UnsubscribeParams object
52 // with the default values initialized, and the ability to set a custom HTTPClient for a request
53 func NewUnsubscribeParamsWithHTTPClient(client *http.Client) *UnsubscribeParams {
55 return &UnsubscribeParams{
60 /*UnsubscribeParams contains all the parameters to send to the API endpoint
61 for the unsubscribe operation typically these are written to a http.Request
63 type UnsubscribeParams struct {
66 The subscriptionId to be unsubscribed
72 Context context.Context
73 HTTPClient *http.Client
76 // WithTimeout adds the timeout to the unsubscribe params
77 func (o *UnsubscribeParams) WithTimeout(timeout time.Duration) *UnsubscribeParams {
82 // SetTimeout adds the timeout to the unsubscribe params
83 func (o *UnsubscribeParams) SetTimeout(timeout time.Duration) {
87 // WithContext adds the context to the unsubscribe params
88 func (o *UnsubscribeParams) WithContext(ctx context.Context) *UnsubscribeParams {
93 // SetContext adds the context to the unsubscribe params
94 func (o *UnsubscribeParams) SetContext(ctx context.Context) {
98 // WithHTTPClient adds the HTTPClient to the unsubscribe params
99 func (o *UnsubscribeParams) WithHTTPClient(client *http.Client) *UnsubscribeParams {
100 o.SetHTTPClient(client)
104 // SetHTTPClient adds the HTTPClient to the unsubscribe params
105 func (o *UnsubscribeParams) SetHTTPClient(client *http.Client) {
106 o.HTTPClient = client
109 // WithSubscriptionID adds the subscriptionID to the unsubscribe params
110 func (o *UnsubscribeParams) WithSubscriptionID(subscriptionID int64) *UnsubscribeParams {
111 o.SetSubscriptionID(subscriptionID)
115 // SetSubscriptionID adds the subscriptionId to the unsubscribe params
116 func (o *UnsubscribeParams) SetSubscriptionID(subscriptionID int64) {
117 o.SubscriptionID = subscriptionID
120 // WriteToRequest writes these params to a swagger request
121 func (o *UnsubscribeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
123 if err := r.SetTimeout(o.timeout); err != nil {
128 // path param subscriptionId
129 if err := r.SetPathParam("subscriptionId", swag.FormatInt64(o.SubscriptionID)); err != nil {
134 return errors.CompositeValidationError(res...)