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.



225
226
227
228
229
230
231
232
233
234
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 225

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



238
239
240
241
242
243
244
245
246
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 238

def delete

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    

    @version.delete('DELETE', @uri, headers: headers)
end

#delete_with_metadataBoolean

Delete the IpAccessControlListMappingInstanceMetadata

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 251

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
      response = @version.('DELETE', @uri, headers: headers)
      ipAccessControlListMapping_instance = IpAccessControlListMappingInstance.new(
          @version,
          response.body,
          account_sid: @solution[:account_sid],
          sid: @solution[:sid],
      )
      .new(@version, ipAccessControlListMapping_instance, response.headers, response.status_code)
end

#fetchIpAccessControlListMappingInstance

Fetch the IpAccessControlListMappingInstance

Returns:



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 270

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    IpAccessControlListMappingInstance.new(
        @version,
        payload,
        account_sid: @solution[:account_sid],
        domain_sid: @solution[:domain_sid],
        sid: @solution[:sid],
    )
end

#fetch_with_metadataIpAccessControlListMappingInstance

Fetch the IpAccessControlListMappingInstanceMetadata

Returns:



291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 291

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    ip_access_control_list_mapping_instance = IpAccessControlListMappingInstance.new(
        @version,
        response.body,
        account_sid: @solution[:account_sid],
        domain_sid: @solution[:domain_sid],
        sid: @solution[:sid],
    )
    .new(
        @version,
        ip_access_control_list_mapping_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



325
326
327
328
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 325

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

#to_sObject

Provide a user friendly representation



318
319
320
321
# File 'lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb', line 318

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