Class: Twilio::REST::Voice::V1::ByocTrunkContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Voice::V1::ByocTrunkContext
- Defined in:
- lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the ByocTrunkInstance.
-
#fetch ⇒ ByocTrunkInstance
Fetch the ByocTrunkInstance.
-
#initialize(version, sid) ⇒ ByocTrunkContext
constructor
Initialize the ByocTrunkContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset) ⇒ ByocTrunkInstance
Update the ByocTrunkInstance.
Constructor Details
#initialize(version, sid) ⇒ ByocTrunkContext
Initialize the ByocTrunkContext
188 189 190 191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 188 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/ByocTrunks/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the ByocTrunkInstance
200 201 202 203 204 205 206 207 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 200 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ ByocTrunkInstance
Fetch the ByocTrunkInstance
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 212 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) ByocTrunkInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
291 292 293 294 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 291 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Voice.V1.ByocTrunkContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
284 285 286 287 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 284 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Voice.V1.ByocTrunkContext #{context}>" end |
#update(friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset) ⇒ ByocTrunkInstance
Update the ByocTrunkInstance
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/twilio-ruby/rest/voice/v1/byoc_trunk.rb', line 241 def update( friendly_name: :unset, voice_url: :unset, voice_method: :unset, voice_fallback_url: :unset, voice_fallback_method: :unset, status_callback_url: :unset, status_callback_method: :unset, cnam_lookup_enabled: :unset, connection_policy_sid: :unset, from_domain_sid: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'VoiceUrl' => voice_url, 'VoiceMethod' => voice_method, 'VoiceFallbackUrl' => voice_fallback_url, 'VoiceFallbackMethod' => voice_fallback_method, 'StatusCallbackUrl' => status_callback_url, 'StatusCallbackMethod' => status_callback_method, 'CnamLookupEnabled' => cnam_lookup_enabled, 'ConnectionPolicySid' => connection_policy_sid, 'FromDomainSid' => from_domain_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) ByocTrunkInstance.new( @version, payload, sid: @solution[:sid], ) end |