示例#1
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="pathCustomerProfileSid"> The unique string that identifies the resource. </param>
        /// <param name="objectSid"> The sid of an object bag </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CustomerProfilesEntityAssignments </returns>
        public static async System.Threading.Tasks.Task <CustomerProfilesEntityAssignmentsResource> CreateAsync(string pathCustomerProfileSid,
                                                                                                                string objectSid,
                                                                                                                ITwilioRestClient client = null)
        {
            var options = new CreateCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, objectSid);

            return(await CreateAsync(options, client));
        }
示例#2
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="pathCustomerProfileSid"> The unique string that identifies the resource. </param>
        /// <param name="objectSid"> The sid of an object bag </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CustomerProfilesEntityAssignments </returns>
        public static CustomerProfilesEntityAssignmentsResource Create(string pathCustomerProfileSid,
                                                                       string objectSid,
                                                                       ITwilioRestClient client = null)
        {
            var options = new CreateCustomerProfilesEntityAssignmentsOptions(pathCustomerProfileSid, objectSid);

            return(Create(options, client));
        }
示例#3
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="options"> Create CustomerProfilesEntityAssignments parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of CustomerProfilesEntityAssignments </returns>
        public static CustomerProfilesEntityAssignmentsResource Create(CreateCustomerProfilesEntityAssignmentsOptions options,
                                                                       ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }
示例#4
0
 private static Request BuildCreateRequest(CreateCustomerProfilesEntityAssignmentsOptions options,
                                           ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Trusthub,
                "/v1/CustomerProfiles/" + options.PathCustomerProfileSid + "/EntityAssignments",
                postParams: options.GetParams(),
                headerParams: null
                ));
 }
示例#5
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="options"> Create CustomerProfilesEntityAssignments parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of CustomerProfilesEntityAssignments </returns>
        public static async System.Threading.Tasks.Task <CustomerProfilesEntityAssignmentsResource> CreateAsync(CreateCustomerProfilesEntityAssignmentsOptions options,
                                                                                                                ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }