Class: Twilio::REST::Voice::V1::IpRecordContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/voice/v1/ip_record.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid) ⇒ IpRecordContext

Initialize the IpRecordContext

Parameters:

  • version (Version)

    Version that contains the resource

  • sid (String)

    The Twilio-provided string that uniquely identifies the IP Record resource to fetch.


170
171
172
173
174
175
176
# File 'lib/twilio-ruby/rest/voice/v1/ip_record.rb', line 170

def initialize(version, sid)
  super(version)

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

Instance Method Details

#deleteBoolean

Delete the IpRecordInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


203
204
205
# File 'lib/twilio-ruby/rest/voice/v1/ip_record.rb', line 203

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

#fetchIpRecordInstance

Fetch the IpRecordInstance

Returns:


181
182
183
184
185
# File 'lib/twilio-ruby/rest/voice/v1/ip_record.rb', line 181

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

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

#inspectObject

Provide a detailed, user friendly representation


216
217
218
219
# File 'lib/twilio-ruby/rest/voice/v1/ip_record.rb', line 216

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

#to_sObject

Provide a user friendly representation


209
210
211
212
# File 'lib/twilio-ruby/rest/voice/v1/ip_record.rb', line 209

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

#update(friendly_name: :unset) ⇒ IpRecordInstance

Update the IpRecordInstance

Parameters:

  • friendly_name (String) (defaults to: :unset)

    A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long.

Returns:


192
193
194
195
196
197
198
# File 'lib/twilio-ruby/rest/voice/v1/ip_record.rb', line 192

def update(friendly_name: :unset)
  data = Twilio::Values.of({'FriendlyName' => friendly_name, })

  payload = @version.update('POST', @uri, data: data)

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