Class: Seahorse::Model::Operation

Inherits:
Object
  • Object
show all
Defined in:
aws-sdk-core/lib/seahorse/model/operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition = {}, options = {}) ⇒ Operation

Returns a new instance of Operation

Parameters:

  • definition (Hash) (defaults to: {})
  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :shape_map (ShapeMap)

7
8
9
10
11
12
13
14
15
16
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 7

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

Instance Attribute Details

#definitionHash (readonly)

Returns:

  • (Hash)

40
41
42
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 40

def definition
  @definition
end

#documentationString<HTML>? (readonly)

Returns:

  • (String<HTML>, nil)

28
29
30
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 28

def documentation
  @documentation
end

#http_methodString (readonly)

Returns:

  • (String)

22
23
24
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 22

def http_method
  @http_method
end

#http_request_uriString (readonly)

Returns:

  • (String)

25
26
27
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 25

def http_request_uri
  @http_request_uri
end

#inputShape? (readonly)

Returns:

  • (Shape, nil)

31
32
33
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 31

def input
  @input
end

#nameString (readonly)

Returns:

  • (String)

19
20
21
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 19

def name
  @name
end

#outputShape? (readonly)

Returns:

  • (Shape, nil)

34
35
36
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 34

def output
  @output
end

#pagingHash (readonly)

Returns:

  • (Hash)

37
38
39
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 37

def paging
  @paging
end

Instance Method Details

#deprecated?Boolean

Returns true if this API operation is deprecated.

Returns:

  • (Boolean)

    Returns true if this API operation is deprecated.


53
54
55
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 53

def deprecated?
  !!@definition['deprecated']
end

#errorsEnumerator

Returns an enumerator that yields error shapes.

Returns:

  • (Enumerator)

    Returns an enumerator that yields error shapes.


59
60
61
62
63
# File 'aws-sdk-core/lib/seahorse/model/operation.rb', line 59

def errors
  errors = (definition['errors'] || [])
  errors = errors.map { |error| shape_for(error) }
  errors.enum_for(:each)
end