Exemplo n.º 1
0
        /// <summary>
        /// Updates the given properties of a Super SIM instance from your account.
        /// </summary>
        /// <param name="options"> Update Sim parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static SimResource Update(UpdateSimOptions options, ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = client.Request(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the given properties of a Super SIM instance from your account.
        /// </summary>
        /// <param name="options"> Update Sim parameters </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sim </returns>
        public static async System.Threading.Tasks.Task <SimResource> UpdateAsync(UpdateSimOptions options,
                                                                                  ITwilioRestClient client = null)
        {
            client = client ?? TwilioClient.GetRestClient();
            var response = await client.RequestAsync(BuildUpdateRequest(options, client));

            return(FromJson(response.Content));
        }
Exemplo n.º 3
0
 private static Request BuildUpdateRequest(UpdateSimOptions options, ITwilioRestClient client)
 {
     return(new Request(
                HttpMethod.Post,
                Rest.Domain.Supersim,
                "/v1/Sims/" + options.PathSid + "",
                postParams: options.GetParams()
                ));
 }
Exemplo n.º 4
0
        /// <summary>
        /// Updates the given properties of a Super SIM instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to update </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="status"> The new status of the Super SIM </param>
        /// <param name="fleet"> The SID or unique name of the Fleet to which the SIM resource should be assigned </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sim </returns>
        public static async System.Threading.Tasks.Task <SimResource> UpdateAsync(string pathSid,
                                                                                  string uniqueName = null,
                                                                                  SimResource.StatusUpdateEnum status = null,
                                                                                  string fleet             = null,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new UpdateSimOptions(pathSid)
            {
                UniqueName = uniqueName, Status = status, Fleet = fleet
            };

            return(await UpdateAsync(options, client));
        }
Exemplo n.º 5
0
        /// <summary>
        /// Updates the given properties of a Super SIM instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to update </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="status"> The new status of the Super SIM </param>
        /// <param name="fleet"> The SID or unique name of the Fleet to which the SIM resource should be assigned </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static SimResource Update(string pathSid,
                                         string uniqueName = null,
                                         SimResource.StatusUpdateEnum status = null,
                                         string fleet             = null,
                                         ITwilioRestClient client = null)
        {
            var options = new UpdateSimOptions(pathSid)
            {
                UniqueName = uniqueName, Status = status, Fleet = fleet
            };

            return(Update(options, client));
        }
Exemplo n.º 6
0
        /// <summary>
        /// Updates the given properties of a Super SIM instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to update </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="status"> The new status of the Super SIM </param>
        /// <param name="fleet"> The SID or unique name of the Fleet to which the SIM resource should be assigned </param>
        /// <param name="callbackUrl"> The URL we should call after the update has finished </param>
        /// <param name="callbackMethod"> The HTTP method we should use to call callback_url </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> A single instance of Sim </returns>
        public static SimResource Update(string pathSid,
                                         string uniqueName = null,
                                         SimResource.StatusUpdateEnum status = null,
                                         string fleet    = null,
                                         Uri callbackUrl = null,
                                         Twilio.Http.HttpMethod callbackMethod = null,
                                         ITwilioRestClient client = null)
        {
            var options = new UpdateSimOptions(pathSid)
            {
                UniqueName = uniqueName, Status = status, Fleet = fleet, CallbackUrl = callbackUrl, CallbackMethod = callbackMethod
            };

            return(Update(options, client));
        }
Exemplo n.º 7
0
        /// <summary>
        /// Updates the given properties of a Super SIM instance from your account.
        /// </summary>
        /// <param name="pathSid"> The SID that identifies the resource to update </param>
        /// <param name="uniqueName"> An application-defined string that uniquely identifies the resource </param>
        /// <param name="status"> The new status of the Super SIM </param>
        /// <param name="fleet"> The SID or unique name of the Fleet to which the SIM resource should be assigned </param>
        /// <param name="callbackUrl"> The URL we should call after the update has finished </param>
        /// <param name="callbackMethod"> The HTTP method we should use to call callback_url </param>
        /// <param name="accountSid"> The SID of the Account to which the Sim resource should belong </param>
        /// <param name="client"> Client to make requests to Twilio </param>
        /// <returns> Task that resolves to A single instance of Sim </returns>
        public static async System.Threading.Tasks.Task <SimResource> UpdateAsync(string pathSid,
                                                                                  string uniqueName = null,
                                                                                  SimResource.StatusUpdateEnum status = null,
                                                                                  string fleet    = null,
                                                                                  Uri callbackUrl = null,
                                                                                  Twilio.Http.HttpMethod callbackMethod = null,
                                                                                  string accountSid        = null,
                                                                                  ITwilioRestClient client = null)
        {
            var options = new UpdateSimOptions(pathSid)
            {
                UniqueName = uniqueName, Status = status, Fleet = fleet, CallbackUrl = callbackUrl, CallbackMethod = callbackMethod, AccountSid = accountSid
            };

            return(await UpdateAsync(options, client));
        }