lib/aws-sdk-mediaconnect/client.rb in aws-sdk-mediaconnect-1.31.0 vs lib/aws-sdk-mediaconnect/client.rb in aws-sdk-mediaconnect-1.32.0

- old
+ new

@@ -390,10 +390,11 @@ # resp.outputs[0].encryption.resource_id #=> String # resp.outputs[0].encryption.role_arn #=> String # resp.outputs[0].encryption.secret_arn #=> String # resp.outputs[0].encryption.url #=> String # resp.outputs[0].entitlement_arn #=> String + # resp.outputs[0].listener_address #=> String # resp.outputs[0].media_live_input_arn #=> String # resp.outputs[0].name #=> String # resp.outputs[0].output_arn #=> String # resp.outputs[0].port #=> Integer # resp.outputs[0].transport.cidr_allow_list #=> Array @@ -734,10 +735,11 @@ # resp.flow.outputs[0].encryption.resource_id #=> String # resp.flow.outputs[0].encryption.role_arn #=> String # resp.flow.outputs[0].encryption.secret_arn #=> String # resp.flow.outputs[0].encryption.url #=> String # resp.flow.outputs[0].entitlement_arn #=> String + # resp.flow.outputs[0].listener_address #=> String # resp.flow.outputs[0].media_live_input_arn #=> String # resp.flow.outputs[0].name #=> String # resp.flow.outputs[0].output_arn #=> String # resp.flow.outputs[0].port #=> Integer # resp.flow.outputs[0].transport.cidr_allow_list #=> Array @@ -908,10 +910,11 @@ # resp.flow.outputs[0].encryption.resource_id #=> String # resp.flow.outputs[0].encryption.role_arn #=> String # resp.flow.outputs[0].encryption.secret_arn #=> String # resp.flow.outputs[0].encryption.url #=> String # resp.flow.outputs[0].entitlement_arn #=> String + # resp.flow.outputs[0].listener_address #=> String # resp.flow.outputs[0].media_live_input_arn #=> String # resp.flow.outputs[0].name #=> String # resp.flow.outputs[0].output_arn #=> String # resp.flow.outputs[0].port #=> Integer # resp.flow.outputs[0].transport.cidr_allow_list #=> Array @@ -991,10 +994,17 @@ # resp.flow.vpc_interfaces[0].security_group_ids[0] #=> String # resp.flow.vpc_interfaces[0].subnet_id #=> String # resp.messages.errors #=> Array # resp.messages.errors[0] #=> String # + # + # The following waiters are defined for this operation (see {Client#wait_until} for detailed usage): + # + # * flow_active + # * flow_deleted + # * flow_standby + # # @see http://docs.aws.amazon.com/goto/WebAPI/mediaconnect-2018-11-14/DescribeFlow AWS API Documentation # # @overload describe_flow(params = {}) # @param [Hash] params ({}) def describe_flow(params = {}, options = {}) @@ -1721,10 +1731,11 @@ # resp.flow.outputs[0].encryption.resource_id #=> String # resp.flow.outputs[0].encryption.role_arn #=> String # resp.flow.outputs[0].encryption.secret_arn #=> String # resp.flow.outputs[0].encryption.url #=> String # resp.flow.outputs[0].entitlement_arn #=> String + # resp.flow.outputs[0].listener_address #=> String # resp.flow.outputs[0].media_live_input_arn #=> String # resp.flow.outputs[0].name #=> String # resp.flow.outputs[0].output_arn #=> String # resp.flow.outputs[0].port #=> Integer # resp.flow.outputs[0].transport.cidr_allow_list #=> Array @@ -1999,10 +2010,11 @@ # resp.output.encryption.resource_id #=> String # resp.output.encryption.role_arn #=> String # resp.output.encryption.secret_arn #=> String # resp.output.encryption.url #=> String # resp.output.entitlement_arn #=> String + # resp.output.listener_address #=> String # resp.output.media_live_input_arn #=> String # resp.output.name #=> String # resp.output.output_arn #=> String # resp.output.port #=> Integer # resp.output.transport.cidr_allow_list #=> Array @@ -2160,17 +2172,134 @@ operation: config.api.operation(operation_name), client: self, params: params, config: config) context[:gem_name] = 'aws-sdk-mediaconnect' - context[:gem_version] = '1.31.0' + context[:gem_version] = '1.32.0' Seahorse::Client::Request.new(handlers, context) end + # Polls an API operation until a resource enters a desired state. + # + # ## Basic Usage + # + # A waiter will call an API operation until: + # + # * It is successful + # * It enters a terminal state + # * It makes the maximum number of attempts + # + # In between attempts, the waiter will sleep. + # + # # polls in a loop, sleeping between attempts + # client.wait_until(waiter_name, params) + # + # ## Configuration + # + # You can configure the maximum number of polling attempts, and the + # delay (in seconds) between each polling attempt. You can pass + # configuration as the final arguments hash. + # + # # poll for ~25 seconds + # client.wait_until(waiter_name, params, { + # max_attempts: 5, + # delay: 5, + # }) + # + # ## Callbacks + # + # You can be notified before each polling attempt and before each + # delay. If you throw `:success` or `:failure` from these callbacks, + # it will terminate the waiter. + # + # started_at = Time.now + # client.wait_until(waiter_name, params, { + # + # # disable max attempts + # max_attempts: nil, + # + # # poll for 1 hour, instead of a number of attempts + # before_wait: -> (attempts, response) do + # throw :failure if Time.now - started_at > 3600 + # end + # }) + # + # ## Handling Errors + # + # When a waiter is unsuccessful, it will raise an error. + # All of the failure errors extend from + # {Aws::Waiters::Errors::WaiterFailed}. + # + # begin + # client.wait_until(...) + # rescue Aws::Waiters::Errors::WaiterFailed + # # resource did not enter the desired state in time + # end + # + # ## Valid Waiters + # + # The following table lists the valid waiter names, the operations they call, + # and the default `:delay` and `:max_attempts` values. + # + # | waiter_name | params | :delay | :max_attempts | + # | ------------ | ---------------------- | -------- | ------------- | + # | flow_active | {Client#describe_flow} | 3 | 40 | + # | flow_deleted | {Client#describe_flow} | 3 | 40 | + # | flow_standby | {Client#describe_flow} | 3 | 40 | + # + # @raise [Errors::FailureStateError] Raised when the waiter terminates + # because the waiter has entered a state that it will not transition + # out of, preventing success. + # + # @raise [Errors::TooManyAttemptsError] Raised when the configured + # maximum number of attempts have been made, and the waiter is not + # yet successful. + # + # @raise [Errors::UnexpectedError] Raised when an error is encounted + # while polling for a resource that is not expected. + # + # @raise [Errors::NoSuchWaiterError] Raised when you request to wait + # for an unknown state. + # + # @return [Boolean] Returns `true` if the waiter was successful. + # @param [Symbol] waiter_name + # @param [Hash] params ({}) + # @param [Hash] options ({}) + # @option options [Integer] :max_attempts + # @option options [Integer] :delay + # @option options [Proc] :before_attempt + # @option options [Proc] :before_wait + def wait_until(waiter_name, params = {}, options = {}) + w = waiter(waiter_name, options) + yield(w.waiter) if block_given? # deprecated + w.wait(params) + end + # @api private # @deprecated def waiter_names - [] + waiters.keys + end + + private + + # @param [Symbol] waiter_name + # @param [Hash] options ({}) + def waiter(waiter_name, options = {}) + waiter_class = waiters[waiter_name] + if waiter_class + waiter_class.new(options.merge(client: self)) + else + raise Aws::Waiters::Errors::NoSuchWaiterError.new(waiter_name, waiters.keys) + end + end + + def waiters + { + flow_active: Waiters::FlowActive, + flow_deleted: Waiters::FlowDeleted, + flow_standby: Waiters::FlowStandby + } end class << self # @api private