Class: Twilio::REST::Api::V2010::AccountContext::SipList::DomainContext::IpAccessControlListMappingContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, account_sid, domain_sid, sid) ⇒ IpAccessControlListMappingContext

Initialize the IpAccessControlListMappingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • account_sid (String)

    The unique id of the Account that is responsible for this resource.

  • domain_sid (String)

    A 34 character string that uniquely identifies the SIP domain.

  • sid (String)

    A 34 character string that uniquely identifies the resource to fetch.


183
184
185
186
187
188
189
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 183

def initialize(version, , domain_sid, sid)
  super(version)

  # Path Solution
  @solution = {account_sid: , domain_sid: domain_sid, sid: sid, }
  @uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:domain_sid]}/IpAccessControlListMappings/#{@solution[:sid]}.json"
end

Instance Method Details

#deleteBoolean

Delete the IpAccessControlListMappingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


209
210
211
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 209

def delete
   @version.delete('DELETE', @uri)
end

#fetchIpAccessControlListMappingInstance

Fetch the IpAccessControlListMappingInstance

Returns:


194
195
196
197
198
199
200
201
202
203
204
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 194

def fetch
  payload = @version.fetch('GET', @uri)

  IpAccessControlListMappingInstance.new(
      @version,
      payload,
      account_sid: @solution[:account_sid],
      domain_sid: @solution[:domain_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


222
223
224
225
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 222

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Api.V2010.IpAccessControlListMappingContext #{context}>"
end

#to_sObject

Provide a user friendly representation


215
216
217
218
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 215

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Api.V2010.IpAccessControlListMappingContext #{context}>"
end