lib/aws-sdk-medialive/waiters.rb in aws-sdk-medialive-1.38.0 vs lib/aws-sdk-medialive/waiters.rb in aws-sdk-medialive-1.39.0

- old
+ new

@@ -213,7 +213,213 @@ # @api private attr_reader :waiter end + + # Wait until a multiplex has been created + class MultiplexCreated + + # @param [Hash] options + # @option options [required, Client] :client + # @option options [Integer] :max_attempts (5) + # @option options [Integer] :delay (3) + # @option options [Proc] :before_attempt + # @option options [Proc] :before_wait + def initialize(options) + @client = options.fetch(:client) + @waiter = Aws::Waiters::Waiter.new({ + max_attempts: 5, + delay: 3, + poller: Aws::Waiters::Poller.new( + operation_name: :describe_multiplex, + acceptors: [ + { + "state" => "success", + "matcher" => "path", + "argument" => "state", + "expected" => "IDLE" + }, + { + "state" => "retry", + "matcher" => "path", + "argument" => "state", + "expected" => "CREATING" + }, + { + "state" => "retry", + "matcher" => "status", + "expected" => 500 + }, + { + "state" => "failure", + "matcher" => "path", + "argument" => "state", + "expected" => "CREATE_FAILED" + } + ] + ) + }.merge(options)) + end + + # @option (see Client#describe_multiplex) + # @return (see Client#describe_multiplex) + def wait(params = {}) + @waiter.wait(client: @client, params: params) + end + + # @api private + attr_reader :waiter + + end + + # Wait until a multiplex has been deleted + class MultiplexDeleted + + # @param [Hash] options + # @option options [required, Client] :client + # @option options [Integer] :max_attempts (20) + # @option options [Integer] :delay (5) + # @option options [Proc] :before_attempt + # @option options [Proc] :before_wait + def initialize(options) + @client = options.fetch(:client) + @waiter = Aws::Waiters::Waiter.new({ + max_attempts: 20, + delay: 5, + poller: Aws::Waiters::Poller.new( + operation_name: :describe_multiplex, + acceptors: [ + { + "state" => "success", + "matcher" => "path", + "argument" => "state", + "expected" => "DELETED" + }, + { + "state" => "retry", + "matcher" => "path", + "argument" => "state", + "expected" => "DELETING" + }, + { + "state" => "retry", + "matcher" => "status", + "expected" => 500 + } + ] + ) + }.merge(options)) + end + + # @option (see Client#describe_multiplex) + # @return (see Client#describe_multiplex) + def wait(params = {}) + @waiter.wait(client: @client, params: params) + end + + # @api private + attr_reader :waiter + + end + + # Wait until a multiplex is running + class MultiplexRunning + + # @param [Hash] options + # @option options [required, Client] :client + # @option options [Integer] :max_attempts (120) + # @option options [Integer] :delay (5) + # @option options [Proc] :before_attempt + # @option options [Proc] :before_wait + def initialize(options) + @client = options.fetch(:client) + @waiter = Aws::Waiters::Waiter.new({ + max_attempts: 120, + delay: 5, + poller: Aws::Waiters::Poller.new( + operation_name: :describe_multiplex, + acceptors: [ + { + "state" => "success", + "matcher" => "path", + "argument" => "state", + "expected" => "RUNNING" + }, + { + "state" => "retry", + "matcher" => "path", + "argument" => "state", + "expected" => "STARTING" + }, + { + "state" => "retry", + "matcher" => "status", + "expected" => 500 + } + ] + ) + }.merge(options)) + end + + # @option (see Client#describe_multiplex) + # @return (see Client#describe_multiplex) + def wait(params = {}) + @waiter.wait(client: @client, params: params) + end + + # @api private + attr_reader :waiter + + end + + # Wait until a multiplex has is stopped + class MultiplexStopped + + # @param [Hash] options + # @option options [required, Client] :client + # @option options [Integer] :max_attempts (28) + # @option options [Integer] :delay (5) + # @option options [Proc] :before_attempt + # @option options [Proc] :before_wait + def initialize(options) + @client = options.fetch(:client) + @waiter = Aws::Waiters::Waiter.new({ + max_attempts: 28, + delay: 5, + poller: Aws::Waiters::Poller.new( + operation_name: :describe_multiplex, + acceptors: [ + { + "state" => "success", + "matcher" => "path", + "argument" => "state", + "expected" => "IDLE" + }, + { + "state" => "retry", + "matcher" => "path", + "argument" => "state", + "expected" => "STOPPING" + }, + { + "state" => "retry", + "matcher" => "status", + "expected" => 500 + } + ] + ) + }.merge(options)) + end + + # @option (see Client#describe_multiplex) + # @return (see Client#describe_multiplex) + def wait(params = {}) + @waiter.wait(client: @client, params: params) + end + + # @api private + attr_reader :waiter + + end end end