Пример #1
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="options"> Create ItemAssignment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of ItemAssignment </returns>
        public static ItemAssignmentResource Create(CreateItemAssignmentOptions 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 Assigned Item.
        /// </summary>
        /// <param name="pathBundleSid"> 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 ItemAssignment </returns>
        public static async System.Threading.Tasks.Task <ItemAssignmentResource> CreateAsync(string pathBundleSid,
                                                                                             string objectSid,
                                                                                             ITwilioRestClient client = null)
        {
            var options = new CreateItemAssignmentOptions(pathBundleSid, objectSid);

            return(await CreateAsync(options, client));
        }
Пример #3
0
 private static Request BuildCreateRequest(CreateItemAssignmentOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Numbers,
                "/v2/RegulatoryCompliance/Bundles/" + options.PathBundleSid + "/ItemAssignments",
                postParams: options.GetParams()
                ));
 }
Пример #4
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="pathBundleSid"> 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 ItemAssignment </returns>
        public static ItemAssignmentResource Create(string pathBundleSid, string objectSid, ITwilioRestClient client = null)
        {
            var options = new CreateItemAssignmentOptions(pathBundleSid, objectSid);

            return(Create(options, client));
        }
Пример #5
0
        /// <summary>
        /// Create a new Assigned Item.
        /// </summary>
        /// <param name="options"> Create ItemAssignment parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of ItemAssignment </returns>
        public static async System.Threading.Tasks.Task <ItemAssignmentResource> CreateAsync(CreateItemAssignmentOptions options,
                                                                                             ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }