aws-sdk-inspector2 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
File without changes
@@ -0,0 +1,200 @@
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::Inspector2
11
+
12
+ # When Inspector2 returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Inspector2::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Inspector2 errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Inspector2::Errors::ServiceError
20
+ # # rescues all Inspector2 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
+ # * {BadRequestException}
32
+ # * {ConflictException}
33
+ # * {InternalServerException}
34
+ # * {ResourceNotFoundException}
35
+ # * {ServiceQuotaExceededException}
36
+ # * {ThrottlingException}
37
+ # * {ValidationException}
38
+ #
39
+ # Additionally, error classes are dynamically generated for service errors based on the error code
40
+ # if they are not defined above.
41
+ module Errors
42
+
43
+ extend Aws::Errors::DynamicErrors
44
+
45
+ class AccessDeniedException < ServiceError
46
+
47
+ # @param [Seahorse::Client::RequestContext] context
48
+ # @param [String] message
49
+ # @param [Aws::Inspector2::Types::AccessDeniedException] data
50
+ def initialize(context, message, data = Aws::EmptyStructure.new)
51
+ super(context, message, data)
52
+ end
53
+
54
+ # @return [String]
55
+ def message
56
+ @message || @data[:message]
57
+ end
58
+ end
59
+
60
+ class BadRequestException < ServiceError
61
+
62
+ # @param [Seahorse::Client::RequestContext] context
63
+ # @param [String] message
64
+ # @param [Aws::Inspector2::Types::BadRequestException] data
65
+ def initialize(context, message, data = Aws::EmptyStructure.new)
66
+ super(context, message, data)
67
+ end
68
+
69
+ # @return [String]
70
+ def message
71
+ @message || @data[:message]
72
+ end
73
+ end
74
+
75
+ class ConflictException < ServiceError
76
+
77
+ # @param [Seahorse::Client::RequestContext] context
78
+ # @param [String] message
79
+ # @param [Aws::Inspector2::Types::ConflictException] data
80
+ def initialize(context, message, data = Aws::EmptyStructure.new)
81
+ super(context, message, data)
82
+ end
83
+
84
+ # @return [String]
85
+ def message
86
+ @message || @data[:message]
87
+ end
88
+
89
+ # @return [String]
90
+ def resource_id
91
+ @data[:resource_id]
92
+ end
93
+
94
+ # @return [String]
95
+ def resource_type
96
+ @data[:resource_type]
97
+ end
98
+ end
99
+
100
+ class InternalServerException < ServiceError
101
+
102
+ # @param [Seahorse::Client::RequestContext] context
103
+ # @param [String] message
104
+ # @param [Aws::Inspector2::Types::InternalServerException] data
105
+ def initialize(context, message, data = Aws::EmptyStructure.new)
106
+ super(context, message, data)
107
+ end
108
+
109
+ # @return [String]
110
+ def message
111
+ @message || @data[:message]
112
+ end
113
+
114
+ # @return [String]
115
+ def retry_after_seconds
116
+ @data[:retry_after_seconds]
117
+ end
118
+
119
+ def retryable?
120
+ true
121
+ end
122
+ end
123
+
124
+ class ResourceNotFoundException < ServiceError
125
+
126
+ # @param [Seahorse::Client::RequestContext] context
127
+ # @param [String] message
128
+ # @param [Aws::Inspector2::Types::ResourceNotFoundException] data
129
+ def initialize(context, message, data = Aws::EmptyStructure.new)
130
+ super(context, message, data)
131
+ end
132
+
133
+ # @return [String]
134
+ def message
135
+ @message || @data[:message]
136
+ end
137
+ end
138
+
139
+ class ServiceQuotaExceededException < ServiceError
140
+
141
+ # @param [Seahorse::Client::RequestContext] context
142
+ # @param [String] message
143
+ # @param [Aws::Inspector2::Types::ServiceQuotaExceededException] data
144
+ def initialize(context, message, data = Aws::EmptyStructure.new)
145
+ super(context, message, data)
146
+ end
147
+
148
+ # @return [String]
149
+ def message
150
+ @message || @data[:message]
151
+ end
152
+
153
+ # @return [String]
154
+ def resource_id
155
+ @data[:resource_id]
156
+ end
157
+ end
158
+
159
+ class ThrottlingException < ServiceError
160
+
161
+ # @param [Seahorse::Client::RequestContext] context
162
+ # @param [String] message
163
+ # @param [Aws::Inspector2::Types::ThrottlingException] data
164
+ def initialize(context, message, data = Aws::EmptyStructure.new)
165
+ super(context, message, data)
166
+ end
167
+
168
+ # @return [String]
169
+ def message
170
+ @message || @data[:message]
171
+ end
172
+ end
173
+
174
+ class ValidationException < ServiceError
175
+
176
+ # @param [Seahorse::Client::RequestContext] context
177
+ # @param [String] message
178
+ # @param [Aws::Inspector2::Types::ValidationException] data
179
+ def initialize(context, message, data = Aws::EmptyStructure.new)
180
+ super(context, message, data)
181
+ end
182
+
183
+ # @return [String]
184
+ def fields
185
+ @data[:fields]
186
+ end
187
+
188
+ # @return [String]
189
+ def message
190
+ @message || @data[:message]
191
+ end
192
+
193
+ # @return [String]
194
+ def reason
195
+ @data[:reason]
196
+ end
197
+ end
198
+
199
+ end
200
+ 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::Inspector2
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