Example #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));
        }
Example #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));
        }
Example #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));
        }
Example #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
                ));
 }
Example #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));
        }