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

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

Instance Attribute Summary

Attributes inherited from BaseOperationDocumenter

#api_request_params, #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 '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



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

def api_request_name
  waiter.poller.operation_name
end

#docstringObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File '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.\n@yieldparam [Waiters::Waiter] waiter\n@raise [Waiters::Errors::WaiterFailed]\n@see Client#wait_until\n".lstrip
end

#example_tagsObject



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 58

def example_tags
  example = "@example Basic usage\n\#{variable_name}.\#{operation_name}\n\n@example 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
  [tag(example)]
end

#option_tagsObject



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

def option_tags
  []
end

#return_messageObject



30
31
32
33
34
35
36
# File '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_tagObject



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

def return_tag
  tag("@return [#{resource_class_name}] #{return_message}")
end

#stateObject



38
39
40
# File '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 'lib/aws-sdk-resources/documenter/waiter_operation_documenter.rb', line 42

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