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

            return(FromJson(response.Content));
        }
示例#2
0
 private static Request BuildCreateRequest(CreateSyncMapItemOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Preview,
                "/Sync/Services/" + options.PathServiceSid + "/Maps/" + options.PathMapSid + "/Items",
                postParams: options.GetParams()
                ));
 }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathMapSid"> The map_sid </param>
        /// <param name="key"> The key </param>
        /// <param name="data"> The data </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncMapItem </returns>
        public static async System.Threading.Tasks.Task <SyncMapItemResource> CreateAsync(string pathServiceSid,
                                                                                          string pathMapSid,
                                                                                          string key,
                                                                                          object data,
                                                                                          ITwilioRestClient client = null)
        {
            var options = new CreateSyncMapItemOptions(pathServiceSid, pathMapSid, key, data);

            return(await CreateAsync(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="pathServiceSid"> The service_sid </param>
        /// <param name="pathMapSid"> The map_sid </param>
        /// <param name="key"> The key </param>
        /// <param name="data"> The data </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of SyncMapItem </returns>
        public static SyncMapItemResource Create(string pathServiceSid,
                                                 string pathMapSid,
                                                 string key,
                                                 object data,
                                                 ITwilioRestClient client = null)
        {
            var options = new CreateSyncMapItemOptions(pathServiceSid, pathMapSid, key, data);

            return(Create(options, client));
        }
        /// <summary>
        /// create
        /// </summary>
        /// <param name="options"> Create SyncMapItem parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of SyncMapItem </returns>
        public static async System.Threading.Tasks.Task <SyncMapItemResource> CreateAsync(CreateSyncMapItemOptions options,
                                                                                          ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildCreateRequest(options, client));

            return(FromJson(response.Content));
        }