Class: Twilio::REST::Api::V2010::AccountContext::SipList::DomainContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Api::V2010::AccountContext::SipList::DomainContext
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.rb,
lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.rb
Defined Under Namespace
Classes: AuthTypesInstance, AuthTypesList, AuthTypesPage, CredentialListMappingContext, CredentialListMappingInstance, CredentialListMappingList, CredentialListMappingPage, IpAccessControlListMappingContext, IpAccessControlListMappingInstance, IpAccessControlListMappingList, IpAccessControlListMappingPage
Instance Method Summary collapse
-
#auth ⇒ AuthTypesList, AuthTypesContext
Access the auth.
-
#credential_list_mappings(sid = :unset) ⇒ CredentialListMappingList, CredentialListMappingContext
Access the credential_list_mappings.
-
#delete ⇒ Boolean
Delete the DomainInstance.
-
#fetch ⇒ DomainInstance
Fetch the DomainInstance.
-
#initialize(version, account_sid, sid) ⇒ DomainContext
constructor
Initialize the DomainContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#ip_access_control_list_mappings(sid = :unset) ⇒ IpAccessControlListMappingList, IpAccessControlListMappingContext
Access the ip_access_control_list_mappings.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset) ⇒ DomainInstance
Update the DomainInstance.
Constructor Details
#initialize(version, account_sid, sid) ⇒ DomainContext
Initialize the DomainContext
202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 202 def initialize(version, account_sid, sid) super(version) # Path Solution @solution = { account_sid: account_sid, sid: sid, } @uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:sid]}.json" # Dependents @auth = nil @ip_access_control_list_mappings = nil @credential_list_mappings = nil end |
Instance Method Details
#auth ⇒ AuthTypesList, AuthTypesContext
Access the auth
313 314 315 316 317 318 319 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 313 def auth unless @auth @auth = AuthTypesList.new( @version, account_sid: @solution[:account_sid], domain_sid: @solution[:sid], ) end @auth end |
#credential_list_mappings(sid = :unset) ⇒ CredentialListMappingList, CredentialListMappingContext
Access the credential_list_mappings
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 343 def credential_list_mappings(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return CredentialListMappingContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @credential_list_mappings @credential_list_mappings = CredentialListMappingList.new( @version, account_sid: @solution[:account_sid], domain_sid: @solution[:sid], ) end @credential_list_mappings end |
#delete ⇒ Boolean
Delete the DomainInstance
217 218 219 220 221 222 223 224 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 217 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ DomainInstance
Fetch the DomainInstance
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 229 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) DomainInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
368 369 370 371 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 368 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.DomainContext #{context}>" end |
#ip_access_control_list_mappings(sid = :unset) ⇒ IpAccessControlListMappingList, IpAccessControlListMappingContext
Access the ip_access_control_list_mappings
324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 324 def ip_access_control_list_mappings(sid=:unset) raise ArgumentError, 'sid cannot be nil' if sid.nil? if sid != :unset return IpAccessControlListMappingContext.new(@version, @solution[:account_sid], @solution[:sid],sid ) end unless @ip_access_control_list_mappings @ip_access_control_list_mappings = IpAccessControlListMappingList.new( @version, account_sid: @solution[:account_sid], domain_sid: @solution[:sid], ) end @ip_access_control_list_mappings end |
#to_s ⇒ Object
Provide a user friendly representation
361 362 363 364 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 361 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Api.V2010.DomainContext #{context}>" end |
#update(friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset) ⇒ DomainInstance
Update the DomainInstance
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb', line 262 def update( friendly_name: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_status_callback_method: :unset, voice_status_callback_url: :unset, voice_url: :unset, sip_registration: :unset, domain_name: :unset, emergency_calling_enabled: :unset, secure: :unset, byoc_trunk_sid: :unset, emergency_caller_sid: :unset ) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'VoiceFallbackMethod' => voice_fallback_method, 'VoiceFallbackUrl' => voice_fallback_url, 'VoiceMethod' => voice_method, 'VoiceStatusCallbackMethod' => voice_status_callback_method, 'VoiceStatusCallbackUrl' => voice_status_callback_url, 'VoiceUrl' => voice_url, 'SipRegistration' => sip_registration, 'DomainName' => domain_name, 'EmergencyCallingEnabled' => emergency_calling_enabled, 'Secure' => secure, 'ByocTrunkSid' => byoc_trunk_sid, 'EmergencyCallerSid' => emergency_caller_sid, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) DomainInstance.new( @version, payload, account_sid: @solution[:account_sid], sid: @solution[:sid], ) end |