Add optional subscription ID
[ric-plt/xapp-frame.git] / pkg / clientapi / common / unsubscribe_parameters.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package common
4
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
7
8 import (
9         "context"
10         "net/http"
11         "time"
12
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/strfmt"
17 )
18
19 // NewUnsubscribeParams creates a new UnsubscribeParams object
20 // with the default values initialized.
21 func NewUnsubscribeParams() *UnsubscribeParams {
22         var ()
23         return &UnsubscribeParams{
24
25                 timeout: cr.DefaultTimeout,
26         }
27 }
28
29 // NewUnsubscribeParamsWithTimeout creates a new UnsubscribeParams object
30 // with the default values initialized, and the ability to set a timeout on a request
31 func NewUnsubscribeParamsWithTimeout(timeout time.Duration) *UnsubscribeParams {
32         var ()
33         return &UnsubscribeParams{
34
35                 timeout: timeout,
36         }
37 }
38
39 // NewUnsubscribeParamsWithContext creates a new UnsubscribeParams object
40 // with the default values initialized, and the ability to set a context for a request
41 func NewUnsubscribeParamsWithContext(ctx context.Context) *UnsubscribeParams {
42         var ()
43         return &UnsubscribeParams{
44
45                 Context: ctx,
46         }
47 }
48
49 // NewUnsubscribeParamsWithHTTPClient creates a new UnsubscribeParams object
50 // with the default values initialized, and the ability to set a custom HTTPClient for a request
51 func NewUnsubscribeParamsWithHTTPClient(client *http.Client) *UnsubscribeParams {
52         var ()
53         return &UnsubscribeParams{
54                 HTTPClient: client,
55         }
56 }
57
58 /*UnsubscribeParams contains all the parameters to send to the API endpoint
59 for the unsubscribe operation typically these are written to a http.Request
60 */
61 type UnsubscribeParams struct {
62
63         /*SubscriptionID
64           The subscriptionId received in the Subscription Response
65
66         */
67         SubscriptionID string
68
69         timeout    time.Duration
70         Context    context.Context
71         HTTPClient *http.Client
72 }
73
74 // WithTimeout adds the timeout to the unsubscribe params
75 func (o *UnsubscribeParams) WithTimeout(timeout time.Duration) *UnsubscribeParams {
76         o.SetTimeout(timeout)
77         return o
78 }
79
80 // SetTimeout adds the timeout to the unsubscribe params
81 func (o *UnsubscribeParams) SetTimeout(timeout time.Duration) {
82         o.timeout = timeout
83 }
84
85 // WithContext adds the context to the unsubscribe params
86 func (o *UnsubscribeParams) WithContext(ctx context.Context) *UnsubscribeParams {
87         o.SetContext(ctx)
88         return o
89 }
90
91 // SetContext adds the context to the unsubscribe params
92 func (o *UnsubscribeParams) SetContext(ctx context.Context) {
93         o.Context = ctx
94 }
95
96 // WithHTTPClient adds the HTTPClient to the unsubscribe params
97 func (o *UnsubscribeParams) WithHTTPClient(client *http.Client) *UnsubscribeParams {
98         o.SetHTTPClient(client)
99         return o
100 }
101
102 // SetHTTPClient adds the HTTPClient to the unsubscribe params
103 func (o *UnsubscribeParams) SetHTTPClient(client *http.Client) {
104         o.HTTPClient = client
105 }
106
107 // WithSubscriptionID adds the subscriptionID to the unsubscribe params
108 func (o *UnsubscribeParams) WithSubscriptionID(subscriptionID string) *UnsubscribeParams {
109         o.SetSubscriptionID(subscriptionID)
110         return o
111 }
112
113 // SetSubscriptionID adds the subscriptionId to the unsubscribe params
114 func (o *UnsubscribeParams) SetSubscriptionID(subscriptionID string) {
115         o.SubscriptionID = subscriptionID
116 }
117
118 // WriteToRequest writes these params to a swagger request
119 func (o *UnsubscribeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
120
121         if err := r.SetTimeout(o.timeout); err != nil {
122                 return err
123         }
124         var res []error
125
126         // path param subscriptionId
127         if err := r.SetPathParam("subscriptionId", o.SubscriptionID); err != nil {
128                 return err
129         }
130
131         if len(res) > 0 {
132                 return errors.CompositeValidationError(res...)
133         }
134         return nil
135 }