aws-sdk-savingsplans 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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 12dfde1f322c0707c32509c14c3c87c2bc9cd42b
4
+ data.tar.gz: 44756d9117d1ca355f65fbc2f64557dd1d6b0327
5
+ SHA512:
6
+ metadata.gz: faca4a76f98d7dbd270cee59283bc9b8e84d3953bb8a268a92ef2b6433e7f6b1ddf00366b72fc1cbb363183744cd7d47b18a4a6552bae4edfe4e00657f6f110e
7
+ data.tar.gz: 67084e66b72d0685f8b13641c2f112b0127958efef45839a1e7e3e37a5a2db2ecb068f863806ad9eefd9b59d3d65dbdfad6cf72a5fa0451dac5e19c0763b2c14
@@ -0,0 +1,47 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'aws-sdk-core'
9
+ require 'aws-sigv4'
10
+
11
+ require_relative 'aws-sdk-savingsplans/types'
12
+ require_relative 'aws-sdk-savingsplans/client_api'
13
+ require_relative 'aws-sdk-savingsplans/client'
14
+ require_relative 'aws-sdk-savingsplans/errors'
15
+ require_relative 'aws-sdk-savingsplans/resource'
16
+ require_relative 'aws-sdk-savingsplans/customizations'
17
+
18
+ # This module provides support for AWS Savings Plans. This module is available in the
19
+ # `aws-sdk-savingsplans` gem.
20
+ #
21
+ # # Client
22
+ #
23
+ # The {Client} class provides one method for each API operation. Operation
24
+ # methods each accept a hash of request parameters and return a response
25
+ # structure.
26
+ #
27
+ # See {Client} for more information.
28
+ #
29
+ # # Errors
30
+ #
31
+ # Errors returned from AWS Savings Plans all
32
+ # extend {Errors::ServiceError}.
33
+ #
34
+ # begin
35
+ # # do stuff
36
+ # rescue Aws::SavingsPlans::Errors::ServiceError
37
+ # # rescues all service API errors
38
+ # end
39
+ #
40
+ # See {Errors} for more information.
41
+ #
42
+ # @service
43
+ module Aws::SavingsPlans
44
+
45
+ GEM_VERSION = '1.0.0'
46
+
47
+ end
@@ -0,0 +1,755 @@
1
+ # WARNING ABOUT GENERATED CODE
2
+ #
3
+ # This file is generated. See the contributing guide for more information:
4
+ # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
5
+ #
6
+ # WARNING ABOUT GENERATED CODE
7
+
8
+ require 'seahorse/client/plugins/content_length.rb'
9
+ require 'aws-sdk-core/plugins/credentials_configuration.rb'
10
+ require 'aws-sdk-core/plugins/logging.rb'
11
+ require 'aws-sdk-core/plugins/param_converter.rb'
12
+ require 'aws-sdk-core/plugins/param_validator.rb'
13
+ require 'aws-sdk-core/plugins/user_agent.rb'
14
+ require 'aws-sdk-core/plugins/helpful_socket_errors.rb'
15
+ require 'aws-sdk-core/plugins/retry_errors.rb'
16
+ require 'aws-sdk-core/plugins/global_configuration.rb'
17
+ require 'aws-sdk-core/plugins/regional_endpoint.rb'
18
+ require 'aws-sdk-core/plugins/endpoint_discovery.rb'
19
+ require 'aws-sdk-core/plugins/endpoint_pattern.rb'
20
+ require 'aws-sdk-core/plugins/response_paging.rb'
21
+ require 'aws-sdk-core/plugins/stub_responses.rb'
22
+ require 'aws-sdk-core/plugins/idempotency_token.rb'
23
+ require 'aws-sdk-core/plugins/jsonvalue_converter.rb'
24
+ require 'aws-sdk-core/plugins/client_metrics_plugin.rb'
25
+ require 'aws-sdk-core/plugins/client_metrics_send_plugin.rb'
26
+ require 'aws-sdk-core/plugins/transfer_encoding.rb'
27
+ require 'aws-sdk-core/plugins/signature_v4.rb'
28
+ require 'aws-sdk-core/plugins/protocols/rest_json.rb'
29
+
30
+ Aws::Plugins::GlobalConfiguration.add_identifier(:savingsplans)
31
+
32
+ module Aws::SavingsPlans
33
+ class Client < Seahorse::Client::Base
34
+
35
+ include Aws::ClientStubs
36
+
37
+ @identifier = :savingsplans
38
+
39
+ set_api(ClientApi::API)
40
+
41
+ add_plugin(Seahorse::Client::Plugins::ContentLength)
42
+ add_plugin(Aws::Plugins::CredentialsConfiguration)
43
+ add_plugin(Aws::Plugins::Logging)
44
+ add_plugin(Aws::Plugins::ParamConverter)
45
+ add_plugin(Aws::Plugins::ParamValidator)
46
+ add_plugin(Aws::Plugins::UserAgent)
47
+ add_plugin(Aws::Plugins::HelpfulSocketErrors)
48
+ add_plugin(Aws::Plugins::RetryErrors)
49
+ add_plugin(Aws::Plugins::GlobalConfiguration)
50
+ add_plugin(Aws::Plugins::RegionalEndpoint)
51
+ add_plugin(Aws::Plugins::EndpointDiscovery)
52
+ add_plugin(Aws::Plugins::EndpointPattern)
53
+ add_plugin(Aws::Plugins::ResponsePaging)
54
+ add_plugin(Aws::Plugins::StubResponses)
55
+ add_plugin(Aws::Plugins::IdempotencyToken)
56
+ add_plugin(Aws::Plugins::JsonvalueConverter)
57
+ add_plugin(Aws::Plugins::ClientMetricsPlugin)
58
+ add_plugin(Aws::Plugins::ClientMetricsSendPlugin)
59
+ add_plugin(Aws::Plugins::TransferEncoding)
60
+ add_plugin(Aws::Plugins::SignatureV4)
61
+ add_plugin(Aws::Plugins::Protocols::RestJson)
62
+
63
+ # @overload initialize(options)
64
+ # @param [Hash] options
65
+ # @option options [required, Aws::CredentialProvider] :credentials
66
+ # Your AWS credentials. This can be an instance of any one of the
67
+ # following classes:
68
+ #
69
+ # * `Aws::Credentials` - Used for configuring static, non-refreshing
70
+ # credentials.
71
+ #
72
+ # * `Aws::InstanceProfileCredentials` - Used for loading credentials
73
+ # from an EC2 IMDS on an EC2 instance.
74
+ #
75
+ # * `Aws::SharedCredentials` - Used for loading credentials from a
76
+ # shared file, such as `~/.aws/config`.
77
+ #
78
+ # * `Aws::AssumeRoleCredentials` - Used when you need to assume a role.
79
+ #
80
+ # When `:credentials` are not configured directly, the following
81
+ # locations will be searched for credentials:
82
+ #
83
+ # * `Aws.config[:credentials]`
84
+ # * The `:access_key_id`, `:secret_access_key`, and `:session_token` options.
85
+ # * ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
86
+ # * `~/.aws/credentials`
87
+ # * `~/.aws/config`
88
+ # * EC2 IMDS instance profile - When used by default, the timeouts are
89
+ # very aggressive. Construct and pass an instance of
90
+ # `Aws::InstanceProfileCredentails` to enable retries and extended
91
+ # timeouts.
92
+ #
93
+ # @option options [required, String] :region
94
+ # The AWS region to connect to. The configured `:region` is
95
+ # used to determine the service `:endpoint`. When not passed,
96
+ # a default `:region` is search for in the following locations:
97
+ #
98
+ # * `Aws.config[:region]`
99
+ # * `ENV['AWS_REGION']`
100
+ # * `ENV['AMAZON_REGION']`
101
+ # * `ENV['AWS_DEFAULT_REGION']`
102
+ # * `~/.aws/credentials`
103
+ # * `~/.aws/config`
104
+ #
105
+ # @option options [String] :access_key_id
106
+ #
107
+ # @option options [Boolean] :active_endpoint_cache (false)
108
+ # When set to `true`, a thread polling for endpoints will be running in
109
+ # the background every 60 secs (default). Defaults to `false`.
110
+ #
111
+ # @option options [Boolean] :client_side_monitoring (false)
112
+ # When `true`, client-side metrics will be collected for all API requests from
113
+ # this client.
114
+ #
115
+ # @option options [String] :client_side_monitoring_client_id ("")
116
+ # Allows you to provide an identifier for this client which will be attached to
117
+ # all generated client side metrics. Defaults to an empty string.
118
+ #
119
+ # @option options [String] :client_side_monitoring_host ("127.0.0.1")
120
+ # Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client
121
+ # side monitoring agent is running on, where client metrics will be published via UDP.
122
+ #
123
+ # @option options [Integer] :client_side_monitoring_port (31000)
124
+ # Required for publishing client metrics. The port that the client side monitoring
125
+ # agent is running on, where client metrics will be published via UDP.
126
+ #
127
+ # @option options [Aws::ClientSideMonitoring::Publisher] :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher)
128
+ # Allows you to provide a custom client-side monitoring publisher class. By default,
129
+ # will use the Client Side Monitoring Agent Publisher.
130
+ #
131
+ # @option options [Boolean] :convert_params (true)
132
+ # When `true`, an attempt is made to coerce request parameters into
133
+ # the required types.
134
+ #
135
+ # @option options [Boolean] :disable_host_prefix_injection (false)
136
+ # Set to true to disable SDK automatically adding host prefix
137
+ # to default service endpoint when available.
138
+ #
139
+ # @option options [String] :endpoint
140
+ # The client endpoint is normally constructed from the `:region`
141
+ # option. You should only configure an `:endpoint` when connecting
142
+ # to test endpoints. This should be avalid HTTP(S) URI.
143
+ #
144
+ # @option options [Integer] :endpoint_cache_max_entries (1000)
145
+ # Used for the maximum size limit of the LRU cache storing endpoints data
146
+ # for endpoint discovery enabled operations. Defaults to 1000.
147
+ #
148
+ # @option options [Integer] :endpoint_cache_max_threads (10)
149
+ # Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.
150
+ #
151
+ # @option options [Integer] :endpoint_cache_poll_interval (60)
152
+ # When :endpoint_discovery and :active_endpoint_cache is enabled,
153
+ # Use this option to config the time interval in seconds for making
154
+ # requests fetching endpoints information. Defaults to 60 sec.
155
+ #
156
+ # @option options [Boolean] :endpoint_discovery (false)
157
+ # When set to `true`, endpoint discovery will be enabled for operations when available. Defaults to `false`.
158
+ #
159
+ # @option options [Aws::Log::Formatter] :log_formatter (Aws::Log::Formatter.default)
160
+ # The log formatter.
161
+ #
162
+ # @option options [Symbol] :log_level (:info)
163
+ # The log level to send messages to the `:logger` at.
164
+ #
165
+ # @option options [Logger] :logger
166
+ # The Logger instance to send log messages to. If this option
167
+ # is not set, logging will be disabled.
168
+ #
169
+ # @option options [String] :profile ("default")
170
+ # Used when loading credentials from the shared credentials file
171
+ # at HOME/.aws/credentials. When not specified, 'default' is used.
172
+ #
173
+ # @option options [Float] :retry_base_delay (0.3)
174
+ # The base delay in seconds used by the default backoff function.
175
+ #
176
+ # @option options [Symbol] :retry_jitter (:none)
177
+ # A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number.
178
+ #
179
+ # @see https://www.awsarchitectureblog.com/2015/03/backoff.html
180
+ #
181
+ # @option options [Integer] :retry_limit (3)
182
+ # The maximum number of times to retry failed requests. Only
183
+ # ~ 500 level server errors and certain ~ 400 level client errors
184
+ # are retried. Generally, these are throttling errors, data
185
+ # checksum errors, networking errors, timeout errors and auth
186
+ # errors from expired credentials.
187
+ #
188
+ # @option options [Integer] :retry_max_delay (0)
189
+ # The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function.
190
+ #
191
+ # @option options [String] :secret_access_key
192
+ #
193
+ # @option options [String] :session_token
194
+ #
195
+ # @option options [Boolean] :stub_responses (false)
196
+ # Causes the client to return stubbed responses. By default
197
+ # fake responses are generated and returned. You can specify
198
+ # the response data to return or errors to raise by calling
199
+ # {ClientStubs#stub_responses}. See {ClientStubs} for more information.
200
+ #
201
+ # ** Please note ** When response stubbing is enabled, no HTTP
202
+ # requests are made, and retries are disabled.
203
+ #
204
+ # @option options [Boolean] :validate_params (true)
205
+ # When `true`, request parameters are validated before
206
+ # sending the request.
207
+ #
208
+ # @option options [URI::HTTP,String] :http_proxy A proxy to send
209
+ # requests through. Formatted like 'http://proxy.com:123'.
210
+ #
211
+ # @option options [Float] :http_open_timeout (15) The number of
212
+ # seconds to wait when opening a HTTP session before rasing a
213
+ # `Timeout::Error`.
214
+ #
215
+ # @option options [Integer] :http_read_timeout (60) The default
216
+ # number of seconds to wait for response data. This value can
217
+ # safely be set
218
+ # per-request on the session yeidled by {#session_for}.
219
+ #
220
+ # @option options [Float] :http_idle_timeout (5) The number of
221
+ # seconds a connection is allowed to sit idble before it is
222
+ # considered stale. Stale connections are closed and removed
223
+ # from the pool before making a request.
224
+ #
225
+ # @option options [Float] :http_continue_timeout (1) The number of
226
+ # seconds to wait for a 100-continue response before sending the
227
+ # request body. This option has no effect unless the request has
228
+ # "Expect" header set to "100-continue". Defaults to `nil` which
229
+ # disables this behaviour. This value can safely be set per
230
+ # request on the session yeidled by {#session_for}.
231
+ #
232
+ # @option options [Boolean] :http_wire_trace (false) When `true`,
233
+ # HTTP debug output will be sent to the `:logger`.
234
+ #
235
+ # @option options [Boolean] :ssl_verify_peer (true) When `true`,
236
+ # SSL peer certificates are verified when establishing a
237
+ # connection.
238
+ #
239
+ # @option options [String] :ssl_ca_bundle Full path to the SSL
240
+ # certificate authority bundle file that should be used when
241
+ # verifying peer certificates. If you do not pass
242
+ # `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
243
+ # will be used if available.
244
+ #
245
+ # @option options [String] :ssl_ca_directory Full path of the
246
+ # directory that contains the unbundled SSL certificate
247
+ # authority files for verifying peer certificates. If you do
248
+ # not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
249
+ # system default will be used if available.
250
+ #
251
+ def initialize(*args)
252
+ super
253
+ end
254
+
255
+ # @!group API Operations
256
+
257
+ # Creates a Savings Plan.
258
+ #
259
+ # @option params [required, String] :savings_plan_offering_id
260
+ # The ID of the offering.
261
+ #
262
+ # @option params [required, String] :commitment
263
+ # The hourly commitment, in USD. This is a value between 0.001 and 1
264
+ # million. You cannot specify more than three digits after the decimal
265
+ # point.
266
+ #
267
+ # @option params [String] :upfront_payment_amount
268
+ # The up-front payment amount. This is a whole number between 50 and 99
269
+ # percent of the total value of the Savings Plan. This parameter is
270
+ # supported only if the payment option is `Partial Upfront`.
271
+ #
272
+ # @option params [String] :client_token
273
+ # Unique, case-sensitive identifier that you provide to ensure the
274
+ # idempotency of the request.
275
+ #
276
+ # **A suitable default value is auto-generated.** You should normally
277
+ # not need to pass this option.**
278
+ #
279
+ # @option params [Hash<String,String>] :tags
280
+ # One or more tags.
281
+ #
282
+ # @return [Types::CreateSavingsPlanResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
283
+ #
284
+ # * {Types::CreateSavingsPlanResponse#savings_plan_id #savings_plan_id} => String
285
+ #
286
+ # @example Request syntax with placeholder values
287
+ #
288
+ # resp = client.create_savings_plan({
289
+ # savings_plan_offering_id: "SavingsPlanOfferingId", # required
290
+ # commitment: "Amount", # required
291
+ # upfront_payment_amount: "Amount",
292
+ # client_token: "ClientToken",
293
+ # tags: {
294
+ # "TagKey" => "TagValue",
295
+ # },
296
+ # })
297
+ #
298
+ # @example Response structure
299
+ #
300
+ # resp.savings_plan_id #=> String
301
+ #
302
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/CreateSavingsPlan AWS API Documentation
303
+ #
304
+ # @overload create_savings_plan(params = {})
305
+ # @param [Hash] params ({})
306
+ def create_savings_plan(params = {}, options = {})
307
+ req = build_request(:create_savings_plan, params)
308
+ req.send_request(options)
309
+ end
310
+
311
+ # Describes the specified Savings Plans rates.
312
+ #
313
+ # @option params [required, String] :savings_plan_id
314
+ # The ID of the Savings Plan.
315
+ #
316
+ # @option params [Array<Types::SavingsPlanRateFilter>] :filters
317
+ # The filters.
318
+ #
319
+ # @option params [String] :next_token
320
+ # The token for the next page of results.
321
+ #
322
+ # @option params [Integer] :max_results
323
+ # The maximum number of results to return with a single call. To
324
+ # retrieve additional results, make another call with the returned token
325
+ # value.
326
+ #
327
+ # @return [Types::DescribeSavingsPlanRatesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
328
+ #
329
+ # * {Types::DescribeSavingsPlanRatesResponse#savings_plan_id #savings_plan_id} => String
330
+ # * {Types::DescribeSavingsPlanRatesResponse#search_results #search_results} => Array&lt;Types::SavingsPlanRate&gt;
331
+ # * {Types::DescribeSavingsPlanRatesResponse#next_token #next_token} => String
332
+ #
333
+ # @example Request syntax with placeholder values
334
+ #
335
+ # resp = client.describe_savings_plan_rates({
336
+ # savings_plan_id: "SavingsPlanId", # required
337
+ # filters: [
338
+ # {
339
+ # name: "region", # accepts region, instanceType, productDescription, tenancy, productType, serviceCode, usageType, operation
340
+ # values: ["String"],
341
+ # },
342
+ # ],
343
+ # next_token: "PaginationToken",
344
+ # max_results: 1,
345
+ # })
346
+ #
347
+ # @example Response structure
348
+ #
349
+ # resp.savings_plan_id #=> String
350
+ # resp.search_results #=> Array
351
+ # resp.search_results[0].rate #=> String
352
+ # resp.search_results[0].currency #=> String, one of "CNY", "USD"
353
+ # resp.search_results[0].unit #=> String, one of "Hrs"
354
+ # resp.search_results[0].product_type #=> String, one of "EC2", "Fargate"
355
+ # resp.search_results[0].service_code #=> String, one of "AmazonEC2", "AmazonECS"
356
+ # resp.search_results[0].usage_type #=> String
357
+ # resp.search_results[0].operation #=> String
358
+ # resp.search_results[0].properties #=> Array
359
+ # resp.search_results[0].properties[0].name #=> String, one of "region", "instanceType", "instanceFamily", "productDescription", "tenancy"
360
+ # resp.search_results[0].properties[0].value #=> String
361
+ # resp.next_token #=> String
362
+ #
363
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/DescribeSavingsPlanRates AWS API Documentation
364
+ #
365
+ # @overload describe_savings_plan_rates(params = {})
366
+ # @param [Hash] params ({})
367
+ def describe_savings_plan_rates(params = {}, options = {})
368
+ req = build_request(:describe_savings_plan_rates, params)
369
+ req.send_request(options)
370
+ end
371
+
372
+ # Describes the specified Savings Plans.
373
+ #
374
+ # @option params [Array<String>] :savings_plan_arns
375
+ # The Amazon Resource Names (ARN) of the Savings Plans.
376
+ #
377
+ # @option params [Array<String>] :savings_plan_ids
378
+ # The IDs of the Savings Plans.
379
+ #
380
+ # @option params [String] :next_token
381
+ # The token for the next page of results.
382
+ #
383
+ # @option params [Integer] :max_results
384
+ # The maximum number of results to return with a single call. To
385
+ # retrieve additional results, make another call with the returned token
386
+ # value.
387
+ #
388
+ # @option params [Array<String>] :states
389
+ # The states.
390
+ #
391
+ # @option params [Array<Types::SavingsPlanFilter>] :filters
392
+ # The filters.
393
+ #
394
+ # @return [Types::DescribeSavingsPlansResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
395
+ #
396
+ # * {Types::DescribeSavingsPlansResponse#savings_plans #savings_plans} => Array&lt;Types::SavingsPlan&gt;
397
+ # * {Types::DescribeSavingsPlansResponse#next_token #next_token} => String
398
+ #
399
+ # @example Request syntax with placeholder values
400
+ #
401
+ # resp = client.describe_savings_plans({
402
+ # savings_plan_arns: ["SavingsPlanArn"],
403
+ # savings_plan_ids: ["SavingsPlanId"],
404
+ # next_token: "PaginationToken",
405
+ # max_results: 1,
406
+ # states: ["payment-pending"], # accepts payment-pending, payment-failed, active, retired
407
+ # filters: [
408
+ # {
409
+ # name: "region", # accepts region, ec2-instance-family, commitment, upfront, term, savings-plan-type, payment-option, start, end
410
+ # values: ["String"],
411
+ # },
412
+ # ],
413
+ # })
414
+ #
415
+ # @example Response structure
416
+ #
417
+ # resp.savings_plans #=> Array
418
+ # resp.savings_plans[0].offering_id #=> String
419
+ # resp.savings_plans[0].savings_plan_id #=> String
420
+ # resp.savings_plans[0].savings_plan_arn #=> String
421
+ # resp.savings_plans[0].description #=> String
422
+ # resp.savings_plans[0].start #=> String
423
+ # resp.savings_plans[0].end #=> String
424
+ # resp.savings_plans[0].state #=> String, one of "payment-pending", "payment-failed", "active", "retired"
425
+ # resp.savings_plans[0].region #=> String
426
+ # resp.savings_plans[0].ec2_instance_family #=> String
427
+ # resp.savings_plans[0].savings_plan_type #=> String, one of "Compute", "EC2Instance"
428
+ # resp.savings_plans[0].payment_option #=> String, one of "All Upfront", "Partial Upfront", "No Upfront"
429
+ # resp.savings_plans[0].product_types #=> Array
430
+ # resp.savings_plans[0].product_types[0] #=> String, one of "EC2", "Fargate"
431
+ # resp.savings_plans[0].currency #=> String, one of "CNY", "USD"
432
+ # resp.savings_plans[0].commitment #=> String
433
+ # resp.savings_plans[0].upfront_payment_amount #=> String
434
+ # resp.savings_plans[0].recurring_payment_amount #=> String
435
+ # resp.savings_plans[0].term_duration_in_seconds #=> Integer
436
+ # resp.savings_plans[0].tags #=> Hash
437
+ # resp.savings_plans[0].tags["TagKey"] #=> String
438
+ # resp.next_token #=> String
439
+ #
440
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/DescribeSavingsPlans AWS API Documentation
441
+ #
442
+ # @overload describe_savings_plans(params = {})
443
+ # @param [Hash] params ({})
444
+ def describe_savings_plans(params = {}, options = {})
445
+ req = build_request(:describe_savings_plans, params)
446
+ req.send_request(options)
447
+ end
448
+
449
+ # Describes the specified Savings Plans offering rates.
450
+ #
451
+ # @option params [Array<String>] :savings_plan_offering_ids
452
+ # The IDs of the offerings.
453
+ #
454
+ # @option params [Array<String>] :savings_plan_payment_options
455
+ # The payment options.
456
+ #
457
+ # @option params [Array<String>] :savings_plan_types
458
+ # The plan types.
459
+ #
460
+ # @option params [Array<String>] :products
461
+ # The AWS products.
462
+ #
463
+ # @option params [Array<String>] :service_codes
464
+ # The services.
465
+ #
466
+ # @option params [Array<String>] :usage_types
467
+ # The usage details of the line item in the billing report.
468
+ #
469
+ # @option params [Array<String>] :operations
470
+ # The specific AWS operation for the line item in the billing report.
471
+ #
472
+ # @option params [Array<Types::SavingsPlanOfferingRateFilterElement>] :filters
473
+ # The filters.
474
+ #
475
+ # @option params [String] :next_token
476
+ # The token for the next page of results.
477
+ #
478
+ # @option params [Integer] :max_results
479
+ # The maximum number of results to return with a single call. To
480
+ # retrieve additional results, make another call with the returned token
481
+ # value.
482
+ #
483
+ # @return [Types::DescribeSavingsPlansOfferingRatesResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
484
+ #
485
+ # * {Types::DescribeSavingsPlansOfferingRatesResponse#search_results #search_results} => Array&lt;Types::SavingsPlanOfferingRate&gt;
486
+ # * {Types::DescribeSavingsPlansOfferingRatesResponse#next_token #next_token} => String
487
+ #
488
+ # @example Request syntax with placeholder values
489
+ #
490
+ # resp = client.describe_savings_plans_offering_rates({
491
+ # savings_plan_offering_ids: ["UUID"],
492
+ # savings_plan_payment_options: ["All Upfront"], # accepts All Upfront, Partial Upfront, No Upfront
493
+ # savings_plan_types: ["Compute"], # accepts Compute, EC2Instance
494
+ # products: ["EC2"], # accepts EC2, Fargate
495
+ # service_codes: ["AmazonEC2"], # accepts AmazonEC2, AmazonECS
496
+ # usage_types: ["SavingsPlanRateUsageType"],
497
+ # operations: ["SavingsPlanRateOperation"],
498
+ # filters: [
499
+ # {
500
+ # name: "region", # accepts region, instanceFamily, instanceType, productDescription, tenancy, productId
501
+ # values: ["JsonSafeFilterValueString"],
502
+ # },
503
+ # ],
504
+ # next_token: "PaginationToken",
505
+ # max_results: 1,
506
+ # })
507
+ #
508
+ # @example Response structure
509
+ #
510
+ # resp.search_results #=> Array
511
+ # resp.search_results[0].savings_plan_offering.offering_id #=> String
512
+ # resp.search_results[0].savings_plan_offering.payment_option #=> String, one of "All Upfront", "Partial Upfront", "No Upfront"
513
+ # resp.search_results[0].savings_plan_offering.plan_type #=> String, one of "Compute", "EC2Instance"
514
+ # resp.search_results[0].savings_plan_offering.duration_seconds #=> Integer
515
+ # resp.search_results[0].savings_plan_offering.currency #=> String, one of "CNY", "USD"
516
+ # resp.search_results[0].savings_plan_offering.plan_description #=> String
517
+ # resp.search_results[0].rate #=> String
518
+ # resp.search_results[0].unit #=> String, one of "Hrs"
519
+ # resp.search_results[0].product_type #=> String, one of "EC2", "Fargate"
520
+ # resp.search_results[0].service_code #=> String, one of "AmazonEC2", "AmazonECS"
521
+ # resp.search_results[0].usage_type #=> String
522
+ # resp.search_results[0].operation #=> String
523
+ # resp.search_results[0].properties #=> Array
524
+ # resp.search_results[0].properties[0].name #=> String
525
+ # resp.search_results[0].properties[0].value #=> String
526
+ # resp.next_token #=> String
527
+ #
528
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/DescribeSavingsPlansOfferingRates AWS API Documentation
529
+ #
530
+ # @overload describe_savings_plans_offering_rates(params = {})
531
+ # @param [Hash] params ({})
532
+ def describe_savings_plans_offering_rates(params = {}, options = {})
533
+ req = build_request(:describe_savings_plans_offering_rates, params)
534
+ req.send_request(options)
535
+ end
536
+
537
+ # Describes the specified Savings Plans offerings.
538
+ #
539
+ # @option params [Array<String>] :offering_ids
540
+ # The IDs of the offerings.
541
+ #
542
+ # @option params [Array<String>] :payment_options
543
+ # The payment options.
544
+ #
545
+ # @option params [String] :product_type
546
+ # The product type.
547
+ #
548
+ # @option params [Array<String>] :plan_types
549
+ # The plan type.
550
+ #
551
+ # @option params [Array<Integer>] :durations
552
+ # The durations, in seconds.
553
+ #
554
+ # @option params [Array<String>] :currencies
555
+ # The currencies.
556
+ #
557
+ # @option params [Array<String>] :descriptions
558
+ # The descriptions.
559
+ #
560
+ # @option params [Array<String>] :service_codes
561
+ # The services.
562
+ #
563
+ # @option params [Array<String>] :usage_types
564
+ # The usage details of the line item in the billing report.
565
+ #
566
+ # @option params [Array<String>] :operations
567
+ # The specific AWS operation for the line item in the billing report.
568
+ #
569
+ # @option params [Array<Types::SavingsPlanOfferingFilterElement>] :filters
570
+ # The filters.
571
+ #
572
+ # @option params [String] :next_token
573
+ # The token for the next page of results.
574
+ #
575
+ # @option params [Integer] :max_results
576
+ # The maximum number of results to return with a single call. To
577
+ # retrieve additional results, make another call with the returned token
578
+ # value.
579
+ #
580
+ # @return [Types::DescribeSavingsPlansOfferingsResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
581
+ #
582
+ # * {Types::DescribeSavingsPlansOfferingsResponse#search_results #search_results} => Array&lt;Types::SavingsPlanOffering&gt;
583
+ # * {Types::DescribeSavingsPlansOfferingsResponse#next_token #next_token} => String
584
+ #
585
+ # @example Request syntax with placeholder values
586
+ #
587
+ # resp = client.describe_savings_plans_offerings({
588
+ # offering_ids: ["UUID"],
589
+ # payment_options: ["All Upfront"], # accepts All Upfront, Partial Upfront, No Upfront
590
+ # product_type: "EC2", # accepts EC2, Fargate
591
+ # plan_types: ["Compute"], # accepts Compute, EC2Instance
592
+ # durations: [1],
593
+ # currencies: ["CNY"], # accepts CNY, USD
594
+ # descriptions: ["SavingsPlanDescription"],
595
+ # service_codes: ["SavingsPlanServiceCode"],
596
+ # usage_types: ["SavingsPlanUsageType"],
597
+ # operations: ["SavingsPlanOperation"],
598
+ # filters: [
599
+ # {
600
+ # name: "region", # accepts region, instanceFamily
601
+ # values: ["JsonSafeFilterValueString"],
602
+ # },
603
+ # ],
604
+ # next_token: "PaginationToken",
605
+ # max_results: 1,
606
+ # })
607
+ #
608
+ # @example Response structure
609
+ #
610
+ # resp.search_results #=> Array
611
+ # resp.search_results[0].offering_id #=> String
612
+ # resp.search_results[0].product_types #=> Array
613
+ # resp.search_results[0].product_types[0] #=> String, one of "EC2", "Fargate"
614
+ # resp.search_results[0].plan_type #=> String, one of "Compute", "EC2Instance"
615
+ # resp.search_results[0].description #=> String
616
+ # resp.search_results[0].payment_option #=> String, one of "All Upfront", "Partial Upfront", "No Upfront"
617
+ # resp.search_results[0].duration_seconds #=> Integer
618
+ # resp.search_results[0].currency #=> String, one of "CNY", "USD"
619
+ # resp.search_results[0].service_code #=> String
620
+ # resp.search_results[0].usage_type #=> String
621
+ # resp.search_results[0].operation #=> String
622
+ # resp.search_results[0].properties #=> Array
623
+ # resp.search_results[0].properties[0].name #=> String, one of "region", "instanceFamily"
624
+ # resp.search_results[0].properties[0].value #=> String
625
+ # resp.next_token #=> String
626
+ #
627
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/DescribeSavingsPlansOfferings AWS API Documentation
628
+ #
629
+ # @overload describe_savings_plans_offerings(params = {})
630
+ # @param [Hash] params ({})
631
+ def describe_savings_plans_offerings(params = {}, options = {})
632
+ req = build_request(:describe_savings_plans_offerings, params)
633
+ req.send_request(options)
634
+ end
635
+
636
+ # Lists the tags for the specified resource.
637
+ #
638
+ # @option params [required, String] :resource_arn
639
+ # The Amazon Resource Name (ARN) of the resource.
640
+ #
641
+ # @return [Types::ListTagsForResourceResponse] Returns a {Seahorse::Client::Response response} object which responds to the following methods:
642
+ #
643
+ # * {Types::ListTagsForResourceResponse#tags #tags} => Hash&lt;String,String&gt;
644
+ #
645
+ # @example Request syntax with placeholder values
646
+ #
647
+ # resp = client.list_tags_for_resource({
648
+ # resource_arn: "SavingsPlanArn", # required
649
+ # })
650
+ #
651
+ # @example Response structure
652
+ #
653
+ # resp.tags #=> Hash
654
+ # resp.tags["TagKey"] #=> String
655
+ #
656
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/ListTagsForResource AWS API Documentation
657
+ #
658
+ # @overload list_tags_for_resource(params = {})
659
+ # @param [Hash] params ({})
660
+ def list_tags_for_resource(params = {}, options = {})
661
+ req = build_request(:list_tags_for_resource, params)
662
+ req.send_request(options)
663
+ end
664
+
665
+ # Adds the specified tags to the specified resource.
666
+ #
667
+ # @option params [required, String] :resource_arn
668
+ # The Amazon Resource Name (ARN) of the resource.
669
+ #
670
+ # @option params [required, Hash<String,String>] :tags
671
+ # One or more tags. For example, \\\{ "tags": \\\{"key1":"value1",
672
+ # "key2":"value2"\\} \\}.
673
+ #
674
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
675
+ #
676
+ # @example Request syntax with placeholder values
677
+ #
678
+ # resp = client.tag_resource({
679
+ # resource_arn: "SavingsPlanArn", # required
680
+ # tags: { # required
681
+ # "TagKey" => "TagValue",
682
+ # },
683
+ # })
684
+ #
685
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/TagResource AWS API Documentation
686
+ #
687
+ # @overload tag_resource(params = {})
688
+ # @param [Hash] params ({})
689
+ def tag_resource(params = {}, options = {})
690
+ req = build_request(:tag_resource, params)
691
+ req.send_request(options)
692
+ end
693
+
694
+ # Removes the specified tags from the specified resource.
695
+ #
696
+ # @option params [required, String] :resource_arn
697
+ # The Amazon Resource Name (ARN) of the resource.
698
+ #
699
+ # @option params [required, Array<String>] :tag_keys
700
+ # The tag keys.
701
+ #
702
+ # @return [Struct] Returns an empty {Seahorse::Client::Response response}.
703
+ #
704
+ # @example Request syntax with placeholder values
705
+ #
706
+ # resp = client.untag_resource({
707
+ # resource_arn: "SavingsPlanArn", # required
708
+ # tag_keys: ["TagKey"], # required
709
+ # })
710
+ #
711
+ # @see http://docs.aws.amazon.com/goto/WebAPI/savingsplans-2019-06-28/UntagResource AWS API Documentation
712
+ #
713
+ # @overload untag_resource(params = {})
714
+ # @param [Hash] params ({})
715
+ def untag_resource(params = {}, options = {})
716
+ req = build_request(:untag_resource, params)
717
+ req.send_request(options)
718
+ end
719
+
720
+ # @!endgroup
721
+
722
+ # @param params ({})
723
+ # @api private
724
+ def build_request(operation_name, params = {})
725
+ handlers = @handlers.for(operation_name)
726
+ context = Seahorse::Client::RequestContext.new(
727
+ operation_name: operation_name,
728
+ operation: config.api.operation(operation_name),
729
+ client: self,
730
+ params: params,
731
+ config: config)
732
+ context[:gem_name] = 'aws-sdk-savingsplans'
733
+ context[:gem_version] = '1.0.0'
734
+ Seahorse::Client::Request.new(handlers, context)
735
+ end
736
+
737
+ # @api private
738
+ # @deprecated
739
+ def waiter_names
740
+ []
741
+ end
742
+
743
+ class << self
744
+
745
+ # @api private
746
+ attr_reader :identifier
747
+
748
+ # @api private
749
+ def errors_module
750
+ Errors
751
+ end
752
+
753
+ end
754
+ end
755
+ end