Class: Twilio::REST::Routes::V2::TrunkInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Routes::V2::TrunkInstance
- Defined in:
- lib/twilio-ruby/rest/routes/v2/trunk.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#context ⇒ TrunkContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this SIP Trunk was assigned an Inbound Processing Region, given in ISO 8601 format.
-
#date_updated ⇒ Time
The date that the Inbound Processing Region was updated for this SIP Trunk, given in ISO 8601 format.
-
#fetch ⇒ TrunkInstance
Fetch the TrunkInstance.
-
#friendly_name ⇒ String
A human readable description of the Inbound Processing Region assignments for this SIP Trunk, up to 64 characters.
-
#initialize(version, payload, sip_trunk_domain: nil) ⇒ TrunkInstance
constructor
Initialize the TrunkInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A 34 character string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk.
-
#sip_trunk_domain ⇒ String
The absolute URL of the SIP Trunk.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(voice_region: :unset, friendly_name: :unset) ⇒ TrunkInstance
Update the TrunkInstance.
-
#url ⇒ String
The absolute URL of the resource.
-
#voice_region ⇒ String
The Inbound Processing Region used for this SIP Trunk for voice.
Constructor Details
#initialize(version, payload, sip_trunk_domain: nil) ⇒ TrunkInstance
Initialize the TrunkInstance
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 160 def initialize(version, payload , sip_trunk_domain: nil) super(version) # Marshaled Properties @properties = { 'sip_trunk_domain' => payload['sip_trunk_domain'], 'url' => payload['url'], 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'voice_region' => payload['voice_region'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'sip_trunk_domain' => sip_trunk_domain || @properties['sip_trunk_domain'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
211 212 213 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 211 def account_sid @properties['account_sid'] end |
#context ⇒ TrunkContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
184 185 186 187 188 189 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 184 def context unless @instance_context @instance_context = TrunkContext.new(@version , @params['sip_trunk_domain']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this SIP Trunk was assigned an Inbound Processing Region, given in ISO 8601 format.
229 230 231 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 229 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that the Inbound Processing Region was updated for this SIP Trunk, given in ISO 8601 format.
235 236 237 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 235 def date_updated @properties['date_updated'] end |
#fetch ⇒ TrunkInstance
Fetch the TrunkInstance
242 243 244 245 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 242 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable description of the Inbound Processing Region assignments for this SIP Trunk, up to 64 characters.
217 218 219 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 217 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
272 273 274 275 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 272 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Routes.V2.TrunkInstance #{values}>" end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies the Inbound Processing Region assignments for this SIP Trunk.
205 206 207 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 205 def sid @properties['sid'] end |
#sip_trunk_domain ⇒ String
Returns The absolute URL of the SIP Trunk.
193 194 195 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 193 def sip_trunk_domain @properties['sip_trunk_domain'] end |
#to_s ⇒ Object
Provide a user friendly representation
265 266 267 268 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 265 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Routes.V2.TrunkInstance #{values}>" end |
#update(voice_region: :unset, friendly_name: :unset) ⇒ TrunkInstance
Update the TrunkInstance
252 253 254 255 256 257 258 259 260 261 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 252 def update( voice_region: :unset, friendly_name: :unset ) context.update( voice_region: voice_region, friendly_name: friendly_name, ) end |
#url ⇒ String
Returns The absolute URL of the resource.
199 200 201 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 199 def url @properties['url'] end |
#voice_region ⇒ String
Returns The Inbound Processing Region used for this SIP Trunk for voice.
223 224 225 |
# File 'lib/twilio-ruby/rest/routes/v2/trunk.rb', line 223 def voice_region @properties['voice_region'] end |