samples/composed/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/StoreApi.cs
/// <summary>
/// Find purchase order by ID For valid response try integer IDs with value &gt;&#x3D; 1 and &lt;&#x3D; 10.\\ \\ Other values will generated exceptions
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="orderId">ID of pet that needs to be fetched</param>
/// <returns>Task of ApiResponse (Order)</returns>
Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10.\\ \\ Other values will generated exceptions
Find purchase order by ID For valid response try integer IDs with value > = 1 and < = 10 . \\ \\ Other values will generated exceptions
public async System.Threading.Tasks.Task<ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long? orderId)
        {
            if (orderId == null)
                throw new ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
            var localVarPath = "/store/order/{orderId}";
            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/json",
                "application/xml"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            if (orderId != null) localVarPathParams.Add("orderId", this.Configuration.ApiClient.ParameterToString(orderId)); 
            IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                Method.GET, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;
            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("GetOrderById", localVarResponse);
                if (exception != null) throw exception;
            }
            return new ApiResponse<Order>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                (Order) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(Order)));
        }
public async System . Threading . Tasks . Task < ApiResponse < Order > > GetOrderByIdAsyncWithHttpInfo ( long ? orderId ) { if ( orderId == 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 ( orderId != null ) localVarPathParams . Add ( " " , this . Configuration . ApiClient . ParameterToString ( orderId ) ) ; IRestResponse localVarResponse = ( IRestResponse ) await this . Configuration . ApiClient . CallApiAsync ( 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 < Order > ( localVarStatusCode , localVarResponse . Headers . ToDictionary ( x => x . Name , x => string . Join ( " " , x . Value ) ) , ( Order ) this . Configuration . ApiClient . Deserialize ( localVarResponse , typeof ( Order ) ) ) ; }
Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10.\\ \\ Other values will generated exceptions
Find purchase order by ID For valid response try integer IDs with value > = 1 and < = 10 . \\ \\ Other values will generated exceptions
// verify the required parameter 'orderId' is set // to determine the Content-Type header // to determine the Accept header // path parameter // make the HTTP request
Task of ApiResponse (Order)
Task of ApiResponse ( Order )
Thrown when fails to make API call
Thrown when fails to make API call
orderId
long?
ID of pet that needs to be fetched
ID of pet that needs to be fetched