samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs
/// <summary>
/// Add a new pet to the store 
/// </summary>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <returns></returns>
Add a new pet to the store
Add a new pet to the store
public void AddPet (Pet body)
        {
            if (body == null) throw new ApiException(400, "Missing required parameter 'body' when calling AddPet");
            var path = "/pet";
            path = path.Replace("{format}", "json");
            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;
                                                postBody = ApiClient.Serialize(body); 
            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 AddPet: " + response.Content, response.Content);
            else if (((int)response.StatusCode) == 0)
                throw new ApiException ((int)response.StatusCode, "Error calling AddPet: " + response.ErrorMessage, response.ErrorMessage);
            return;
        }
public void AddPet ( Pet body ) { if ( body == null ) throw new ApiException ( 400 , " " ) ; var path = " " ; path = path . Replace ( " " , " " ) ; 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 ; postBody = ApiClient . Serialize ( body ) ; 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 ; }
Add a new pet to the store
Add a new pet to the store
// verify the required parameter 'body' is set // http body (model) parameter // authentication setting, if any // make the HTTP request
None
body
Pet
Pet object that needs to be added to the store
Pet object that needs to be added to the store