lib/mock/twilio/decorator.rb in mock-twilio-0.3.0 vs lib/mock/twilio/decorator.rb in mock-twilio-0.4.0
- old
+ new
@@ -1,16 +1,24 @@
# frozen_string_literal: true
require_relative "schemas/api_2010"
require_relative "schemas/messaging_v1"
+require_relative "schemas/customer_profiles_v1"
+require_relative "schemas/end_users_v1"
+require_relative "schemas/supporting_documents_v1"
+require_relative "schemas/phone_numbers_v2"
module Mock
module Twilio
class Decorator
ENDPOINTS = {
api_2010: Mock::Twilio::Schemas::Api2010,
messaging_v1: Mock::Twilio::Schemas::MessagingV1,
+ customer_profiles_v1: Mock::Twilio::Schemas::CustomerProfilesV1,
+ end_users_v1: Mock::Twilio::Schemas::EndUsersV1,
+ supporting_documents_v1: Mock::Twilio::Schemas::SupportingDocumentsV1,
+ phone_numbers_v2: Mock::Twilio::Schemas::PhoneNumbersV2
}
class << self
def call(body, request)
body = JSON.parse(body)
@@ -33,9 +41,17 @@
case url
when %r{\/2010-04-01/Accounts/[A-Za-z0-9]+/}
:api_2010
when %r{\/v1/Services/[A-Za-z0-9]+/}
:messaging_v1
+ when %r{\/v1/CustomerProfiles}
+ :customer_profiles_v1
+ when %r{\/v1/EndUsers}
+ :end_users_v1
+ when %r{\/v1/SupportingDocuments}
+ :supporting_documents_v1
+ when %r{\/v2/PhoneNumbers}
+ :phone_numbers_v2
end
end
end
end
end