/// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create CredentialList parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CredentialList </returns>
        public static CredentialListResource Create(CreateCredentialListOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathTrunkSid"> The SID of the Trunk to associate the credential list with </param>
        /// <param name="credentialListSid"> The SID of the Credential List that you want to associate with the trunk </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CredentialList </returns>
        public static async System.Threading.Tasks.Task <CredentialListResource> CreateAsync(string pathTrunkSid,
                                                                                             string credentialListSid,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new CreateCredentialListOptions(pathTrunkSid, credentialListSid);

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathTrunkSid"> The SID of the Trunk to associate the credential list with </param>
        /// <param name="credentialListSid"> The SID of the Credential List that you want to associate with the trunk </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CredentialList </returns>
        public static CredentialListResource Create(string pathTrunkSid,
                                                    string credentialListSid,
                                                    ITwilioRestClient client = null)
        {
            var options = new CreateCredentialListOptions(pathTrunkSid, credentialListSid);

            return(Create(options, client));
        }
Example #4
0
 private static Request BuildCreateRequest(CreateCredentialListOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Trunking,
                "/v1/Trunks/" + options.PathTrunkSid + "/CredentialLists",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create CredentialList parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CredentialList </returns>
        public static async System.Threading.Tasks.Task <CredentialListResource> CreateAsync(CreateCredentialListOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }