aws-sdk-glacier 1.0.0.rc1 → 1.0.0.rc2

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,179 +1,177 @@
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 Glacier
10
- class Notification
11
-
12
- extend Aws::Deprecations
13
-
14
- # @overload def initialize(account_id, vault_name, options = {})
15
- # @param [String] account_id
16
- # @param [String] vault_name
17
- # @option options [Client] :client
18
- # @overload def initialize(options = {})
19
- # @option options [required, String] :account_id
20
- # @option options [required, String] :vault_name
21
- # @option options [Client] :client
22
- def initialize(*args)
23
- options = Hash === args.last ? args.pop.dup : {}
24
- @account_id = extract_account_id(args, options)
25
- @vault_name = extract_vault_name(args, options)
26
- @data = options.delete(:data)
27
- @client = options.delete(:client) || Client.new(options)
28
- end
8
+ module Aws::Glacier
9
+ class Notification
10
+
11
+ extend Aws::Deprecations
12
+
13
+ # @overload def initialize(account_id, vault_name, options = {})
14
+ # @param [String] account_id
15
+ # @param [String] vault_name
16
+ # @option options [Client] :client
17
+ # @overload def initialize(options = {})
18
+ # @option options [required, String] :account_id
19
+ # @option options [required, String] :vault_name
20
+ # @option options [Client] :client
21
+ def initialize(*args)
22
+ options = Hash === args.last ? args.pop.dup : {}
23
+ @account_id = extract_account_id(args, options)
24
+ @vault_name = extract_vault_name(args, options)
25
+ @data = options.delete(:data)
26
+ @client = options.delete(:client) || Client.new(options)
27
+ end
29
28
 
30
- # @!group Read-Only Attributes
29
+ # @!group Read-Only Attributes
31
30
 
32
- # @return [String]
33
- def account_id
34
- @account_id
35
- end
31
+ # @return [String]
32
+ def account_id
33
+ @account_id
34
+ end
36
35
 
37
- # @return [String]
38
- def vault_name
39
- @vault_name
40
- end
36
+ # @return [String]
37
+ def vault_name
38
+ @vault_name
39
+ end
41
40
 
42
- # The Amazon Simple Notification Service (Amazon SNS) topic Amazon
43
- # Resource Name (ARN).
44
- # @return [String]
45
- def sns_topic
46
- data.sns_topic
47
- end
41
+ # The Amazon Simple Notification Service (Amazon SNS) topic Amazon
42
+ # Resource Name (ARN).
43
+ # @return [String]
44
+ def sns_topic
45
+ data.sns_topic
46
+ end
48
47
 
49
- # A list of one or more events for which Amazon Glacier will send a
50
- # notification to the specified Amazon SNS topic.
51
- # @return [Array<String>]
52
- def events
53
- data.events
54
- end
48
+ # A list of one or more events for which Amazon Glacier will send a
49
+ # notification to the specified Amazon SNS topic.
50
+ # @return [Array<String>]
51
+ def events
52
+ data.events
53
+ end
55
54
 
56
- # @!endgroup
55
+ # @!endgroup
57
56
 
58
- # @return [Client]
59
- def client
60
- @client
61
- end
57
+ # @return [Client]
58
+ def client
59
+ @client
60
+ end
62
61
 
63
- # Loads, or reloads {#data} for the current {Notification}.
64
- # Returns `self` making it possible to chain methods.
65
- #
66
- # notification.reload.data
67
- #
68
- # @return [self]
69
- def load
70
- resp = @client.get_vault_notifications(
71
- account_id: @account_id,
72
- vault_name: @vault_name
73
- )
74
- @data = resp.vaultnotificationconfig
75
- self
76
- end
77
- alias :reload :load
78
-
79
- # @return [Types::VaultNotificationConfig]
80
- # Returns the data for this {Notification}. Calls
81
- # {Client#get_vault_notifications} if {#data_loaded?} is `false`.
82
- def data
83
- load unless @data
84
- @data
85
- end
62
+ # Loads, or reloads {#data} for the current {Notification}.
63
+ # Returns `self` making it possible to chain methods.
64
+ #
65
+ # notification.reload.data
66
+ #
67
+ # @return [self]
68
+ def load
69
+ resp = @client.get_vault_notifications(
70
+ account_id: @account_id,
71
+ vault_name: @vault_name
72
+ )
73
+ @data = resp.vaultnotificationconfig
74
+ self
75
+ end
76
+ alias :reload :load
77
+
78
+ # @return [Types::VaultNotificationConfig]
79
+ # Returns the data for this {Notification}. Calls
80
+ # {Client#get_vault_notifications} if {#data_loaded?} is `false`.
81
+ def data
82
+ load unless @data
83
+ @data
84
+ end
86
85
 
87
- # @return [Boolean]
88
- # Returns `true` if this resource is loaded. Accessing attributes or
89
- # {#data} on an unloaded resource will trigger a call to {#load}.
90
- def data_loaded?
91
- !!@data
92
- end
86
+ # @return [Boolean]
87
+ # Returns `true` if this resource is loaded. Accessing attributes or
88
+ # {#data} on an unloaded resource will trigger a call to {#load}.
89
+ def data_loaded?
90
+ !!@data
91
+ end
93
92
 
94
- # @!group Actions
95
-
96
- # @example Request syntax with placeholder values
97
- #
98
- # notification.delete()
99
- # @param [Hash] options ({})
100
- # @return [EmptyStructure]
101
- def delete(options = {})
102
- options = options.merge(
103
- account_id: @account_id,
104
- vault_name: @vault_name
105
- )
106
- resp = @client.delete_vault_notifications(options)
107
- resp.data
108
- end
93
+ # @!group Actions
94
+
95
+ # @example Request syntax with placeholder values
96
+ #
97
+ # notification.delete()
98
+ # @param [Hash] options ({})
99
+ # @return [EmptyStructure]
100
+ def delete(options = {})
101
+ options = options.merge(
102
+ account_id: @account_id,
103
+ vault_name: @vault_name
104
+ )
105
+ resp = @client.delete_vault_notifications(options)
106
+ resp.data
107
+ end
109
108
 
110
- # @example Request syntax with placeholder values
111
- #
112
- # notification.set({
113
- # vault_notification_config: {
114
- # sns_topic: "string",
115
- # events: ["string"],
116
- # },
117
- # })
118
- # @param [Hash] options ({})
119
- # @option options [Types::VaultNotificationConfig] :vault_notification_config
120
- # Provides options for specifying notification configuration.
121
- # @return [EmptyStructure]
122
- def set(options = {})
123
- options = options.merge(
124
- account_id: @account_id,
125
- vault_name: @vault_name
126
- )
127
- resp = @client.set_vault_notifications(options)
128
- resp.data
129
- end
109
+ # @example Request syntax with placeholder values
110
+ #
111
+ # notification.set({
112
+ # vault_notification_config: {
113
+ # sns_topic: "string",
114
+ # events: ["string"],
115
+ # },
116
+ # })
117
+ # @param [Hash] options ({})
118
+ # @option options [Types::VaultNotificationConfig] :vault_notification_config
119
+ # Provides options for specifying notification configuration.
120
+ # @return [EmptyStructure]
121
+ def set(options = {})
122
+ options = options.merge(
123
+ account_id: @account_id,
124
+ vault_name: @vault_name
125
+ )
126
+ resp = @client.set_vault_notifications(options)
127
+ resp.data
128
+ end
130
129
 
131
- # @!group Associations
130
+ # @!group Associations
132
131
 
133
- # @return [Vault]
134
- def vault
135
- Vault.new(
136
- account_id: @account_id,
137
- name: @vault_name,
138
- client: @client
139
- )
140
- end
132
+ # @return [Vault]
133
+ def vault
134
+ Vault.new(
135
+ account_id: @account_id,
136
+ name: @vault_name,
137
+ client: @client
138
+ )
139
+ end
141
140
 
142
- # @deprecated
143
- # @api private
144
- def identifiers
145
- {
146
- account_id: @account_id,
147
- vault_name: @vault_name
148
- }
149
- end
150
- deprecated(:identifiers)
151
-
152
- private
153
-
154
- def extract_account_id(args, options)
155
- value = args[0] || options.delete(:account_id)
156
- case value
157
- when String then value
158
- when nil then raise ArgumentError, "missing required option :account_id"
159
- else
160
- msg = "expected :account_id to be a String, got #{value.class}"
161
- raise ArgumentError, msg
162
- end
141
+ # @deprecated
142
+ # @api private
143
+ def identifiers
144
+ {
145
+ account_id: @account_id,
146
+ vault_name: @vault_name
147
+ }
148
+ end
149
+ deprecated(:identifiers)
150
+
151
+ private
152
+
153
+ def extract_account_id(args, options)
154
+ value = args[0] || options.delete(:account_id)
155
+ case value
156
+ when String then value
157
+ when nil then raise ArgumentError, "missing required option :account_id"
158
+ else
159
+ msg = "expected :account_id to be a String, got #{value.class}"
160
+ raise ArgumentError, msg
163
161
  end
162
+ end
164
163
 
165
- def extract_vault_name(args, options)
166
- value = args[1] || options.delete(:vault_name)
167
- case value
168
- when String then value
169
- when nil then raise ArgumentError, "missing required option :vault_name"
170
- else
171
- msg = "expected :vault_name to be a String, got #{value.class}"
172
- raise ArgumentError, msg
173
- end
164
+ def extract_vault_name(args, options)
165
+ value = args[1] || options.delete(:vault_name)
166
+ case value
167
+ when String then value
168
+ when nil then raise ArgumentError, "missing required option :vault_name"
169
+ else
170
+ msg = "expected :vault_name to be a String, got #{value.class}"
171
+ raise ArgumentError, msg
174
172
  end
175
-
176
- class Collection < Aws::Resources::Collection; end
177
173
  end
174
+
175
+ class Collection < Aws::Resources::Collection; end
178
176
  end
179
177
  end
@@ -1,82 +1,80 @@
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 Glacier
10
- class Resource
8
+ module Aws::Glacier
9
+ class Resource
11
10
 
12
- # @param options ({})
13
- # @option options [Client] :client
14
- def initialize(options = {})
15
- @client = options[:client] || Client.new(options)
16
- end
11
+ # @param options ({})
12
+ # @option options [Client] :client
13
+ def initialize(options = {})
14
+ @client = options[:client] || Client.new(options)
15
+ end
17
16
 
18
- # @return [Client]
19
- def client
20
- @client
21
- end
17
+ # @return [Client]
18
+ def client
19
+ @client
20
+ end
22
21
 
23
- # @!group Actions
22
+ # @!group Actions
24
23
 
25
- # @example Request syntax with placeholder values
26
- #
27
- # vault = glacier.create_vault({
28
- # vault_name: "string", # required
29
- # })
30
- # @param [Hash] options ({})
31
- # @option options [required, String] :vault_name
32
- # The name of the vault.
33
- # @return [Vault]
34
- def create_vault(options = {})
35
- options = options.merge(account_id: "-")
36
- resp = @client.create_vault(options)
37
- Vault.new(
38
- account_id: options[:account_id],
39
- name: options[:vault_name],
40
- client: @client
41
- )
42
- end
24
+ # @example Request syntax with placeholder values
25
+ #
26
+ # vault = glacier.create_vault({
27
+ # vault_name: "string", # required
28
+ # })
29
+ # @param [Hash] options ({})
30
+ # @option options [required, String] :vault_name
31
+ # The name of the vault.
32
+ # @return [Vault]
33
+ def create_vault(options = {})
34
+ options = options.merge(account_id: "-")
35
+ resp = @client.create_vault(options)
36
+ Vault.new(
37
+ account_id: options[:account_id],
38
+ name: options[:vault_name],
39
+ client: @client
40
+ )
41
+ end
43
42
 
44
- # @!group Associations
43
+ # @!group Associations
45
44
 
46
- # @param [String] id
47
- # @return [Account]
48
- def account(id)
49
- Account.new(
50
- id: id,
51
- client: @client
52
- )
53
- end
45
+ # @param [String] id
46
+ # @return [Account]
47
+ def account(id)
48
+ Account.new(
49
+ id: id,
50
+ client: @client
51
+ )
52
+ end
54
53
 
55
- # @example Request syntax with placeholder values
56
- #
57
- # vaults = glacier.vaults()
58
- # @param [Hash] options ({})
59
- # @return [Vault::Collection]
60
- def vaults(options = {})
61
- batches = Enumerator.new do |y|
62
- options = options.merge(account_id: "-")
63
- resp = @client.list_vaults(options)
64
- resp.each_page do |page|
65
- batch = []
66
- page.data.vault_list.each do |v|
67
- batch << Vault.new(
68
- account_id: options[:account_id],
69
- name: v.vault_name,
70
- data: v,
71
- client: @client
72
- )
73
- end
74
- y.yield(batch)
54
+ # @example Request syntax with placeholder values
55
+ #
56
+ # glacier.vaults()
57
+ # @param [Hash] options ({})
58
+ # @return [Vault::Collection]
59
+ def vaults(options = {})
60
+ batches = Enumerator.new do |y|
61
+ options = options.merge(account_id: "-")
62
+ resp = @client.list_vaults(options)
63
+ resp.each_page do |page|
64
+ batch = []
65
+ page.data.vault_list.each do |v|
66
+ batch << Vault.new(
67
+ account_id: options[:account_id],
68
+ name: v.vault_name,
69
+ data: v,
70
+ client: @client
71
+ )
75
72
  end
73
+ y.yield(batch)
76
74
  end
77
- Vault::Collection.new(batches)
78
75
  end
79
-
76
+ Vault::Collection.new(batches)
80
77
  end
78
+
81
79
  end
82
80
  end