Class: Twilio::REST::Trunking::V1::TrunkContext::IpAccessControlListContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, trunk_sid, sid) ⇒ IpAccessControlListContext

Initialize the IpAccessControlListContext

Parameters:

  • version (Version)

    Version that contains the resource

  • trunk_sid (String)

    The trunk_sid

  • sid (String)

    The sid



187
188
189
190
191
192
193
194
195
196
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb', line 187

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

  # Path Solution
  @solution = {
      trunk_sid: trunk_sid,
      sid: sid,
  }
  @uri = "/Trunks/#{@solution[:trunk_sid]}/IpAccessControlLists/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Deletes the IpAccessControlListInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



221
222
223
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb', line 221

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

#fetchIpAccessControlListInstance

Fetch a IpAccessControlListInstance

Returns:



201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb', line 201

def fetch
  params = Twilio::Values.of({})

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

  IpAccessControlListInstance.new(
      @version,
      payload,
      trunk_sid: @solution[:trunk_sid],
      sid: @solution[:sid],
  )
end

#to_sObject

Provide a user friendly representation



227
228
229
230
# File 'lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb', line 227

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