samples/composed/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs
/// <summary>
/// Find pet by ID schedule pet feeding
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="token">status</param>
/// <param name="petType">type of food</param>
/// <param name="status">status</param>
/// <param name="petId">ID of pet to return</param>
/// <returns>Task of ApiResponse</returns>
Find pet by ID schedule pet feeding
Find pet by ID schedule pet feeding
public async System.Threading.Tasks.Task<ApiResponse<Object>> FeedPetAsyncWithHttpInfo (Pet body, string token, string petType, string status, long? petId)
        {
            if (body == null)
                throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->FeedPet");
            if (token == null)
                throw new ApiException(400, "Missing required parameter 'token' when calling PetApi->FeedPet");
            if (petType == null)
                throw new ApiException(400, "Missing required parameter 'petType' when calling PetApi->FeedPet");
            if (status == null)
                throw new ApiException(400, "Missing required parameter 'status' when calling PetApi->FeedPet");
            if (petId == null)
                throw new ApiException(400, "Missing required parameter 'petId' when calling PetApi->FeedPet");
            var localVarPath = "/pet/feed/{petId}";
            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[] {
                "application/json", 
                "application/xml"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);
            String[] localVarHttpHeaderAccepts = new String[] {
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
            if (localVarHttpHeaderAccept != null)
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); 
            if (petType != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "petType", petType)); 
            if (status != null) localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "status", status)); 
            if (token != null) localVarHeaderParams.Add("token", this.Configuration.ApiClient.ParameterToString(token)); 
            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(body); 
            }
            else
            {
                localVarPostBody = body; 
            }
            IRestResponse localVarResponse = (IRestResponse) await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                localVarPathParams, localVarHttpContentType);
            int localVarStatusCode = (int) localVarResponse.StatusCode;
            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("FeedPet", localVarResponse);
                if (exception != null) throw exception;
            }
            return new ApiResponse<Object>(localVarStatusCode,
                localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                null);
        }
public async System . Threading . Tasks . Task < ApiResponse < Object > > FeedPetAsyncWithHttpInfo ( Pet body , string token , string petType , string status , long ? petId ) { if ( body == null ) throw new ApiException ( 400 , " " ) ; if ( token == null ) throw new ApiException ( 400 , " " ) ; if ( petType == null ) throw new ApiException ( 400 , " " ) ; if ( status == null ) throw new ApiException ( 400 , " " ) ; if ( petId == 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 ( petId != null ) localVarPathParams . Add ( " " , this . Configuration . ApiClient . ParameterToString ( petId ) ) ; if ( petType != null ) localVarQueryParams . AddRange ( this . Configuration . ApiClient . ParameterToKeyValuePairs ( " " , " " , petType ) ) ; if ( status != null ) localVarQueryParams . AddRange ( this . Configuration . ApiClient . ParameterToKeyValuePairs ( " " , " " , status ) ) ; if ( token != null ) localVarHeaderParams . Add ( " " , this . Configuration . ApiClient . ParameterToString ( token ) ) ; if ( body != null && body . GetType ( ) != typeof ( byte [ ] ) ) { localVarPostBody = this . Configuration . ApiClient . Serialize ( body ) ; } else { localVarPostBody = body ; } IRestResponse localVarResponse = ( IRestResponse ) await this . Configuration . ApiClient . CallApiAsync ( localVarPath , Method . POST , 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 < Object > ( localVarStatusCode , localVarResponse . Headers . ToDictionary ( x => x . Name , x => string . Join ( " " , x . Value ) ) , null ) ; }
Find pet by ID schedule pet feeding
Find pet by ID schedule pet feeding
// verify the required parameter 'body' is set // verify the required parameter 'token' is set // verify the required parameter 'petType' is set // verify the required parameter 'status' is set // verify the required parameter 'petId' is set // to determine the Content-Type header // to determine the Accept header // path parameter // query parameter // query parameter // header parameter // http body (model) parameter // byte array // make the HTTP request
Task of ApiResponse
Task of ApiResponse
Thrown when fails to make API call
Thrown when fails to make API call
body
Pet
Pet object that needs to be added to the store
Pet object that needs to be added to the store
token
string
None
petType
string
type of food
type of food
status
string
None
petId
long?
ID of pet to return
ID of pet to return