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 + ' ' + "Waits until this \#{resource_class_name} is \#{state}. This method\nwaits by polling {Client#\#{api_request_name}} until successful. An error is\nraised after a configurable number of failed checks.\n\nThis waiter uses the following defaults:\n\n| Configuration   | Default                |\n|-----------------|------------------------|\n| `#delay`        | \#{waiter.delay}        |\n| `#max_attempts` | \#{waiter.max_attempts} |\n\nYou can modify defaults and register callbacks by passing a block argument.\[email protected] [Waiters::Waiter] waiter\[email protected] [Waiters::Errors::WaiterFailed]\[email protected] Client#wait_until\n".lstrip
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 Basic usage\n\#{variable_name}.\#{operation_name}\n\[email protected] Modify default configuration\n\#{variable_name}.\#{operation_name} do |w|\nw.interval = 10\nw.max_attempts = 100\nw.before_attempt { |count| ... }\nw.before_wait do { |count, prev_resp| ... }\nend\n".strip
  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