Class: Twilio::REST::Preview::TrustedComms::CurrentCallInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, payload) ⇒ CurrentCallInstance

Initialize the CurrentCallInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 123

def initialize(version, payload)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'from' => payload['from'],
      'to' => payload['to'],
      'status' => payload['status'],
      'reason' => payload['reason'],
      'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
      'caller' => payload['caller'],
      'logo' => payload['logo'],
      'bg_color' => payload['bg_color'],
      'font_color' => payload['font_color'],
      'use_case' => payload['use_case'],
      'manager' => payload['manager'],
      'shield_img' => payload['shield_img'],
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {}
end

Instance Method Details

#bg_colorString

Returns Background color of the current phone call.

Returns:

  • (String)

    Background color of the current phone call



210
211
212
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 210

def bg_color
  @properties['bg_color']
end

#callerString

Returns Caller name of the current phone call.

Returns:

  • (String)

    Caller name of the current phone call



198
199
200
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 198

def caller
  @properties['caller']
end

#contextCurrentCallContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



153
154
155
156
157
158
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 153

def context
  unless @instance_context
    @instance_context = CurrentCallContext.new(@version, )
  end
  @instance_context
end

#created_atTime

Returns The date this current phone call was created.

Returns:

  • (Time)

    The date this current phone call was created



192
193
194
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 192

def created_at
  @properties['created_at']
end

#fetch(from: :unset, to: :unset) ⇒ CurrentCallInstance

Fetch a CurrentCallInstance

Parameters:

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

    The originating Phone Number, given in E.164 format (en.wikipedia.org/wiki/E.164). This phone number should be a Twilio number, otherwise it will return an error with HTTP Status Code 400.

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

    The terminating Phone Number, given in E.164 format (en.wikipedia.org/wiki/E.164).

Returns:



252
253
254
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 252

def fetch(from: :unset, to: :unset)
  context.fetch(from: from, to: to, )
end

#font_colorString

Returns Font color of the current phone call.

Returns:

  • (String)

    Font color of the current phone call



216
217
218
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 216

def font_color
  @properties['font_color']
end

#fromString

Returns The originating phone number.

Returns:

  • (String)

    The originating phone number



168
169
170
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 168

def from
  @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation



265
266
267
268
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 265

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.CurrentCallInstance #{values}>"
end

#logoString

Returns Logo URL of the caller.

Returns:

  • (String)

    Logo URL of the caller



204
205
206
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 204

def 
  @properties['logo']
end

#managerString

Returns The name of the CPS organization.

Returns:

  • (String)

    The name of the CPS organization



228
229
230
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 228

def manager
  @properties['manager']
end

#reasonString

Returns The business reason for this current phone call.

Returns:

  • (String)

    The business reason for this current phone call



186
187
188
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 186

def reason
  @properties['reason']
end

#shield_imgString

Returns Shield image URL that serves as authenticity proof of the current phone call.

Returns:

  • (String)

    Shield image URL that serves as authenticity proof of the current phone call



234
235
236
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 234

def shield_img
  @properties['shield_img']
end

#sidString

Returns A string that uniquely identifies this current phone call.

Returns:

  • (String)

    A string that uniquely identifies this current phone call.



162
163
164
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 162

def sid
  @properties['sid']
end

#statusString

Returns The status of the current phone call.

Returns:

  • (String)

    The status of the current phone call



180
181
182
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 180

def status
  @properties['status']
end

#toString

Returns The terminating phone number.

Returns:

  • (String)

    The terminating phone number



174
175
176
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 174

def to
  @properties['to']
end

#to_sObject

Provide a user friendly representation



258
259
260
261
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 258

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.CurrentCallInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



240
241
242
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 240

def url
  @properties['url']
end

#use_caseString

Returns The use case for the current phone call.

Returns:

  • (String)

    The use case for the current phone call



222
223
224
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 222

def use_case
  @properties['use_case']
end