Class: Seahorse::Model::Shapes::ShapeRef

Inherits:
Object
  • Object
show all
Defined in:
lib/seahorse/model/shapes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ShapeRef

Returns a new instance of ShapeRef



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/seahorse/model/shapes.rb', line 9

def initialize(options = {})
  @metadata = {}
  @required = false
  @deprecated = false
  @location = nil
  @location_name = nil
  @event = false
  @eventstream = false
  @eventpayload = false
  @eventpayload_type = ''
  @eventheader = false
  @eventheader_type = ''
  options.each do |key, value|
    if key == :metadata
      value.each do |k,v|
        self[k] = v
      end
    else
      send("#{key}=", value)
    end
  end
end

Instance Attribute Details

#deprecatedBoolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/seahorse/model/shapes.rb', line 42

def deprecated
  @deprecated
end

#documentationString?

Returns:

  • (String, nil)


39
40
41
# File 'lib/seahorse/model/shapes.rb', line 39

def documentation
  @documentation
end

#eventBoolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/seahorse/model/shapes.rb', line 45

def event
  @event
end

#eventheaderBoolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/seahorse/model/shapes.rb', line 54

def eventheader
  @eventheader
end

#eventheader_typeBoolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/seahorse/model/shapes.rb', line 60

def eventheader_type
  @eventheader_type
end

#eventpayloadBoolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/seahorse/model/shapes.rb', line 51

def eventpayload
  @eventpayload
end

#eventpayload_typeString

Returns:

  • (String)


57
58
59
# File 'lib/seahorse/model/shapes.rb', line 57

def eventpayload_type
  @eventpayload_type
end

#eventstreamBoolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/seahorse/model/shapes.rb', line 48

def eventstream
  @eventstream
end

#requiredBoolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/seahorse/model/shapes.rb', line 36

def required
  @required
end

#shapeShape

Returns:



33
34
35
# File 'lib/seahorse/model/shapes.rb', line 33

def shape
  @shape
end

Instance Method Details

#[](key) ⇒ Object

Gets metadata for the given `key`.



81
82
83
84
85
86
87
# File 'lib/seahorse/model/shapes.rb', line 81

def [](key)
  if @metadata.key?(key.to_s)
    @metadata[key.to_s]
  else
    @shape[key.to_s]
  end
end

#[]=(key, value) ⇒ Object

Sets metadata for the given `key`.



90
91
92
# File 'lib/seahorse/model/shapes.rb', line 90

def []=(key, value)
  @metadata[key.to_s] = value
end

#locationString?

Returns:

  • (String, nil)


63
64
65
# File 'lib/seahorse/model/shapes.rb', line 63

def location
  @location || (shape && shape[:location])
end

#location=(location) ⇒ Object



67
68
69
# File 'lib/seahorse/model/shapes.rb', line 67

def location= location
  @location = location
end

#location_nameString?

Returns:

  • (String, nil)


72
73
74
# File 'lib/seahorse/model/shapes.rb', line 72

def location_name
  @location_name || (shape && shape[:location_name])
end

#location_name=(location_name) ⇒ Object



76
77
78
# File 'lib/seahorse/model/shapes.rb', line 76

def location_name= location_name
  @location_name = location_name
end