Class: Mock::Twilio::Schemas::EndUsersV1

Inherits:
Object
  • Object
show all
Defined in:
lib/mock/twilio/schemas/end_users_v1.rb

Class Method Summary collapse

Class Method Details

.end_user_sid(body, request) ⇒ Object



19
20
21
22
23
# File 'lib/mock/twilio/schemas/end_users_v1.rb', line 19

def end_user_sid(body, request)
  prefix = "IT"
  sid = prefix + SecureRandom.hex(16)
  body["sid"] = sid
end

.for(body, request) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/mock/twilio/schemas/end_users_v1.rb', line 8

def for(body, request)
  body["date_updated"] = Time.current.rfc2822 if body["date_updated"]
  body["date_created"] = Time.current.rfc2822 if body["date_created"]
  body["account_sid"] = ::Twilio. if body["account_sid"]
  body["type"] = request.data["Type"] if body["type"]
  end_user_sid(body, request) if body["sid"]
  body["friendly_name"] = request.data["FriendlyName"] if body["friendly_name"]

  body
end