Exemple #1
0
        /// <summary>
        /// Add a new push notification credential to your account
        /// </summary>
        /// <param name="type"> The type of push-notification service the credential is for. </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="certificate"> [APN only] The URL encoded representation of the certificate. </param>
        /// <param name="privateKey"> [APN only] The URL encoded representation of the private key. </param>
        /// <param name="sandbox"> [APN only] Whether to send the credential to sandbox APNs. </param>
        /// <param name="apiKey"> [GCM only] The API key for the project that was obtained from the Google Developer console
        ///              for your GCM Service application credential. </param>
        /// <param name="secret"> [FCM only] The Server key of your project from Firebase console. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Credential </returns>
        public static CredentialResource Create(CredentialResource.PushTypeEnum type,
                                                string friendlyName      = null,
                                                string certificate       = null,
                                                string privateKey        = null,
                                                bool?sandbox             = null,
                                                string apiKey            = null,
                                                string secret            = null,
                                                ITwilioRestClient client = null)
        {
            var options = new CreateCredentialOptions(type)
            {
                FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret
            };

            return(Create(options, client));
        }
Exemple #2
0
 /// <summary>
 /// Construct a new CreateCredentialOptions
 /// </summary>
 /// <param name="type"> The type of push-notification service the credential is for. </param>
 public CreateCredentialOptions(CredentialResource.PushTypeEnum type)
 {
     Type = type;
 }
Exemple #3
0
        /// <summary>
        /// Update an existing push notification credential on your account
        /// </summary>
        /// <param name="pathSid"> A 34 character string that uniquely identifies this resource. </param>
        /// <param name="type"> The type of push-notification service the credential is for. </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="certificate"> [APN only] The URL encoded representation of the certificate. </param>
        /// <param name="privateKey"> [APN only] The URL encoded representation of the private key. </param>
        /// <param name="sandbox"> [APN only] Whether to send the credential to sandbox APNs. </param>
        /// <param name="apiKey"> [GCM only] The API key for the project that was obtained from the Google Developer console
        ///              for your GCM Service application credential. </param>
        /// <param name="secret"> [FCM only] The Server key of your project from Firebase console. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Credential </returns>
        public static async System.Threading.Tasks.Task <CredentialResource> UpdateAsync(string pathSid,
                                                                                         CredentialResource.PushTypeEnum type = null,
                                                                                         string friendlyName      = null,
                                                                                         string certificate       = null,
                                                                                         string privateKey        = null,
                                                                                         bool?sandbox             = null,
                                                                                         string apiKey            = null,
                                                                                         string secret            = null,
                                                                                         ITwilioRestClient client = null)
        {
            var options = new UpdateCredentialOptions(pathSid)
            {
                Type = type, FriendlyName = friendlyName, Certificate = certificate, PrivateKey = privateKey, Sandbox = sandbox, ApiKey = apiKey, Secret = secret
            };

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