##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Routes
#    This is the public Twilio REST API.
#
#    NOTE: This class is auto generated by OpenAPI Generator.
#    https://openapi-generator.tech
#    Do not edit the class manually.
#

module Twilio
    module REST
        class Routes
            class V2 < Version
                ##
                # Initialize the V2 version of Routes
                def initialize(domain)
                    super
                    @version = 'v2'
                    @phone_numbers = nil
                    @sip_domains = nil
                    @trunks = nil
                end

                ##
                # @param [String] phone_number The phone number in E.164 format
                # @return [Twilio::REST::Routes::V2::PhoneNumberContext] if phoneNumber was passed.
                # @return [Twilio::REST::Routes::V2::PhoneNumberList]
                def phone_numbers(phone_number=:unset)
                    if phone_number.nil?
                        raise ArgumentError, 'phone_number cannot be nil'
                    end
                    if phone_number == :unset
                        @phone_numbers ||= PhoneNumberList.new self
                    else
                        PhoneNumberContext.new(self, phone_number)
                    end
                end
                ##
                # @param [String] sip_domain 
                # @return [Twilio::REST::Routes::V2::SipDomainContext] if sipDomain was passed.
                # @return [Twilio::REST::Routes::V2::SipDomainList]
                def sip_domains(sip_domain=:unset)
                    if sip_domain.nil?
                        raise ArgumentError, 'sip_domain cannot be nil'
                    end
                    if sip_domain == :unset
                        @sip_domains ||= SipDomainList.new self
                    else
                        SipDomainContext.new(self, sip_domain)
                    end
                end
                ##
                # @param [String] sip_trunk_domain The absolute URL of the SIP Trunk
                # @return [Twilio::REST::Routes::V2::TrunkContext] if sipTrunkDomain was passed.
                # @return [Twilio::REST::Routes::V2::TrunkList]
                def trunks(sip_trunk_domain=:unset)
                    if sip_trunk_domain.nil?
                        raise ArgumentError, 'sip_trunk_domain cannot be nil'
                    end
                    if sip_trunk_domain == :unset
                        @trunks ||= TrunkList.new self
                    else
                        TrunkContext.new(self, sip_trunk_domain)
                    end
                end
                ##
                # Provide a user friendly representation
                def to_s
                    '<Twilio::REST::Routes::V2>';
                end
            end
        end
    end
end
