Class: VoiceML::SipAuthMappingList

Inherits:
Object
  • Object
show all
Includes:
Pageable
Defined in:
lib/voiceml/models/sip.rb

Overview

SipAuthMappingList — page envelope used by all four /Auth/* mapping list endpoints. Twilio's spec uses a generic contents envelope key here (not credential_list_mappings / ip_access_control_list_mappings) because the same list shape is reused across CredentialList and IpAccessControlList auth mappings; the inner items decode as SipDomainMapping either way.

Constant Summary

Constants included from Pageable

Pageable::PAGE_FIELDS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Pageable

#assign_page_fields

Constructor Details

#initialize(hash = {}) ⇒ SipAuthMappingList

Returns a new instance of SipAuthMappingList.



178
179
180
181
# File 'lib/voiceml/models/sip.rb', line 178

def initialize(hash = {})
  assign_page_fields(hash)
  @contents = (hash['contents'] || []).map { |h| SipDomainMapping.from_hash(h) }
end

Instance Attribute Details

#contentsObject (readonly)

Returns the value of attribute contents.



177
178
179
# File 'lib/voiceml/models/sip.rb', line 177

def contents
  @contents
end

Class Method Details

.from_hash(hash) ⇒ Object



182
# File 'lib/voiceml/models/sip.rb', line 182

def self.from_hash(hash); new(hash || {}); end