From f44e5faf1b73eae2a600e13e0567c5a67cebb623 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 12 Dec 2015 15:58:35 +0800 Subject: [PATCH 1/5] add http info support for python --- .../src/main/resources/python/api.mustache | 46 +- .../main/resources/python/api_client.mustache | 4 +- samples/client/petstore/python/.coverage | 1 + .../petstore/python/dev-requirements.txt.log | 253 ++++++ .../python/swagger_client/api_client.py | 4 +- .../python/swagger_client/apis/pet_api.py | 833 +++++++++--------- .../python/swagger_client/apis/store_api.py | 354 ++++---- .../python/swagger_client/apis/user_api.py | 605 +++++++++---- 8 files changed, 1279 insertions(+), 821 deletions(-) create mode 100644 samples/client/petstore/python/.coverage create mode 100644 samples/client/petstore/python/dev-requirements.txt.log diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 230f05d94af..f395c783dc6 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -47,7 +47,7 @@ class {{classname}}(object): self.api_client = config.api_client {{#operation}} - def {{nickname}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): + def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): """ {{{summary}}} {{{notes}}} @@ -59,10 +59,43 @@ class {{classname}}(object): >>> pprint(response) >>> {{#sortParamsByRequiredFlag}} - >>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function) + >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function) {{/sortParamsByRequiredFlag}} {{^sortParamsByRequiredFlag}} - >>> thread = api.{{nickname}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function) + >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function) +{{/sortParamsByRequiredFlag}} + + :param callback function: The callback function + for asynchronous request. (optional) +{{#allParams}} + :param {{dataType}} {{paramName}}: {{{description}}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} +{{/allParams}} + :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) + else: + (data, status_code, response_headers) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) + return data + + def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): + """ + {{{summary}}} + {{{notes}}} + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> +{{#sortParamsByRequiredFlag}} + >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}callback=callback_function) +{{/sortParamsByRequiredFlag}} +{{^sortParamsByRequiredFlag}} + >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}callback=callback_function) {{/sortParamsByRequiredFlag}} :param callback function: The callback function @@ -83,7 +116,7 @@ class {{classname}}(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method {{nickname}}" % key + " to method {{operationId}}" % key ) params[key] = val del params['kwargs'] @@ -92,7 +125,7 @@ class {{classname}}(object): {{#required}} # verify the required parameter '{{paramName}}' is set if ('{{paramName}}' not in params) or (params['{{paramName}}'] is None): - raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{nickname}}`") + raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") {{/required}} {{/allParams}} @@ -141,7 +174,7 @@ class {{classname}}(object): # Authentication setting auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] - response = self.api_client.call_api(resource_path, '{{httpMethod}}', + return self.api_client.call_api(resource_path, '{{httpMethod}}', path_params, query_params, header_params, @@ -151,6 +184,5 @@ class {{classname}}(object): response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, auth_settings=auth_settings, callback=params.get('callback')) - return response {{/operation}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 98fee823591..685580ae839 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -157,9 +157,9 @@ class ApiClient(object): deserialized_data = None if callback: - callback(deserialized_data) + callback((deserialized_data, response_data.status, response_data.getheaders())) else: - return deserialized_data + return (deserialized_data, response_data.status, response_data.getheaders()) def to_path_value(self, obj): """ diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage new file mode 100644 index 00000000000..0a07b3c83eb --- /dev/null +++ b/samples/client/petstore/python/.coverage @@ -0,0 +1 @@ +!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 222, 97, 228, 178, 234, 108, 240, 119], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 132, 134, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 112, 114, 116, 122], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 57, 216, 218, 220, 222, 95, 97, 226, 228, 234, 108, 238, 240, 117, 119, 212, 106], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [135, 136, 137, 138, 139, 142, 19, 149, 22, 23, 25, 26, 157, 158, 31, 32, 34, 36, 37, 39, 40, 41, 170, 43, 172, 46, 47, 189, 179, 52, 54, 59, 61, 190, 63, 192, 224, 67, 69, 71, 200, 73, 204, 80, 81, 82, 84, 213, 86, 199, 88, 90, 219, 92, 221, 222, 223, 96, 225, 98, 100, 102, 230, 104, 167, 111, 76, 168, 122, 123, 42, 21], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [128, 129, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 272, 145, 18, 20, 22, 23, 26, 28, 29, 32, 37, 39, 40, 41, 171, 44, 46, 48, 94, 67, 70, 71, 73, 93, 350, 96, 97, 104, 107, 108, 110, 112, 114, 116, 117, 246, 119, 376, 122, 123, 124], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 112, 114, 116, 122], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [518, 525, 526, 527, 19, 21, 22, 23, 24, 537, 26, 27, 28, 29, 30, 31, 32, 33, 34, 547, 36, 37, 40, 42, 44, 45, 558, 47, 49, 52, 566, 568, 569, 570, 571, 572, 573, 575, 68, 69, 70, 75, 76, 77, 79, 80, 82, 84, 91, 96, 98, 102, 103, 104, 107, 108, 109, 111, 112, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 129, 130, 131, 134, 137, 138, 141, 144, 145, 146, 147, 149, 152, 153, 155, 157, 158, 160, 162, 171, 172, 174, 176, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 212, 213, 214, 216, 217, 219, 231, 235, 236, 240, 242, 251, 252, 254, 255, 256, 257, 258, 260, 261, 262, 263, 267, 268, 269, 272, 274, 275, 276, 278, 279, 280, 281, 283, 286, 287, 288, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 337, 338, 339, 340, 341, 345, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 369, 370, 371, 372, 379, 387, 389, 390, 392, 393, 394, 395, 548, 397, 398, 399, 400, 401, 402, 404, 406, 413, 414, 416, 418, 419, 421, 423, 430, 431, 433, 435, 436, 438, 440, 448, 450, 453, 454, 455, 456, 458, 459, 467, 546, 493, 502, 503, 508, 510], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [513, 126, 375, 516, 517, 519, 520, 521, 523, 109, 525, 527, 528, 344, 18, 20, 533, 22, 23, 26, 539, 28, 29, 543, 32, 545, 546, 547, 548, 37, 550, 39, 40, 41, 42, 556, 45, 46, 48, 435, 862, 121, 348, 95, 123, 96, 578, 68, 581, 582, 71, 584, 74, 439, 655, 867, 345, 105, 100, 607, 608, 610, 611, 612, 617, 618, 530, 110, 229, 625, 114, 627, 628, 629, 118, 631, 633, 553, 635, 636, 637, 638, 639, 640, 642, 132, 534, 646, 647, 136, 138, 535, 652, 141, 142, 621, 144, 657, 658, 659, 660, 149, 662, 663, 664, 665, 666, 668, 318, 624, 446, 169, 549, 172, 173, 175, 689, 371, 692, 693, 695, 722, 116, 347, 196, 197, 199, 200, 201, 119, 143, 717, 718, 207, 720, 721, 210, 211, 206, 215, 728, 217, 731, 220, 122, 222, 735, 224, 737, 738, 227, 228, 741, 743, 744, 233, 234, 747, 748, 237, 750, 239, 240, 753, 754, 243, 244, 245, 246, 247, 248, 127, 250, 763, 765, 766, 213, 768, 769, 770, 771, 772, 773, 774, 145, 776, 44, 128, 727, 346, 270, 554, 273, 274, 276, 798, 645, 801, 802, 219, 804, 146, 140, 297, 298, 300, 301, 302, 307, 308, 734, 311, 312, 314, 223, 828, 317, 830, 831, 832, 322, 651, 147, 837, 838, 328, 841, 330, 343, 844, 845, 551, 847, 848, 849, 335, 739, 340, 853, 342, 855, 856, 857, 858, 859, 860, 349, 540, 351, 865, 866, 827, 871, 872, 316, 875, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 745, 377, 661, 320, 98, 398, 399, 401, 402, 323, 409, 408, 106, 412, 413, 325, 133, 417, 418, 99, 139, 241, 424, 426, 242, 430, 431, 72, 755, 436, 329, 441, 442, 415, 444, 445, 429, 447, 448, 449, 450, 452, 403, 759, 112, 760, 419, 334, 472, 473, 851, 475, 476, 478, 421, 552, 374, 423, 338, 443, 499, 500, 502, 503, 504, 767, 509, 510, 341], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [791, 657, 18, 276, 149, 22, 23, 26, 28, 29, 32, 37, 39, 553, 684, 175, 48, 579, 456, 74, 378, 351, 481, 20, 250, 765], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 266, 272, 147, 21, 22, 25, 284, 29, 158, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 11, 12, 13, 16, 18, 20], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251]}} \ No newline at end of file diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log new file mode 100644 index 00000000000..9a337359484 --- /dev/null +++ b/samples/client/petstore/python/dev-requirements.txt.log @@ -0,0 +1,253 @@ +Collecting nose (from -r dev-requirements.txt (line 1)) + Using cached nose-1.3.7-py2-none-any.whl +Collecting tox (from -r dev-requirements.txt (line 2)) + Using cached tox-2.1.1-py2.py3-none-any.whl +Collecting coverage (from -r dev-requirements.txt (line 3)) +Collecting randomize (from -r dev-requirements.txt (line 4)) + Using cached randomize-0.13-py2.py3-none-any.whl +Collecting virtualenv>=1.11.2 (from tox->-r dev-requirements.txt (line 2)) + Using cached virtualenv-13.1.2-py2.py3-none-any.whl +Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) + Using cached py-1.4.30-py2.py3-none-any.whl +Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) + Using cached pluggy-0.3.0-py2.py3-none-any.whl +Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize +Successfully installed coverage-3.7.1 nose-1.3.7 pluggy-0.3.0 py-1.4.30 randomize-0.13 tox-2.1.1 virtualenv-13.1.2 +Requirement already satisfied (use --upgrade to upgrade): nose in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Collecting nose (from -r dev-requirements.txt (line 1)) + Using cached nose-1.3.7-py2-none-any.whl +Collecting tox (from -r dev-requirements.txt (line 2)) + Using cached tox-2.2.1-py2.py3-none-any.whl +Collecting coverage (from -r dev-requirements.txt (line 3)) + Downloading coverage-4.0.3.tar.gz (354kB) +Collecting randomize (from -r dev-requirements.txt (line 4)) + Using cached randomize-0.13-py2.py3-none-any.whl +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in /Library/Python/2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) + Downloading py-1.4.31-py2.py3-none-any.whl (81kB) +Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) + Using cached pluggy-0.3.1-py2.py3-none-any.whl +Installing collected packages: nose, py, pluggy, tox, coverage, randomize +Collecting nose (from -r dev-requirements.txt (line 1)) + Using cached nose-1.3.7-py2-none-any.whl +Collecting tox (from -r dev-requirements.txt (line 2)) + Using cached tox-2.2.1-py2.py3-none-any.whl +Collecting coverage (from -r dev-requirements.txt (line 3)) + Using cached coverage-4.0.3.tar.gz +Collecting randomize (from -r dev-requirements.txt (line 4)) + Using cached randomize-0.13-py2.py3-none-any.whl +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in /Library/Python/2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) + Using cached py-1.4.31-py2.py3-none-any.whl +Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) + Using cached pluggy-0.3.1-py2.py3-none-any.whl +Installing collected packages: nose, py, pluggy, tox, coverage, randomize +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) diff --git a/samples/client/petstore/python/swagger_client/api_client.py b/samples/client/petstore/python/swagger_client/api_client.py index e598115e319..e5e4738e961 100644 --- a/samples/client/petstore/python/swagger_client/api_client.py +++ b/samples/client/petstore/python/swagger_client/api_client.py @@ -157,9 +157,9 @@ class ApiClient(object): deserialized_data = None if callback: - callback(deserialized_data) + callback((deserialized_data, response_data.status, response_data.getheaders())) else: - return deserialized_data + return (deserialized_data, response_data.status, response_data.getheaders()) def to_path_value(self, obj): """ diff --git a/samples/client/petstore/python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/swagger_client/apis/pet_api.py index 8b081e077dc..134e299c0f9 100644 --- a/samples/client/petstore/python/swagger_client/apis/pet_api.py +++ b/samples/client/petstore/python/swagger_client/apis/pet_api.py @@ -2,7 +2,7 @@ """ PetApi.py -Copyright 2016 SmartBear Software +Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,6 +45,107 @@ class PetApi(object): config.api_client = ApiClient() self.api_client = config.api_client + def update_pet(self, **kwargs): + """ + Update an existing pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.update_pet_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.update_pet_with_http_info(**kwargs) + return data + + def update_pet_with_http_info(self, **kwargs): + """ + Update an existing pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/pet'.replace('{format}', 'json') + method = 'PUT' + + path_params = {} + + query_params = {} + + header_params = {} + + form_params = {} + files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, method, + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + def add_pet(self, **kwargs): """ Add a new pet to the store @@ -58,6 +159,32 @@ class PetApi(object): >>> >>> thread = api.add_pet(callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.add_pet_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.add_pet_with_http_info(**kwargs) + return data + + def add_pet_with_http_info(self, **kwargs): + """ + Add a new pet to the store + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.add_pet_with_http_info(callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param Pet body: Pet object that needs to be added to the store @@ -81,14 +208,16 @@ class PetApi(object): resource_path = '/pet'.replace('{format}', 'json') + method = 'POST' + path_params = {} query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None if 'body' in params: @@ -107,176 +236,21 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response - - def add_pet_using_byte_array(self, **kwargs): - """ - Fake endpoint to test byte array in body parameter for adding a new pet to the store - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.add_pet_using_byte_array(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str body: Pet object in the form of byte array - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method add_pet_using_byte_array" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/pet?testing_byte_array=true'.replace('{format}', 'json') - path_params = {} - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) - - # Authentication setting - auth_settings = ['petstore_auth'] - - response = self.api_client.call_api(resource_path, 'POST', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - return response - - def delete_pet(self, pet_id, **kwargs): - """ - Deletes a pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_pet(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: Pet id to delete (required) - :param str api_key: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['pet_id', 'api_key'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") - - resource_path = '/pet/{petId}'.replace('{format}', 'json') - path_params = {} - if 'pet_id' in params: - path_params['petId'] = params['pet_id'] - - query_params = {} - - header_params = {} - if 'api_key' in params: - header_params['api_key'] = params['api_key'] - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = ['petstore_auth'] - - response = self.api_client.call_api(resource_path, 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - return response def find_pets_by_status(self, **kwargs): """ Finds Pets by status - Multiple status values can be provided with comma separated strings + Multiple status values can be provided with comma seperated strings This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -288,7 +262,33 @@ class PetApi(object): :param callback function: The callback function for asynchronous request. (optional) - :param list[str] status: Status values that need to be considered for query + :param list[str] status: Status values that need to be considered for filter + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.find_pets_by_status_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.find_pets_by_status_with_http_info(**kwargs) + return data + + def find_pets_by_status_with_http_info(self, **kwargs): + """ + Finds Pets by status + Multiple status values can be provided with comma seperated strings + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.find_pets_by_status_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param list[str] status: Status values that need to be considered for filter :return: list[Pet] If the method is called asynchronously, returns the request thread. @@ -309,6 +309,8 @@ class PetApi(object): resource_path = '/pet/findByStatus'.replace('{format}', 'json') + method = 'GET' + path_params = {} query_params = {} @@ -317,8 +319,8 @@ class PetApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -335,17 +337,16 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type='list[Pet]', auth_settings=auth_settings, callback=params.get('callback')) - return response def find_pets_by_tags(self, **kwargs): """ @@ -360,6 +361,32 @@ class PetApi(object): >>> >>> thread = api.find_pets_by_tags(callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param list[str] tags: Tags to filter by + :return: list[Pet] + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.find_pets_by_tags_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.find_pets_by_tags_with_http_info(**kwargs) + return data + + def find_pets_by_tags_with_http_info(self, **kwargs): + """ + Finds Pets by tags + Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.find_pets_by_tags_with_http_info(callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param list[str] tags: Tags to filter by @@ -383,6 +410,8 @@ class PetApi(object): resource_path = '/pet/findByTags'.replace('{format}', 'json') + method = 'GET' + path_params = {} query_params = {} @@ -391,8 +420,8 @@ class PetApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -409,17 +438,16 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type='list[Pet]', auth_settings=auth_settings, callback=params.get('callback')) - return response def get_pet_by_id(self, pet_id, **kwargs): """ @@ -434,6 +462,32 @@ class PetApi(object): >>> >>> thread = api.get_pet_by_id(pet_id, callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: Pet + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_pet_by_id_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) + return data + + def get_pet_by_id_with_http_info(self, pet_id, **kwargs): + """ + Find pet by ID + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_pet_by_id_with_http_info(pet_id, callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param int pet_id: ID of pet that needs to be fetched (required) @@ -460,6 +514,8 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") resource_path = '/pet/{petId}'.replace('{format}', 'json') + method = 'GET' + path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -468,8 +524,8 @@ class PetApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -484,247 +540,18 @@ class PetApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['api_key', 'petstore_auth'] + auth_settings = ['api_key'] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type='Pet', auth_settings=auth_settings, callback=params.get('callback')) - return response - - def get_pet_by_id_in_object(self, pet_id, **kwargs): - """ - Fake endpoint to test inline arbitrary object return by 'Find pet by ID' - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.get_pet_by_id_in_object(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: ID of pet that needs to be fetched (required) - :return: InlineResponse200 - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['pet_id'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_pet_by_id_in_object" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id_in_object`") - - resource_path = '/pet/{petId}?response=inline_arbitrary_object'.replace('{format}', 'json') - path_params = {} - if 'pet_id' in params: - path_params['petId'] = params['pet_id'] - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = ['api_key', 'petstore_auth'] - - response = self.api_client.call_api(resource_path, 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='InlineResponse200', - auth_settings=auth_settings, - callback=params.get('callback')) - return response - - def pet_pet_idtesting_byte_arraytrue_get(self, pet_id, **kwargs): - """ - Fake endpoint to test byte array return by 'Find pet by ID' - Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.pet_pet_idtesting_byte_arraytrue_get(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: ID of pet that needs to be fetched (required) - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['pet_id'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method pet_pet_idtesting_byte_arraytrue_get" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `pet_pet_idtesting_byte_arraytrue_get`") - - resource_path = '/pet/{petId}?testing_byte_array=true'.replace('{format}', 'json') - path_params = {} - if 'pet_id' in params: - path_params['petId'] = params['pet_id'] - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = ['api_key', 'petstore_auth'] - - response = self.api_client.call_api(resource_path, 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', - auth_settings=auth_settings, - callback=params.get('callback')) - return response - - def update_pet(self, **kwargs): - """ - Update an existing pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.update_pet(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Pet body: Pet object that needs to be added to the store - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/pet'.replace('{format}', 'json') - path_params = {} - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) - - # Authentication setting - auth_settings = ['petstore_auth'] - - response = self.api_client.call_api(resource_path, 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - return response def update_pet_with_form(self, pet_id, **kwargs): """ @@ -739,6 +566,34 @@ class PetApi(object): >>> >>> thread = api.update_pet_with_form(pet_id, callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param str pet_id: ID of pet that needs to be updated (required) + :param str name: Updated name of the pet + :param str status: Updated status of the pet + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.update_pet_with_form_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) + return data + + def update_pet_with_form_with_http_info(self, pet_id, **kwargs): + """ + Updates a pet in the store with form data + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet_with_form_with_http_info(pet_id, callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param str pet_id: ID of pet that needs to be updated (required) @@ -767,6 +622,8 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") resource_path = '/pet/{petId}'.replace('{format}', 'json') + method = 'POST' + path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -775,12 +632,12 @@ class PetApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} if 'name' in params: - form_params.append(('name', params['name'])) + form_params['name'] = params['name'] if 'status' in params: - form_params.append(('status', params['status'])) + form_params['status'] = params['status'] body_params = None @@ -797,17 +654,124 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def delete_pet(self, pet_id, **kwargs): + """ + Deletes a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_pet(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_pet_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.delete_pet_with_http_info(pet_id, **kwargs) + return data + + def delete_pet_with_http_info(self, pet_id, **kwargs): + """ + Deletes a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_pet_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'api_key'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") + + resource_path = '/pet/{petId}'.replace('{format}', 'json') + method = 'DELETE' + + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] + + form_params = {} + files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, method, + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response def upload_file(self, pet_id, **kwargs): """ @@ -822,6 +786,34 @@ class PetApi(object): >>> >>> thread = api.upload_file(pet_id, callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet to update (required) + :param str additional_metadata: Additional data to pass to server + :param file file: file to upload + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.upload_file_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.upload_file_with_http_info(pet_id, **kwargs) + return data + + def upload_file_with_http_info(self, pet_id, **kwargs): + """ + uploads an image + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.upload_file_with_http_info(pet_id, callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param int pet_id: ID of pet to update (required) @@ -850,6 +842,8 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") resource_path = '/pet/{petId}/uploadImage'.replace('{format}', 'json') + method = 'POST' + path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -858,12 +852,12 @@ class PetApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} if 'additional_metadata' in params: - form_params.append(('additionalMetadata', params['additional_metadata'])) + form_params['additionalMetadata'] = params['additional_metadata'] if 'file' in params: - local_var_files['file'] = params['file'] + files['file'] = params['file'] body_params = None @@ -880,14 +874,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response diff --git a/samples/client/petstore/python/swagger_client/apis/store_api.py b/samples/client/petstore/python/swagger_client/apis/store_api.py index 85bb90ed40c..ee6e2f7633d 100644 --- a/samples/client/petstore/python/swagger_client/apis/store_api.py +++ b/samples/client/petstore/python/swagger_client/apis/store_api.py @@ -2,7 +2,7 @@ """ StoreApi.py -Copyright 2016 SmartBear Software +Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,157 +45,6 @@ class StoreApi(object): config.api_client = ApiClient() self.api_client = config.api_client - def delete_order(self, order_id, **kwargs): - """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_order(order_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str order_id: ID of the order that needs to be deleted (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['order_id'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_order" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") - - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') - path_params = {} - if 'order_id' in params: - path_params['orderId'] = params['order_id'] - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - response = self.api_client.call_api(resource_path, 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - return response - - def find_orders_by_status(self, **kwargs): - """ - Finds orders by status - A single status value can be provided as a string - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.find_orders_by_status(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str status: Status value that needs to be considered for query - :return: list[Order] - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['status'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method find_orders_by_status" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/store/findByStatus'.replace('{format}', 'json') - path_params = {} - - query_params = {} - if 'status' in params: - query_params['status'] = params['status'] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = ['test_api_client_id', 'test_api_client_secret'] - - response = self.api_client.call_api(resource_path, 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='list[Order]', - auth_settings=auth_settings, - callback=params.get('callback')) - return response - def get_inventory(self, **kwargs): """ Returns pet inventories by status @@ -209,6 +58,31 @@ class StoreApi(object): >>> >>> thread = api.get_inventory(callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :return: dict(str, int) + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_inventory_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.get_inventory_with_http_info(**kwargs) + return data + + def get_inventory_with_http_info(self, **kwargs): + """ + Returns pet inventories by status + Returns a map of status codes to quantities + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_inventory_with_http_info(callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :return: dict(str, int) @@ -231,14 +105,16 @@ class StoreApi(object): resource_path = '/store/inventory'.replace('{format}', 'json') + method = 'GET' + path_params = {} query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -255,22 +131,21 @@ class StoreApi(object): # Authentication setting auth_settings = ['api_key'] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type='dict(str, int)', auth_settings=auth_settings, callback=params.get('callback')) - return response - def get_inventory_in_object(self, **kwargs): + def place_order(self, **kwargs): """ - Fake endpoint to test arbitrary object return by 'Get inventory' - Returns an arbitrary object which is actually a map of status codes to quantities + Place an order for a pet + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -278,16 +153,43 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.get_inventory_in_object(callback=callback_function) + >>> thread = api.place_order(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :return: object + :param Order body: order placed for purchasing the pet + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.place_order_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.place_order_with_http_info(**kwargs) + return data + + def place_order_with_http_info(self, **kwargs): + """ + Place an order for a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.place_order_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Order body: order placed for purchasing the pet + :return: Order If the method is called asynchronously, returns the request thread. """ - all_params = [] + all_params = ['body'] all_params.append('callback') params = locals() @@ -295,23 +197,27 @@ class StoreApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_inventory_in_object" % key + " to method place_order" % key ) params[key] = val del params['kwargs'] - resource_path = '/store/inventory?response=arbitrary_object'.replace('{format}', 'json') + resource_path = '/store/order'.replace('{format}', 'json') + method = 'POST' + path_params = {} query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -324,19 +230,18 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['api_key'] + auth_settings = [] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, - response_type='object', + files=files, + response_type='Order', auth_settings=auth_settings, callback=params.get('callback')) - return response def get_order_by_id(self, order_id, **kwargs): """ @@ -351,6 +256,32 @@ class StoreApi(object): >>> >>> thread = api.get_order_by_id(order_id, callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param str order_id: ID of pet that needs to be fetched (required) + :return: Order + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_order_by_id_with_http_info(order_id, **kwargs) + else: + (data, status_code, response_headers) = self.get_order_by_id_with_http_info(order_id, **kwargs) + return data + + def get_order_by_id_with_http_info(self, order_id, **kwargs): + """ + Find purchase order by ID + For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_order_by_id_with_http_info(order_id, callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param str order_id: ID of pet that needs to be fetched (required) @@ -377,6 +308,8 @@ class StoreApi(object): raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") resource_path = '/store/order/{orderId}'.replace('{format}', 'json') + method = 'GET' + path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -385,8 +318,8 @@ class StoreApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -401,24 +334,23 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['test_api_key_header', 'test_api_key_query'] + auth_settings = [] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type='Order', auth_settings=auth_settings, callback=params.get('callback')) - return response - def place_order(self, **kwargs): + def delete_order(self, order_id, **kwargs): """ - Place an order for a pet - + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -426,17 +358,43 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.place_order(callback=callback_function) + >>> thread = api.delete_order(order_id, callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param Order body: order placed for purchasing the pet - :return: Order + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_order_with_http_info(order_id, **kwargs) + else: + (data, status_code, response_headers) = self.delete_order_with_http_info(order_id, **kwargs) + return data + + def delete_order_with_http_info(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_order_with_http_info(order_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str order_id: ID of the order that needs to be deleted (required) + :return: None If the method is called asynchronously, returns the request thread. """ - all_params = ['body'] + all_params = ['order_id'] all_params.append('callback') params = locals() @@ -444,25 +402,30 @@ class StoreApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method place_order" % key + " to method delete_order" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") + + resource_path = '/store/order/{orderId}'.replace('{format}', 'json') + method = 'DELETE' - resource_path = '/store/order'.replace('{format}', 'json') path_params = {} + if 'order_id' in params: + path_params['orderId'] = params['order_id'] query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -475,16 +438,15 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['test_api_client_id', 'test_api_client_secret'] + auth_settings = [] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, - response_type='Order', + files=files, + response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response diff --git a/samples/client/petstore/python/swagger_client/apis/user_api.py b/samples/client/petstore/python/swagger_client/apis/user_api.py index 07d976b0bf5..8ce1ddd151a 100644 --- a/samples/client/petstore/python/swagger_client/apis/user_api.py +++ b/samples/client/petstore/python/swagger_client/apis/user_api.py @@ -2,7 +2,7 @@ """ UserApi.py -Copyright 2016 SmartBear Software +Copyright 2015 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -58,6 +58,32 @@ class UserApi(object): >>> >>> thread = api.create_user(callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param User body: Created user object + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.create_user_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.create_user_with_http_info(**kwargs) + return data + + def create_user_with_http_info(self, **kwargs): + """ + Create user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.create_user_with_http_info(callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param User body: Created user object @@ -81,14 +107,16 @@ class UserApi(object): resource_path = '/user'.replace('{format}', 'json') + method = 'POST' + path_params = {} query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None if 'body' in params: @@ -107,17 +135,16 @@ class UserApi(object): # Authentication setting auth_settings = [] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response def create_users_with_array_input(self, **kwargs): """ @@ -132,6 +159,32 @@ class UserApi(object): >>> >>> thread = api.create_users_with_array_input(callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param list[User] body: List of user object + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.create_users_with_array_input_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.create_users_with_array_input_with_http_info(**kwargs) + return data + + def create_users_with_array_input_with_http_info(self, **kwargs): + """ + Creates list of users with given input array + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.create_users_with_array_input_with_http_info(callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param list[User] body: List of user object @@ -155,14 +208,16 @@ class UserApi(object): resource_path = '/user/createWithArray'.replace('{format}', 'json') + method = 'POST' + path_params = {} query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None if 'body' in params: @@ -181,17 +236,16 @@ class UserApi(object): # Authentication setting auth_settings = [] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response def create_users_with_list_input(self, **kwargs): """ @@ -206,6 +260,32 @@ class UserApi(object): >>> >>> thread = api.create_users_with_list_input(callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param list[User] body: List of user object + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.create_users_with_list_input_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.create_users_with_list_input_with_http_info(**kwargs) + return data + + def create_users_with_list_input_with_http_info(self, **kwargs): + """ + Creates list of users with given input array + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.create_users_with_list_input_with_http_info(callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param list[User] body: List of user object @@ -229,14 +309,16 @@ class UserApi(object): resource_path = '/user/createWithList'.replace('{format}', 'json') + method = 'POST' + path_params = {} query_params = {} header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None if 'body' in params: @@ -255,22 +337,21 @@ class UserApi(object): # Authentication setting auth_settings = [] - response = self.api_client.call_api(resource_path, 'POST', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response - def delete_user(self, username, **kwargs): + def login_user(self, **kwargs): """ - Delete user - This can only be done by the logged in user. + Logs user into the system + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -278,17 +359,45 @@ class UserApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.delete_user(username, callback=callback_function) + >>> thread = api.login_user(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param str username: The name that needs to be deleted (required) - :return: None + :param str username: The user name for login + :param str password: The password for login in clear text + :return: str + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.login_user_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.login_user_with_http_info(**kwargs) + return data + + def login_user_with_http_info(self, **kwargs): + """ + Logs user into the system + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.login_user_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The user name for login + :param str password: The password for login in clear text + :return: str If the method is called asynchronously, returns the request thread. """ - all_params = ['username'] + all_params = ['username', 'password'] all_params.append('callback') params = locals() @@ -296,26 +405,27 @@ class UserApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete_user" % key + " to method login_user" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `delete_user`") - resource_path = '/user/{username}'.replace('{format}', 'json') + resource_path = '/user/login'.replace('{format}', 'json') + method = 'GET' + path_params = {} - if 'username' in params: - path_params['username'] = params['username'] query_params = {} + if 'username' in params: + query_params['username'] = params['username'] + if 'password' in params: + query_params['password'] = params['password'] header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -330,19 +440,115 @@ class UserApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['test_http_basic'] + auth_settings = [] - response = self.api_client.call_api(resource_path, 'DELETE', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, + response_type='str', + auth_settings=auth_settings, + callback=params.get('callback')) + + def logout_user(self, **kwargs): + """ + Logs out current logged in user session + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.logout_user(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.logout_user_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.logout_user_with_http_info(**kwargs) + return data + + def logout_user_with_http_info(self, **kwargs): + """ + Logs out current logged in user session + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.logout_user_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method logout_user" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/user/logout'.replace('{format}', 'json') + method = 'GET' + + path_params = {} + + query_params = {} + + header_params = {} + + form_params = {} + files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api(resource_path, method, + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response def get_user_by_name(self, username, **kwargs): """ @@ -357,6 +563,32 @@ class UserApi(object): >>> >>> thread = api.get_user_by_name(username, callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_user_by_name_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.get_user_by_name_with_http_info(username, **kwargs) + return data + + def get_user_by_name_with_http_info(self, username, **kwargs): + """ + Get user by user name + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_user_by_name_with_http_info(username, callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param str username: The name that needs to be fetched. Use user1 for testing. (required) @@ -383,6 +615,8 @@ class UserApi(object): raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") resource_path = '/user/{username}'.replace('{format}', 'json') + method = 'GET' + path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -391,8 +625,8 @@ class UserApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None @@ -409,165 +643,16 @@ class UserApi(object): # Authentication setting auth_settings = [] - response = self.api_client.call_api(resource_path, 'GET', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, response_type='User', auth_settings=auth_settings, callback=params.get('callback')) - return response - - def login_user(self, **kwargs): - """ - Logs user into the system - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.login_user(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The user name for login - :param str password: The password for login in clear text - :return: str - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['username', 'password'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method login_user" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/user/login'.replace('{format}', 'json') - path_params = {} - - query_params = {} - if 'username' in params: - query_params['username'] = params['username'] - if 'password' in params: - query_params['password'] = params['password'] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - response = self.api_client.call_api(resource_path, 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='str', - auth_settings=auth_settings, - callback=params.get('callback')) - return response - - def logout_user(self, **kwargs): - """ - Logs out current logged in user session - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.logout_user(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method logout_user" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/user/logout'.replace('{format}', 'json') - path_params = {} - - query_params = {} - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - response = self.api_client.call_api(resource_path, 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - return response def update_user(self, username, **kwargs): """ @@ -582,6 +667,33 @@ class UserApi(object): >>> >>> thread = api.update_user(username, callback=callback_function) + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: name that need to be deleted (required) + :param User body: Updated user object + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.update_user_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.update_user_with_http_info(username, **kwargs) + return data + + def update_user_with_http_info(self, username, **kwargs): + """ + Updated user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_user_with_http_info(username, callback=callback_function) + :param callback function: The callback function for asynchronous request. (optional) :param str username: name that need to be deleted (required) @@ -609,6 +721,8 @@ class UserApi(object): raise ValueError("Missing the required parameter `username` when calling `update_user`") resource_path = '/user/{username}'.replace('{format}', 'json') + method = 'PUT' + path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -617,8 +731,8 @@ class UserApi(object): header_params = {} - form_params = [] - local_var_files = {} + form_params = {} + files = {} body_params = None if 'body' in params: @@ -637,14 +751,117 @@ class UserApi(object): # Authentication setting auth_settings = [] - response = self.api_client.call_api(resource_path, 'PUT', + return self.api_client.call_api(resource_path, method, path_params, query_params, header_params, body=body_params, post_params=form_params, - files=local_var_files, + files=files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def delete_user(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_user(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_user_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.delete_user_with_http_info(username, **kwargs) + return data + + def delete_user_with_http_info(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_user_with_http_info(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") + + resource_path = '/user/{username}'.replace('{format}', 'json') + method = 'DELETE' + + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = {} + + header_params = {} + + form_params = {} + files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api(resource_path, method, + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - return response From 10de0b5c5b3fe556cf2ec91f50b00ff713b41428 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 8 Apr 2016 23:54:47 +0800 Subject: [PATCH 2/5] update python sample after rebase --- samples/client/petstore/python/.coverage | 2 +- .../petstore/python/dev-requirements.txt.log | 7 + .../python/swagger_client/__init__.py | 3 + .../python/swagger_client/apis/pet_api.py | 797 ++++++++++++------ .../python/swagger_client/apis/store_api.py | 328 +++++-- .../python/swagger_client/apis/user_api.py | 474 +++++------ .../python/swagger_client/models/__init__.py | 3 + .../python/swagger_client/models/name.py | 29 +- 8 files changed, 1069 insertions(+), 574 deletions(-) diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage index 0a07b3c83eb..554238217d0 100644 --- a/samples/client/petstore/python/.coverage +++ b/samples/client/petstore/python/.coverage @@ -1 +1 @@ -!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 222, 97, 228, 178, 234, 108, 240, 119], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 132, 134, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 112, 114, 116, 122], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 57, 216, 218, 220, 222, 95, 97, 226, 228, 234, 108, 238, 240, 117, 119, 212, 106], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [135, 136, 137, 138, 139, 142, 19, 149, 22, 23, 25, 26, 157, 158, 31, 32, 34, 36, 37, 39, 40, 41, 170, 43, 172, 46, 47, 189, 179, 52, 54, 59, 61, 190, 63, 192, 224, 67, 69, 71, 200, 73, 204, 80, 81, 82, 84, 213, 86, 199, 88, 90, 219, 92, 221, 222, 223, 96, 225, 98, 100, 102, 230, 104, 167, 111, 76, 168, 122, 123, 42, 21], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [128, 129, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 272, 145, 18, 20, 22, 23, 26, 28, 29, 32, 37, 39, 40, 41, 171, 44, 46, 48, 94, 67, 70, 71, 73, 93, 350, 96, 97, 104, 107, 108, 110, 112, 114, 116, 117, 246, 119, 376, 122, 123, 124], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 112, 114, 116, 122], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [518, 525, 526, 527, 19, 21, 22, 23, 24, 537, 26, 27, 28, 29, 30, 31, 32, 33, 34, 547, 36, 37, 40, 42, 44, 45, 558, 47, 49, 52, 566, 568, 569, 570, 571, 572, 573, 575, 68, 69, 70, 75, 76, 77, 79, 80, 82, 84, 91, 96, 98, 102, 103, 104, 107, 108, 109, 111, 112, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 129, 130, 131, 134, 137, 138, 141, 144, 145, 146, 147, 149, 152, 153, 155, 157, 158, 160, 162, 171, 172, 174, 176, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 212, 213, 214, 216, 217, 219, 231, 235, 236, 240, 242, 251, 252, 254, 255, 256, 257, 258, 260, 261, 262, 263, 267, 268, 269, 272, 274, 275, 276, 278, 279, 280, 281, 283, 286, 287, 288, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 337, 338, 339, 340, 341, 345, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 369, 370, 371, 372, 379, 387, 389, 390, 392, 393, 394, 395, 548, 397, 398, 399, 400, 401, 402, 404, 406, 413, 414, 416, 418, 419, 421, 423, 430, 431, 433, 435, 436, 438, 440, 448, 450, 453, 454, 455, 456, 458, 459, 467, 546, 493, 502, 503, 508, 510], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [513, 126, 375, 516, 517, 519, 520, 521, 523, 109, 525, 527, 528, 344, 18, 20, 533, 22, 23, 26, 539, 28, 29, 543, 32, 545, 546, 547, 548, 37, 550, 39, 40, 41, 42, 556, 45, 46, 48, 435, 862, 121, 348, 95, 123, 96, 578, 68, 581, 582, 71, 584, 74, 439, 655, 867, 345, 105, 100, 607, 608, 610, 611, 612, 617, 618, 530, 110, 229, 625, 114, 627, 628, 629, 118, 631, 633, 553, 635, 636, 637, 638, 639, 640, 642, 132, 534, 646, 647, 136, 138, 535, 652, 141, 142, 621, 144, 657, 658, 659, 660, 149, 662, 663, 664, 665, 666, 668, 318, 624, 446, 169, 549, 172, 173, 175, 689, 371, 692, 693, 695, 722, 116, 347, 196, 197, 199, 200, 201, 119, 143, 717, 718, 207, 720, 721, 210, 211, 206, 215, 728, 217, 731, 220, 122, 222, 735, 224, 737, 738, 227, 228, 741, 743, 744, 233, 234, 747, 748, 237, 750, 239, 240, 753, 754, 243, 244, 245, 246, 247, 248, 127, 250, 763, 765, 766, 213, 768, 769, 770, 771, 772, 773, 774, 145, 776, 44, 128, 727, 346, 270, 554, 273, 274, 276, 798, 645, 801, 802, 219, 804, 146, 140, 297, 298, 300, 301, 302, 307, 308, 734, 311, 312, 314, 223, 828, 317, 830, 831, 832, 322, 651, 147, 837, 838, 328, 841, 330, 343, 844, 845, 551, 847, 848, 849, 335, 739, 340, 853, 342, 855, 856, 857, 858, 859, 860, 349, 540, 351, 865, 866, 827, 871, 872, 316, 875, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 745, 377, 661, 320, 98, 398, 399, 401, 402, 323, 409, 408, 106, 412, 413, 325, 133, 417, 418, 99, 139, 241, 424, 426, 242, 430, 431, 72, 755, 436, 329, 441, 442, 415, 444, 445, 429, 447, 448, 449, 450, 452, 403, 759, 112, 760, 419, 334, 472, 473, 851, 475, 476, 478, 421, 552, 374, 423, 338, 443, 499, 500, 502, 503, 504, 767, 509, 510, 341], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [791, 657, 18, 276, 149, 22, 23, 26, 28, 29, 32, 37, 39, 553, 684, 175, 48, 579, 456, 74, 378, 351, 481, 20, 250, 765], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 266, 272, 147, 21, 22, 25, 284, 29, 158, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 11, 12, 13, 16, 18, 20], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251]}} \ No newline at end of file +!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [774, 652, 272, 18, 147, 20, 22, 23, 26, 28, 29, 32, 37, 39, 173, 48, 447, 576, 74, 473, 549, 747, 677, 371, 246, 345], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 24, 26, 28], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 162, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_200_response.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/animal.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/special_model_name.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 122], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 272, 147, 21, 22, 25, 284, 29, 158, 290, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/cat.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [150, 274, 20, 22, 23, 26, 28, 541, 32, 48, 37, 39, 29, 176, 567, 74, 439, 465, 344, 18, 369, 249], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/name.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/inline_response_200.py": [130, 141, 19, 21, 22, 25, 29, 158, 169, 180, 30, 191, 64, 202, 75, 86, 97, 228, 234, 108, 240, 246, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [513, 521, 528, 529, 530, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 550, 551, 40, 42, 44, 45, 47, 561, 52, 569, 571, 572, 573, 574, 575, 576, 578, 68, 69, 74, 75, 76, 78, 79, 81, 82, 84, 86, 93, 98, 100, 104, 105, 106, 109, 110, 111, 113, 114, 117, 118, 119, 120, 121, 122, 125, 126, 127, 128, 131, 132, 133, 136, 139, 140, 143, 146, 147, 148, 149, 151, 154, 155, 157, 159, 162, 164, 540, 173, 174, 176, 178, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 207, 214, 215, 216, 218, 219, 221, 549, 233, 237, 238, 242, 244, 253, 254, 256, 257, 258, 259, 260, 262, 263, 264, 265, 269, 270, 271, 274, 276, 277, 278, 280, 281, 282, 283, 285, 288, 289, 290, 49, 318, 319, 320, 321, 322, 334, 335, 339, 340, 341, 342, 343, 347, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 371, 372, 373, 374, 381, 389, 391, 392, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 407, 409, 416, 417, 419, 421, 422, 424, 426, 433, 434, 436, 438, 439, 441, 443, 451, 453, 456, 457, 458, 459, 461, 462, 470, 496, 505, 506, 511], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [1024, 1025, 1026, 617, 1030, 1032, 1033, 1034, 1035, 1036, 1037, 1039, 344, 18, 1043, 20, 430, 22, 23, 1048, 1028, 26, 1143, 28, 29, 410, 1055, 32, 944, 1058, 1059, 1060, 37, 550, 39, 40, 1065, 42, 1136, 45, 46, 48, 435, 570, 1119, 573, 574, 1087, 576, 608, 1090, 1091, 68, 1093, 650, 71, 72, 74, 951, 1134, 440, 611, 597, 598, 441, 600, 601, 1116, 1117, 95, 96, 1121, 98, 99, 100, 1126, 614, 615, 616, 105, 106, 619, 109, 110, 623, 112, 114, 1061, 116, 117, 630, 119, 120, 121, 1146, 635, 124, 125, 126, 639, 1152, 641, 130, 131, 644, 645, 134, 647, 136, 137, 138, 139, 652, 141, 142, 143, 144, 145, 1164, 147, 1172, 1130, 1049, 1135, 624, 678, 1052, 434, 173, 1165, 449, 1054, 1044, 1140, 629, 1056, 1142, 1057, 631, 1166, 1149, 1144, 1145, 621, 1147, 1062, 636, 1063, 1167, 1133, 754, 246, 41, 438, 1153, 44, 267, 780, 642, 270, 271, 273, 643, 646, 295, 296, 1127, 298, 299, 300, 402, 648, 306, 309, 649, 312, 313, 314, 315, 317, 319, 320, 321, 323, 324, 326, 140, 330, 331, 1042, 335, 336, 339, 341, 342, 343, 856, 345, 346, 347, 348, 349, 350, 352, 1168, 1154, 1169, 1120, 876, 1170, 879, 880, 882, 1171, 372, 626, 375, 376, 378, 1173, 1138, 903, 904, 906, 907, 908, 399, 400, 913, 914, 403, 404, 917, 918, 920, 409, 922, 924, 925, 414, 927, 928, 929, 418, 932, 933, 934, 423, 425, 938, 939, 428, 429, 942, 413, 1162, 945, 946, 947, 948, 949, 950, 329, 952, 953, 442, 955, 444, 445, 446, 447, 448, 416, 451, 417, 305, 977, 980, 981, 983, 420, 477, 1158, 422, 1020, 1006, 1007, 1009, 1010, 1011, 1016, 1017, 1159, 443, 1023], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [19, 21, 22, 23, 25, 26, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 46, 47, 52, 54, 59, 61, 63, 67, 69, 71, 73, 76, 80, 81, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 104, 111, 122, 123, 135, 136, 137, 138, 139, 142, 149, 157, 158, 167, 168, 170, 172, 179, 189, 190, 192, 199, 200, 201, 204, 210, 211, 213, 219, 221, 222, 223, 224, 225, 228, 229, 230, 231, 232, 235, 236, 237, 238, 239, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 256, 257, 258, 259, 260, 265], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 97, 228, 178, 234, 108, 240, 246, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 122], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 84, 86, 57, 95, 97, 228, 234, 108, 240, 117, 246, 119, 106], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_return.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/dog.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63]}} \ No newline at end of file diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log index 9a337359484..6c260212adc 100644 --- a/samples/client/petstore/python/dev-requirements.txt.log +++ b/samples/client/petstore/python/dev-requirements.txt.log @@ -251,3 +251,10 @@ Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/li Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) diff --git a/samples/client/petstore/python/swagger_client/__init__.py b/samples/client/petstore/python/swagger_client/__init__.py index 3b52f200834..dbdd791ada2 100644 --- a/samples/client/petstore/python/swagger_client/__init__.py +++ b/samples/client/petstore/python/swagger_client/__init__.py @@ -1,7 +1,10 @@ from __future__ import absolute_import # import models into sdk package +from .models.animal import Animal +from .models.cat import Cat from .models.category import Category +from .models.dog import Dog from .models.inline_response_200 import InlineResponse200 from .models.model_200_response import Model200Response from .models.model_return import ModelReturn diff --git a/samples/client/petstore/python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/swagger_client/apis/pet_api.py index 134e299c0f9..ae7a828e959 100644 --- a/samples/client/petstore/python/swagger_client/apis/pet_api.py +++ b/samples/client/petstore/python/swagger_client/apis/pet_api.py @@ -2,7 +2,7 @@ """ PetApi.py -Copyright 2015 SmartBear Software +Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,107 +45,6 @@ class PetApi(object): config.api_client = ApiClient() self.api_client = config.api_client - def update_pet(self, **kwargs): - """ - Update an existing pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.update_pet(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Pet body: Pet object that needs to be added to the store - :return: None - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.update_pet_with_http_info(**kwargs) - else: - (data, status_code, response_headers) = self.update_pet_with_http_info(**kwargs) - return data - - def update_pet_with_http_info(self, **kwargs): - """ - Update an existing pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.update_pet_with_http_info(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Pet body: Pet object that needs to be added to the store - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/pet'.replace('{format}', 'json') - method = 'PUT' - - path_params = {} - - query_params = {} - - header_params = {} - - form_params = {} - files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) - - # Authentication setting - auth_settings = ['petstore_auth'] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - def add_pet(self, **kwargs): """ Add a new pet to the store @@ -208,16 +107,14 @@ class PetApi(object): resource_path = '/pet'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -236,13 +133,218 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def add_pet_using_byte_array(self, **kwargs): + """ + Fake endpoint to test byte array in body parameter for adding a new pet to the store + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.add_pet_using_byte_array(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str body: Pet object in the form of byte array + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.add_pet_using_byte_array_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.add_pet_using_byte_array_with_http_info(**kwargs) + return data + + def add_pet_using_byte_array_with_http_info(self, **kwargs): + """ + Fake endpoint to test byte array in body parameter for adding a new pet to the store + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.add_pet_using_byte_array_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str body: Pet object in the form of byte array + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_pet_using_byte_array" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/pet?testing_byte_array=true'.replace('{format}', 'json') + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def delete_pet(self, pet_id, **kwargs): + """ + Deletes a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_pet(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_pet_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.delete_pet_with_http_info(pet_id, **kwargs) + return data + + def delete_pet_with_http_info(self, pet_id, **kwargs): + """ + Deletes a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_pet_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'api_key'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") + + resource_path = '/pet/{petId}'.replace('{format}', 'json') + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -250,7 +352,7 @@ class PetApi(object): def find_pets_by_status(self, **kwargs): """ Finds Pets by status - Multiple status values can be provided with comma seperated strings + Multiple status values can be provided with comma separated strings This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -262,7 +364,7 @@ class PetApi(object): :param callback function: The callback function for asynchronous request. (optional) - :param list[str] status: Status values that need to be considered for filter + :param list[str] status: Status values that need to be considered for query :return: list[Pet] If the method is called asynchronously, returns the request thread. @@ -276,7 +378,7 @@ class PetApi(object): def find_pets_by_status_with_http_info(self, **kwargs): """ Finds Pets by status - Multiple status values can be provided with comma seperated strings + Multiple status values can be provided with comma separated strings This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -288,7 +390,7 @@ class PetApi(object): :param callback function: The callback function for asynchronous request. (optional) - :param list[str] status: Status values that need to be considered for filter + :param list[str] status: Status values that need to be considered for query :return: list[Pet] If the method is called asynchronously, returns the request thread. @@ -309,8 +411,6 @@ class PetApi(object): resource_path = '/pet/findByStatus'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} @@ -319,8 +419,8 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -337,13 +437,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='list[Pet]', auth_settings=auth_settings, callback=params.get('callback')) @@ -410,8 +510,6 @@ class PetApi(object): resource_path = '/pet/findByTags'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} @@ -420,8 +518,8 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -438,13 +536,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='list[Pet]', auth_settings=auth_settings, callback=params.get('callback')) @@ -514,8 +612,6 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") resource_path = '/pet/{petId}'.replace('{format}', 'json') - method = 'GET' - path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -524,8 +620,8 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -540,19 +636,322 @@ class PetApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key', 'petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='Pet', auth_settings=auth_settings, callback=params.get('callback')) + def get_pet_by_id_in_object(self, pet_id, **kwargs): + """ + Fake endpoint to test inline arbitrary object return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_pet_by_id_in_object(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: InlineResponse200 + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) + return data + + def get_pet_by_id_in_object_with_http_info(self, pet_id, **kwargs): + """ + Fake endpoint to test inline arbitrary object return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_pet_by_id_in_object_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: InlineResponse200 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pet_by_id_in_object" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id_in_object`") + + resource_path = '/pet/{petId}?response=inline_arbitrary_object'.replace('{format}', 'json') + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['api_key', 'petstore_auth'] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse200', + auth_settings=auth_settings, + callback=params.get('callback')) + + def pet_pet_idtesting_byte_arraytrue_get(self, pet_id, **kwargs): + """ + Fake endpoint to test byte array return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.pet_pet_idtesting_byte_arraytrue_get(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) + return data + + def pet_pet_idtesting_byte_arraytrue_get_with_http_info(self, pet_id, **kwargs): + """ + Fake endpoint to test byte array return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pet_pet_idtesting_byte_arraytrue_get" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `pet_pet_idtesting_byte_arraytrue_get`") + + resource_path = '/pet/{petId}?testing_byte_array=true'.replace('{format}', 'json') + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['api_key', 'petstore_auth'] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', + auth_settings=auth_settings, + callback=params.get('callback')) + + def update_pet(self, **kwargs): + """ + Update an existing pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.update_pet_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.update_pet_with_http_info(**kwargs) + return data + + def update_pet_with_http_info(self, **kwargs): + """ + Update an existing pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/pet'.replace('{format}', 'json') + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + def update_pet_with_form(self, pet_id, **kwargs): """ Updates a pet in the store with form data @@ -622,8 +1021,6 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") resource_path = '/pet/{petId}'.replace('{format}', 'json') - method = 'POST' - path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -632,12 +1029,12 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} if 'name' in params: - form_params['name'] = params['name'] + form_params.append(('name', params['name'])) if 'status' in params: - form_params['status'] = params['status'] + form_params.append(('status', params['status'])) body_params = None @@ -654,121 +1051,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - - def delete_pet(self, pet_id, **kwargs): - """ - Deletes a pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_pet(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: Pet id to delete (required) - :param str api_key: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.delete_pet_with_http_info(pet_id, **kwargs) - else: - (data, status_code, response_headers) = self.delete_pet_with_http_info(pet_id, **kwargs) - return data - - def delete_pet_with_http_info(self, pet_id, **kwargs): - """ - Deletes a pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_pet_with_http_info(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: Pet id to delete (required) - :param str api_key: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['pet_id', 'api_key'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") - - resource_path = '/pet/{petId}'.replace('{format}', 'json') - method = 'DELETE' - - path_params = {} - if 'pet_id' in params: - path_params['petId'] = params['pet_id'] - - query_params = {} - - header_params = {} - if 'api_key' in params: - header_params['api_key'] = params['api_key'] - - form_params = {} - files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = ['petstore_auth'] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -842,8 +1131,6 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") resource_path = '/pet/{petId}/uploadImage'.replace('{format}', 'json') - method = 'POST' - path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -852,12 +1139,12 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} if 'additional_metadata' in params: - form_params['additionalMetadata'] = params['additional_metadata'] + form_params.append(('additionalMetadata', params['additional_metadata'])) if 'file' in params: - files['file'] = params['file'] + local_var_files['file'] = params['file'] body_params = None @@ -874,13 +1161,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) diff --git a/samples/client/petstore/python/swagger_client/apis/store_api.py b/samples/client/petstore/python/swagger_client/apis/store_api.py index ee6e2f7633d..4d4ffca2ce5 100644 --- a/samples/client/petstore/python/swagger_client/apis/store_api.py +++ b/samples/client/petstore/python/swagger_client/apis/store_api.py @@ -2,7 +2,7 @@ """ StoreApi.py -Copyright 2015 SmartBear Software +Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,6 +45,207 @@ class StoreApi(object): config.api_client = ApiClient() self.api_client = config.api_client + def delete_order(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_order(order_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_order_with_http_info(order_id, **kwargs) + else: + (data, status_code, response_headers) = self.delete_order_with_http_info(order_id, **kwargs) + return data + + def delete_order_with_http_info(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_order_with_http_info(order_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") + + resource_path = '/store/order/{orderId}'.replace('{format}', 'json') + path_params = {} + if 'order_id' in params: + path_params['orderId'] = params['order_id'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api(resource_path, 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def find_orders_by_status(self, **kwargs): + """ + Finds orders by status + A single status value can be provided as a string + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.find_orders_by_status(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str status: Status value that needs to be considered for query + :return: list[Order] + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.find_orders_by_status_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.find_orders_by_status_with_http_info(**kwargs) + return data + + def find_orders_by_status_with_http_info(self, **kwargs): + """ + Finds orders by status + A single status value can be provided as a string + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.find_orders_by_status_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str status: Status value that needs to be considered for query + :return: list[Order] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_orders_by_status" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/store/findByStatus'.replace('{format}', 'json') + path_params = {} + + query_params = {} + if 'status' in params: + query_params['status'] = params['status'] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['test_api_client_id', 'test_api_client_secret'] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Order]', + auth_settings=auth_settings, + callback=params.get('callback')) + def get_inventory(self, **kwargs): """ Returns pet inventories by status @@ -105,16 +306,14 @@ class StoreApi(object): resource_path = '/store/inventory'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -131,21 +330,21 @@ class StoreApi(object): # Authentication setting auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='dict(str, int)', auth_settings=auth_settings, callback=params.get('callback')) - def place_order(self, **kwargs): + def get_inventory_in_object(self, **kwargs): """ - Place an order for a pet - + Fake endpoint to test arbitrary object return by 'Get inventory' + Returns an arbitrary object which is actually a map of status codes to quantities This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -153,25 +352,24 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.place_order(callback=callback_function) + >>> thread = api.get_inventory_in_object(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param Order body: order placed for purchasing the pet - :return: Order + :return: object If the method is called asynchronously, returns the request thread. """ if kwargs.get('callback'): - return self.place_order_with_http_info(**kwargs) + return self.get_inventory_in_object_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.place_order_with_http_info(**kwargs) + (data, status_code, response_headers) = self.get_inventory_in_object_with_http_info(**kwargs) return data - def place_order_with_http_info(self, **kwargs): + def get_inventory_in_object_with_http_info(self, **kwargs): """ - Place an order for a pet - + Fake endpoint to test arbitrary object return by 'Get inventory' + Returns an arbitrary object which is actually a map of status codes to quantities This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -179,17 +377,16 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.place_order_with_http_info(callback=callback_function) + >>> thread = api.get_inventory_in_object_with_http_info(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param Order body: order placed for purchasing the pet - :return: Order + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['body'] + all_params = [] all_params.append('callback') params = locals() @@ -197,27 +394,23 @@ class StoreApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method place_order" % key + " to method get_inventory_in_object" % key ) params[key] = val del params['kwargs'] - resource_path = '/store/order'.replace('{format}', 'json') - method = 'POST' - + resource_path = '/store/inventory?response=arbitrary_object'.replace('{format}', 'json') path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -230,16 +423,16 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = [] + auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type='Order', + files=local_var_files, + response_type='object', auth_settings=auth_settings, callback=params.get('callback')) @@ -308,8 +501,6 @@ class StoreApi(object): raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") resource_path = '/store/order/{orderId}'.replace('{format}', 'json') - method = 'GET' - path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -318,8 +509,8 @@ class StoreApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -334,23 +525,23 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = [] + auth_settings = ['test_api_key_header', 'test_api_key_query'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='Order', auth_settings=auth_settings, callback=params.get('callback')) - def delete_order(self, order_id, **kwargs): + def place_order(self, **kwargs): """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Place an order for a pet + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -358,25 +549,25 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.delete_order(order_id, callback=callback_function) + >>> thread = api.place_order(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param str order_id: ID of the order that needs to be deleted (required) - :return: None + :param Order body: order placed for purchasing the pet + :return: Order If the method is called asynchronously, returns the request thread. """ if kwargs.get('callback'): - return self.delete_order_with_http_info(order_id, **kwargs) + return self.place_order_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.delete_order_with_http_info(order_id, **kwargs) + (data, status_code, response_headers) = self.place_order_with_http_info(**kwargs) return data - def delete_order_with_http_info(self, order_id, **kwargs): + def place_order_with_http_info(self, **kwargs): """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Place an order for a pet + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -384,17 +575,17 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.delete_order_with_http_info(order_id, callback=callback_function) + >>> thread = api.place_order_with_http_info(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param str order_id: ID of the order that needs to be deleted (required) - :return: None + :param Order body: order placed for purchasing the pet + :return: Order If the method is called asynchronously, returns the request thread. """ - all_params = ['order_id'] + all_params = ['body'] all_params.append('callback') params = locals() @@ -402,30 +593,25 @@ class StoreApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete_order" % key + " to method place_order" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") - - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') - method = 'DELETE' + resource_path = '/store/order'.replace('{format}', 'json') path_params = {} - if 'order_id' in params: - path_params['orderId'] = params['order_id'] query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -438,15 +624,15 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = [] + auth_settings = ['test_api_client_id', 'test_api_client_secret'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type=None, + files=local_var_files, + response_type='Order', auth_settings=auth_settings, callback=params.get('callback')) diff --git a/samples/client/petstore/python/swagger_client/apis/user_api.py b/samples/client/petstore/python/swagger_client/apis/user_api.py index 8ce1ddd151a..39ab9148a15 100644 --- a/samples/client/petstore/python/swagger_client/apis/user_api.py +++ b/samples/client/petstore/python/swagger_client/apis/user_api.py @@ -2,7 +2,7 @@ """ UserApi.py -Copyright 2015 SmartBear Software +Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -107,16 +107,14 @@ class UserApi(object): resource_path = '/user'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -135,13 +133,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -208,16 +206,14 @@ class UserApi(object): resource_path = '/user/createWithArray'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -236,13 +232,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -309,16 +305,14 @@ class UserApi(object): resource_path = '/user/createWithList'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -337,17 +331,221 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) + def delete_user(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_user(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_user_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.delete_user_with_http_info(username, **kwargs) + return data + + def delete_user_with_http_info(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_user_with_http_info(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") + + resource_path = '/user/{username}'.replace('{format}', 'json') + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['test_http_basic'] + + return self.api_client.call_api(resource_path, 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def get_user_by_name(self, username, **kwargs): + """ + Get user by user name + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_user_by_name(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_user_by_name_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.get_user_by_name_with_http_info(username, **kwargs) + return data + + def get_user_by_name_with_http_info(self, username, **kwargs): + """ + Get user by user name + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_user_by_name_with_http_info(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_by_name" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") + + resource_path = '/user/{username}'.replace('{format}', 'json') + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', + auth_settings=auth_settings, + callback=params.get('callback')) + def login_user(self, **kwargs): """ Logs user into the system @@ -412,8 +610,6 @@ class UserApi(object): resource_path = '/user/login'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} @@ -424,8 +620,8 @@ class UserApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -442,13 +638,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) @@ -513,16 +709,14 @@ class UserApi(object): resource_path = '/user/logout'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -539,121 +733,17 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - def get_user_by_name(self, username, **kwargs): - """ - Get user by user name - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.get_user_by_name(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :return: User - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.get_user_by_name_with_http_info(username, **kwargs) - else: - (data, status_code, response_headers) = self.get_user_by_name_with_http_info(username, **kwargs) - return data - - def get_user_by_name_with_http_info(self, username, **kwargs): - """ - Get user by user name - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.get_user_by_name_with_http_info(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :return: User - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['username'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") - - resource_path = '/user/{username}'.replace('{format}', 'json') - method = 'GET' - - path_params = {} - if 'username' in params: - path_params['username'] = params['username'] - - query_params = {} - - header_params = {} - - form_params = {} - files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, - response_type='User', - auth_settings=auth_settings, - callback=params.get('callback')) - def update_user(self, username, **kwargs): """ Updated user @@ -721,8 +811,6 @@ class UserApi(object): raise ValueError("Missing the required parameter `username` when calling `update_user`") resource_path = '/user/{username}'.replace('{format}', 'json') - method = 'PUT' - path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -731,8 +819,8 @@ class UserApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -751,117 +839,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - - def delete_user(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_user(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be deleted (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.delete_user_with_http_info(username, **kwargs) - else: - (data, status_code, response_headers) = self.delete_user_with_http_info(username, **kwargs) - return data - - def delete_user_with_http_info(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_user_with_http_info(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be deleted (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['username'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `delete_user`") - - resource_path = '/user/{username}'.replace('{format}', 'json') - method = 'DELETE' - - path_params = {} - if 'username' in params: - path_params['username'] = params['username'] - - query_params = {} - - header_params = {} - - form_params = {} - files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) diff --git a/samples/client/petstore/python/swagger_client/models/__init__.py b/samples/client/petstore/python/swagger_client/models/__init__.py index baccc53b4d6..c441500bc40 100644 --- a/samples/client/petstore/python/swagger_client/models/__init__.py +++ b/samples/client/petstore/python/swagger_client/models/__init__.py @@ -1,7 +1,10 @@ from __future__ import absolute_import # import models into model package +from .animal import Animal +from .cat import Cat from .category import Category +from .dog import Dog from .inline_response_200 import InlineResponse200 from .model_200_response import Model200Response from .model_return import ModelReturn diff --git a/samples/client/petstore/python/swagger_client/models/name.py b/samples/client/petstore/python/swagger_client/models/name.py index 52187bd7bc5..068bca97eea 100644 --- a/samples/client/petstore/python/swagger_client/models/name.py +++ b/samples/client/petstore/python/swagger_client/models/name.py @@ -37,14 +37,17 @@ class Name(object): and the value is json key in definition. """ self.swagger_types = { - 'name': 'int' + 'name': 'int', + 'snake_case': 'int' } self.attribute_map = { - 'name': 'name' + 'name': 'name', + 'snake_case': 'snake_case' } self._name = None + self._snake_case = None @property def name(self): @@ -68,6 +71,28 @@ class Name(object): """ self._name = name + @property + def snake_case(self): + """ + Gets the snake_case of this Name. + + + :return: The snake_case of this Name. + :rtype: int + """ + return self._snake_case + + @snake_case.setter + def snake_case(self, snake_case): + """ + Sets the snake_case of this Name. + + + :param snake_case: The snake_case of this Name. + :type: int + """ + self._snake_case = snake_case + def to_dict(self): """ Returns the model properties as a dict From 67c3f98d96c9c6ed8bcf2490a2c1449084a352ca Mon Sep 17 00:00:00 2001 From: zhenjun115 Date: Sat, 4 Jun 2016 23:30:10 +0800 Subject: [PATCH 3/5] enable python api client to return just data without http header info when need; --- .../src/main/resources/python/api.mustache | 8 +- .../main/resources/python/api_client.mustache | 14 +- samples/client/petstore/python/.coverage | 2 +- .../petstore/python/dev-requirements.txt.log | 260 +----------------- .../python/swagger_client/api_client.py | 14 +- .../python/swagger_client/apis/pet_api.py | 88 ++++-- .../python/swagger_client/apis/store_api.py | 48 +++- .../python/swagger_client/apis/user_api.py | 64 +++-- .../python/swagger_client/models/animal.py | 120 ++++++++ .../python/swagger_client/models/cat.py | 145 ++++++++++ .../python/swagger_client/models/dog.py | 145 ++++++++++ .../petstore/python/tests/test_pet_api.py | 9 + 12 files changed, 602 insertions(+), 315 deletions(-) create mode 100644 samples/client/petstore/python/swagger_client/models/animal.py create mode 100644 samples/client/petstore/python/swagger_client/models/cat.py create mode 100644 samples/client/petstore/python/swagger_client/models/dog.py diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index f395c783dc6..8545b08f7ce 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -48,6 +48,7 @@ class {{classname}}(object): {{#operation}} def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): + _return_http_data_only = True """ {{{summary}}} {{{notes}}} @@ -74,10 +75,11 @@ class {{classname}}(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) else: - (data, status_code, response_headers) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) + (data) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) return data def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): @@ -110,6 +112,7 @@ class {{classname}}(object): all_params = [{{#allParams}}'{{paramName}}'{{#hasMore}}, {{/hasMore}}{{/allParams}}] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -183,6 +186,7 @@ class {{classname}}(object): files=local_var_files, response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) {{/operation}} {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 685580ae839..311d1d34b66 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -103,7 +103,7 @@ class ApiClient(object): def __call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_type=None, auth_settings=None, callback=None): + response_type=None, auth_settings=None, callback=None, _return_http_data_only=None): # headers parameters header_params = header_params or {} @@ -157,9 +157,12 @@ class ApiClient(object): deserialized_data = None if callback: - callback((deserialized_data, response_data.status, response_data.getheaders())) + callback(deserialized_data) if _return_http_data_only else callback((deserialized_data, response_data.status, response_data.getheaders())) + elif _return_http_data_only: + return ( deserialized_data ); else: return (deserialized_data, response_data.status, response_data.getheaders()) + def to_path_value(self, obj): """ @@ -287,7 +290,7 @@ class ApiClient(object): def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_type=None, auth_settings=None, callback=None): + response_type=None, auth_settings=None, callback=None, _return_http_data_only=None): """ Makes the HTTP request (synchronous) and return the deserialized data. To make an async request, define a function for callback. @@ -308,6 +311,7 @@ class ApiClient(object): :param callback function: Callback function for asynchronous request. If provide this parameter, the request will be called asynchronously. + :param _return_http_data_only: response data without head status code and headers :return: If provide parameter callback, the request will be called asynchronously. @@ -319,7 +323,7 @@ class ApiClient(object): return self.__call_api(resource_path, method, path_params, query_params, header_params, body, post_params, files, - response_type, auth_settings, callback) + response_type, auth_settings, callback, _return_http_data_only) else: thread = threading.Thread(target=self.__call_api, args=(resource_path, method, @@ -327,7 +331,7 @@ class ApiClient(object): header_params, body, post_params, files, response_type, auth_settings, - callback)) + callback,_return_http_data_only)) thread.start() return thread diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage index 554238217d0..6ec2ece7d7a 100644 --- a/samples/client/petstore/python/.coverage +++ b/samples/client/petstore/python/.coverage @@ -1 +1 @@ -!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [774, 652, 272, 18, 147, 20, 22, 23, 26, 28, 29, 32, 37, 39, 173, 48, 447, 576, 74, 473, 549, 747, 677, 371, 246, 345], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 24, 26, 28], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 162, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_200_response.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/animal.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/special_model_name.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 122], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 272, 147, 21, 22, 25, 284, 29, 158, 290, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/cat.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [150, 274, 20, 22, 23, 26, 28, 541, 32, 48, 37, 39, 29, 176, 567, 74, 439, 465, 344, 18, 369, 249], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/name.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/inline_response_200.py": [130, 141, 19, 21, 22, 25, 29, 158, 169, 180, 30, 191, 64, 202, 75, 86, 97, 228, 234, 108, 240, 246, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [513, 521, 528, 529, 530, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 550, 551, 40, 42, 44, 45, 47, 561, 52, 569, 571, 572, 573, 574, 575, 576, 578, 68, 69, 74, 75, 76, 78, 79, 81, 82, 84, 86, 93, 98, 100, 104, 105, 106, 109, 110, 111, 113, 114, 117, 118, 119, 120, 121, 122, 125, 126, 127, 128, 131, 132, 133, 136, 139, 140, 143, 146, 147, 148, 149, 151, 154, 155, 157, 159, 162, 164, 540, 173, 174, 176, 178, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 207, 214, 215, 216, 218, 219, 221, 549, 233, 237, 238, 242, 244, 253, 254, 256, 257, 258, 259, 260, 262, 263, 264, 265, 269, 270, 271, 274, 276, 277, 278, 280, 281, 282, 283, 285, 288, 289, 290, 49, 318, 319, 320, 321, 322, 334, 335, 339, 340, 341, 342, 343, 347, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 371, 372, 373, 374, 381, 389, 391, 392, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 407, 409, 416, 417, 419, 421, 422, 424, 426, 433, 434, 436, 438, 439, 441, 443, 451, 453, 456, 457, 458, 459, 461, 462, 470, 496, 505, 506, 511], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [1024, 1025, 1026, 617, 1030, 1032, 1033, 1034, 1035, 1036, 1037, 1039, 344, 18, 1043, 20, 430, 22, 23, 1048, 1028, 26, 1143, 28, 29, 410, 1055, 32, 944, 1058, 1059, 1060, 37, 550, 39, 40, 1065, 42, 1136, 45, 46, 48, 435, 570, 1119, 573, 574, 1087, 576, 608, 1090, 1091, 68, 1093, 650, 71, 72, 74, 951, 1134, 440, 611, 597, 598, 441, 600, 601, 1116, 1117, 95, 96, 1121, 98, 99, 100, 1126, 614, 615, 616, 105, 106, 619, 109, 110, 623, 112, 114, 1061, 116, 117, 630, 119, 120, 121, 1146, 635, 124, 125, 126, 639, 1152, 641, 130, 131, 644, 645, 134, 647, 136, 137, 138, 139, 652, 141, 142, 143, 144, 145, 1164, 147, 1172, 1130, 1049, 1135, 624, 678, 1052, 434, 173, 1165, 449, 1054, 1044, 1140, 629, 1056, 1142, 1057, 631, 1166, 1149, 1144, 1145, 621, 1147, 1062, 636, 1063, 1167, 1133, 754, 246, 41, 438, 1153, 44, 267, 780, 642, 270, 271, 273, 643, 646, 295, 296, 1127, 298, 299, 300, 402, 648, 306, 309, 649, 312, 313, 314, 315, 317, 319, 320, 321, 323, 324, 326, 140, 330, 331, 1042, 335, 336, 339, 341, 342, 343, 856, 345, 346, 347, 348, 349, 350, 352, 1168, 1154, 1169, 1120, 876, 1170, 879, 880, 882, 1171, 372, 626, 375, 376, 378, 1173, 1138, 903, 904, 906, 907, 908, 399, 400, 913, 914, 403, 404, 917, 918, 920, 409, 922, 924, 925, 414, 927, 928, 929, 418, 932, 933, 934, 423, 425, 938, 939, 428, 429, 942, 413, 1162, 945, 946, 947, 948, 949, 950, 329, 952, 953, 442, 955, 444, 445, 446, 447, 448, 416, 451, 417, 305, 977, 980, 981, 983, 420, 477, 1158, 422, 1020, 1006, 1007, 1009, 1010, 1011, 1016, 1017, 1159, 443, 1023], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [19, 21, 22, 23, 25, 26, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 46, 47, 52, 54, 59, 61, 63, 67, 69, 71, 73, 76, 80, 81, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 104, 111, 122, 123, 135, 136, 137, 138, 139, 142, 149, 157, 158, 167, 168, 170, 172, 179, 189, 190, 192, 199, 200, 201, 204, 210, 211, 213, 219, 221, 222, 223, 224, 225, 228, 229, 230, 231, 232, 235, 236, 237, 238, 239, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 256, 257, 258, 259, 260, 265], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 97, 228, 178, 234, 108, 240, 246, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 122], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 84, 86, 57, 95, 97, 228, 234, 108, 240, 117, 246, 119, 106], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_return.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/dog.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63]}} \ No newline at end of file +!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [385, 775, 23, 18, 20, 22, 151, 282, 28, 26, 32, 676, 37, 39, 29, 48, 179, 569, 703, 76, 463, 598, 804, 357, 491, 254], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/name.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 111, 118, 120, 122], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/cat.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [409, 515, 517, 525, 19, 532, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 40, 553, 42, 555, 44, 45, 47, 49, 52, 565, 573, 575, 576, 577, 578, 579, 68, 69, 582, 74, 75, 76, 78, 79, 81, 82, 84, 86, 93, 98, 100, 104, 105, 106, 109, 110, 111, 113, 114, 117, 118, 119, 120, 121, 122, 125, 126, 533, 128, 131, 132, 133, 136, 139, 140, 143, 146, 147, 148, 149, 151, 154, 155, 157, 159, 160, 161, 162, 164, 167, 534, 176, 177, 179, 181, 544, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 217, 218, 219, 221, 222, 224, 236, 240, 241, 245, 247, 127, 554, 256, 257, 259, 260, 261, 262, 263, 265, 266, 267, 268, 272, 273, 274, 277, 279, 280, 281, 283, 284, 285, 286, 288, 291, 292, 293, 322, 323, 324, 325, 326, 328, 329, 330, 331, 332, 333, 334, 335, 336, 338, 339, 343, 344, 345, 346, 347, 351, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 375, 376, 377, 378, 385, 393, 395, 396, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 580, 411, 413, 420, 421, 423, 425, 426, 428, 430, 437, 438, 440, 442, 443, 445, 447, 455, 457, 460, 461, 462, 463, 465, 466, 474, 500, 509, 510], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [18, 20, 22, 23, 26, 28, 29, 32, 37, 39, 40, 41, 42, 44, 45, 46, 48, 49, 69, 70, 73, 74, 76, 97, 98, 99, 101, 102, 103, 108, 109, 112, 113, 115, 117, 119, 120, 122, 123, 124, 127, 128, 129, 133, 134, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 151, 179, 254, 255, 276, 277, 280, 281, 283, 305, 306, 307, 309, 310, 311, 316, 317, 320, 323, 324, 325, 326, 328, 330, 331, 332, 334, 335, 337, 340, 341, 342, 346, 347, 350, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 364, 365, 385, 386, 389, 390, 392, 413, 414, 415, 417, 418, 419, 424, 425, 428, 429, 431, 432, 433, 435, 437, 438, 440, 443, 444, 445, 449, 450, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 467, 468, 488, 489, 492, 493, 495, 516, 517, 518, 520, 521, 522, 527, 528, 531, 532, 534, 535, 536, 538, 540, 541, 543, 546, 547, 548, 552, 553, 556, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 570, 571, 591, 592, 593, 595, 596, 598, 619, 620, 621, 623, 624, 625, 630, 631, 634, 637, 638, 639, 640, 642, 644, 646, 647, 649, 652, 653, 654, 658, 659, 662, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 676, 704, 782, 810, 888, 889, 909, 910, 913, 914, 916, 937, 938, 939, 941, 942, 943, 948, 949, 952, 953, 955, 957, 959, 960, 962, 963, 964, 967, 968, 969, 973, 974, 977, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 991, 992, 1014, 1015, 1018, 1019, 1021, 1044, 1045, 1046, 1048, 1049, 1050, 1055, 1056, 1059, 1062, 1063, 1064, 1065, 1067, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1078, 1081, 1082, 1083, 1087, 1088, 1091, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1105, 1106, 1128, 1129, 1132, 1133, 1135, 1158, 1159, 1160, 1162, 1163, 1164, 1169, 1170, 1173, 1176, 1177, 1178, 1179, 1181, 1183, 1185, 1186, 1187, 1188, 1189, 1190, 1192, 1195, 1196, 1197, 1201, 1202, 1205, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_return.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 97, 228, 178, 234, 108, 240, 246, 119], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/dog.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 24, 26, 28], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/special_model_name.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [257, 258, 282, 278, 305, 18, 20, 277, 22, 23, 281, 154, 284, 26, 32, 304, 37, 39, 40, 28, 327, 44, 46, 29, 48, 561, 306, 308, 309, 182, 315, 316, 319, 320, 322, 324, 310, 326, 455, 329, 76, 589, 334, 333, 338, 339, 342, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 483, 356, 41, 332, 383], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/inline_response_200.py": [130, 141, 19, 21, 22, 25, 29, 158, 169, 180, 30, 191, 64, 202, 75, 86, 97, 228, 234, 108, 240, 246, 119], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/animal.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [19, 21, 22, 23, 25, 26, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 46, 47, 52, 54, 59, 61, 63, 67, 69, 71, 73, 76, 80, 81, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 104, 111, 122, 123, 135, 136, 137, 138, 139, 142, 149, 157, 158, 167, 168, 170, 172, 179, 189, 190, 192, 199, 200, 201, 204, 210, 211, 213, 219, 221, 222, 223, 224, 225, 228, 229, 230, 231, 232, 235, 236, 237, 238, 239, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 256, 257, 258, 259, 260, 265], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 57, 216, 217, 95, 224, 97, 226, 228, 232, 234, 108, 240, 244, 117, 246, 119, 212, 106], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 134, 138, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 111, 118, 120, 122], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 272, 147, 21, 22, 25, 284, 29, 158, 290, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_200_response.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30]}} \ No newline at end of file diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log index 6c260212adc..23fed21daa7 100644 --- a/samples/client/petstore/python/dev-requirements.txt.log +++ b/samples/client/petstore/python/dev-requirements.txt.log @@ -1,260 +1,16 @@ Collecting nose (from -r dev-requirements.txt (line 1)) - Using cached nose-1.3.7-py2-none-any.whl + Downloading nose-1.3.7-py2-none-any.whl (154kB) Collecting tox (from -r dev-requirements.txt (line 2)) - Using cached tox-2.1.1-py2.py3-none-any.whl + Downloading tox-2.3.1-py2.py3-none-any.whl (40kB) Collecting coverage (from -r dev-requirements.txt (line 3)) + Downloading coverage-4.1-cp27-cp27m-macosx_10_10_x86_64.whl (164kB) Collecting randomize (from -r dev-requirements.txt (line 4)) - Using cached randomize-0.13-py2.py3-none-any.whl + Downloading randomize-0.13-py2.py3-none-any.whl Collecting virtualenv>=1.11.2 (from tox->-r dev-requirements.txt (line 2)) - Using cached virtualenv-13.1.2-py2.py3-none-any.whl -Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) - Using cached py-1.4.30-py2.py3-none-any.whl -Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) - Using cached pluggy-0.3.0-py2.py3-none-any.whl -Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize -Successfully installed coverage-3.7.1 nose-1.3.7 pluggy-0.3.0 py-1.4.30 randomize-0.13 tox-2.1.1 virtualenv-13.1.2 -Requirement already satisfied (use --upgrade to upgrade): nose in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./.venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./.venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Collecting nose (from -r dev-requirements.txt (line 1)) - Using cached nose-1.3.7-py2-none-any.whl -Collecting tox (from -r dev-requirements.txt (line 2)) - Using cached tox-2.2.1-py2.py3-none-any.whl -Collecting coverage (from -r dev-requirements.txt (line 3)) - Downloading coverage-4.0.3.tar.gz (354kB) -Collecting randomize (from -r dev-requirements.txt (line 4)) - Using cached randomize-0.13-py2.py3-none-any.whl -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in /Library/Python/2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) + Downloading virtualenv-15.0.2-py2.py3-none-any.whl (1.8MB) Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) Downloading py-1.4.31-py2.py3-none-any.whl (81kB) Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) - Using cached pluggy-0.3.1-py2.py3-none-any.whl -Installing collected packages: nose, py, pluggy, tox, coverage, randomize -Collecting nose (from -r dev-requirements.txt (line 1)) - Using cached nose-1.3.7-py2-none-any.whl -Collecting tox (from -r dev-requirements.txt (line 2)) - Using cached tox-2.2.1-py2.py3-none-any.whl -Collecting coverage (from -r dev-requirements.txt (line 3)) - Using cached coverage-4.0.3.tar.gz -Collecting randomize (from -r dev-requirements.txt (line 4)) - Using cached randomize-0.13-py2.py3-none-any.whl -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in /Library/Python/2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) - Using cached py-1.4.31-py2.py3-none-any.whl -Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) - Using cached pluggy-0.3.1-py2.py3-none-any.whl -Installing collected packages: nose, py, pluggy, tox, coverage, randomize -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) -Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) -Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) -Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) -Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) + Downloading pluggy-0.3.1-py2.py3-none-any.whl +Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize +Successfully installed coverage-4.1 nose-1.3.7 pluggy-0.3.1 py-1.4.31 randomize-0.13 tox-2.3.1 virtualenv-15.0.2 diff --git a/samples/client/petstore/python/swagger_client/api_client.py b/samples/client/petstore/python/swagger_client/api_client.py index e5e4738e961..f4351250056 100644 --- a/samples/client/petstore/python/swagger_client/api_client.py +++ b/samples/client/petstore/python/swagger_client/api_client.py @@ -103,7 +103,7 @@ class ApiClient(object): def __call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_type=None, auth_settings=None, callback=None): + response_type=None, auth_settings=None, callback=None, _return_http_data_only=None): # headers parameters header_params = header_params or {} @@ -157,9 +157,12 @@ class ApiClient(object): deserialized_data = None if callback: - callback((deserialized_data, response_data.status, response_data.getheaders())) + callback(deserialized_data) if _return_http_data_only else callback((deserialized_data, response_data.status, response_data.getheaders())) + elif _return_http_data_only: + return ( deserialized_data ); else: return (deserialized_data, response_data.status, response_data.getheaders()) + def to_path_value(self, obj): """ @@ -287,7 +290,7 @@ class ApiClient(object): def call_api(self, resource_path, method, path_params=None, query_params=None, header_params=None, body=None, post_params=None, files=None, - response_type=None, auth_settings=None, callback=None): + response_type=None, auth_settings=None, callback=None, _return_http_data_only=None): """ Makes the HTTP request (synchronous) and return the deserialized data. To make an async request, define a function for callback. @@ -308,6 +311,7 @@ class ApiClient(object): :param callback function: Callback function for asynchronous request. If provide this parameter, the request will be called asynchronously. + :param _return_http_data_only: response data without head status code and headers :return: If provide parameter callback, the request will be called asynchronously. @@ -319,7 +323,7 @@ class ApiClient(object): return self.__call_api(resource_path, method, path_params, query_params, header_params, body, post_params, files, - response_type, auth_settings, callback) + response_type, auth_settings, callback, _return_http_data_only) else: thread = threading.Thread(target=self.__call_api, args=(resource_path, method, @@ -327,7 +331,7 @@ class ApiClient(object): header_params, body, post_params, files, response_type, auth_settings, - callback)) + callback,_return_http_data_only)) thread.start() return thread diff --git a/samples/client/petstore/python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/swagger_client/apis/pet_api.py index ae7a828e959..b61af397f70 100644 --- a/samples/client/petstore/python/swagger_client/apis/pet_api.py +++ b/samples/client/petstore/python/swagger_client/apis/pet_api.py @@ -46,6 +46,7 @@ class PetApi(object): self.api_client = config.api_client def add_pet(self, **kwargs): + _return_http_data_only = True """ Add a new pet to the store @@ -65,10 +66,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.add_pet_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.add_pet_with_http_info(**kwargs) + (data) = self.add_pet_with_http_info(**kwargs) return data def add_pet_with_http_info(self, **kwargs): @@ -94,6 +96,7 @@ class PetApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -142,9 +145,11 @@ class PetApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def add_pet_using_byte_array(self, **kwargs): + _return_http_data_only = True """ Fake endpoint to test byte array in body parameter for adding a new pet to the store @@ -164,10 +169,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.add_pet_using_byte_array_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.add_pet_using_byte_array_with_http_info(**kwargs) + (data) = self.add_pet_using_byte_array_with_http_info(**kwargs) return data def add_pet_using_byte_array_with_http_info(self, **kwargs): @@ -193,6 +199,7 @@ class PetApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -241,9 +248,11 @@ class PetApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def delete_pet(self, pet_id, **kwargs): + _return_http_data_only = True """ Deletes a pet @@ -264,10 +273,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.delete_pet_with_http_info(pet_id, **kwargs) else: - (data, status_code, response_headers) = self.delete_pet_with_http_info(pet_id, **kwargs) + (data) = self.delete_pet_with_http_info(pet_id, **kwargs) return data def delete_pet_with_http_info(self, pet_id, **kwargs): @@ -294,6 +304,7 @@ class PetApi(object): all_params = ['pet_id', 'api_key'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -347,9 +358,11 @@ class PetApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def find_pets_by_status(self, **kwargs): + _return_http_data_only = True """ Finds Pets by status Multiple status values can be provided with comma separated strings @@ -369,10 +382,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.find_pets_by_status_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.find_pets_by_status_with_http_info(**kwargs) + (data) = self.find_pets_by_status_with_http_info(**kwargs) return data def find_pets_by_status_with_http_info(self, **kwargs): @@ -398,6 +412,7 @@ class PetApi(object): all_params = ['status'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -446,9 +461,11 @@ class PetApi(object): files=local_var_files, response_type='list[Pet]', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def find_pets_by_tags(self, **kwargs): + _return_http_data_only = True """ Finds Pets by tags Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing. @@ -468,10 +485,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.find_pets_by_tags_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.find_pets_by_tags_with_http_info(**kwargs) + (data) = self.find_pets_by_tags_with_http_info(**kwargs) return data def find_pets_by_tags_with_http_info(self, **kwargs): @@ -497,6 +515,7 @@ class PetApi(object): all_params = ['tags'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -545,9 +564,11 @@ class PetApi(object): files=local_var_files, response_type='list[Pet]', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def get_pet_by_id(self, pet_id, **kwargs): + _return_http_data_only = True """ Find pet by ID Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions @@ -567,10 +588,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.get_pet_by_id_with_http_info(pet_id, **kwargs) else: - (data, status_code, response_headers) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) + (data) = self.get_pet_by_id_with_http_info(pet_id, **kwargs) return data def get_pet_by_id_with_http_info(self, pet_id, **kwargs): @@ -596,6 +618,7 @@ class PetApi(object): all_params = ['pet_id'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -647,9 +670,11 @@ class PetApi(object): files=local_var_files, response_type='Pet', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def get_pet_by_id_in_object(self, pet_id, **kwargs): + _return_http_data_only = True """ Fake endpoint to test inline arbitrary object return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions @@ -669,10 +694,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) else: - (data, status_code, response_headers) = self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) + (data) = self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) return data def get_pet_by_id_in_object_with_http_info(self, pet_id, **kwargs): @@ -698,6 +724,7 @@ class PetApi(object): all_params = ['pet_id'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -749,9 +776,11 @@ class PetApi(object): files=local_var_files, response_type='InlineResponse200', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def pet_pet_idtesting_byte_arraytrue_get(self, pet_id, **kwargs): + _return_http_data_only = True """ Fake endpoint to test byte array return by 'Find pet by ID' Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions @@ -771,10 +800,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) else: - (data, status_code, response_headers) = self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) + (data) = self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) return data def pet_pet_idtesting_byte_arraytrue_get_with_http_info(self, pet_id, **kwargs): @@ -800,6 +830,7 @@ class PetApi(object): all_params = ['pet_id'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -851,9 +882,11 @@ class PetApi(object): files=local_var_files, response_type='str', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def update_pet(self, **kwargs): + _return_http_data_only = True """ Update an existing pet @@ -873,10 +906,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.update_pet_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.update_pet_with_http_info(**kwargs) + (data) = self.update_pet_with_http_info(**kwargs) return data def update_pet_with_http_info(self, **kwargs): @@ -902,6 +936,7 @@ class PetApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -950,9 +985,11 @@ class PetApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def update_pet_with_form(self, pet_id, **kwargs): + _return_http_data_only = True """ Updates a pet in the store with form data @@ -974,10 +1011,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.update_pet_with_form_with_http_info(pet_id, **kwargs) else: - (data, status_code, response_headers) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) + (data) = self.update_pet_with_form_with_http_info(pet_id, **kwargs) return data def update_pet_with_form_with_http_info(self, pet_id, **kwargs): @@ -1005,6 +1043,7 @@ class PetApi(object): all_params = ['pet_id', 'name', 'status'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -1060,9 +1099,11 @@ class PetApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def upload_file(self, pet_id, **kwargs): + _return_http_data_only = True """ uploads an image @@ -1084,10 +1125,11 @@ class PetApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.upload_file_with_http_info(pet_id, **kwargs) else: - (data, status_code, response_headers) = self.upload_file_with_http_info(pet_id, **kwargs) + (data) = self.upload_file_with_http_info(pet_id, **kwargs) return data def upload_file_with_http_info(self, pet_id, **kwargs): @@ -1115,6 +1157,7 @@ class PetApi(object): all_params = ['pet_id', 'additional_metadata', 'file'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -1170,4 +1213,5 @@ class PetApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) diff --git a/samples/client/petstore/python/swagger_client/apis/store_api.py b/samples/client/petstore/python/swagger_client/apis/store_api.py index 4d4ffca2ce5..938b16b66be 100644 --- a/samples/client/petstore/python/swagger_client/apis/store_api.py +++ b/samples/client/petstore/python/swagger_client/apis/store_api.py @@ -46,6 +46,7 @@ class StoreApi(object): self.api_client = config.api_client def delete_order(self, order_id, **kwargs): + _return_http_data_only = True """ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors @@ -65,10 +66,11 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.delete_order_with_http_info(order_id, **kwargs) else: - (data, status_code, response_headers) = self.delete_order_with_http_info(order_id, **kwargs) + (data) = self.delete_order_with_http_info(order_id, **kwargs) return data def delete_order_with_http_info(self, order_id, **kwargs): @@ -94,6 +96,7 @@ class StoreApi(object): all_params = ['order_id'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -145,9 +148,11 @@ class StoreApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def find_orders_by_status(self, **kwargs): + _return_http_data_only = True """ Finds orders by status A single status value can be provided as a string @@ -167,10 +172,11 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.find_orders_by_status_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.find_orders_by_status_with_http_info(**kwargs) + (data) = self.find_orders_by_status_with_http_info(**kwargs) return data def find_orders_by_status_with_http_info(self, **kwargs): @@ -196,6 +202,7 @@ class StoreApi(object): all_params = ['status'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -244,9 +251,11 @@ class StoreApi(object): files=local_var_files, response_type='list[Order]', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def get_inventory(self, **kwargs): + _return_http_data_only = True """ Returns pet inventories by status Returns a map of status codes to quantities @@ -265,10 +274,11 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.get_inventory_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.get_inventory_with_http_info(**kwargs) + (data) = self.get_inventory_with_http_info(**kwargs) return data def get_inventory_with_http_info(self, **kwargs): @@ -293,6 +303,7 @@ class StoreApi(object): all_params = [] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -339,9 +350,11 @@ class StoreApi(object): files=local_var_files, response_type='dict(str, int)', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def get_inventory_in_object(self, **kwargs): + _return_http_data_only = True """ Fake endpoint to test arbitrary object return by 'Get inventory' Returns an arbitrary object which is actually a map of status codes to quantities @@ -360,10 +373,11 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.get_inventory_in_object_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.get_inventory_in_object_with_http_info(**kwargs) + (data) = self.get_inventory_in_object_with_http_info(**kwargs) return data def get_inventory_in_object_with_http_info(self, **kwargs): @@ -388,6 +402,7 @@ class StoreApi(object): all_params = [] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -434,9 +449,11 @@ class StoreApi(object): files=local_var_files, response_type='object', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def get_order_by_id(self, order_id, **kwargs): + _return_http_data_only = True """ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions @@ -456,10 +473,11 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.get_order_by_id_with_http_info(order_id, **kwargs) else: - (data, status_code, response_headers) = self.get_order_by_id_with_http_info(order_id, **kwargs) + (data) = self.get_order_by_id_with_http_info(order_id, **kwargs) return data def get_order_by_id_with_http_info(self, order_id, **kwargs): @@ -485,6 +503,7 @@ class StoreApi(object): all_params = ['order_id'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -536,9 +555,11 @@ class StoreApi(object): files=local_var_files, response_type='Order', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def place_order(self, **kwargs): + _return_http_data_only = True """ Place an order for a pet @@ -558,10 +579,11 @@ class StoreApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.place_order_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.place_order_with_http_info(**kwargs) + (data) = self.place_order_with_http_info(**kwargs) return data def place_order_with_http_info(self, **kwargs): @@ -587,6 +609,7 @@ class StoreApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -635,4 +658,5 @@ class StoreApi(object): files=local_var_files, response_type='Order', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) diff --git a/samples/client/petstore/python/swagger_client/apis/user_api.py b/samples/client/petstore/python/swagger_client/apis/user_api.py index 39ab9148a15..b26264178c1 100644 --- a/samples/client/petstore/python/swagger_client/apis/user_api.py +++ b/samples/client/petstore/python/swagger_client/apis/user_api.py @@ -46,6 +46,7 @@ class UserApi(object): self.api_client = config.api_client def create_user(self, **kwargs): + _return_http_data_only = True """ Create user This can only be done by the logged in user. @@ -65,10 +66,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.create_user_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.create_user_with_http_info(**kwargs) + (data) = self.create_user_with_http_info(**kwargs) return data def create_user_with_http_info(self, **kwargs): @@ -94,6 +96,7 @@ class UserApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -142,9 +145,11 @@ class UserApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def create_users_with_array_input(self, **kwargs): + _return_http_data_only = True """ Creates list of users with given input array @@ -164,10 +169,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.create_users_with_array_input_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.create_users_with_array_input_with_http_info(**kwargs) + (data) = self.create_users_with_array_input_with_http_info(**kwargs) return data def create_users_with_array_input_with_http_info(self, **kwargs): @@ -193,6 +199,7 @@ class UserApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -241,9 +248,11 @@ class UserApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def create_users_with_list_input(self, **kwargs): + _return_http_data_only = True """ Creates list of users with given input array @@ -263,10 +272,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.create_users_with_list_input_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.create_users_with_list_input_with_http_info(**kwargs) + (data) = self.create_users_with_list_input_with_http_info(**kwargs) return data def create_users_with_list_input_with_http_info(self, **kwargs): @@ -292,6 +302,7 @@ class UserApi(object): all_params = ['body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -340,9 +351,11 @@ class UserApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def delete_user(self, username, **kwargs): + _return_http_data_only = True """ Delete user This can only be done by the logged in user. @@ -362,10 +375,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.delete_user_with_http_info(username, **kwargs) else: - (data, status_code, response_headers) = self.delete_user_with_http_info(username, **kwargs) + (data) = self.delete_user_with_http_info(username, **kwargs) return data def delete_user_with_http_info(self, username, **kwargs): @@ -391,6 +405,7 @@ class UserApi(object): all_params = ['username'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -442,9 +457,11 @@ class UserApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def get_user_by_name(self, username, **kwargs): + _return_http_data_only = True """ Get user by user name @@ -464,10 +481,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.get_user_by_name_with_http_info(username, **kwargs) else: - (data, status_code, response_headers) = self.get_user_by_name_with_http_info(username, **kwargs) + (data) = self.get_user_by_name_with_http_info(username, **kwargs) return data def get_user_by_name_with_http_info(self, username, **kwargs): @@ -493,6 +511,7 @@ class UserApi(object): all_params = ['username'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -544,9 +563,11 @@ class UserApi(object): files=local_var_files, response_type='User', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def login_user(self, **kwargs): + _return_http_data_only = True """ Logs user into the system @@ -567,10 +588,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.login_user_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.login_user_with_http_info(**kwargs) + (data) = self.login_user_with_http_info(**kwargs) return data def login_user_with_http_info(self, **kwargs): @@ -597,6 +619,7 @@ class UserApi(object): all_params = ['username', 'password'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -647,9 +670,11 @@ class UserApi(object): files=local_var_files, response_type='str', auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def logout_user(self, **kwargs): + _return_http_data_only = True """ Logs out current logged in user session @@ -668,10 +693,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.logout_user_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.logout_user_with_http_info(**kwargs) + (data) = self.logout_user_with_http_info(**kwargs) return data def logout_user_with_http_info(self, **kwargs): @@ -696,6 +722,7 @@ class UserApi(object): all_params = [] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -742,9 +769,11 @@ class UserApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) def update_user(self, username, **kwargs): + _return_http_data_only = True """ Updated user This can only be done by the logged in user. @@ -765,10 +794,11 @@ class UserApi(object): If the method is called asynchronously, returns the request thread. """ + kwargs['_return_http_data_only'] = _return_http_data_only if kwargs.get('callback'): return self.update_user_with_http_info(username, **kwargs) else: - (data, status_code, response_headers) = self.update_user_with_http_info(username, **kwargs) + (data) = self.update_user_with_http_info(username, **kwargs) return data def update_user_with_http_info(self, username, **kwargs): @@ -795,6 +825,7 @@ class UserApi(object): all_params = ['username', 'body'] all_params.append('callback') + all_params.append('_return_http_data_only') params = locals() for key, val in iteritems(params['kwargs']): @@ -848,4 +879,5 @@ class UserApi(object): files=local_var_files, response_type=None, auth_settings=auth_settings, - callback=params.get('callback')) + callback=params.get('callback'), + _return_http_data_only=params.get('_return_http_data_only')) diff --git a/samples/client/petstore/python/swagger_client/models/animal.py b/samples/client/petstore/python/swagger_client/models/animal.py new file mode 100644 index 00000000000..762e3df5b37 --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/animal.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class Animal(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + Animal - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'class_name': 'str' + } + + self.attribute_map = { + 'class_name': 'className' + } + + self._class_name = None + + @property + def class_name(self): + """ + Gets the class_name of this Animal. + + + :return: The class_name of this Animal. + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """ + Sets the class_name of this Animal. + + + :param class_name: The class_name of this Animal. + :type: str + """ + self._class_name = class_name + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/samples/client/petstore/python/swagger_client/models/cat.py b/samples/client/petstore/python/swagger_client/models/cat.py new file mode 100644 index 00000000000..4744fc4821c --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/cat.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class Cat(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + Cat - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'class_name': 'str', + 'declawed': 'bool' + } + + self.attribute_map = { + 'class_name': 'className', + 'declawed': 'declawed' + } + + self._class_name = None + self._declawed = None + + @property + def class_name(self): + """ + Gets the class_name of this Cat. + + + :return: The class_name of this Cat. + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """ + Sets the class_name of this Cat. + + + :param class_name: The class_name of this Cat. + :type: str + """ + self._class_name = class_name + + @property + def declawed(self): + """ + Gets the declawed of this Cat. + + + :return: The declawed of this Cat. + :rtype: bool + """ + return self._declawed + + @declawed.setter + def declawed(self, declawed): + """ + Sets the declawed of this Cat. + + + :param declawed: The declawed of this Cat. + :type: bool + """ + self._declawed = declawed + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/samples/client/petstore/python/swagger_client/models/dog.py b/samples/client/petstore/python/swagger_client/models/dog.py new file mode 100644 index 00000000000..3885dd314ef --- /dev/null +++ b/samples/client/petstore/python/swagger_client/models/dog.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" +Copyright 2016 SmartBear Software + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + Ref: https://github.com/swagger-api/swagger-codegen +""" + +from pprint import pformat +from six import iteritems + + +class Dog(object): + """ + NOTE: This class is auto generated by the swagger code generator program. + Do not edit the class manually. + """ + def __init__(self): + """ + Dog - a model defined in Swagger + + :param dict swaggerTypes: The key is attribute name + and the value is attribute type. + :param dict attributeMap: The key is attribute name + and the value is json key in definition. + """ + self.swagger_types = { + 'class_name': 'str', + 'breed': 'str' + } + + self.attribute_map = { + 'class_name': 'className', + 'breed': 'breed' + } + + self._class_name = None + self._breed = None + + @property + def class_name(self): + """ + Gets the class_name of this Dog. + + + :return: The class_name of this Dog. + :rtype: str + """ + return self._class_name + + @class_name.setter + def class_name(self, class_name): + """ + Sets the class_name of this Dog. + + + :param class_name: The class_name of this Dog. + :type: str + """ + self._class_name = class_name + + @property + def breed(self): + """ + Gets the breed of this Dog. + + + :return: The breed of this Dog. + :rtype: str + """ + return self._breed + + @breed.setter + def breed(self, breed): + """ + Sets the breed of this Dog. + + + :param breed: The breed of this Dog. + :type: str + """ + self._breed = breed + + def to_dict(self): + """ + Returns the model properties as a dict + """ + result = {} + + for attr, _ in iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """ + Returns the string representation of the model + """ + return pformat(self.to_dict()) + + def __repr__(self): + """ + For `print` and `pprint` + """ + return self.to_str() + + def __eq__(self, other): + """ + Returns true if both objects are equal + """ + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """ + Returns true if both objects are not equal + """ + return not self == other + diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 300a7bee783..14a9895ab97 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -97,6 +97,15 @@ class PetApiTests(unittest.TestCase): self.assertIsNotNone(fetched.category) self.assertEqual(self.pet.category.name, fetched.category.name) + def test_add_pet_and_get_pet_by_id_with_http_info(self): + self.pet_api.add_pet(body=self.pet) + + fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched[0].id) + self.assertIsNotNone(fetched[0].category) + self.assertEqual(self.pet.category.name, fetched[0].category.name) + def test_update_pet(self): self.pet.name = "hello kity with updated" self.pet_api.update_pet(body=self.pet) From 86c8647ace4a0559e281df14ce99665025697558 Mon Sep 17 00:00:00 2001 From: zhenjun115 Date: Sun, 19 Jun 2016 12:31:10 +0800 Subject: [PATCH 4/5] add async method test case for pet api; --- samples/client/petstore/python/.coverage | 1 - .../petstore/python/dev-requirements.txt.log | 16 ---------- .../petstore/python/tests/test_pet_api.py | 30 +++++++++++++++++++ 3 files changed, 30 insertions(+), 17 deletions(-) delete mode 100644 samples/client/petstore/python/.coverage delete mode 100644 samples/client/petstore/python/dev-requirements.txt.log diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage deleted file mode 100644 index 6ec2ece7d7a..00000000000 --- a/samples/client/petstore/python/.coverage +++ /dev/null @@ -1 +0,0 @@ -!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [385, 775, 23, 18, 20, 22, 151, 282, 28, 26, 32, 676, 37, 39, 29, 48, 179, 569, 703, 76, 463, 598, 804, 357, 491, 254], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/name.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 111, 118, 120, 122], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/cat.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [409, 515, 517, 525, 19, 532, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 40, 553, 42, 555, 44, 45, 47, 49, 52, 565, 573, 575, 576, 577, 578, 579, 68, 69, 582, 74, 75, 76, 78, 79, 81, 82, 84, 86, 93, 98, 100, 104, 105, 106, 109, 110, 111, 113, 114, 117, 118, 119, 120, 121, 122, 125, 126, 533, 128, 131, 132, 133, 136, 139, 140, 143, 146, 147, 148, 149, 151, 154, 155, 157, 159, 160, 161, 162, 164, 167, 534, 176, 177, 179, 181, 544, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 217, 218, 219, 221, 222, 224, 236, 240, 241, 245, 247, 127, 554, 256, 257, 259, 260, 261, 262, 263, 265, 266, 267, 268, 272, 273, 274, 277, 279, 280, 281, 283, 284, 285, 286, 288, 291, 292, 293, 322, 323, 324, 325, 326, 328, 329, 330, 331, 332, 333, 334, 335, 336, 338, 339, 343, 344, 345, 346, 347, 351, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 375, 376, 377, 378, 385, 393, 395, 396, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 580, 411, 413, 420, 421, 423, 425, 426, 428, 430, 437, 438, 440, 442, 443, 445, 447, 455, 457, 460, 461, 462, 463, 465, 466, 474, 500, 509, 510], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [18, 20, 22, 23, 26, 28, 29, 32, 37, 39, 40, 41, 42, 44, 45, 46, 48, 49, 69, 70, 73, 74, 76, 97, 98, 99, 101, 102, 103, 108, 109, 112, 113, 115, 117, 119, 120, 122, 123, 124, 127, 128, 129, 133, 134, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 151, 179, 254, 255, 276, 277, 280, 281, 283, 305, 306, 307, 309, 310, 311, 316, 317, 320, 323, 324, 325, 326, 328, 330, 331, 332, 334, 335, 337, 340, 341, 342, 346, 347, 350, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 364, 365, 385, 386, 389, 390, 392, 413, 414, 415, 417, 418, 419, 424, 425, 428, 429, 431, 432, 433, 435, 437, 438, 440, 443, 444, 445, 449, 450, 453, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 467, 468, 488, 489, 492, 493, 495, 516, 517, 518, 520, 521, 522, 527, 528, 531, 532, 534, 535, 536, 538, 540, 541, 543, 546, 547, 548, 552, 553, 556, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 570, 571, 591, 592, 593, 595, 596, 598, 619, 620, 621, 623, 624, 625, 630, 631, 634, 637, 638, 639, 640, 642, 644, 646, 647, 649, 652, 653, 654, 658, 659, 662, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 676, 704, 782, 810, 888, 889, 909, 910, 913, 914, 916, 937, 938, 939, 941, 942, 943, 948, 949, 952, 953, 955, 957, 959, 960, 962, 963, 964, 967, 968, 969, 973, 974, 977, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 991, 992, 1014, 1015, 1018, 1019, 1021, 1044, 1045, 1046, 1048, 1049, 1050, 1055, 1056, 1059, 1062, 1063, 1064, 1065, 1067, 1069, 1071, 1072, 1073, 1074, 1075, 1076, 1078, 1081, 1082, 1083, 1087, 1088, 1091, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1105, 1106, 1128, 1129, 1132, 1133, 1135, 1158, 1159, 1160, 1162, 1163, 1164, 1169, 1170, 1173, 1176, 1177, 1178, 1179, 1181, 1183, 1185, 1186, 1187, 1188, 1189, 1190, 1192, 1195, 1196, 1197, 1201, 1202, 1205, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_return.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 97, 228, 178, 234, 108, 240, 246, 119], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/dog.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 24, 26, 28], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/special_model_name.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [257, 258, 282, 278, 305, 18, 20, 277, 22, 23, 281, 154, 284, 26, 32, 304, 37, 39, 40, 28, 327, 44, 46, 29, 48, 561, 306, 308, 309, 182, 315, 316, 319, 320, 322, 324, 310, 326, 455, 329, 76, 589, 334, 333, 338, 339, 342, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 483, 356, 41, 332, 383], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/inline_response_200.py": [130, 141, 19, 21, 22, 25, 29, 158, 169, 180, 30, 191, 64, 202, 75, 86, 97, 228, 234, 108, 240, 246, 119], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/animal.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [19, 21, 22, 23, 25, 26, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 46, 47, 52, 54, 59, 61, 63, 67, 69, 71, 73, 76, 80, 81, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 104, 111, 122, 123, 135, 136, 137, 138, 139, 142, 149, 157, 158, 167, 168, 170, 172, 179, 189, 190, 192, 199, 200, 201, 204, 210, 211, 213, 219, 221, 222, 223, 224, 225, 228, 229, 230, 231, 232, 235, 236, 237, 238, 239, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 256, 257, 258, 259, 260, 265], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 57, 216, 217, 95, 224, 97, 226, 228, 232, 234, 108, 240, 244, 117, 246, 119, 212, 106], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 134, 138, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 111, 118, 120, 122], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 272, 147, 21, 22, 25, 284, 29, 158, 290, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/huangzhenjun/Public/git/PartTime/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_200_response.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30]}} \ No newline at end of file diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log deleted file mode 100644 index 23fed21daa7..00000000000 --- a/samples/client/petstore/python/dev-requirements.txt.log +++ /dev/null @@ -1,16 +0,0 @@ -Collecting nose (from -r dev-requirements.txt (line 1)) - Downloading nose-1.3.7-py2-none-any.whl (154kB) -Collecting tox (from -r dev-requirements.txt (line 2)) - Downloading tox-2.3.1-py2.py3-none-any.whl (40kB) -Collecting coverage (from -r dev-requirements.txt (line 3)) - Downloading coverage-4.1-cp27-cp27m-macosx_10_10_x86_64.whl (164kB) -Collecting randomize (from -r dev-requirements.txt (line 4)) - Downloading randomize-0.13-py2.py3-none-any.whl -Collecting virtualenv>=1.11.2 (from tox->-r dev-requirements.txt (line 2)) - Downloading virtualenv-15.0.2-py2.py3-none-any.whl (1.8MB) -Collecting py>=1.4.17 (from tox->-r dev-requirements.txt (line 2)) - Downloading py-1.4.31-py2.py3-none-any.whl (81kB) -Collecting pluggy<0.4.0,>=0.3.0 (from tox->-r dev-requirements.txt (line 2)) - Downloading pluggy-0.3.1-py2.py3-none-any.whl -Installing collected packages: nose, virtualenv, py, pluggy, tox, coverage, randomize -Successfully installed coverage-4.1 nose-1.3.7 pluggy-0.3.1 py-1.4.31 randomize-0.13 tox-2.3.1 virtualenv-15.0.2 diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 14a9895ab97..805086fc680 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -97,6 +97,21 @@ class PetApiTests(unittest.TestCase): self.assertIsNotNone(fetched.category) self.assertEqual(self.pet.category.name, fetched.category.name) + def test_async_add_pet_and_get_pet_by_id(self): + self.pet_api.add_pet(body=self.pet) + + def callback_function(data): + #fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(data) + self.assertEqual(self.pet.id, data.id) + self.assertIsNotNone(data.category) + self.assertEqual(self.pet.category.name, data.category.name) + + thread = self.pet_api.get_pet_by_id(pet_id=self.pet.id, callback=callback_function) + thread.join(10) + if thread.isAlive(): + self.fail("Request timeout") + def test_add_pet_and_get_pet_by_id_with_http_info(self): self.pet_api.add_pet(body=self.pet) @@ -106,6 +121,21 @@ class PetApiTests(unittest.TestCase): self.assertIsNotNone(fetched[0].category) self.assertEqual(self.pet.category.name, fetched[0].category.name) + def test_async_add_pet_and_get_pet_by_id_with_http_info(self): + self.pet_api.add_pet(body=self.pet) + + def callback_function(data): + #fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + self.assertIsNotNone(data) + self.assertEqual(self.pet.id, data.id) + self.assertIsNotNone(data.category) + self.assertEqual(self.pet.category.name, data.category.name) + + thread = self.pet_api.get_pet_by_id(pet_id=self.pet.id, callback=callback_function) + thread.join(10) + if thread.isAlive(): + self.fail("Request timeout") + def test_update_pet(self): self.pet.name = "hello kity with updated" self.pet_api.update_pet(body=self.pet) From 8180a46a35d2992e8ccb0f076c46c8368a1884a0 Mon Sep 17 00:00:00 2001 From: zhenjun115 Date: Sun, 19 Jun 2016 21:44:12 +0800 Subject: [PATCH 5/5] add test case for pet api method with http info returned; --- samples/client/petstore/python/tests/test_pet_api.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/client/petstore/python/tests/test_pet_api.py b/samples/client/petstore/python/tests/test_pet_api.py index 805086fc680..822f35b5ae8 100644 --- a/samples/client/petstore/python/tests/test_pet_api.py +++ b/samples/client/petstore/python/tests/test_pet_api.py @@ -127,11 +127,11 @@ class PetApiTests(unittest.TestCase): def callback_function(data): #fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) self.assertIsNotNone(data) - self.assertEqual(self.pet.id, data.id) - self.assertIsNotNone(data.category) - self.assertEqual(self.pet.category.name, data.category.name) + self.assertEqual(self.pet.id, data[0].id) + self.assertIsNotNone(data[0].category) + self.assertEqual(self.pet.category.name, data[0].category.name) - thread = self.pet_api.get_pet_by_id(pet_id=self.pet.id, callback=callback_function) + thread = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id, callback=callback_function) thread.join(10) if thread.isAlive(): self.fail("Request timeout")