Beispiel #1
0
 /// <summary>
 /// Construct a new FetchPhoneNumberOptions
 /// </summary>
 ///
 /// <param name="pathPhoneNumber"> The phone_number </param>
 public FetchPhoneNumberOptions(Types.PhoneNumber pathPhoneNumber)
 {
     PathPhoneNumber = pathPhoneNumber;
     Type            = new List <string>();
     AddOns          = new List <string>();
 }
Beispiel #2
0
 /// <summary>
 /// Construct a new FetchNumberOptions
 /// </summary>
 /// <param name="pathDestinationNumber"> Fetches voice prices for number </param>
 public FetchNumberOptions(Types.PhoneNumber pathDestinationNumber)
 {
     PathDestinationNumber = pathDestinationNumber;
 }
Beispiel #3
0
 /// <summary>
 /// Construct a new CreateExecutionOptions
 /// </summary>
 /// <param name="pathFlowSid"> The flow_sid </param>
 /// <param name="to"> The to </param>
 /// <param name="from"> The from </param>
 public CreateExecutionOptions(string pathFlowSid, Types.PhoneNumber to, Types.PhoneNumber from)
 {
     PathFlowSid = pathFlowSid;
     To          = to;
     From        = from;
 }
        /// <summary>
        /// Retrieve a list of messages belonging to the account used to make the request
        /// </summary>
        /// <param name="pathAccountSid"> The SID of the Account that created the resources to read </param>
        /// <param name="to"> Filter by messages sent to this number </param>
        /// <param name="from"> Filter by from number </param>
        /// <param name="dateSentBefore"> Filter by date sent </param>
        /// <param name="dateSent"> Filter by date sent </param>
        /// <param name="dateSentAfter"> Filter by date sent </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Message </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MessageResource> > ReadAsync(string pathAccountSid   = null,
                                                                                                   Types.PhoneNumber to    = null,
                                                                                                   Types.PhoneNumber from  = null,
                                                                                                   DateTime?dateSentBefore = null,
                                                                                                   DateTime?dateSent       = null,
                                                                                                   DateTime?dateSentAfter  = null,
                                                                                                   int?pageSize            = null,
                                                                                                   long?limit = null,
                                                                                                   ITwilioRestClient client = null)
        {
            var options = new ReadMessageOptions()
            {
                PathAccountSid = pathAccountSid, To = to, From = from, DateSentBefore = dateSentBefore, DateSent = dateSent, DateSentAfter = dateSentAfter, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #5
0
        /// <summary>
        /// read
        /// </summary>
        /// <param name="pathCountryCode"> The ISO Country code of the country from which to read phone numbers </param>
        /// <param name="pathAccountSid"> The SID of the Account requesting the AvailablePhoneNumber resources </param>
        /// <param name="areaCode"> The area code of the phone numbers to read </param>
        /// <param name="contains"> The pattern on which to match phone numbers </param>
        /// <param name="smsEnabled"> Whether the phone numbers can receive text messages </param>
        /// <param name="mmsEnabled"> Whether the phone numbers can receive MMS messages </param>
        /// <param name="voiceEnabled"> Whether the phone numbers can receive calls. </param>
        /// <param name="excludeAllAddressRequired"> Whether to exclude phone numbers that require an Address </param>
        /// <param name="excludeLocalAddressRequired"> Whether to exclude phone numbers that require a local address </param>
        /// <param name="excludeForeignAddressRequired"> Whether to exclude phone numbers that require a foreign address
        ///                                     </param>
        /// <param name="beta"> Whether to read phone numbers new to the Twilio platform </param>
        /// <param name="nearNumber"> Given a phone number, find a geographically close number within distance miles.
        ///                  (US/Canada only) </param>
        /// <param name="nearLatLong"> Given a latitude/longitude pair lat,long find geographically close numbers within
        ///                   distance miles. (US/Canada only) </param>
        /// <param name="distance"> The search radius, in miles, for a near_ query. (US/Canada only) </param>
        /// <param name="inPostalCode"> Limit results to a particular postal code. (US/Canada only) </param>
        /// <param name="inRegion"> Limit results to a particular region. (US/Canada only) </param>
        /// <param name="inRateCenter"> Limit results to a specific rate center, or given a phone number search within the same
        ///                    rate center as that number. (US/Canada only) </param>
        /// <param name="inLata"> Limit results to a specific local access and transport area. (US/Canada only) </param>
        /// <param name="inLocality"> Limit results to a particular locality </param>
        /// <param name="faxEnabled"> Whether the phone numbers can receive faxes </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of National </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <NationalResource> > ReadAsync(string pathCountryCode,
                                                                                                    string pathAccountSid              = null,
                                                                                                    int?areaCode                       = null,
                                                                                                    string contains                    = null,
                                                                                                    bool?smsEnabled                    = null,
                                                                                                    bool?mmsEnabled                    = null,
                                                                                                    bool?voiceEnabled                  = null,
                                                                                                    bool?excludeAllAddressRequired     = null,
                                                                                                    bool?excludeLocalAddressRequired   = null,
                                                                                                    bool?excludeForeignAddressRequired = null,
                                                                                                    bool?beta = null,
                                                                                                    Types.PhoneNumber nearNumber = null,
                                                                                                    string nearLatLong           = null,
                                                                                                    int?distance             = null,
                                                                                                    string inPostalCode      = null,
                                                                                                    string inRegion          = null,
                                                                                                    string inRateCenter      = null,
                                                                                                    string inLata            = null,
                                                                                                    string inLocality        = null,
                                                                                                    bool?faxEnabled          = null,
                                                                                                    int?pageSize             = null,
                                                                                                    long?limit               = null,
                                                                                                    ITwilioRestClient client = null)
        {
            var options = new ReadNationalOptions(pathCountryCode)
            {
                PathAccountSid = pathAccountSid, AreaCode = areaCode, Contains = contains, SmsEnabled = smsEnabled, MmsEnabled = mmsEnabled, VoiceEnabled = voiceEnabled, ExcludeAllAddressRequired = excludeAllAddressRequired, ExcludeLocalAddressRequired = excludeLocalAddressRequired, ExcludeForeignAddressRequired = excludeForeignAddressRequired, Beta = beta, NearNumber = nearNumber, NearLatLong = nearLatLong, Distance = distance, InPostalCode = inPostalCode, InRegion = inRegion, InRateCenter = inRateCenter, InLata = inLata, InLocality = inLocality, FaxEnabled = faxEnabled, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #6
0
 /// <summary>
 /// Construct a new CreateCallOptions
 /// </summary>
 ///
 /// <param name="to"> Phone number, SIP address or client identifier to call </param>
 /// <param name="from"> Twilio number from which to originate the call </param>
 public CreateCallOptions(IEndpoint to, Types.PhoneNumber from)
 {
     To   = to;
     From = from;
     StatusCallbackEvent = new List <string>();
 }
        /// <summary>
        /// Triggers a new Execution for the Flow
        /// </summary>
        /// <param name="pathFlowSid"> The SID of the Flow </param>
        /// <param name="to"> The Contact phone number to start a Studio Flow Execution </param>
        /// <param name="from"> The Twilio phone number to send messages or initiate calls from during the Flow Execution
        ///            </param>
        /// <param name="parameters"> JSON data that will be added to the Flow's context </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Execution </returns>
        public static async System.Threading.Tasks.Task <ExecutionResource> CreateAsync(string pathFlowSid,
                                                                                        Types.PhoneNumber to,
                                                                                        Types.PhoneNumber from,
                                                                                        object parameters        = null,
                                                                                        ITwilioRestClient client = null)
        {
            var options = new CreateExecutionOptions(pathFlowSid, to, from)
            {
                Parameters = parameters
            };

            return(await CreateAsync(options, client));
        }
Beispiel #8
0
        /// <summary>
        /// fetch
        /// </summary>
        /// <param name="pathPhoneNumber"> The phone number to fetch in E.164 format </param>
        /// <param name="countryCode"> The ISO country code of the phone number </param>
        /// <param name="type"> The type of information to return </param>
        /// <param name="addOns"> The unique_name of an Add-on you would like to invoke </param>
        /// <param name="addOnsData"> Data specific to the add-on you would like to invoke </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of PhoneNumber </returns>
        public static async System.Threading.Tasks.Task <PhoneNumberResource> FetchAsync(Types.PhoneNumber pathPhoneNumber,
                                                                                         string countryCode   = null,
                                                                                         List <string> type   = null,
                                                                                         List <string> addOns = null,
                                                                                         Dictionary <string, object> addOnsData = null,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new FetchPhoneNumberOptions(pathPhoneNumber)
            {
                CountryCode = countryCode, Type = type, AddOns = addOns, AddOnsData = addOnsData
            };

            return(await FetchAsync(options, client));
        }
 /// <summary>
 /// Construct a new CreateParticipantOptions
 /// </summary>
 ///
 /// <param name="pathConferenceSid"> The conference_sid </param>
 /// <param name="from"> The from </param>
 /// <param name="to"> The to </param>
 public CreateParticipantOptions(string pathConferenceSid, Types.PhoneNumber from, Types.PhoneNumber to)
 {
     PathConferenceSid = pathConferenceSid;
     From = from;
     To   = to;
     StatusCallbackEvent           = new List <string>();
     ConferenceStatusCallbackEvent = new List <string>();
 }
        /// <summary>
        /// Send a message from the account used to make the request
        /// </summary>
        ///
        /// <param name="to"> The phone number to receive the message </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="from"> The phone number that initiated the message </param>
        /// <param name="messagingServiceSid"> The messaging_service_sid </param>
        /// <param name="body"> The body </param>
        /// <param name="mediaUrl"> The media_url </param>
        /// <param name="statusCallback"> URL Twilio will request when the status changes </param>
        /// <param name="applicationSid"> The application to use for callbacks </param>
        /// <param name="maxPrice"> The max_price </param>
        /// <param name="provideFeedback"> The provide_feedback </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Message </returns>
        public static async System.Threading.Tasks.Task <MessageResource> CreateAsync(Types.PhoneNumber to, string pathAccountSid = null, Types.PhoneNumber from = null, string messagingServiceSid = null, string body = null, List <Uri> mediaUrl = null, Uri statusCallback = null, string applicationSid = null, decimal?maxPrice = null, bool?provideFeedback = null, ITwilioRestClient client = null)
        {
            var options = new CreateMessageOptions(to)
            {
                PathAccountSid = pathAccountSid, From = from, MessagingServiceSid = messagingServiceSid, Body = body, MediaUrl = mediaUrl, StatusCallback = statusCallback, ApplicationSid = applicationSid, MaxPrice = maxPrice, ProvideFeedback = provideFeedback
            };

            return(await CreateAsync(options, client));
        }
Beispiel #11
0
 /// <summary>
 /// Construct a new CreateMobileOptions
 /// </summary>
 /// <param name="phoneNumber"> The phone number to purchase in E.164 format </param>
 public CreateMobileOptions(Types.PhoneNumber phoneNumber)
 {
     PhoneNumber = phoneNumber;
 }
        /// <summary>
        /// Add a Phone Number to the Service's Proxy Number Pool.
        /// </summary>
        /// <param name="pathServiceSid"> Service Sid. </param>
        /// <param name="sid"> A string that uniquely identifies this Phone Number. </param>
        /// <param name="phoneNumber"> The phone_number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of PhoneNumber </returns>
        public static async System.Threading.Tasks.Task <PhoneNumberResource> CreateAsync(string pathServiceSid,
                                                                                          string sid = null,
                                                                                          Types.PhoneNumber phoneNumber = null,
                                                                                          ITwilioRestClient client      = null)
        {
            var options = new CreatePhoneNumberOptions(pathServiceSid)
            {
                Sid = sid, PhoneNumber = phoneNumber
            };

            return(await CreateAsync(options, client));
        }
Beispiel #13
0
        /// <summary>
        /// Host a phone number's capability on Twilio's platform.
        /// </summary>
        /// <param name="phoneNumber"> An E164 formatted phone number. </param>
        /// <param name="smsCapability"> Specify SMS capability to host. </param>
        /// <param name="accountSid"> Account Sid. </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this HostedNumberOrder. </param>
        /// <param name="ccEmails"> A list of emails. </param>
        /// <param name="smsUrl"> SMS URL. </param>
        /// <param name="smsMethod"> SMS Method. </param>
        /// <param name="smsFallbackUrl"> SMS Fallback URL. </param>
        /// <param name="smsFallbackMethod"> SMS Fallback Method. </param>
        /// <param name="statusCallbackUrl"> Status Callback URL. </param>
        /// <param name="statusCallbackMethod"> Status Callback Method. </param>
        /// <param name="smsApplicationSid"> SMS Application Sid. </param>
        /// <param name="addressSid"> Address sid. </param>
        /// <param name="email"> Email. </param>
        /// <param name="verificationType"> Verification Type. </param>
        /// <param name="verificationDocumentSid"> Verification Document Sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of HostedNumberOrder </returns>
        public static async System.Threading.Tasks.Task <HostedNumberOrderResource> CreateAsync(Types.PhoneNumber phoneNumber,
                                                                                                bool?smsCapability,
                                                                                                string accountSid                           = null,
                                                                                                string friendlyName                         = null,
                                                                                                string uniqueName                           = null,
                                                                                                List <string> ccEmails                      = null,
                                                                                                Uri smsUrl                                  = null,
                                                                                                Twilio.Http.HttpMethod smsMethod            = null,
                                                                                                Uri smsFallbackUrl                          = null,
                                                                                                Twilio.Http.HttpMethod smsFallbackMethod    = null,
                                                                                                Uri statusCallbackUrl                       = null,
                                                                                                Twilio.Http.HttpMethod statusCallbackMethod = null,
                                                                                                string smsApplicationSid                    = null,
                                                                                                string addressSid                           = null,
                                                                                                string email                                = null,
                                                                                                HostedNumberOrderResource.VerificationTypeEnum verificationType = null,
                                                                                                string verificationDocumentSid = null,
                                                                                                ITwilioRestClient client       = null)
        {
            var options = new CreateHostedNumberOrderOptions(phoneNumber, smsCapability)
            {
                AccountSid = accountSid, FriendlyName = friendlyName, UniqueName = uniqueName, CcEmails = ccEmails, SmsUrl = smsUrl, SmsMethod = smsMethod, SmsFallbackUrl = smsFallbackUrl, SmsFallbackMethod = smsFallbackMethod, StatusCallbackUrl = statusCallbackUrl, StatusCallbackMethod = statusCallbackMethod, SmsApplicationSid = smsApplicationSid, AddressSid = addressSid, Email = email, VerificationType = verificationType, VerificationDocumentSid = verificationDocumentSid
            };

            return(await CreateAsync(options, client));
        }
Beispiel #14
0
        /// <summary>
        /// Retrieve a list of HostedNumberOrders belonging to the account initiating the request.
        /// </summary>
        /// <param name="status"> The Status of this HostedNumberOrder. </param>
        /// <param name="phoneNumber"> An E164 formatted phone number. </param>
        /// <param name="incomingPhoneNumberSid"> IncomingPhoneNumber sid. </param>
        /// <param name="friendlyName"> A human readable description of this resource. </param>
        /// <param name="uniqueName"> A unique, developer assigned name of this HostedNumberOrder. </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of HostedNumberOrder </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <HostedNumberOrderResource> > ReadAsync(HostedNumberOrderResource.StatusEnum status = null,
                                                                                                             Types.PhoneNumber phoneNumber = null,
                                                                                                             string incomingPhoneNumberSid = null,
                                                                                                             string friendlyName           = null,
                                                                                                             string uniqueName             = null,
                                                                                                             int?pageSize             = null,
                                                                                                             long?limit               = null,
                                                                                                             ITwilioRestClient client = null)
        {
            var options = new ReadHostedNumberOrderOptions()
            {
                Status = status, PhoneNumber = phoneNumber, IncomingPhoneNumberSid = incomingPhoneNumberSid, FriendlyName = friendlyName, UniqueName = uniqueName, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #15
0
        /// <summary>
        /// Create a new outgoing call to phones, SIP-enabled endpoints or Twilio Client connections
        /// </summary>
        ///
        /// <param name="to"> Phone number, SIP address or client identifier to call </param>
        /// <param name="from"> Twilio number from which to originate the call </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="url"> Url from which to fetch TwiML </param>
        /// <param name="applicationSid"> ApplicationSid that configures from where to fetch TwiML </param>
        /// <param name="method"> HTTP method to use to fetch TwiML </param>
        /// <param name="fallbackUrl"> Fallback URL in case of error </param>
        /// <param name="fallbackMethod"> HTTP Method to use with FallbackUrl </param>
        /// <param name="statusCallback"> Status Callback URL </param>
        /// <param name="statusCallbackEvent"> The status_callback_event </param>
        /// <param name="statusCallbackMethod"> HTTP Method to use with StatusCallback </param>
        /// <param name="sendDigits"> Digits to send </param>
        /// <param name="ifMachine"> Action to take if a machine has answered the call </param>
        /// <param name="timeout"> Number of seconds to wait for an answer </param>
        /// <param name="record"> Whether or not to record the Call </param>
        /// <param name="recordingChannels"> The recording_channels </param>
        /// <param name="recordingStatusCallback"> The recording_status_callback </param>
        /// <param name="recordingStatusCallbackMethod"> The recording_status_callback_method </param>
        /// <param name="sipAuthUsername"> The sip_auth_username </param>
        /// <param name="sipAuthPassword"> The sip_auth_password </param>
        /// <param name="machineDetection"> Enable machine detection or end of greeting detection </param>
        /// <param name="machineDetectionTimeout"> Number of miliseconds to wait for machine detection </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Call </returns>
        public static async System.Threading.Tasks.Task <CallResource> CreateAsync(IEndpoint to, Types.PhoneNumber from, string pathAccountSid = null, Uri url = null, string applicationSid = null, Twilio.Http.HttpMethod method = null, Uri fallbackUrl = null, Twilio.Http.HttpMethod fallbackMethod = null, Uri statusCallback = null, List <string> statusCallbackEvent = null, Twilio.Http.HttpMethod statusCallbackMethod = null, string sendDigits = null, string ifMachine = null, int?timeout = null, bool?record = null, string recordingChannels = null, string recordingStatusCallback = null, Twilio.Http.HttpMethod recordingStatusCallbackMethod = null, string sipAuthUsername = null, string sipAuthPassword = null, string machineDetection = null, int?machineDetectionTimeout = null, ITwilioRestClient client = null)
        {
            var options = new CreateCallOptions(to, from)
            {
                PathAccountSid = pathAccountSid, Url = url, ApplicationSid = applicationSid, Method = method, FallbackUrl = fallbackUrl, FallbackMethod = fallbackMethod, StatusCallback = statusCallback, StatusCallbackEvent = statusCallbackEvent, StatusCallbackMethod = statusCallbackMethod, SendDigits = sendDigits, IfMachine = ifMachine, Timeout = timeout, Record = record, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, MachineDetection = machineDetection, MachineDetectionTimeout = machineDetectionTimeout
            };

            return(await CreateAsync(options, client));
        }
Beispiel #16
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathNumber"> The number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Number </returns>
        public static NumberResource Fetch(Types.PhoneNumber pathNumber, ITwilioRestClient client = null)
        {
            var options = new FetchNumberOptions(pathNumber);

            return(Fetch(options, client));
        }
Beispiel #17
0
        /// <summary>
        /// Retrieves a collection of Calls made to and from your account
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="to"> Phone number or Client identifier to filter `to` on </param>
        /// <param name="from"> Phone number or Client identifier to filter `from` on </param>
        /// <param name="parentCallSid"> Parent Call Sid to filter on </param>
        /// <param name="status"> Status to filter on </param>
        /// <param name="startTimeBefore"> StartTime to filter on </param>
        /// <param name="startTime"> StartTime to filter on </param>
        /// <param name="startTimeAfter"> StartTime to filter on </param>
        /// <param name="endTimeBefore"> EndTime to filter on </param>
        /// <param name="endTime"> EndTime to filter on </param>
        /// <param name="endTimeAfter"> EndTime to filter on </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Call </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <CallResource> > ReadAsync(string pathAccountSid = null, Types.PhoneNumber to = null, Types.PhoneNumber from = null, string parentCallSid = null, CallResource.StatusEnum status = null, DateTime?startTimeBefore = null, DateTime?startTime = null, DateTime?startTimeAfter = null, DateTime?endTimeBefore = null, DateTime?endTime = null, DateTime?endTimeAfter = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadCallOptions {
                PathAccountSid = pathAccountSid, To = to, From = from, ParentCallSid = parentCallSid, Status = status, StartTimeBefore = startTimeBefore, StartTime = startTime, StartTimeAfter = startTimeAfter, EndTimeBefore = endTimeBefore, EndTime = endTime, EndTimeAfter = endTimeAfter, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
Beispiel #18
0
        /// <summary>
        /// fetch
        /// </summary>
        ///
        /// <param name="pathNumber"> The number </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Number </returns>
        public static async System.Threading.Tasks.Task <NumberResource> FetchAsync(Types.PhoneNumber pathNumber, ITwilioRestClient client = null)
        {
            var options = new FetchNumberOptions(pathNumber);

            return(await FetchAsync(options, client));
        }
 /// <summary>
 /// Construct a new CreateValidationRequestOptions
 /// </summary>
 /// <param name="phoneNumber"> The phone number to verify in E.164 format </param>
 public CreateValidationRequestOptions(Types.PhoneNumber phoneNumber)
 {
     PhoneNumber = phoneNumber;
 }
        /// <summary>
        /// Send a message from the account used to make the request
        /// </summary>
        ///
        /// <param name="to"> The phone number to receive the message </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="from"> The phone number that initiated the message </param>
        /// <param name="messagingServiceSid"> The messaging_service_sid </param>
        /// <param name="body"> The body </param>
        /// <param name="mediaUrl"> The media_url </param>
        /// <param name="statusCallback"> URL Twilio will request when the status changes </param>
        /// <param name="applicationSid"> The application to use for callbacks </param>
        /// <param name="maxPrice"> The max_price </param>
        /// <param name="provideFeedback"> The provide_feedback </param>
        /// <param name="validityPeriod"> The validity_period </param>
        /// <param name="maxRate"> The max_rate </param>
        /// <param name="forceDelivery"> The force_delivery </param>
        /// <param name="providerSid"> The provider_sid </param>
        /// <param name="contentRetention"> The content_retention </param>
        /// <param name="addressRetention"> The address_retention </param>
        /// <param name="smartEncoded"> The smart_encoded </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Message </returns>
        public static MessageResource Create(Types.PhoneNumber to, string pathAccountSid = null, Types.PhoneNumber from = null, string messagingServiceSid = null, string body = null, List <Uri> mediaUrl = null, Uri statusCallback = null, string applicationSid = null, decimal?maxPrice = null, bool?provideFeedback = null, int?validityPeriod = null, string maxRate = null, bool?forceDelivery = null, string providerSid = null, MessageResource.ContentRetentionEnum contentRetention = null, MessageResource.AddressRetentionEnum addressRetention = null, bool?smartEncoded = null, ITwilioRestClient client = null)
        {
            var options = new CreateMessageOptions(to)
            {
                PathAccountSid = pathAccountSid, From = from, MessagingServiceSid = messagingServiceSid, Body = body, MediaUrl = mediaUrl, StatusCallback = statusCallback, ApplicationSid = applicationSid, MaxPrice = maxPrice, ProvideFeedback = provideFeedback, ValidityPeriod = validityPeriod, MaxRate = maxRate, ForceDelivery = forceDelivery, ProviderSid = providerSid, ContentRetention = contentRetention, AddressRetention = addressRetention, SmartEncoded = smartEncoded
            };

            return(Create(options, client));
        }
        /// <summary>
        /// Send a message from the account used to make the request
        /// </summary>
        /// <param name="to"> The destination phone number </param>
        /// <param name="pathAccountSid"> The SID of the Account that will create the resource </param>
        /// <param name="from"> The phone number that initiated the message </param>
        /// <param name="messagingServiceSid"> The SID of the Messaging Service you want to associate with the message. </param>
        /// <param name="body"> The text of the message you want to send. Can be up to 1,600 characters in length. </param>
        /// <param name="mediaUrl"> The URL of the media to send with the message </param>
        /// <param name="statusCallback"> The URL we should call to send status information to your application </param>
        /// <param name="applicationSid"> The application to use for callbacks </param>
        /// <param name="maxPrice"> The total maximum price up to 4 decimal places in US dollars acceptable for the message to
        ///                be delivered. </param>
        /// <param name="provideFeedback"> Whether to confirm delivery of the message </param>
        /// <param name="validityPeriod"> The number of seconds that the message can remain in our outgoing queue. </param>
        /// <param name="forceDelivery"> Reserved </param>
        /// <param name="smartEncoded"> Whether to detect Unicode characters that have a similar GSM-7 character and replace
        ///                    them </param>
        /// <param name="interactiveData"> A JSON string that represents an interactive message </param>
        /// <param name="forceOptIn"> Whether to forcefully whitelist a from:to pair </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Message </returns>
        public static async System.Threading.Tasks.Task <MessageResource> CreateAsync(Types.PhoneNumber to,
                                                                                      string pathAccountSid      = null,
                                                                                      Types.PhoneNumber from     = null,
                                                                                      string messagingServiceSid = null,
                                                                                      string body              = null,
                                                                                      List <Uri> mediaUrl      = null,
                                                                                      Uri statusCallback       = null,
                                                                                      string applicationSid    = null,
                                                                                      decimal?maxPrice         = null,
                                                                                      bool?provideFeedback     = null,
                                                                                      int?validityPeriod       = null,
                                                                                      bool?forceDelivery       = null,
                                                                                      bool?smartEncoded        = null,
                                                                                      string interactiveData   = null,
                                                                                      bool?forceOptIn          = null,
                                                                                      ITwilioRestClient client = null)
        {
            var options = new CreateMessageOptions(to)
            {
                PathAccountSid = pathAccountSid, From = from, MessagingServiceSid = messagingServiceSid, Body = body, MediaUrl = mediaUrl, StatusCallback = statusCallback, ApplicationSid = applicationSid, MaxPrice = maxPrice, ProvideFeedback = provideFeedback, ValidityPeriod = validityPeriod, ForceDelivery = forceDelivery, SmartEncoded = smartEncoded, InteractiveData = interactiveData, ForceOptIn = forceOptIn
            };

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of messages belonging to the account used to make the request
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="to"> Filter by messages to this number </param>
        /// <param name="from"> Filter by from number </param>
        /// <param name="dateSentBefore"> Filter by date sent </param>
        /// <param name="dateSent"> Filter by date sent </param>
        /// <param name="dateSentAfter"> Filter by date sent </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Message </returns>
        public static ResourceSet <MessageResource> Read(string pathAccountSid = null, Types.PhoneNumber to = null, Types.PhoneNumber from = null, DateTime?dateSentBefore = null, DateTime?dateSent = null, DateTime?dateSentAfter = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadMessageOptions {
                PathAccountSid = pathAccountSid, To = to, From = from, DateSentBefore = dateSentBefore, DateSent = dateSent, DateSentAfter = dateSentAfter, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Beispiel #23
0
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="beta"> The beta </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="phoneNumber"> The phone_number </param>
        /// <param name="origin"> The origin </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Mobile </returns>
        public static ResourceSet <MobileResource> Read(string pathAccountSid = null, bool?beta = null, string friendlyName = null, Types.PhoneNumber phoneNumber = null, string origin = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadMobileOptions {
                PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, Origin = origin, PageSize = pageSize, Limit = limit
            };

            return(Read(options, client));
        }
Beispiel #24
0
 /// <summary>
 /// Construct a new CreateMessageOptions
 /// </summary>
 /// <param name="to"> The destination phone number </param>
 public CreateMessageOptions(Types.PhoneNumber to)
 {
     To               = to;
     MediaUrl         = new List <Uri>();
     PersistentAction = new List <string>();
 }
 /// <summary>
 /// Construct a new CreateTollFreeOptions
 /// </summary>
 /// <param name="phoneNumber"> The phone_number </param>
 public CreateTollFreeOptions(Types.PhoneNumber phoneNumber)
 {
     PhoneNumber = phoneNumber;
 }
Beispiel #26
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="phoneNumber"> The phone_number </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="apiVersion"> The api_version </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="smsApplicationSid"> The sms_application_sid </param>
        /// <param name="smsFallbackMethod"> The sms_fallback_method </param>
        /// <param name="smsFallbackUrl"> The sms_fallback_url </param>
        /// <param name="smsMethod"> The sms_method </param>
        /// <param name="smsUrl"> The sms_url </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="voiceApplicationSid"> The voice_application_sid </param>
        /// <param name="voiceCallerIdLookup"> The voice_caller_id_lookup </param>
        /// <param name="voiceFallbackMethod"> The voice_fallback_method </param>
        /// <param name="voiceFallbackUrl"> The voice_fallback_url </param>
        /// <param name="voiceMethod"> The voice_method </param>
        /// <param name="voiceUrl"> The voice_url </param>
        /// <param name="identitySid"> The identity_sid </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of TollFree </returns>
        public static async System.Threading.Tasks.Task <TollFreeResource> CreateAsync(Types.PhoneNumber phoneNumber, string pathAccountSid = null, string apiVersion = null, string friendlyName = null, string smsApplicationSid = null, Twilio.Http.HttpMethod smsFallbackMethod = null, Uri smsFallbackUrl = null, Twilio.Http.HttpMethod smsMethod = null, Uri smsUrl = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, string voiceApplicationSid = null, bool?voiceCallerIdLookup = null, Twilio.Http.HttpMethod voiceFallbackMethod = null, Uri voiceFallbackUrl = null, Twilio.Http.HttpMethod voiceMethod = null, Uri voiceUrl = null, string identitySid = null, ITwilioRestClient client = null)
        {
            var options = new CreateTollFreeOptions(phoneNumber)
            {
                PathAccountSid = pathAccountSid, ApiVersion = apiVersion, FriendlyName = friendlyName, SmsApplicationSid = smsApplicationSid, SmsFallbackMethod = smsFallbackMethod, SmsFallbackUrl = smsFallbackUrl, SmsMethod = smsMethod, SmsUrl = smsUrl, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, VoiceApplicationSid = voiceApplicationSid, VoiceCallerIdLookup = voiceCallerIdLookup, VoiceFallbackMethod = voiceFallbackMethod, VoiceFallbackUrl = voiceFallbackUrl, VoiceMethod = voiceMethod, VoiceUrl = voiceUrl, IdentitySid = identitySid
            };

            return(await CreateAsync(options, client));
        }
Beispiel #27
0
        /// <summary>
        /// create
        /// </summary>
        ///
        /// <param name="pathConferenceSid"> The conference_sid </param>
        /// <param name="from"> The from </param>
        /// <param name="to"> The to </param>
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="statusCallback"> The status_callback </param>
        /// <param name="statusCallbackMethod"> The status_callback_method </param>
        /// <param name="statusCallbackEvent"> The status_callback_event </param>
        /// <param name="timeout"> The timeout </param>
        /// <param name="record"> The record </param>
        /// <param name="muted"> The muted </param>
        /// <param name="beep"> The beep </param>
        /// <param name="startConferenceOnEnter"> The start_conference_on_enter </param>
        /// <param name="endConferenceOnExit"> The end_conference_on_exit </param>
        /// <param name="waitUrl"> The wait_url </param>
        /// <param name="waitMethod"> The wait_method </param>
        /// <param name="earlyMedia"> The early_media </param>
        /// <param name="maxParticipants"> The max_participants </param>
        /// <param name="conferenceRecord"> The conference_record </param>
        /// <param name="conferenceTrim"> The conference_trim </param>
        /// <param name="conferenceStatusCallback"> The conference_status_callback </param>
        /// <param name="conferenceStatusCallbackMethod"> The conference_status_callback_method </param>
        /// <param name="conferenceStatusCallbackEvent"> The conference_status_callback_event </param>
        /// <param name="recordingChannels"> The recording_channels </param>
        /// <param name="recordingStatusCallback"> The recording_status_callback </param>
        /// <param name="recordingStatusCallbackMethod"> The recording_status_callback_method </param>
        /// <param name="sipAuthUsername"> The sip_auth_username </param>
        /// <param name="sipAuthPassword"> The sip_auth_password </param>
        /// <param name="region"> The region </param>
        /// <param name="conferenceRecordingStatusCallback"> The conference_recording_status_callback </param>
        /// <param name="conferenceRecordingStatusCallbackMethod"> The conference_recording_status_callback_method </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Participant </returns>
        public static async System.Threading.Tasks.Task <ParticipantResource> CreateAsync(string pathConferenceSid, Types.PhoneNumber from, Types.PhoneNumber to, string pathAccountSid = null, Uri statusCallback = null, Twilio.Http.HttpMethod statusCallbackMethod = null, List <string> statusCallbackEvent = null, int?timeout = null, bool?record = null, bool?muted = null, string beep = null, bool?startConferenceOnEnter = null, bool?endConferenceOnExit = null, Uri waitUrl = null, Twilio.Http.HttpMethod waitMethod = null, bool?earlyMedia = null, int?maxParticipants = null, string conferenceRecord = null, string conferenceTrim = null, Uri conferenceStatusCallback = null, Twilio.Http.HttpMethod conferenceStatusCallbackMethod = null, List <string> conferenceStatusCallbackEvent = null, string recordingChannels = null, Uri recordingStatusCallback = null, Twilio.Http.HttpMethod recordingStatusCallbackMethod = null, string sipAuthUsername = null, string sipAuthPassword = null, string region = null, Uri conferenceRecordingStatusCallback = null, Twilio.Http.HttpMethod conferenceRecordingStatusCallbackMethod = null, ITwilioRestClient client = null)
        {
            var options = new CreateParticipantOptions(pathConferenceSid, from, to)
            {
                PathAccountSid = pathAccountSid, StatusCallback = statusCallback, StatusCallbackMethod = statusCallbackMethod, StatusCallbackEvent = statusCallbackEvent, Timeout = timeout, Record = record, Muted = muted, Beep = beep, StartConferenceOnEnter = startConferenceOnEnter, EndConferenceOnExit = endConferenceOnExit, WaitUrl = waitUrl, WaitMethod = waitMethod, EarlyMedia = earlyMedia, MaxParticipants = maxParticipants, ConferenceRecord = conferenceRecord, ConferenceTrim = conferenceTrim, ConferenceStatusCallback = conferenceStatusCallback, ConferenceStatusCallbackMethod = conferenceStatusCallbackMethod, ConferenceStatusCallbackEvent = conferenceStatusCallbackEvent, RecordingChannels = recordingChannels, RecordingStatusCallback = recordingStatusCallback, RecordingStatusCallbackMethod = recordingStatusCallbackMethod, SipAuthUsername = sipAuthUsername, SipAuthPassword = sipAuthPassword, Region = region, ConferenceRecordingStatusCallback = conferenceRecordingStatusCallback, ConferenceRecordingStatusCallbackMethod = conferenceRecordingStatusCallbackMethod
            };

            return(await CreateAsync(options, client));
        }
Beispiel #28
0
 /// <summary>
 /// Construct a new CreateMessageOptions
 /// </summary>
 ///
 /// <param name="to"> The phone number to receive the message </param>
 public CreateMessageOptions(Types.PhoneNumber to)
 {
     To       = to;
     MediaUrl = new List <Uri>();
 }
        /// <summary>
        /// read
        /// </summary>
        ///
        /// <param name="pathAccountSid"> The account_sid </param>
        /// <param name="beta"> The beta </param>
        /// <param name="friendlyName"> The friendly_name </param>
        /// <param name="phoneNumber"> The phone_number </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Mobile </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <MobileResource> > ReadAsync(string pathAccountSid = null, bool?beta = null, string friendlyName = null, Types.PhoneNumber phoneNumber = null, int?pageSize = null, long?limit = null, ITwilioRestClient client = null)
        {
            var options = new ReadMobileOptions {
                PathAccountSid = pathAccountSid, Beta = beta, FriendlyName = friendlyName, PhoneNumber = phoneNumber, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }
        /// <summary>
        /// Retrieve a list of outgoing-caller-ids belonging to the account used to make the request
        /// </summary>
        /// <param name="pathAccountSid"> The SID of the Account that created the resources to read </param>
        /// <param name="phoneNumber"> The phone number of the OutgoingCallerId resources to read </param>
        /// <param name="friendlyName"> The string that identifies the OutgoingCallerId resources to read </param>
        /// <param name="pageSize"> Page size </param>
        /// <param name="limit"> Record limit </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of OutgoingCallerId </returns>
        public static async System.Threading.Tasks.Task <ResourceSet <OutgoingCallerIdResource> > ReadAsync(string pathAccountSid         = null,
                                                                                                            Types.PhoneNumber phoneNumber = null,
                                                                                                            string friendlyName           = null,
                                                                                                            int?pageSize             = null,
                                                                                                            long?limit               = null,
                                                                                                            ITwilioRestClient client = null)
        {
            var options = new ReadOutgoingCallerIdOptions()
            {
                PathAccountSid = pathAccountSid, PhoneNumber = phoneNumber, FriendlyName = friendlyName, PageSize = pageSize, Limit = limit
            };

            return(await ReadAsync(options, client));
        }