Sha256: de88b6ca75954769629ca10df88d710550308713d5ac810a4b62f77fc3018259
Contents?: true
Size: 1.18 KB
Versions: 8
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require_relative "../decorators/messaging_v1/phone_number_list" require_relative "../decorators/messaging_v1/phone_number_create" require_relative "../decorators/messaging_v1/phone_number_fetch" module Mock module Twilio module Schemas class MessagingV1 class << self RESOURCES = { phone_number_list: Mock::Twilio::Decorators::MessagingV1::PhoneNumberList, phone_number_create: Mock::Twilio::Decorators::MessagingV1::PhoneNumberCreate, phone_number_fetch: Mock::Twilio::Decorators::MessagingV1::PhoneNumberFetch, } def for(body, request) url = request.url.split(request.host).last case url when %r{\/v1\/Services\/\w{34}\/PhoneNumbers$} return RESOURCES[:phone_number_list].decorate(body, request) if request.method == "GET" return RESOURCES[:phone_number_create].decorate(body, request) if request.method == "POST" when %r{\/v1\/Services\/\w{34}\/PhoneNumbers\/\w{34}} RESOURCES[:phone_number_fetch].decorate(body, request) end end end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems