@@ -495,6 +495,124 @@ def upload_file_with_http_info(pet_id, opts = {})
495
495
end
496
496
return data , status_code , headers
497
497
end
498
+
499
+ # Fake endpoint to test byte array return by 'Find pet by ID'
500
+ # Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
501
+ # @param pet_id ID of pet that needs to be fetched
502
+ # @param [Hash] opts the optional parameters
503
+ # @return [binary]
504
+ def get_pet_by_id_with_byte_array ( pet_id , opts = { } )
505
+ data , status_code , headers = get_pet_by_id_with_byte_array_with_http_info ( pet_id , opts )
506
+ return data
507
+ end
508
+
509
+ # Fake endpoint to test byte array return by 'Find pet by ID'
510
+ # Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
511
+ # @param pet_id ID of pet that needs to be fetched
512
+ # @param [Hash] opts the optional parameters
513
+ # @return [Array<(binary, Fixnum, Hash)>] binary data, response status code and response headers
514
+ def get_pet_by_id_with_byte_array_with_http_info ( pet_id , opts = { } )
515
+ if @api_client . config . debugging
516
+ @api_client . config . logger . debug "Calling API: PetApi#get_pet_by_id_with_byte_array ..."
517
+ end
518
+
519
+ # verify the required parameter 'pet_id' is set
520
+ fail "Missing the required parameter 'pet_id' when calling get_pet_by_id_with_byte_array" if pet_id . nil?
521
+
522
+ # resource path
523
+ path = "/pet/{petId}?testing_byte_array=true" . sub ( '{format}' , 'json' ) . sub ( '{' + 'petId' + '}' , pet_id . to_s )
524
+
525
+ # query parameters
526
+ query_params = { }
527
+
528
+ # header parameters
529
+ header_params = { }
530
+
531
+ # HTTP header 'Accept' (if needed)
532
+ _header_accept = [ 'application/json' , 'application/xml' ]
533
+ _header_accept_result = @api_client . select_header_accept ( _header_accept ) and header_params [ 'Accept' ] = _header_accept_result
534
+
535
+ # HTTP header 'Content-Type'
536
+ _header_content_type = [ ]
537
+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( _header_content_type )
538
+
539
+ # form parameters
540
+ form_params = { }
541
+
542
+ # http body (model)
543
+ post_body = nil
544
+
545
+
546
+ auth_names = [ 'api_key' ]
547
+ data , status_code , headers = @api_client . call_api ( :GET , path ,
548
+ :header_params => header_params ,
549
+ :query_params => query_params ,
550
+ :form_params => form_params ,
551
+ :body => post_body ,
552
+ :auth_names => auth_names ,
553
+ :return_type => 'binary' )
554
+ if @api_client . config . debugging
555
+ @api_client . config . logger . debug "API called: PetApi#get_pet_by_id_with_byte_array\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
556
+ end
557
+ return data , status_code , headers
558
+ end
559
+
560
+ # Fake endpoint to test byte array in body parameter for adding a new pet to the store
561
+ #
562
+ # @param [Hash] opts the optional parameters
563
+ # @option opts [binary] :body Pet object in the form of byte array
564
+ # @return [nil]
565
+ def add_pet_using_byte_array ( opts = { } )
566
+ add_pet_using_byte_array_with_http_info ( opts )
567
+ return nil
568
+ end
569
+
570
+ # Fake endpoint to test byte array in body parameter for adding a new pet to the store
571
+ #
572
+ # @param [Hash] opts the optional parameters
573
+ # @option opts [binary] :body Pet object in the form of byte array
574
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
575
+ def add_pet_using_byte_array_with_http_info ( opts = { } )
576
+ if @api_client . config . debugging
577
+ @api_client . config . logger . debug "Calling API: PetApi#add_pet_using_byte_array ..."
578
+ end
579
+
580
+ # resource path
581
+ path = "/pet?testing_byte_array=true" . sub ( '{format}' , 'json' )
582
+
583
+ # query parameters
584
+ query_params = { }
585
+
586
+ # header parameters
587
+ header_params = { }
588
+
589
+ # HTTP header 'Accept' (if needed)
590
+ _header_accept = [ 'application/json' , 'application/xml' ]
591
+ _header_accept_result = @api_client . select_header_accept ( _header_accept ) and header_params [ 'Accept' ] = _header_accept_result
592
+
593
+ # HTTP header 'Content-Type'
594
+ _header_content_type = [ 'application/json' , 'application/xml' ]
595
+ header_params [ 'Content-Type' ] = @api_client . select_header_content_type ( _header_content_type )
596
+
597
+ # form parameters
598
+ form_params = { }
599
+
600
+ # http body (model)
601
+ post_body = @api_client . object_to_http_body ( opts [ :'body' ] )
602
+
603
+
604
+ auth_names = [ 'petstore_auth' ]
605
+ data , status_code , headers = @api_client . call_api ( :POST , path ,
606
+ :header_params => header_params ,
607
+ :query_params => query_params ,
608
+ :form_params => form_params ,
609
+ :body => post_body ,
610
+ :auth_names => auth_names )
611
+ if @api_client . config . debugging
612
+ @api_client . config . logger . debug "API called: PetApi#add_pet_using_byte_array\n Data: #{ data . inspect } \n Status code: #{ status_code } \n Headers: #{ headers } "
613
+ end
614
+ return data , status_code , headers
615
+ end
498
616
end
499
617
end
500
618
0 commit comments