-
Notifications
You must be signed in to change notification settings - Fork 0
/
post_v1_services_type_incoming_webhook_parameters.go
116 lines (89 loc) · 3.95 KB
/
post_v1_services_type_incoming_webhook_parameters.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
package service
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"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"
"github.com/yamamoto-febc/sakuraio-api/gen/models"
)
// NewPostV1ServicesTypeIncomingWebhookParams creates a new PostV1ServicesTypeIncomingWebhookParams object
// with the default values initialized.
func NewPostV1ServicesTypeIncomingWebhookParams() *PostV1ServicesTypeIncomingWebhookParams {
var ()
return &PostV1ServicesTypeIncomingWebhookParams{
timeout: cr.DefaultTimeout,
}
}
// NewPostV1ServicesTypeIncomingWebhookParamsWithTimeout creates a new PostV1ServicesTypeIncomingWebhookParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPostV1ServicesTypeIncomingWebhookParamsWithTimeout(timeout time.Duration) *PostV1ServicesTypeIncomingWebhookParams {
var ()
return &PostV1ServicesTypeIncomingWebhookParams{
timeout: timeout,
}
}
// NewPostV1ServicesTypeIncomingWebhookParamsWithContext creates a new PostV1ServicesTypeIncomingWebhookParams object
// with the default values initialized, and the ability to set a context for a request
func NewPostV1ServicesTypeIncomingWebhookParamsWithContext(ctx context.Context) *PostV1ServicesTypeIncomingWebhookParams {
var ()
return &PostV1ServicesTypeIncomingWebhookParams{
Context: ctx,
}
}
/*PostV1ServicesTypeIncomingWebhookParams contains all the parameters to send to the API endpoint
for the post v1 services type incoming webhook operation typically these are written to a http.Request
*/
type PostV1ServicesTypeIncomingWebhookParams struct {
/*IncomingWebhookService
IncomingWebhookService to create
*/
IncomingWebhookService *models.IncomingWebhookServiceUpdate
timeout time.Duration
Context context.Context
}
// WithTimeout adds the timeout to the post v1 services type incoming webhook params
func (o *PostV1ServicesTypeIncomingWebhookParams) WithTimeout(timeout time.Duration) *PostV1ServicesTypeIncomingWebhookParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post v1 services type incoming webhook params
func (o *PostV1ServicesTypeIncomingWebhookParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post v1 services type incoming webhook params
func (o *PostV1ServicesTypeIncomingWebhookParams) WithContext(ctx context.Context) *PostV1ServicesTypeIncomingWebhookParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post v1 services type incoming webhook params
func (o *PostV1ServicesTypeIncomingWebhookParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithIncomingWebhookService adds the incomingWebhookService to the post v1 services type incoming webhook params
func (o *PostV1ServicesTypeIncomingWebhookParams) WithIncomingWebhookService(incomingWebhookService *models.IncomingWebhookServiceUpdate) *PostV1ServicesTypeIncomingWebhookParams {
o.SetIncomingWebhookService(incomingWebhookService)
return o
}
// SetIncomingWebhookService adds the incomingWebhookService to the post v1 services type incoming webhook params
func (o *PostV1ServicesTypeIncomingWebhookParams) SetIncomingWebhookService(incomingWebhookService *models.IncomingWebhookServiceUpdate) {
o.IncomingWebhookService = incomingWebhookService
}
// WriteToRequest writes these params to a swagger request
func (o *PostV1ServicesTypeIncomingWebhookParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if o.IncomingWebhookService == nil {
o.IncomingWebhookService = new(models.IncomingWebhookServiceUpdate)
}
if err := r.SetBodyParam(o.IncomingWebhookService); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}