aws-sdk-appconfig 1.11.0 → 1.67.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,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
+ require 'aws-sdk-core/waiters'
11
+
12
+ module Aws::AppConfig
13
+ # Waiters are utility methods that poll for a particular state to occur
14
+ # on a client. Waiters can fail after a number of attempts at a polling
15
+ # interval defined for the service client.
16
+ #
17
+ # For a list of operations that can be waited for and the
18
+ # client methods called for each operation, see the table below or the
19
+ # {Client#wait_until} field documentation for the {Client}.
20
+ #
21
+ # # Invoking a Waiter
22
+ # To invoke a waiter, call #wait_until on a {Client}. The first parameter
23
+ # is the waiter name, which is specific to the service client and indicates
24
+ # which operation is being waited for. The second parameter is a hash of
25
+ # parameters that are passed to the client method called by the waiter,
26
+ # which varies according to the waiter name.
27
+ #
28
+ # # Wait Failures
29
+ # To catch errors in a waiter, use WaiterFailed,
30
+ # as shown in the following example.
31
+ #
32
+ # rescue rescue Aws::Waiters::Errors::WaiterFailed => error
33
+ # puts "failed waiting for instance running: #{error.message}
34
+ # end
35
+ #
36
+ # # Configuring a Waiter
37
+ # Each waiter has a default polling interval and a maximum number of
38
+ # attempts it will make before returning control to your program.
39
+ # To set these values, use the `max_attempts` and `delay` parameters
40
+ # in your `#wait_until` call.
41
+ # The following example waits for up to 25 seconds, polling every five seconds.
42
+ #
43
+ # client.wait_until(...) do |w|
44
+ # w.max_attempts = 5
45
+ # w.delay = 5
46
+ # end
47
+ #
48
+ # To disable wait failures, set the value of either of these parameters
49
+ # to `nil`.
50
+ #
51
+ # # Extending a Waiter
52
+ # To modify the behavior of waiters, you can register callbacks that are
53
+ # triggered before each polling attempt and before waiting.
54
+ #
55
+ # The following example implements an exponential backoff in a waiter
56
+ # by doubling the amount of time to wait on every attempt.
57
+ #
58
+ # client.wait_until(...) do |w|
59
+ # w.interval = 0 # disable normal sleep
60
+ # w.before_wait do |n, resp|
61
+ # sleep(n ** 2)
62
+ # end
63
+ # end
64
+ #
65
+ # # Available Waiters
66
+ #
67
+ # The following table lists the valid waiter names, the operations they call,
68
+ # and the default `:delay` and `:max_attempts` values.
69
+ #
70
+ # | waiter_name | params | :delay | :max_attempts |
71
+ # | -------------------------------- | ------------------------ | -------- | ------------- |
72
+ # | deployment_complete | {Client#get_deployment} | 30 | 999 |
73
+ # | environment_ready_for_deployment | {Client#get_environment} | 30 | 999 |
74
+ #
75
+ module Waiters
76
+
77
+ class DeploymentComplete
78
+
79
+ # @param [Hash] options
80
+ # @option options [required, Client] :client
81
+ # @option options [Integer] :max_attempts (999)
82
+ # @option options [Integer] :delay (30)
83
+ # @option options [Proc] :before_attempt
84
+ # @option options [Proc] :before_wait
85
+ def initialize(options)
86
+ @client = options.fetch(:client)
87
+ @waiter = Aws::Waiters::Waiter.new({
88
+ max_attempts: 999,
89
+ delay: 30,
90
+ poller: Aws::Waiters::Poller.new(
91
+ operation_name: :get_deployment,
92
+ acceptors: [
93
+ {
94
+ "state" => "success",
95
+ "matcher" => "path",
96
+ "argument" => "state",
97
+ "expected" => "COMPLETE"
98
+ },
99
+ {
100
+ "state" => "failure",
101
+ "matcher" => "path",
102
+ "argument" => "state",
103
+ "expected" => "ROLLED_BACK"
104
+ },
105
+ {
106
+ "state" => "failure",
107
+ "matcher" => "path",
108
+ "argument" => "state",
109
+ "expected" => "REVERTED"
110
+ }
111
+ ]
112
+ )
113
+ }.merge(options))
114
+ end
115
+
116
+ # @option (see Client#get_deployment)
117
+ # @return (see Client#get_deployment)
118
+ def wait(params = {})
119
+ @waiter.wait(client: @client, params: params)
120
+ end
121
+
122
+ # @api private
123
+ attr_reader :waiter
124
+
125
+ end
126
+
127
+ class EnvironmentReadyForDeployment
128
+
129
+ # @param [Hash] options
130
+ # @option options [required, Client] :client
131
+ # @option options [Integer] :max_attempts (999)
132
+ # @option options [Integer] :delay (30)
133
+ # @option options [Proc] :before_attempt
134
+ # @option options [Proc] :before_wait
135
+ def initialize(options)
136
+ @client = options.fetch(:client)
137
+ @waiter = Aws::Waiters::Waiter.new({
138
+ max_attempts: 999,
139
+ delay: 30,
140
+ poller: Aws::Waiters::Poller.new(
141
+ operation_name: :get_environment,
142
+ acceptors: [
143
+ {
144
+ "state" => "success",
145
+ "matcher" => "path",
146
+ "argument" => "state",
147
+ "expected" => "ReadyForDeployment"
148
+ },
149
+ {
150
+ "state" => "failure",
151
+ "matcher" => "path",
152
+ "argument" => "state",
153
+ "expected" => "RolledBack"
154
+ },
155
+ {
156
+ "state" => "failure",
157
+ "matcher" => "path",
158
+ "argument" => "state",
159
+ "expected" => "Reverted"
160
+ }
161
+ ]
162
+ )
163
+ }.merge(options))
164
+ end
165
+
166
+ # @option (see Client#get_environment)
167
+ # @return (see Client#get_environment)
168
+ def wait(params = {})
169
+ @waiter.wait(client: @client, params: params)
170
+ end
171
+
172
+ # @api private
173
+ attr_reader :waiter
174
+
175
+ end
176
+ end
177
+ end
@@ -3,7 +3,7 @@
3
3
  # WARNING ABOUT GENERATED CODE
4
4
  #
5
5
  # This file is generated. See the contributing guide for more information:
6
- # https://github.com/aws/aws-sdk-ruby/blob/master/CONTRIBUTING.md
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
@@ -11,12 +11,7 @@
11
11
  require 'aws-sdk-core'
12
12
  require 'aws-sigv4'
13
13
 
14
- require_relative 'aws-sdk-appconfig/types'
15
- require_relative 'aws-sdk-appconfig/client_api'
16
- require_relative 'aws-sdk-appconfig/client'
17
- require_relative 'aws-sdk-appconfig/errors'
18
- require_relative 'aws-sdk-appconfig/resource'
19
- require_relative 'aws-sdk-appconfig/customizations'
14
+ Aws::Plugins::GlobalConfiguration.add_identifier(:appconfig)
20
15
 
21
16
  # This module provides support for Amazon AppConfig. This module is available in the
22
17
  # `aws-sdk-appconfig` gem.
@@ -47,7 +42,21 @@ require_relative 'aws-sdk-appconfig/customizations'
47
42
  #
48
43
  # @!group service
49
44
  module Aws::AppConfig
45
+ autoload :Types, 'aws-sdk-appconfig/types'
46
+ autoload :ClientApi, 'aws-sdk-appconfig/client_api'
47
+ module Plugins
48
+ autoload :Endpoints, 'aws-sdk-appconfig/plugins/endpoints.rb'
49
+ end
50
+ autoload :Client, 'aws-sdk-appconfig/client'
51
+ autoload :Errors, 'aws-sdk-appconfig/errors'
52
+ autoload :Waiters, 'aws-sdk-appconfig/waiters'
53
+ autoload :Resource, 'aws-sdk-appconfig/resource'
54
+ autoload :EndpointParameters, 'aws-sdk-appconfig/endpoint_parameters'
55
+ autoload :EndpointProvider, 'aws-sdk-appconfig/endpoint_provider'
56
+ autoload :Endpoints, 'aws-sdk-appconfig/endpoints'
50
57
 
51
- GEM_VERSION = '1.11.0'
58
+ GEM_VERSION = '1.67.0'
52
59
 
53
60
  end
61
+
62
+ require_relative 'aws-sdk-appconfig/customizations'