コード例 #1
0
        /// <summary>
        /// Create a new AWS Credential
        /// </summary>
        /// <param name="options"> Create Aws parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Aws </returns>
        public static AwsResource Create(CreateAwsOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #2
0
        /// <summary>
        /// Create a new AWS Credential
        /// </summary>
        /// <param name="options"> Create Aws parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Aws </returns>
        public static async System.Threading.Tasks.Task <AwsResource> CreateAsync(CreateAwsOptions options,
                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
コード例 #3
0
 private static Request BuildCreateRequest(CreateAwsOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Accounts,
                "/v1/Credentials/AWS",
                postParams: options.GetParams()
                ));
 }
コード例 #4
0
        /// <summary>
        /// Create a new AWS Credential
        /// </summary>
        /// <param name="credentials"> A string that contains the AWS access credentials in the format
        ///                   <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY> </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="accountSid"> The Subaccount this Credential should be associated with. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Aws </returns>
        public static async System.Threading.Tasks.Task <AwsResource> CreateAsync(string credentials,
                                                                                  string friendlyName      = null,
                                                                                  string accountSid        = null,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new CreateAwsOptions(credentials)
            {
                FriendlyName = friendlyName, AccountSid = accountSid
            };

            return(await CreateAsync(options, client));
        }
コード例 #5
0
        /// <summary>
        /// Create a new AWS Credential
        /// </summary>
        /// <param name="credentials"> A string that contains the AWS access credentials in the format
        ///                   <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY> </param>
        /// <param name="friendlyName"> A string to describe the resource </param>
        /// <param name="accountSid"> The Subaccount this Credential should be associated with. </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Aws </returns>
        public static AwsResource Create(string credentials,
                                         string friendlyName      = null,
                                         string accountSid        = null,
                                         ITwilioRestClient client = null)
        {
            var options = new CreateAwsOptions(credentials)
            {
                FriendlyName = friendlyName, AccountSid = accountSid
            };

            return(Create(options, client));
        }