samples/composed/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/UserApi.cs
/// <summary>
/// Updated user This can only be done by the logged in user.
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Updated user object</param>
/// <param name="username">name that need to be updated</param>
/// <returns>ApiResponse of Object(void)</returns>
Updated user This can only be done by the logged in user.
Updated user This can only be done by the logged in user .
public ApiResponse<Object> UserUsernamePutWithHttpInfo (User body, string username)
        {
            if (body == null)
                throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UserUsernamePut");
            if (username == null)
                throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UserUsernamePut");
            var localVarPath = "/user/{username}";
            var localVarPathParams = new Dictionary<String, String>();
            var localVarQueryParams = new List<KeyValuePair<String, String>>();
            var localVarHeaderParams = new Dictionary<String, String>(this.Configuration.DefaultHeader);
            var localVarFormParams = new Dictionary<String, String>();
            var localVarFileParams = new Dictionary<String, FileParameter>();
            Object localVarPostBody = null;
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
            String[] localVarHttpHeaderAccepts = new String[] {
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); 
            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(body); 
            }
            else
            {
                localVarPostBody = body; 
            }
            IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
                Method.PUT, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;
            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("UserUsernamePut", localVarResponse);
                if (exception != null) throw exception;
            }
            return new ApiResponse<Object>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                null);
        }
public ApiResponse < Object > UserUsernamePutWithHttpInfo ( User body , string username ) { if ( body == null ) throw new ApiException ( 400 , " " ) ; if ( username == null ) throw new ApiException ( 400 , " " ) ; var localVarPath = " " ; var localVarPathParams = new Dictionary < String , String > ( ) ; var localVarQueryParams = new List < KeyValuePair < String , String > > ( ) ; var localVarHeaderParams = new Dictionary < String , String > ( this . Configuration . DefaultHeader ) ; var localVarFormParams = new Dictionary < String , String > ( ) ; var localVarFileParams = new Dictionary < String , FileParameter > ( ) ; Object localVarPostBody = null ; String [ ] localVarHttpContentTypes = new String [ ] { " " } ; String localVarHttpContentType = this . Configuration . ApiClient . SelectHeaderContentType ( localVarHttpContentTypes ) ; String [ ] localVarHttpHeaderAccepts = new String [ ] { } ; String localVarHttpHeaderAccept = this . Configuration . ApiClient . SelectHeaderAccept ( localVarHttpHeaderAccepts ) ; if ( localVarHttpHeaderAccept != null ) localVarHeaderParams . Add ( " " , localVarHttpHeaderAccept ) ; if ( username != null ) localVarPathParams . Add ( " " , this . Configuration . ApiClient . ParameterToString ( username ) ) ; if ( body != null && body . GetType ( ) != typeof ( byte [ ] ) ) { localVarPostBody = this . Configuration . ApiClient . Serialize ( body ) ; } else { localVarPostBody = body ; } IRestResponse localVarResponse = ( IRestResponse ) this . Configuration . ApiClient . CallApi ( localVarPath , Method . PUT , localVarQueryParams , localVarPostBody , localVarHeaderParams , localVarFormParams , localVarFileParams , localVarPathParams , localVarHttpContentType ) ; int localVarStatusCode = ( int ) localVarResponse . StatusCode ; if ( ExceptionFactory != null ) { Exception exception = ExceptionFactory ( " " , localVarResponse ) ; if ( exception != null ) throw exception ; } return new ApiResponse < Object > ( localVarStatusCode , localVarResponse . Headers . ToDictionary ( x => x . Name , x => string . Join ( " " , x . Value ) ) , null ) ; }
Updated user This can only be done by the logged in user.
Updated user This can only be done by the logged in user .
// verify the required parameter 'body' is set // verify the required parameter 'username' is set // to determine the Content-Type header // to determine the Accept header // path parameter // http body (model) parameter // byte array // make the HTTP request
ApiResponse of Object(void)
ApiResponse of Object ( void )
Thrown when fails to make API call
Thrown when fails to make API call
body
User
Updated user object
Updated user object
username
string
name that need to be updated
name that need to be updated