aws-sdk-controltower 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +8 -0
- data/LICENSE.txt +202 -0
- data/VERSION +1 -0
- data/lib/aws-sdk-controltower/client.rb +541 -0
- data/lib/aws-sdk-controltower/client_api.rb +191 -0
- data/lib/aws-sdk-controltower/customizations.rb +0 -0
- data/lib/aws-sdk-controltower/errors.rb +177 -0
- data/lib/aws-sdk-controltower/resource.rb +26 -0
- data/lib/aws-sdk-controltower/types.rb +335 -0
- data/lib/aws-sdk-controltower.rb +53 -0
- metadata +90 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
module Aws::ControlTower
|
11
|
+
# @api private
|
12
|
+
module ClientApi
|
13
|
+
|
14
|
+
include Seahorse::Model
|
15
|
+
|
16
|
+
AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
|
17
|
+
ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
|
18
|
+
ControlIdentifier = Shapes::StringShape.new(name: 'ControlIdentifier')
|
19
|
+
ControlOperation = Shapes::StructureShape.new(name: 'ControlOperation')
|
20
|
+
ControlOperationStatus = Shapes::StringShape.new(name: 'ControlOperationStatus')
|
21
|
+
ControlOperationType = Shapes::StringShape.new(name: 'ControlOperationType')
|
22
|
+
DisableControlInput = Shapes::StructureShape.new(name: 'DisableControlInput')
|
23
|
+
DisableControlOutput = Shapes::StructureShape.new(name: 'DisableControlOutput')
|
24
|
+
EnableControlInput = Shapes::StructureShape.new(name: 'EnableControlInput')
|
25
|
+
EnableControlOutput = Shapes::StructureShape.new(name: 'EnableControlOutput')
|
26
|
+
EnabledControlSummary = Shapes::StructureShape.new(name: 'EnabledControlSummary')
|
27
|
+
EnabledControls = Shapes::ListShape.new(name: 'EnabledControls')
|
28
|
+
GetControlOperationInput = Shapes::StructureShape.new(name: 'GetControlOperationInput')
|
29
|
+
GetControlOperationOutput = Shapes::StructureShape.new(name: 'GetControlOperationOutput')
|
30
|
+
Integer = Shapes::IntegerShape.new(name: 'Integer')
|
31
|
+
InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
|
32
|
+
ListEnabledControlsInput = Shapes::StructureShape.new(name: 'ListEnabledControlsInput')
|
33
|
+
ListEnabledControlsOutput = Shapes::StructureShape.new(name: 'ListEnabledControlsOutput')
|
34
|
+
MaxResults = Shapes::IntegerShape.new(name: 'MaxResults')
|
35
|
+
OperationIdentifier = Shapes::StringShape.new(name: 'OperationIdentifier')
|
36
|
+
ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
|
37
|
+
ServiceQuotaExceededException = Shapes::StructureShape.new(name: 'ServiceQuotaExceededException')
|
38
|
+
String = Shapes::StringShape.new(name: 'String')
|
39
|
+
SyntheticTimestamp_date_time = Shapes::TimestampShape.new(name: 'SyntheticTimestamp_date_time', timestampFormat: "iso8601")
|
40
|
+
TargetIdentifier = Shapes::StringShape.new(name: 'TargetIdentifier')
|
41
|
+
ThrottlingException = Shapes::StructureShape.new(name: 'ThrottlingException')
|
42
|
+
ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
|
43
|
+
|
44
|
+
AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
45
|
+
AccessDeniedException.struct_class = Types::AccessDeniedException
|
46
|
+
|
47
|
+
ConflictException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
48
|
+
ConflictException.struct_class = Types::ConflictException
|
49
|
+
|
50
|
+
ControlOperation.add_member(:end_time, Shapes::ShapeRef.new(shape: SyntheticTimestamp_date_time, location_name: "endTime"))
|
51
|
+
ControlOperation.add_member(:operation_type, Shapes::ShapeRef.new(shape: ControlOperationType, location_name: "operationType"))
|
52
|
+
ControlOperation.add_member(:start_time, Shapes::ShapeRef.new(shape: SyntheticTimestamp_date_time, location_name: "startTime"))
|
53
|
+
ControlOperation.add_member(:status, Shapes::ShapeRef.new(shape: ControlOperationStatus, location_name: "status"))
|
54
|
+
ControlOperation.add_member(:status_message, Shapes::ShapeRef.new(shape: String, location_name: "statusMessage"))
|
55
|
+
ControlOperation.struct_class = Types::ControlOperation
|
56
|
+
|
57
|
+
DisableControlInput.add_member(:control_identifier, Shapes::ShapeRef.new(shape: ControlIdentifier, required: true, location_name: "controlIdentifier"))
|
58
|
+
DisableControlInput.add_member(:target_identifier, Shapes::ShapeRef.new(shape: TargetIdentifier, required: true, location_name: "targetIdentifier"))
|
59
|
+
DisableControlInput.struct_class = Types::DisableControlInput
|
60
|
+
|
61
|
+
DisableControlOutput.add_member(:operation_identifier, Shapes::ShapeRef.new(shape: OperationIdentifier, required: true, location_name: "operationIdentifier"))
|
62
|
+
DisableControlOutput.struct_class = Types::DisableControlOutput
|
63
|
+
|
64
|
+
EnableControlInput.add_member(:control_identifier, Shapes::ShapeRef.new(shape: ControlIdentifier, required: true, location_name: "controlIdentifier"))
|
65
|
+
EnableControlInput.add_member(:target_identifier, Shapes::ShapeRef.new(shape: TargetIdentifier, required: true, location_name: "targetIdentifier"))
|
66
|
+
EnableControlInput.struct_class = Types::EnableControlInput
|
67
|
+
|
68
|
+
EnableControlOutput.add_member(:operation_identifier, Shapes::ShapeRef.new(shape: OperationIdentifier, required: true, location_name: "operationIdentifier"))
|
69
|
+
EnableControlOutput.struct_class = Types::EnableControlOutput
|
70
|
+
|
71
|
+
EnabledControlSummary.add_member(:control_identifier, Shapes::ShapeRef.new(shape: ControlIdentifier, location_name: "controlIdentifier"))
|
72
|
+
EnabledControlSummary.struct_class = Types::EnabledControlSummary
|
73
|
+
|
74
|
+
EnabledControls.member = Shapes::ShapeRef.new(shape: EnabledControlSummary)
|
75
|
+
|
76
|
+
GetControlOperationInput.add_member(:operation_identifier, Shapes::ShapeRef.new(shape: OperationIdentifier, required: true, location_name: "operationIdentifier"))
|
77
|
+
GetControlOperationInput.struct_class = Types::GetControlOperationInput
|
78
|
+
|
79
|
+
GetControlOperationOutput.add_member(:control_operation, Shapes::ShapeRef.new(shape: ControlOperation, required: true, location_name: "controlOperation"))
|
80
|
+
GetControlOperationOutput.struct_class = Types::GetControlOperationOutput
|
81
|
+
|
82
|
+
InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
83
|
+
InternalServerException.struct_class = Types::InternalServerException
|
84
|
+
|
85
|
+
ListEnabledControlsInput.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResults, location_name: "maxResults"))
|
86
|
+
ListEnabledControlsInput.add_member(:next_token, Shapes::ShapeRef.new(shape: String, location_name: "nextToken"))
|
87
|
+
ListEnabledControlsInput.add_member(:target_identifier, Shapes::ShapeRef.new(shape: TargetIdentifier, required: true, location_name: "targetIdentifier"))
|
88
|
+
ListEnabledControlsInput.struct_class = Types::ListEnabledControlsInput
|
89
|
+
|
90
|
+
ListEnabledControlsOutput.add_member(:enabled_controls, Shapes::ShapeRef.new(shape: EnabledControls, required: true, location_name: "enabledControls"))
|
91
|
+
ListEnabledControlsOutput.add_member(:next_token, Shapes::ShapeRef.new(shape: String, location_name: "nextToken"))
|
92
|
+
ListEnabledControlsOutput.struct_class = Types::ListEnabledControlsOutput
|
93
|
+
|
94
|
+
ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
95
|
+
ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
|
96
|
+
|
97
|
+
ServiceQuotaExceededException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
98
|
+
ServiceQuotaExceededException.struct_class = Types::ServiceQuotaExceededException
|
99
|
+
|
100
|
+
ThrottlingException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
101
|
+
ThrottlingException.add_member(:quota_code, Shapes::ShapeRef.new(shape: String, location_name: "quotaCode"))
|
102
|
+
ThrottlingException.add_member(:retry_after_seconds, Shapes::ShapeRef.new(shape: Integer, location: "header", location_name: "Retry-After"))
|
103
|
+
ThrottlingException.add_member(:service_code, Shapes::ShapeRef.new(shape: String, location_name: "serviceCode"))
|
104
|
+
ThrottlingException.struct_class = Types::ThrottlingException
|
105
|
+
|
106
|
+
ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
|
107
|
+
ValidationException.struct_class = Types::ValidationException
|
108
|
+
|
109
|
+
|
110
|
+
# @api private
|
111
|
+
API = Seahorse::Model::Api.new.tap do |api|
|
112
|
+
|
113
|
+
api.version = "2018-05-10"
|
114
|
+
|
115
|
+
api.metadata = {
|
116
|
+
"apiVersion" => "2018-05-10",
|
117
|
+
"endpointPrefix" => "controltower",
|
118
|
+
"jsonVersion" => "1.1",
|
119
|
+
"protocol" => "rest-json",
|
120
|
+
"serviceFullName" => "AWS Control Tower",
|
121
|
+
"serviceId" => "ControlTower",
|
122
|
+
"signatureVersion" => "v4",
|
123
|
+
"signingName" => "controltower",
|
124
|
+
"uid" => "controltower-2018-05-10",
|
125
|
+
}
|
126
|
+
|
127
|
+
api.add_operation(:disable_control, Seahorse::Model::Operation.new.tap do |o|
|
128
|
+
o.name = "DisableControl"
|
129
|
+
o.http_method = "POST"
|
130
|
+
o.http_request_uri = "/disable-control"
|
131
|
+
o.input = Shapes::ShapeRef.new(shape: DisableControlInput)
|
132
|
+
o.output = Shapes::ShapeRef.new(shape: DisableControlOutput)
|
133
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
134
|
+
o.errors << Shapes::ShapeRef.new(shape: ConflictException)
|
135
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
136
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
137
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
138
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
139
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
140
|
+
end)
|
141
|
+
|
142
|
+
api.add_operation(:enable_control, Seahorse::Model::Operation.new.tap do |o|
|
143
|
+
o.name = "EnableControl"
|
144
|
+
o.http_method = "POST"
|
145
|
+
o.http_request_uri = "/enable-control"
|
146
|
+
o.input = Shapes::ShapeRef.new(shape: EnableControlInput)
|
147
|
+
o.output = Shapes::ShapeRef.new(shape: EnableControlOutput)
|
148
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
149
|
+
o.errors << Shapes::ShapeRef.new(shape: ConflictException)
|
150
|
+
o.errors << Shapes::ShapeRef.new(shape: ServiceQuotaExceededException)
|
151
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
152
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
153
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
154
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
155
|
+
end)
|
156
|
+
|
157
|
+
api.add_operation(:get_control_operation, Seahorse::Model::Operation.new.tap do |o|
|
158
|
+
o.name = "GetControlOperation"
|
159
|
+
o.http_method = "POST"
|
160
|
+
o.http_request_uri = "/get-control-operation"
|
161
|
+
o.input = Shapes::ShapeRef.new(shape: GetControlOperationInput)
|
162
|
+
o.output = Shapes::ShapeRef.new(shape: GetControlOperationOutput)
|
163
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
164
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
165
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
166
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
167
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
168
|
+
end)
|
169
|
+
|
170
|
+
api.add_operation(:list_enabled_controls, Seahorse::Model::Operation.new.tap do |o|
|
171
|
+
o.name = "ListEnabledControls"
|
172
|
+
o.http_method = "POST"
|
173
|
+
o.http_request_uri = "/list-enabled-controls"
|
174
|
+
o.input = Shapes::ShapeRef.new(shape: ListEnabledControlsInput)
|
175
|
+
o.output = Shapes::ShapeRef.new(shape: ListEnabledControlsOutput)
|
176
|
+
o.errors << Shapes::ShapeRef.new(shape: ValidationException)
|
177
|
+
o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
|
178
|
+
o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
|
179
|
+
o.errors << Shapes::ShapeRef.new(shape: ThrottlingException)
|
180
|
+
o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
|
181
|
+
o[:pager] = Aws::Pager.new(
|
182
|
+
limit_key: "max_results",
|
183
|
+
tokens: {
|
184
|
+
"next_token" => "next_token"
|
185
|
+
}
|
186
|
+
)
|
187
|
+
end)
|
188
|
+
end
|
189
|
+
|
190
|
+
end
|
191
|
+
end
|
File without changes
|
@@ -0,0 +1,177 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
module Aws::ControlTower
|
11
|
+
|
12
|
+
# When ControlTower returns an error response, the Ruby SDK constructs and raises an error.
|
13
|
+
# These errors all extend Aws::ControlTower::Errors::ServiceError < {Aws::Errors::ServiceError}
|
14
|
+
#
|
15
|
+
# You can rescue all ControlTower errors using ServiceError:
|
16
|
+
#
|
17
|
+
# begin
|
18
|
+
# # do stuff
|
19
|
+
# rescue Aws::ControlTower::Errors::ServiceError
|
20
|
+
# # rescues all ControlTower API errors
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
#
|
24
|
+
# ## Request Context
|
25
|
+
# ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
|
26
|
+
# information about the request that generated the error.
|
27
|
+
# See {Seahorse::Client::RequestContext} for more information.
|
28
|
+
#
|
29
|
+
# ## Error Classes
|
30
|
+
# * {AccessDeniedException}
|
31
|
+
# * {ConflictException}
|
32
|
+
# * {InternalServerException}
|
33
|
+
# * {ResourceNotFoundException}
|
34
|
+
# * {ServiceQuotaExceededException}
|
35
|
+
# * {ThrottlingException}
|
36
|
+
# * {ValidationException}
|
37
|
+
#
|
38
|
+
# Additionally, error classes are dynamically generated for service errors based on the error code
|
39
|
+
# if they are not defined above.
|
40
|
+
module Errors
|
41
|
+
|
42
|
+
extend Aws::Errors::DynamicErrors
|
43
|
+
|
44
|
+
class AccessDeniedException < ServiceError
|
45
|
+
|
46
|
+
# @param [Seahorse::Client::RequestContext] context
|
47
|
+
# @param [String] message
|
48
|
+
# @param [Aws::ControlTower::Types::AccessDeniedException] data
|
49
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
50
|
+
super(context, message, data)
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [String]
|
54
|
+
def message
|
55
|
+
@message || @data[:message]
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
class ConflictException < ServiceError
|
60
|
+
|
61
|
+
# @param [Seahorse::Client::RequestContext] context
|
62
|
+
# @param [String] message
|
63
|
+
# @param [Aws::ControlTower::Types::ConflictException] data
|
64
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
65
|
+
super(context, message, data)
|
66
|
+
end
|
67
|
+
|
68
|
+
# @return [String]
|
69
|
+
def message
|
70
|
+
@message || @data[:message]
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class InternalServerException < ServiceError
|
75
|
+
|
76
|
+
# @param [Seahorse::Client::RequestContext] context
|
77
|
+
# @param [String] message
|
78
|
+
# @param [Aws::ControlTower::Types::InternalServerException] data
|
79
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
80
|
+
super(context, message, data)
|
81
|
+
end
|
82
|
+
|
83
|
+
# @return [String]
|
84
|
+
def message
|
85
|
+
@message || @data[:message]
|
86
|
+
end
|
87
|
+
|
88
|
+
def retryable?
|
89
|
+
true
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
class ResourceNotFoundException < ServiceError
|
94
|
+
|
95
|
+
# @param [Seahorse::Client::RequestContext] context
|
96
|
+
# @param [String] message
|
97
|
+
# @param [Aws::ControlTower::Types::ResourceNotFoundException] data
|
98
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
99
|
+
super(context, message, data)
|
100
|
+
end
|
101
|
+
|
102
|
+
# @return [String]
|
103
|
+
def message
|
104
|
+
@message || @data[:message]
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
class ServiceQuotaExceededException < ServiceError
|
109
|
+
|
110
|
+
# @param [Seahorse::Client::RequestContext] context
|
111
|
+
# @param [String] message
|
112
|
+
# @param [Aws::ControlTower::Types::ServiceQuotaExceededException] data
|
113
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
114
|
+
super(context, message, data)
|
115
|
+
end
|
116
|
+
|
117
|
+
# @return [String]
|
118
|
+
def message
|
119
|
+
@message || @data[:message]
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
class ThrottlingException < ServiceError
|
124
|
+
|
125
|
+
# @param [Seahorse::Client::RequestContext] context
|
126
|
+
# @param [String] message
|
127
|
+
# @param [Aws::ControlTower::Types::ThrottlingException] data
|
128
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
129
|
+
super(context, message, data)
|
130
|
+
end
|
131
|
+
|
132
|
+
# @return [String]
|
133
|
+
def message
|
134
|
+
@message || @data[:message]
|
135
|
+
end
|
136
|
+
|
137
|
+
# @return [String]
|
138
|
+
def quota_code
|
139
|
+
@data[:quota_code]
|
140
|
+
end
|
141
|
+
|
142
|
+
# @return [String]
|
143
|
+
def retry_after_seconds
|
144
|
+
@data[:retry_after_seconds]
|
145
|
+
end
|
146
|
+
|
147
|
+
# @return [String]
|
148
|
+
def service_code
|
149
|
+
@data[:service_code]
|
150
|
+
end
|
151
|
+
|
152
|
+
def retryable?
|
153
|
+
true
|
154
|
+
end
|
155
|
+
|
156
|
+
def throttling?
|
157
|
+
true
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
class ValidationException < ServiceError
|
162
|
+
|
163
|
+
# @param [Seahorse::Client::RequestContext] context
|
164
|
+
# @param [String] message
|
165
|
+
# @param [Aws::ControlTower::Types::ValidationException] data
|
166
|
+
def initialize(context, message, data = Aws::EmptyStructure.new)
|
167
|
+
super(context, message, data)
|
168
|
+
end
|
169
|
+
|
170
|
+
# @return [String]
|
171
|
+
def message
|
172
|
+
@message || @data[:message]
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
end
|
177
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# WARNING ABOUT GENERATED CODE
|
4
|
+
#
|
5
|
+
# This file is generated. See the contributing guide for more information:
|
6
|
+
# https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
|
7
|
+
#
|
8
|
+
# WARNING ABOUT GENERATED CODE
|
9
|
+
|
10
|
+
module Aws::ControlTower
|
11
|
+
|
12
|
+
class Resource
|
13
|
+
|
14
|
+
# @param options ({})
|
15
|
+
# @option options [Client] :client
|
16
|
+
def initialize(options = {})
|
17
|
+
@client = options[:client] || Client.new(options)
|
18
|
+
end
|
19
|
+
|
20
|
+
# @return [Client]
|
21
|
+
def client
|
22
|
+
@client
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|