/
op_UpdateGlobalTableSettings.go
155 lines (121 loc) · 5.94 KB
/
op_UpdateGlobalTableSettings.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
package dyno
import (
"context"
ddb "github.com/aws/aws-sdk-go-v2/service/dynamodb"
"sync"
)
// UpdateGlobalTableSettings executes UpdateGlobalTableSettings operation and returns a UpdateGlobalTableSettings operation
func (s *Session) UpdateGlobalTableSettings(input *ddb.UpdateGlobalTableSettingsInput, mw ...UpdateGlobalTableSettingsMiddleWare) *UpdateGlobalTableSettings {
return NewUpdateGlobalTableSettings(input, mw...).Invoke(s.ctx, s.ddb)
}
// UpdateGlobalTableSettings executes a UpdateGlobalTableSettings operation with a UpdateGlobalTableSettingsInput in this pool and returns the UpdateGlobalTableSettings operation
func (p *Pool) UpdateGlobalTableSettings(input *ddb.UpdateGlobalTableSettingsInput, mw ...UpdateGlobalTableSettingsMiddleWare) *UpdateGlobalTableSettings {
op := NewUpdateGlobalTableSettings(input, mw...)
p.Do(op) // run the operation in the pool
return op
}
// UpdateGlobalTableSettingsContext represents an exhaustive UpdateGlobalTableSettings operation request context
type UpdateGlobalTableSettingsContext struct {
context.Context
Input *ddb.UpdateGlobalTableSettingsInput
Client *ddb.Client
}
// UpdateGlobalTableSettingsOutput represents the output for the UpdateGlobalTableSettings operation
type UpdateGlobalTableSettingsOutput struct {
out *ddb.UpdateGlobalTableSettingsOutput
err error
mu sync.RWMutex
}
// Set sets the output
func (o *UpdateGlobalTableSettingsOutput) Set(out *ddb.UpdateGlobalTableSettingsOutput, err error) {
o.mu.Lock()
o.out = out
o.err = err
o.mu.Unlock()
}
// Get gets the output
func (o *UpdateGlobalTableSettingsOutput) Get() (out *ddb.UpdateGlobalTableSettingsOutput, err error) {
o.mu.Lock()
out = o.out
err = o.err
o.mu.Unlock()
return
}
// UpdateGlobalTableSettingsHandler represents a handler for UpdateGlobalTableSettings requests
type UpdateGlobalTableSettingsHandler interface {
HandleUpdateGlobalTableSettings(ctx *UpdateGlobalTableSettingsContext, output *UpdateGlobalTableSettingsOutput)
}
// UpdateGlobalTableSettingsHandlerFunc is a UpdateGlobalTableSettingsHandler function
type UpdateGlobalTableSettingsHandlerFunc func(ctx *UpdateGlobalTableSettingsContext, output *UpdateGlobalTableSettingsOutput)
// HandleUpdateGlobalTableSettings implements UpdateGlobalTableSettingsHandler
func (h UpdateGlobalTableSettingsHandlerFunc) HandleUpdateGlobalTableSettings(ctx *UpdateGlobalTableSettingsContext, output *UpdateGlobalTableSettingsOutput) {
h(ctx, output)
}
// UpdateGlobalTableSettingsFinalHandler is the final UpdateGlobalTableSettingsHandler that executes a dynamodb UpdateGlobalTableSettings operation
type UpdateGlobalTableSettingsFinalHandler struct{}
// HandleUpdateGlobalTableSettings implements the UpdateGlobalTableSettingsHandler
func (h *UpdateGlobalTableSettingsFinalHandler) HandleUpdateGlobalTableSettings(ctx *UpdateGlobalTableSettingsContext, output *UpdateGlobalTableSettingsOutput) {
output.Set(ctx.Client.UpdateGlobalTableSettings(ctx, ctx.Input))
}
// UpdateGlobalTableSettingsMiddleWare is a middleware function use for wrapping UpdateGlobalTableSettingsHandler requests
type UpdateGlobalTableSettingsMiddleWare interface {
UpdateGlobalTableSettingsMiddleWare(next UpdateGlobalTableSettingsHandler) UpdateGlobalTableSettingsHandler
}
// UpdateGlobalTableSettingsMiddleWareFunc is a functional UpdateGlobalTableSettingsMiddleWare
type UpdateGlobalTableSettingsMiddleWareFunc func(next UpdateGlobalTableSettingsHandler) UpdateGlobalTableSettingsHandler
// UpdateGlobalTableSettingsMiddleWare implements the UpdateGlobalTableSettingsMiddleWare interface
func (mw UpdateGlobalTableSettingsMiddleWareFunc) UpdateGlobalTableSettingsMiddleWare(next UpdateGlobalTableSettingsHandler) UpdateGlobalTableSettingsHandler {
return mw(next)
}
// UpdateGlobalTableSettings represents a UpdateGlobalTableSettings operation
type UpdateGlobalTableSettings struct {
*BaseOperation
input *ddb.UpdateGlobalTableSettingsInput
middleWares []UpdateGlobalTableSettingsMiddleWare
}
// NewUpdateGlobalTableSettings creates a new UpdateGlobalTableSettings operation
func NewUpdateGlobalTableSettings(input *ddb.UpdateGlobalTableSettingsInput, mws ...UpdateGlobalTableSettingsMiddleWare) *UpdateGlobalTableSettings {
return &UpdateGlobalTableSettings{
BaseOperation: NewOperation(),
input: input,
middleWares: mws,
}
}
// Invoke invokes the UpdateGlobalTableSettings operation in a goroutine and returns a UpdateGlobalTableSettings operation
func (op *UpdateGlobalTableSettings) Invoke(ctx context.Context, client *ddb.Client) *UpdateGlobalTableSettings {
op.SetRunning() // operation now waiting for a response
go op.InvokeDynoOperation(ctx, client)
return op
}
// InvokeDynoOperation invokes the UpdateGlobalTableSettings operation
func (op *UpdateGlobalTableSettings) InvokeDynoOperation(ctx context.Context, client *ddb.Client) {
output := new(UpdateGlobalTableSettingsOutput)
defer func() { op.SetResponse(output.Get()) }()
var h UpdateGlobalTableSettingsHandler
h = new(UpdateGlobalTableSettingsFinalHandler)
// loop in reverse to preserve middleware order
for i := len(op.middleWares) - 1; i >= 0; i-- {
h = op.middleWares[i].UpdateGlobalTableSettingsMiddleWare(h)
}
requestCtx := &UpdateGlobalTableSettingsContext{
Context: ctx,
Client: client,
Input: op.input,
}
h.HandleUpdateGlobalTableSettings(requestCtx, output)
}
// Await waits for the UpdateGlobalTableSettings operation to be fulfilled and then returns a UpdateGlobalTableSettingsOutput and error
func (op *UpdateGlobalTableSettings) Await() (*ddb.UpdateGlobalTableSettingsOutput, error) {
out, err := op.BaseOperation.Await()
if out == nil {
return nil, err
}
return out.(*ddb.UpdateGlobalTableSettingsOutput), err
}
// NewUpdateGlobalTableSettingsInput creates a new UpdateGlobalTableSettingsInput
func NewUpdateGlobalTableSettingsInput(tableName *string) *ddb.UpdateGlobalTableSettingsInput {
return &ddb.UpdateGlobalTableSettingsInput{
GlobalTableName: tableName,
}
}
// todo: add UpdateGlobalTableSettingsInputBuilder