Class: Aws::Resources::Documenter::WaiterOperationDocumenter

Inherits:
BaseOperationDocumenter show all
Defined in:
aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb

Instance Attribute Summary

Attributes inherited from BaseOperationDocumenter

#builder, #called_operation, #operation_name, #resource_class, #resource_class_name, #source, #target_resource_class, #target_resource_class_name, #yard_class

Instance Method Summary collapse

Methods inherited from BaseOperationDocumenter

#initialize, #method_object

Constructor Details

This class inherits a constructor from Aws::Resources::Documenter::BaseOperationDocumenter

Instance Method Details

#api_requestObject


46
47
48
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 46

def api_request
  @resource_class.client_class.api.operation(api_request_name)
end

#api_request_nameObject


54
55
56
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 54

def api_request_name
  waiter.poller.operation_name
end

#api_request_paramsObject


50
51
52
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 50

def api_request_params
  @operation.params
end

#docstringObject


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 6

def docstring
  super + ' ' + <<-DOCSTRING.lstrip
Waits until this #{resource_class_name} is #{state}. This method
waits by polling {Client##{api_request_name}} until successful. An error is
raised after a configurable number of failed checks.

This waiter uses the following defaults:

| Configuration   | Default                |
|-----------------|------------------------|
| `#delay`        | #{waiter.delay}        |
| `#max_attempts` | #{waiter.max_attempts} |

You can modify defaults and register callbacks by passing a block argument.
@yieldparam [Waiters::Waiter] waiter
@raise [Waiters::Errors::WaiterFailed]
@see Client#wait_until
  DOCSTRING
end

#example_tagsObject


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 62

def example_tags
  tag = <<-EXAMPLE.strip
@example Basic usage
  #{variable_name}.#{operation_name}

@example Modify default configuration
  #{variable_name}.#{operation_name} do |w|
     w.interval = 10
     w.max_attempts = 100
     w.before_attempt { |count| ... }
     w.before_wait do { |count, prev_resp| ... }
  end
  EXAMPLE
  YARD::DocstringParser.new.parse(tag).to_docstring.tags
end

#option_tagsObject


58
59
60
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 58

def option_tags
  []
end

#return_messageObject


30
31
32
33
34
35
36
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 30

def return_message
  if @operation.path
    "Returns a copy of this #{resource_class_name} with loaded data."
  else
    "Returns a copy of this #{resource_class_name} that is not loaded."
  end
end

#return_typeObject


26
27
28
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 26

def return_type
  [resource_class_name]
end

#stateObject


38
39
40
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 38

def state
  operation_name.to_s.sub('wait_until_', '')
end

#waiterObject


42
43
44
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 42

def waiter
  @resource_class.client_class.waiters.waiter(@operation.waiter_name)
end