You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Seahorse::Model::Shapes::StructureShape

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

Instance Attribute Summary collapse

Attributes inherited from Shape

#documentation, #name

Instance Method Summary collapse

Methods inherited from Shape

#[], #[]=

Constructor Details

#initialize(options = {}) ⇒ StructureShape

Returns a new instance of StructureShape



183
184
185
186
187
188
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 183

def initialize(options = {})
  @members = {}
  @members_by_location_name = {}
  @required = Set.new
  super
end

Instance Attribute Details

#requiredSet<Symbol>

Returns:

  • (Set<Symbol>)


191
192
193
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 191

def required
  @required
end

#struct_classClass<Struct>

Returns:

  • (Class<Struct>)


194
195
196
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 194

def struct_class
  @struct_class
end

Instance Method Details

#add_member(name, shape_ref) ⇒ Object

Parameters:



198
199
200
201
202
203
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 198

def add_member(name, shape_ref)
  name = name.to_sym
  @required << name if shape_ref.required
  @members_by_location_name[shape_ref.location_name] = [name, shape_ref]
  @members[name] = shape_ref
end

#member(name) ⇒ ShapeRef

Parameters:

  • name (Symbol)

Returns:



224
225
226
227
228
229
230
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 224

def member(name)
  if member?(name)
    @members[name.to_sym]
  else
    raise ArgumentError, "no such member #{name.inspect}"
  end
end

#member?(member_name) ⇒ Boolean

Returns true if there exists a member with the given name.

Parameters:

  • member_name (Symbol)

Returns:

  • (Boolean)

    Returns true if there exists a member with the given name.



213
214
215
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 213

def member?(member_name)
  @members.key?(member_name.to_sym)
end

#member_namesArray<Symbol>

Returns:

  • (Array<Symbol>)


206
207
208
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 206

def member_names
  @members.keys
end

#membersEnumerator<[Symbol,ShapeRef]>

Returns:



218
219
220
# File 'gems/aws-sdk-core/lib/seahorse/model/shapes.rb', line 218

def members
  @members.to_enum
end