Class TollFreeCreator

    • Constructor Detail

      • TollFreeCreator

        public TollFreeCreator​(PhoneNumber phoneNumber)
        Construct a new TollFreeCreator.
        Parameters:
        phoneNumber - The phone number to purchase in E.164 format
      • TollFreeCreator

        public TollFreeCreator​(String pathAccountSid,
                               PhoneNumber phoneNumber)
        Construct a new TollFreeCreator.
        Parameters:
        pathAccountSid - The SID of the Account that will create the resource
        phoneNumber - The phone number to purchase in E.164 format
    • Method Detail

      • setApiVersion

        public TollFreeCreator setApiVersion​(String apiVersion)
        The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`..
        Parameters:
        apiVersion - The API version to use for incoming calls made to the new phone number
        Returns:
        this
      • setFriendlyName

        public TollFreeCreator setFriendlyName​(String friendlyName)
        A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number..
        Parameters:
        friendlyName - A string to describe the new phone number
        Returns:
        this
      • setSmsApplicationSid

        public TollFreeCreator setSmsApplicationSid​(String smsApplicationSid)
        The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application..
        Parameters:
        smsApplicationSid - The SID of the application to handle SMS messages
        Returns:
        this
      • setSmsFallbackMethod

        public TollFreeCreator setSmsFallbackMethod​(HttpMethod smsFallbackMethod)
        The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`..
        Parameters:
        smsFallbackMethod - HTTP method used with sms_fallback_url
        Returns:
        this
      • setSmsFallbackUrl

        public TollFreeCreator setSmsFallbackUrl​(URI smsFallbackUrl)
        The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`..
        Parameters:
        smsFallbackUrl - The URL we call when an error occurs while executing TwiML
        Returns:
        this
      • setSmsFallbackUrl

        public TollFreeCreator setSmsFallbackUrl​(String smsFallbackUrl)
        The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`..
        Parameters:
        smsFallbackUrl - The URL we call when an error occurs while executing TwiML
        Returns:
        this
      • setSmsMethod

        public TollFreeCreator setSmsMethod​(HttpMethod smsMethod)
        The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`..
        Parameters:
        smsMethod - The HTTP method to use with sms_url
        Returns:
        this
      • setSmsUrl

        public TollFreeCreator setSmsUrl​(URI smsUrl)
        The URL we should call when the new phone number receives an incoming SMS message..
        Parameters:
        smsUrl - The URL we should call when the new phone number receives an incoming SMS message
        Returns:
        this
      • setSmsUrl

        public TollFreeCreator setSmsUrl​(String smsUrl)
        The URL we should call when the new phone number receives an incoming SMS message..
        Parameters:
        smsUrl - The URL we should call when the new phone number receives an incoming SMS message
        Returns:
        this
      • setStatusCallback

        public TollFreeCreator setStatusCallback​(URI statusCallback)
        The URL we should call using the `status_callback_method` to send status information to your application..
        Parameters:
        statusCallback - The URL to send status information to your application
        Returns:
        this
      • setStatusCallback

        public TollFreeCreator setStatusCallback​(String statusCallback)
        The URL we should call using the `status_callback_method` to send status information to your application..
        Parameters:
        statusCallback - The URL to send status information to your application
        Returns:
        this
      • setStatusCallbackMethod

        public TollFreeCreator setStatusCallbackMethod​(HttpMethod statusCallbackMethod)
        The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`..
        Parameters:
        statusCallbackMethod - The HTTP method we should use to call status_callback
        Returns:
        this
      • setVoiceApplicationSid

        public TollFreeCreator setVoiceApplicationSid​(String voiceApplicationSid)
        The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa..
        Parameters:
        voiceApplicationSid - The SID of the application to handle the new phone number
        Returns:
        this
      • setVoiceCallerIdLookup

        public TollFreeCreator setVoiceCallerIdLookup​(Boolean voiceCallerIdLookup)
        Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`..
        Parameters:
        voiceCallerIdLookup - Whether to lookup the caller's name
        Returns:
        this
      • setVoiceFallbackMethod

        public TollFreeCreator setVoiceFallbackMethod​(HttpMethod voiceFallbackMethod)
        The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`..
        Parameters:
        voiceFallbackMethod - The HTTP method used with voice_fallback_url
        Returns:
        this
      • setVoiceFallbackUrl

        public TollFreeCreator setVoiceFallbackUrl​(URI voiceFallbackUrl)
        The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`..
        Parameters:
        voiceFallbackUrl - The URL we will call when an error occurs in TwiML
        Returns:
        this
      • setVoiceFallbackUrl

        public TollFreeCreator setVoiceFallbackUrl​(String voiceFallbackUrl)
        The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`..
        Parameters:
        voiceFallbackUrl - The URL we will call when an error occurs in TwiML
        Returns:
        this
      • setVoiceMethod

        public TollFreeCreator setVoiceMethod​(HttpMethod voiceMethod)
        The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`..
        Parameters:
        voiceMethod - The HTTP method used with the voice_url
        Returns:
        this
      • setVoiceUrl

        public TollFreeCreator setVoiceUrl​(URI voiceUrl)
        The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set..
        Parameters:
        voiceUrl - The URL we should call when the phone number receives a call
        Returns:
        this
      • setVoiceUrl

        public TollFreeCreator setVoiceUrl​(String voiceUrl)
        The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set..
        Parameters:
        voiceUrl - The URL we should call when the phone number receives a call
        Returns:
        this
      • setIdentitySid

        public TollFreeCreator setIdentitySid​(String identitySid)
        The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations..
        Parameters:
        identitySid - The SID of the Identity resource to associate with the new phone number
        Returns:
        this
      • setAddressSid

        public TollFreeCreator setAddressSid​(String addressSid)
        The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations..
        Parameters:
        addressSid - The SID of the Address resource associated with the phone number
        Returns:
        this
      • create

        public TollFree create​(TwilioRestClient client)
        Make the request to the Twilio API to perform the create.
        Specified by:
        create in class Creator<TollFree>
        Parameters:
        client - TwilioRestClient with which to make the request
        Returns:
        Created TollFree