aws-sdk-ec2 1.0.0.rc2 → 1.0.0.rc3

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.
@@ -1,204 +1,202 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module EC2
10
- class InternetGateway
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(id, options = {})
15
- # @param [String] id
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :id
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @id = extract_id(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::EC2
9
+ class InternetGateway
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(id, options = {})
14
+ # @param [String] id
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :id
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @id = extract_id(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def id
31
- @id
32
- end
33
- alias :internet_gateway_id :id
28
+ # @return [String]
29
+ def id
30
+ @id
31
+ end
32
+ alias :internet_gateway_id :id
34
33
 
35
- # Any VPCs attached to the Internet gateway.
36
- # @return [Array<Types::InternetGatewayAttachment>]
37
- def attachments
38
- data.attachments
39
- end
34
+ # Any VPCs attached to the Internet gateway.
35
+ # @return [Array<Types::InternetGatewayAttachment>]
36
+ def attachments
37
+ data.attachments
38
+ end
40
39
 
41
- # Any tags assigned to the Internet gateway.
42
- # @return [Array<Types::Tag>]
43
- def tags
44
- data.tags
45
- end
40
+ # Any tags assigned to the Internet gateway.
41
+ # @return [Array<Types::Tag>]
42
+ def tags
43
+ data.tags
44
+ end
46
45
 
47
- # @!endgroup
46
+ # @!endgroup
48
47
 
49
- # @return [Client]
50
- def client
51
- @client
52
- end
48
+ # @return [Client]
49
+ def client
50
+ @client
51
+ end
53
52
 
54
- # Loads, or reloads {#data} for the current {InternetGateway}.
55
- # Returns `self` making it possible to chain methods.
56
- #
57
- # internet_gateway.reload.data
58
- #
59
- # @return [self]
60
- def load
61
- resp = @client.describe_internet_gateways(internet_gateway_ids: [@id])
62
- @data = resp.internetgateways[0]
63
- self
64
- end
65
- alias :reload :load
66
-
67
- # @return [Types::InternetGateway]
68
- # Returns the data for this {InternetGateway}. Calls
69
- # {Client#describe_internet_gateways} if {#data_loaded?} is `false`.
70
- def data
71
- load unless @data
72
- @data
73
- end
53
+ # Loads, or reloads {#data} for the current {InternetGateway}.
54
+ # Returns `self` making it possible to chain methods.
55
+ #
56
+ # internet_gateway.reload.data
57
+ #
58
+ # @return [self]
59
+ def load
60
+ resp = @client.describe_internet_gateways(internet_gateway_ids: [@id])
61
+ @data = resp.internetgateways[0]
62
+ self
63
+ end
64
+ alias :reload :load
65
+
66
+ # @return [Types::InternetGateway]
67
+ # Returns the data for this {InternetGateway}. Calls
68
+ # {Client#describe_internet_gateways} if {#data_loaded?} is `false`.
69
+ def data
70
+ load unless @data
71
+ @data
72
+ end
74
73
 
75
- # @return [Boolean]
76
- # Returns `true` if this resource is loaded. Accessing attributes or
77
- # {#data} on an unloaded resource will trigger a call to {#load}.
78
- def data_loaded?
79
- !!@data
80
- end
74
+ # @return [Boolean]
75
+ # Returns `true` if this resource is loaded. Accessing attributes or
76
+ # {#data} on an unloaded resource will trigger a call to {#load}.
77
+ def data_loaded?
78
+ !!@data
79
+ end
81
80
 
82
- # @!group Actions
83
-
84
- # @example Request syntax with placeholder values
85
- #
86
- # internet_gateway.attach_to_vpc({
87
- # dry_run: false,
88
- # vpc_id: "String", # required
89
- # })
90
- # @param [Hash] options ({})
91
- # @option options [Boolean] :dry_run
92
- # Checks whether you have the required permissions for the action,
93
- # without actually making the request, and provides an error response.
94
- # If you have the required permissions, the error response is
95
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
96
- # @option options [required, String] :vpc_id
97
- # The ID of the VPC.
98
- # @return [EmptyStructure]
99
- def attach_to_vpc(options = {})
100
- options = options.merge(internet_gateway_id: @id)
101
- resp = @client.attach_internet_gateway(options)
102
- resp.data
103
- end
81
+ # @!group Actions
82
+
83
+ # @example Request syntax with placeholder values
84
+ #
85
+ # internet_gateway.attach_to_vpc({
86
+ # dry_run: false,
87
+ # vpc_id: "String", # required
88
+ # })
89
+ # @param [Hash] options ({})
90
+ # @option options [Boolean] :dry_run
91
+ # Checks whether you have the required permissions for the action,
92
+ # without actually making the request, and provides an error response.
93
+ # If you have the required permissions, the error response is
94
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
95
+ # @option options [required, String] :vpc_id
96
+ # The ID of the VPC.
97
+ # @return [EmptyStructure]
98
+ def attach_to_vpc(options = {})
99
+ options = options.merge(internet_gateway_id: @id)
100
+ resp = @client.attach_internet_gateway(options)
101
+ resp.data
102
+ end
104
103
 
105
- # @example Request syntax with placeholder values
106
- #
107
- # tag = internet_gateway.create_tags({
108
- # dry_run: false,
109
- # tags: [ # required
110
- # {
111
- # key: "String",
112
- # value: "String",
113
- # },
114
- # ],
115
- # })
116
- # @param [Hash] options ({})
117
- # @option options [Boolean] :dry_run
118
- # Checks whether you have the required permissions for the action,
119
- # without actually making the request, and provides an error response.
120
- # If you have the required permissions, the error response is
121
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
122
- # @option options [required, Array<Types::Tag>] :tags
123
- # One or more tags. The `value` parameter is required, but if you don't
124
- # want the tag to have a value, specify the parameter with no value, and
125
- # we set the value to an empty string.
126
- # @return [Tag::Collection]
127
- def create_tags(options = {})
128
- batch = []
129
- options = Aws::Util.deep_merge(options, resources: [@id])
130
- resp = @client.create_tags(options)
131
- options[:tags].each do |t|
132
- batch << Tag.new(
133
- resource_id: @id,
134
- key: t[:key],
135
- value: t[:value],
136
- client: @client
137
- )
138
- end
139
- Tag::Collection.new([batch], size: batch.size)
104
+ # @example Request syntax with placeholder values
105
+ #
106
+ # tag = internet_gateway.create_tags({
107
+ # dry_run: false,
108
+ # tags: [ # required
109
+ # {
110
+ # key: "String",
111
+ # value: "String",
112
+ # },
113
+ # ],
114
+ # })
115
+ # @param [Hash] options ({})
116
+ # @option options [Boolean] :dry_run
117
+ # Checks whether you have the required permissions for the action,
118
+ # without actually making the request, and provides an error response.
119
+ # If you have the required permissions, the error response is
120
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
121
+ # @option options [required, Array<Types::Tag>] :tags
122
+ # One or more tags. The `value` parameter is required, but if you don't
123
+ # want the tag to have a value, specify the parameter with no value, and
124
+ # we set the value to an empty string.
125
+ # @return [Tag::Collection]
126
+ def create_tags(options = {})
127
+ batch = []
128
+ options = Aws::Util.deep_merge(options, resources: [@id])
129
+ resp = @client.create_tags(options)
130
+ options[:tags].each do |t|
131
+ batch << Tag.new(
132
+ resource_id: @id,
133
+ key: t[:key],
134
+ value: t[:value],
135
+ client: @client
136
+ )
140
137
  end
138
+ Tag::Collection.new([batch], size: batch.size)
139
+ end
141
140
 
142
- # @example Request syntax with placeholder values
143
- #
144
- # internet_gateway.delete({
145
- # dry_run: false,
146
- # })
147
- # @param [Hash] options ({})
148
- # @option options [Boolean] :dry_run
149
- # Checks whether you have the required permissions for the action,
150
- # without actually making the request, and provides an error response.
151
- # If you have the required permissions, the error response is
152
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
153
- # @return [EmptyStructure]
154
- def delete(options = {})
155
- options = options.merge(internet_gateway_id: @id)
156
- resp = @client.delete_internet_gateway(options)
157
- resp.data
158
- end
141
+ # @example Request syntax with placeholder values
142
+ #
143
+ # internet_gateway.delete({
144
+ # dry_run: false,
145
+ # })
146
+ # @param [Hash] options ({})
147
+ # @option options [Boolean] :dry_run
148
+ # Checks whether you have the required permissions for the action,
149
+ # without actually making the request, and provides an error response.
150
+ # If you have the required permissions, the error response is
151
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
152
+ # @return [EmptyStructure]
153
+ def delete(options = {})
154
+ options = options.merge(internet_gateway_id: @id)
155
+ resp = @client.delete_internet_gateway(options)
156
+ resp.data
157
+ end
159
158
 
160
- # @example Request syntax with placeholder values
161
- #
162
- # internet_gateway.detach_from_vpc({
163
- # dry_run: false,
164
- # vpc_id: "String", # required
165
- # })
166
- # @param [Hash] options ({})
167
- # @option options [Boolean] :dry_run
168
- # Checks whether you have the required permissions for the action,
169
- # without actually making the request, and provides an error response.
170
- # If you have the required permissions, the error response is
171
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
172
- # @option options [required, String] :vpc_id
173
- # The ID of the VPC.
174
- # @return [EmptyStructure]
175
- def detach_from_vpc(options = {})
176
- options = options.merge(internet_gateway_id: @id)
177
- resp = @client.detach_internet_gateway(options)
178
- resp.data
179
- end
159
+ # @example Request syntax with placeholder values
160
+ #
161
+ # internet_gateway.detach_from_vpc({
162
+ # dry_run: false,
163
+ # vpc_id: "String", # required
164
+ # })
165
+ # @param [Hash] options ({})
166
+ # @option options [Boolean] :dry_run
167
+ # Checks whether you have the required permissions for the action,
168
+ # without actually making the request, and provides an error response.
169
+ # If you have the required permissions, the error response is
170
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
171
+ # @option options [required, String] :vpc_id
172
+ # The ID of the VPC.
173
+ # @return [EmptyStructure]
174
+ def detach_from_vpc(options = {})
175
+ options = options.merge(internet_gateway_id: @id)
176
+ resp = @client.detach_internet_gateway(options)
177
+ resp.data
178
+ end
180
179
 
181
- # @deprecated
182
- # @api private
183
- def identifiers
184
- { id: @id }
185
- end
186
- deprecated(:identifiers)
187
-
188
- private
189
-
190
- def extract_id(args, options)
191
- value = args[0] || options.delete(:id)
192
- case value
193
- when String then value
194
- when nil then raise ArgumentError, "missing required option :id"
195
- else
196
- msg = "expected :id to be a String, got #{value.class}"
197
- raise ArgumentError, msg
198
- end
180
+ # @deprecated
181
+ # @api private
182
+ def identifiers
183
+ { id: @id }
184
+ end
185
+ deprecated(:identifiers)
186
+
187
+ private
188
+
189
+ def extract_id(args, options)
190
+ value = args[0] || options.delete(:id)
191
+ case value
192
+ when String then value
193
+ when nil then raise ArgumentError, "missing required option :id"
194
+ else
195
+ msg = "expected :id to be a String, got #{value.class}"
196
+ raise ArgumentError, msg
199
197
  end
200
-
201
- class Collection < Aws::Resources::Collection; end
202
198
  end
199
+
200
+ class Collection < Aws::Resources::Collection; end
203
201
  end
204
202
  end
@@ -1,120 +1,118 @@
1
1
  # WARNING ABOUT GENERATED CODE
2
2
  #
3
- # This file is generated. See the contributing for info on making contributions:
3
+ # This file is generated. See the contributing guide for more information:
4
4
  # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
5
  #
6
6
  # WARNING ABOUT GENERATED CODE
7
7
 
8
- module Aws
9
- module EC2
10
- class KeyPair
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(name, options = {})
15
- # @param [String] name
16
- # @option options [Client] :client
17
- # @overload def initialize(options = {})
18
- # @option options [required, String] :name
19
- # @option options [Client] :client
20
- def initialize(*args)
21
- options = Hash === args.last ? args.pop.dup : {}
22
- @name = extract_name(args, options)
23
- @data = options.delete(:data)
24
- @client = options.delete(:client) || Client.new(options)
25
- end
8
+ module Aws::EC2
9
+ class KeyPair
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(name, options = {})
14
+ # @param [String] name
15
+ # @option options [Client] :client
16
+ # @overload def initialize(options = {})
17
+ # @option options [required, String] :name
18
+ # @option options [Client] :client
19
+ def initialize(*args)
20
+ options = Hash === args.last ? args.pop.dup : {}
21
+ @name = extract_name(args, options)
22
+ @data = options.delete(:data)
23
+ @client = options.delete(:client) || Client.new(options)
24
+ end
26
25
 
27
- # @!group Read-Only Attributes
26
+ # @!group Read-Only Attributes
28
27
 
29
- # @return [String]
30
- def name
31
- @name
32
- end
33
- alias :key_name :name
28
+ # @return [String]
29
+ def name
30
+ @name
31
+ end
32
+ alias :key_name :name
34
33
 
35
- # The SHA-1 digest of the DER encoded private key.
36
- # @return [String]
37
- def key_fingerprint
38
- data.key_fingerprint
39
- end
34
+ # The SHA-1 digest of the DER encoded private key.
35
+ # @return [String]
36
+ def key_fingerprint
37
+ data.key_fingerprint
38
+ end
40
39
 
41
- # An unencrypted PEM encoded RSA private key.
42
- # @return [String]
43
- def key_material
44
- data.key_material
45
- end
40
+ # An unencrypted PEM encoded RSA private key.
41
+ # @return [String]
42
+ def key_material
43
+ data.key_material
44
+ end
46
45
 
47
- # @!endgroup
46
+ # @!endgroup
48
47
 
49
- # @return [Client]
50
- def client
51
- @client
52
- end
48
+ # @return [Client]
49
+ def client
50
+ @client
51
+ end
53
52
 
54
- # @raise [Errors::ResourceNotLoadable]
55
- # @api private
56
- def load
57
- msg = "#load is not implemented, data only available via enumeration"
58
- raise Errors::ResourceNotLoadable, msg
59
- end
60
- alias :reload :load
61
-
62
- # @raise [Errors::ResourceNotLoadableError] Raises when {#data_loaded?} is `false`.
63
- # @return [Types::KeyPair]
64
- # Returns the data for this {KeyPair}.
65
- def data
66
- load unless @data
67
- @data
68
- end
53
+ # @raise [NotImplementedError]
54
+ # @api private
55
+ def load
56
+ msg = "#load is not implemented, data only available via enumeration"
57
+ raise NotImplementedError, msg
58
+ end
59
+ alias :reload :load
60
+
61
+ # @raise [NotImplementedError] Raises when {#data_loaded?} is `false`.
62
+ # @return [Types::KeyPair]
63
+ # Returns the data for this {KeyPair}.
64
+ def data
65
+ load unless @data
66
+ @data
67
+ end
69
68
 
70
- # @return [Boolean]
71
- # Returns `true` if this resource is loaded. Accessing attributes or
72
- # {#data} on an unloaded resource will trigger a call to {#load}.
73
- def data_loaded?
74
- !!@data
75
- end
69
+ # @return [Boolean]
70
+ # Returns `true` if this resource is loaded. Accessing attributes or
71
+ # {#data} on an unloaded resource will trigger a call to {#load}.
72
+ def data_loaded?
73
+ !!@data
74
+ end
76
75
 
77
- # @!group Actions
78
-
79
- # @example Request syntax with placeholder values
80
- #
81
- # key_pair.delete({
82
- # dry_run: false,
83
- # })
84
- # @param [Hash] options ({})
85
- # @option options [Boolean] :dry_run
86
- # Checks whether you have the required permissions for the action,
87
- # without actually making the request, and provides an error response.
88
- # If you have the required permissions, the error response is
89
- # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
90
- # @return [EmptyStructure]
91
- def delete(options = {})
92
- options = options.merge(key_name: @name)
93
- resp = @client.delete_key_pair(options)
94
- resp.data
95
- end
76
+ # @!group Actions
77
+
78
+ # @example Request syntax with placeholder values
79
+ #
80
+ # key_pair.delete({
81
+ # dry_run: false,
82
+ # })
83
+ # @param [Hash] options ({})
84
+ # @option options [Boolean] :dry_run
85
+ # Checks whether you have the required permissions for the action,
86
+ # without actually making the request, and provides an error response.
87
+ # If you have the required permissions, the error response is
88
+ # `DryRunOperation`. Otherwise, it is `UnauthorizedOperation`.
89
+ # @return [EmptyStructure]
90
+ def delete(options = {})
91
+ options = options.merge(key_name: @name)
92
+ resp = @client.delete_key_pair(options)
93
+ resp.data
94
+ end
96
95
 
97
- # @deprecated
98
- # @api private
99
- def identifiers
100
- { name: @name }
101
- end
102
- deprecated(:identifiers)
103
-
104
- private
105
-
106
- def extract_name(args, options)
107
- value = args[0] || options.delete(:name)
108
- case value
109
- when String then value
110
- when nil then raise ArgumentError, "missing required option :name"
111
- else
112
- msg = "expected :name to be a String, got #{value.class}"
113
- raise ArgumentError, msg
114
- end
96
+ # @deprecated
97
+ # @api private
98
+ def identifiers
99
+ { name: @name }
100
+ end
101
+ deprecated(:identifiers)
102
+
103
+ private
104
+
105
+ def extract_name(args, options)
106
+ value = args[0] || options.delete(:name)
107
+ case value
108
+ when String then value
109
+ when nil then raise ArgumentError, "missing required option :name"
110
+ else
111
+ msg = "expected :name to be a String, got #{value.class}"
112
+ raise ArgumentError, msg
115
113
  end
116
-
117
- class Collection < Aws::Resources::Collection; end
118
114
  end
115
+
116
+ class Collection < Aws::Resources::Collection; end
119
117
  end
120
118
  end