samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/AnimalApi.cs
/// <summary>
/// Find animal by ID Returns a single animal
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="animalId">ID of pet to return</param>
/// <returns>ApiResponse of Animal</returns>
Find animal by ID Returns a single animal
Find animal by ID Returns a single animal
public ApiResponse< Animal > GetAnimalByIdWithHttpInfo (long? animalId)
        {
            if (animalId == null)
                throw new ApiException(400, "Missing required parameter 'animalId' when calling AnimalApi->GetAnimalById");
            var localVarPath = "/animal/{animalId}";
            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[] {
                "application/xml",
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            if (animalId != null) localVarPathParams.Add("animalId", this.Configuration.ApiClient.ParameterToString(animalId)); 
            IRestResponse localVarResponse = (IRestResponse) this.Configuration.ApiClient.CallApi(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;
            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetAnimalById", localVarResponse);
                if (exception != null) throw exception;
            }
            return new ApiResponse<Animal>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                (Animal) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Animal)));
        }
public ApiResponse < Animal > GetAnimalByIdWithHttpInfo ( long ? animalId ) { if ( animalId == 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 ( animalId != null ) localVarPathParams . Add ( " " , this . Configuration . ApiClient . ParameterToString ( animalId ) ) ; IRestResponse localVarResponse = ( IRestResponse ) this . Configuration . ApiClient . CallApi ( localVarPath , Method . GET , 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 < Animal > ( localVarStatusCode , localVarResponse . Headers . ToDictionary ( x => x . Name , x => string . Join ( " " , x . Value ) ) , ( Animal ) this . Configuration . ApiClient . Deserialize ( localVarResponse , typeof ( Animal ) ) ) ; }
Find animal by ID Returns a single animal
Find animal by ID Returns a single animal
// verify the required parameter 'animalId' is set // to determine the Content-Type header // to determine the Accept header // path parameter // make the HTTP request
ApiResponse of Animal
ApiResponse of Animal
Thrown when fails to make API call
Thrown when fails to make API call
animalId
long?
ID of pet to return
ID of pet to return