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



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 = {
      'bg_color' => payload['bg_color'],
      'caller' => payload['caller'],
      'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
      'font_color' => payload['font_color'],
      'from' => payload['from'],
      'logo' => payload['logo'],
      'manager' => payload['manager'],
      'reason' => payload['reason'],
      'shield_img' => payload['shield_img'],
      'sid' => payload['sid'],
      'status' => payload['status'],
      'to' => payload['to'],
      'url' => payload['url'],
      'use_case' => payload['use_case'],
  }

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

Instance Method Details

#bg_colorString



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

def bg_color
  @properties['bg_color']
end

#callerString



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

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



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



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

def created_at
  @properties['created_at']
end

#fetch(x_xcnam_sensitive_phone_number_from: :unset, x_xcnam_sensitive_phone_number_to: :unset) ⇒ CurrentCallInstance

Fetch the CurrentCallInstance



253
254
255
256
257
258
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 253

def fetch(x_xcnam_sensitive_phone_number_from: :unset, x_xcnam_sensitive_phone_number_to: :unset)
  context.fetch(
      x_xcnam_sensitive_phone_number_from: x_xcnam_sensitive_phone_number_from,
      x_xcnam_sensitive_phone_number_to: x_xcnam_sensitive_phone_number_to,
  )
end

#font_colorString



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

def font_color
  @properties['font_color']
end

#fromString



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

def from
  @properties['from']
end

#inspectObject

Provide a detailed, user friendly representation



269
270
271
272
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 269

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

#logoString



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

def 
  @properties['logo']
end

#managerString



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

def manager
  @properties['manager']
end

#reasonString



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

def reason
  @properties['reason']
end

#shield_imgString



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

def shield_img
  @properties['shield_img']
end

#sidString



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

def sid
  @properties['sid']
end

#statusString



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

def status
  @properties['status']
end

#toString



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

def to
  @properties['to']
end

#to_sObject

Provide a user friendly representation



262
263
264
265
# File 'lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb', line 262

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

#urlString



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

def url
  @properties['url']
end

#use_caseString



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

def use_case
  @properties['use_case']
end