samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/DogApi.cs
/// <summary>
/// Find dog by ID Returns a single dog
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="dogId">ID of dog to return</param>
/// <returns>ApiResponse of Dog</returns>
Find dog by ID Returns a single dog
Find dog by ID Returns a single dog
public ApiResponse< Dog > GetDogByIdWithHttpInfo (long? dogId)
        {
            if (dogId == null)
                throw new ApiException(400, "Missing required parameter 'dogId' when calling DogApi->GetDogById");
            var localVarPath = "/dog/{dogId}";
            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 (dogId != null) localVarPathParams.Add("dogId", this.Configuration.ApiClient.ParameterToString(dogId)); 
            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("GetDogById", localVarResponse);
                if (exception != null) throw exception;
            }
            return new ApiResponse<Dog>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                (Dog) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Dog)));
        }
public ApiResponse < Dog > GetDogByIdWithHttpInfo ( long ? dogId ) { if ( dogId == 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 ( dogId != null ) localVarPathParams . Add ( " " , this . Configuration . ApiClient . ParameterToString ( dogId ) ) ; 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 < Dog > ( localVarStatusCode , localVarResponse . Headers . ToDictionary ( x => x . Name , x => string . Join ( " " , x . Value ) ) , ( Dog ) this . Configuration . ApiClient . Deserialize ( localVarResponse , typeof ( Dog ) ) ) ; }
Find dog by ID Returns a single dog
Find dog by ID Returns a single dog
// verify the required parameter 'dogId' is set // to determine the Content-Type header // to determine the Accept header // path parameter // make the HTTP request
ApiResponse of Dog
ApiResponse of Dog
Thrown when fails to make API call
Thrown when fails to make API call
dogId
long?
ID of dog to return
ID of dog to return