-
Notifications
You must be signed in to change notification settings - Fork 623
/
api_op_DeleteChannel.go
286 lines (225 loc) · 7.81 KB
/
api_op_DeleteChannel.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package medialive
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type DeleteChannelInput struct {
_ struct{} `type:"structure"`
// ChannelId is a required field
ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"`
}
// String returns the string representation
func (s DeleteChannelInput) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteChannelInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DeleteChannelInput"}
if s.ChannelId == nil {
invalidParams.Add(aws.NewErrParamRequired("ChannelId"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DeleteChannelInput) MarshalFields(e protocol.FieldEncoder) error {
e.SetValue(protocol.HeaderTarget, "Content-Type", protocol.StringValue("application/json"), protocol.Metadata{})
if s.ChannelId != nil {
v := *s.ChannelId
metadata := protocol.Metadata{}
e.SetValue(protocol.PathTarget, "channelId", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
type DeleteChannelOutput struct {
_ struct{} `type:"structure"`
Arn *string `locationName:"arn" type:"string"`
// A standard channel has two encoding pipelines and a single pipeline channel
// only has one.
ChannelClass ChannelClass `locationName:"channelClass" type:"string" enum:"true"`
Destinations []OutputDestination `locationName:"destinations" type:"list"`
EgressEndpoints []ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"`
// Encoder Settings
EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"`
Id *string `locationName:"id" type:"string"`
InputAttachments []InputAttachment `locationName:"inputAttachments" type:"list"`
InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"`
// The log level the user wants for their channel.
LogLevel LogLevel `locationName:"logLevel" type:"string" enum:"true"`
Name *string `locationName:"name" type:"string"`
PipelineDetails []PipelineDetail `locationName:"pipelineDetails" type:"list"`
PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"`
RoleArn *string `locationName:"roleArn" type:"string"`
State ChannelState `locationName:"state" type:"string" enum:"true"`
Tags map[string]string `locationName:"tags" type:"map"`
}
// String returns the string representation
func (s DeleteChannelOutput) String() string {
return awsutil.Prettify(s)
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DeleteChannelOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.Arn != nil {
v := *s.Arn
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "arn", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.ChannelClass) > 0 {
v := s.ChannelClass
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "channelClass", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.Destinations != nil {
v := s.Destinations
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "destinations", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if s.EgressEndpoints != nil {
v := s.EgressEndpoints
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "egressEndpoints", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if s.EncoderSettings != nil {
v := s.EncoderSettings
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "encoderSettings", v, metadata)
}
if s.Id != nil {
v := *s.Id
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "id", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.InputAttachments != nil {
v := s.InputAttachments
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "inputAttachments", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if s.InputSpecification != nil {
v := s.InputSpecification
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "inputSpecification", v, metadata)
}
if len(s.LogLevel) > 0 {
v := s.LogLevel
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "logLevel", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.Name != nil {
v := *s.Name
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.PipelineDetails != nil {
v := s.PipelineDetails
metadata := protocol.Metadata{}
ls0 := e.List(protocol.BodyTarget, "pipelineDetails", metadata)
ls0.Start()
for _, v1 := range v {
ls0.ListAddFields(v1)
}
ls0.End()
}
if s.PipelinesRunningCount != nil {
v := *s.PipelinesRunningCount
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "pipelinesRunningCount", protocol.Int64Value(v), metadata)
}
if s.RoleArn != nil {
v := *s.RoleArn
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "roleArn", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if len(s.State) > 0 {
v := s.State
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "state", protocol.QuotedValue{ValueMarshaler: v}, metadata)
}
if s.Tags != nil {
v := s.Tags
metadata := protocol.Metadata{}
ms0 := e.Map(protocol.BodyTarget, "tags", metadata)
ms0.Start()
for k1, v1 := range v {
ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ms0.End()
}
return nil
}
const opDeleteChannel = "DeleteChannel"
// DeleteChannelRequest returns a request value for making API operation for
// AWS Elemental MediaLive.
//
// Starts deletion of channel. The associated outputs are also deleted.
//
// // Example sending a request using DeleteChannelRequest.
// req := client.DeleteChannelRequest(params)
// resp, err := req.Send(context.TODO())
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteChannel
func (c *Client) DeleteChannelRequest(input *DeleteChannelInput) DeleteChannelRequest {
op := &aws.Operation{
Name: opDeleteChannel,
HTTPMethod: "DELETE",
HTTPPath: "/prod/channels/{channelId}",
}
if input == nil {
input = &DeleteChannelInput{}
}
req := c.newRequest(op, input, &DeleteChannelOutput{})
return DeleteChannelRequest{Request: req, Input: input, Copy: c.DeleteChannelRequest}
}
// DeleteChannelRequest is the request type for the
// DeleteChannel API operation.
type DeleteChannelRequest struct {
*aws.Request
Input *DeleteChannelInput
Copy func(*DeleteChannelInput) DeleteChannelRequest
}
// Send marshals and sends the DeleteChannel API request.
func (r DeleteChannelRequest) Send(ctx context.Context) (*DeleteChannelResponse, error) {
r.Request.SetContext(ctx)
err := r.Request.Send()
if err != nil {
return nil, err
}
resp := &DeleteChannelResponse{
DeleteChannelOutput: r.Request.Data.(*DeleteChannelOutput),
response: &aws.Response{Request: r.Request},
}
return resp, nil
}
// DeleteChannelResponse is the response type for the
// DeleteChannel API operation.
type DeleteChannelResponse struct {
*DeleteChannelOutput
response *aws.Response
}
// SDKResponseMetdata returns the response metadata for the
// DeleteChannel request.
func (r *DeleteChannelResponse) SDKResponseMetdata() *aws.Response {
return r.response
}