/// <summary> /// Update current user You can update a few fields on the current user. Each field is optional and you\ndo not need to specify all fields on update. /// </summary> /// <param name="options"></param> /// <returns>Task of InlineResponse20010</returns> public async System.Threading.Tasks.Task<InlineResponse20010> UpdateUserSelfAsync (Options6 options = null) { ApiResponse<InlineResponse20010> response = await UpdateUserSelfAsyncWithHttpInfo(options); return response.Data; }
/// <summary> /// Update current user You can update a few fields on the current user. Each field is optional and you\ndo not need to specify all fields on update. /// </summary> /// <param name="options"></param> /// <returns>Task of ApiResponse (InlineResponse20010)</returns> public async System.Threading.Tasks.Task<ApiResponse<InlineResponse20010>> UpdateUserSelfAsyncWithHttpInfo (Options6 options = null) { var path_ = "/users/me"; 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"); postBody = Configuration.ApiClient.Serialize(options); // http body (model) parameter // 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) await Configuration.ApiClient.CallApiAsync(path_, Method.PUT, queryParams, postBody, headerParams, formParams, fileParams, pathParams, httpContentType); int statusCode = (int) response.StatusCode; if (statusCode >= 400) throw new ApiException (statusCode, "Error calling UpdateUserSelf: " + response.Content, response.Content); else if (statusCode == 0) throw new ApiException (statusCode, "Error calling UpdateUserSelf: " + response.ErrorMessage, response.ErrorMessage); return new ApiResponse<InlineResponse20010>(statusCode, response.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (InlineResponse20010) Configuration.ApiClient.Deserialize(response, typeof(InlineResponse20010))); }
/// <summary> /// Update current user You can update a few fields on the current user. Each field is optional and you\ndo not need to specify all fields on update. /// </summary> /// <param name="options"></param> /// <returns>InlineResponse20010</returns> public InlineResponse20010 UpdateUserSelf (Options6 options = null) { ApiResponse<InlineResponse20010> response = UpdateUserSelfWithHttpInfo(options); return response.Data; }