samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs
/// <summary>
/// Updates a pet in the store with form data 
/// </summary>
/// <param name="petId">ID of pet that needs to be updated</param> 
/// <param name="name">Updated name of the pet</param> 
/// <param name="status">Updated status of the pet</param> 
/// <returns></returns>            
Updates a pet in the store with form data
Updates a pet in the store with form data
public void UpdatePetWithForm (long? petId, string name, string status)
        {
            if (petId == null) throw new ApiException(400, "Missing required parameter 'petId' when calling UpdatePetWithForm");
            var path = "/pet/{petId}";
            path = path.Replace("{format}", "json");
            path = path.Replace("{" + "petId" + "}", ApiClient.ParameterToString(petId));
            var queryParams = new Dictionary<String, String>();
            var headerParams = new Dictionary<String, String>();
            var formParams = new Dictionary<String, String>();
            var fileParams = new Dictionary<String, FileParameter>();
            String postBody = null;
                                    if (name != null) formParams.Add("name", ApiClient.ParameterToString(name)); 
if (status != null) formParams.Add("status", ApiClient.ParameterToString(status)); 
            String[] authSettings = new String[] { "petstore_auth" };
            IRestResponse response = (IRestResponse) ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);
            if (((int)response.StatusCode) >= 400)
                throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.Content, response.Content);
            else if (((int)response.StatusCode) == 0)
                throw new ApiException ((int)response.StatusCode, "Error calling UpdatePetWithForm: " + response.ErrorMessage, response.ErrorMessage);
            return;
        }
public void UpdatePetWithForm ( long ? petId , string name , string status ) { if ( petId == null ) throw new ApiException ( 400 , " " ) ; var path = " " ; path = path . Replace ( " " , " " ) ; path = path . Replace ( " " + " " + " " , ApiClient . ParameterToString ( petId ) ) ; var queryParams = new Dictionary < String , String > ( ) ; var headerParams = new Dictionary < String , String > ( ) ; var formParams = new Dictionary < String , String > ( ) ; var fileParams = new Dictionary < String , FileParameter > ( ) ; String postBody = null ; if ( name != null ) formParams . Add ( " " , ApiClient . ParameterToString ( name ) ) ; if ( status != null ) formParams . Add ( " " , ApiClient . ParameterToString ( status ) ) ; String [ ] authSettings = new String [ ] { " " } ; IRestResponse response = ( IRestResponse ) ApiClient . CallApi ( path , Method . POST , queryParams , postBody , headerParams , formParams , fileParams , authSettings ) ; if ( ( ( int ) response . StatusCode ) >= 400 ) throw new ApiException ( ( int ) response . StatusCode , " " + response . Content , response . Content ) ; else if ( ( ( int ) response . StatusCode ) == 0 ) throw new ApiException ( ( int ) response . StatusCode , " " + response . ErrorMessage , response . ErrorMessage ) ; return ; }
Updates a pet in the store with form data
Updates a pet in the store with form data
// verify the required parameter 'petId' is set // form parameter // form parameter // authentication setting, if any // make the HTTP request
None
petId
long?
ID of pet that needs to be updated
ID of pet that needs to be updated
name
string
Updated name of the pet
Updated name of the pet
status
string
Updated status of the pet
Updated status of the pet