From f44e5faf1b73eae2a600e13e0567c5a67cebb623 Mon Sep 17 00:00:00 2001 From: wing328 Date: Sat, 12 Dec 2015 15:58:35 +0800 Subject: [PATCH] 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