/// <summary> /// Downgrade billing plan Downgrading a billing plan can only be done for a lower plan. The current plan will stay\nin effect until the end of the current plan's billing cycle. /// </summary> /// <param name="options"></param> /// <returns>string</returns> public string DowngradeBillingPlan (Options7 options) { ApiResponse<string> response = DowngradeBillingPlanWithHttpInfo(options); return response.Data; }
/// <summary> /// Downgrade billing plan Downgrading a billing plan can only be done for a lower plan. The current plan will stay\nin effect until the end of the current plan's billing cycle. /// </summary> /// <param name="options"></param> /// <returns>ApiResponse of string</returns> public ApiResponse< string > DowngradeBillingPlanWithHttpInfo (Options7 options) { // verify the required parameter 'options' is set if (options == null) throw new ApiException(400, "Missing required parameter 'options' when calling UsersApi->DowngradeBillingPlan"); var path_ = "/users/me/billingplan/downgrade"; var pathParams = new Dictionary<String, String>(); var queryParams = new Dictionary<String, String>(); var headerParams = new Dictionary<String, String>(Configuration.DefaultHeader); var formParams = new Dictionary<String, String>(); var fileParams = new Dictionary<String, FileParameter>(); Object postBody = null; // to determine the Content-Type header String[] httpContentTypes = new String[] { "application/json" }; String httpContentType = Configuration.ApiClient.SelectHeaderContentType(httpContentTypes); // to determine the Accept header String[] httpHeaderAccepts = new String[] { "application/json", "text/plain", "text/html" }; String httpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(httpHeaderAccepts); if (httpHeaderAccept != null) headerParams.Add("Accept", httpHeaderAccept); // set "format" to json by default // e.g. /pet/{petId}.{format} becomes /pet/{petId}.json pathParams.Add("format", "json"); if (options.GetType() != typeof(byte[])) { postBody = Configuration.ApiClient.Serialize(options); // http body (model) parameter } else { postBody = options; // byte array } // authentication (apikey) required // http basic authentication required if (!String.IsNullOrEmpty(Configuration.Username) || !String.IsNullOrEmpty(Configuration.Password)) { headerParams["Authorization"] = "Basic " + Base64Encode(Configuration.Username + ":" + Configuration.Password); } // make the HTTP request IRestResponse response = (IRestResponse) Configuration.ApiClient.CallApi(path_, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, pathParams, httpContentType); int statusCode = (int) response.StatusCode; if (statusCode >= 400) throw new ApiException (statusCode, "Error calling DowngradeBillingPlan: " + response.Content, response.Content); else if (statusCode == 0) throw new ApiException (statusCode, "Error calling DowngradeBillingPlan: " + response.ErrorMessage, response.ErrorMessage); return new ApiResponse<string>(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (string) Configuration.ApiClient.Deserialize(response, typeof(string))); }
/// <summary> /// Downgrade billing plan Downgrading a billing plan can only be done for a lower plan. The current plan will stay\nin effect until the end of the current plan's billing cycle. /// </summary> /// <param name="options"></param> /// <returns>Task of string</returns> public async System.Threading.Tasks.Task<string> DowngradeBillingPlanAsync (Options7 options) { ApiResponse<string> response = await DowngradeBillingPlanAsyncWithHttpInfo(options); return response.Data; }