class Seahorse::Model::Operation
def deprecated?
-
(Boolean)
- Returns `true` if this API operation is deprecated.
def deprecated? !!@definition['deprecated'] end
def errors
-
(Enumerator)
- Returns an enumerator that yields error
def errors errors = (definition['errors'] || []) errors = errors.map { |error| shape_for(error) } errors.enum_for(:each) end
def http_method
-
(String)
-
def http_method (@definition['http'] || {})['method'] || 'POST' end
def http_request_uri
-
(String)
-
def http_request_uri (@definition['http'] || {})['requestUri'] || '/' end
def initialize(definition = {}, options = {})
(**options)
-
:shape_map
(ShapeMap
) --
Parameters:
-
definition
(Hash
) --
def initialize(definition = {}, options = {}) @definition = definition @shape_map = options[:shape_map] || ShapeMap.new @name = definition['name'] @input = shape_for(definition['input']) if definition['input'] @output = shape_for(definition['output']) if definition['output'] @deprecated = !!definition['deprecated'] @documentation = definition['documentation'] @paging = definition['paging'] || {} end
def shape_for(definition)
def shape_for(definition) if definition.key?('shape') @shape_map.shape(definition) else Shapes::Shape.new(definition, shape_map: @shape_map) end end