From 10de0b5c5b3fe556cf2ec91f50b00ff713b41428 Mon Sep 17 00:00:00 2001 From: wing328 Date: Fri, 8 Apr 2016 23:54:47 +0800 Subject: [PATCH] update python sample after rebase --- samples/client/petstore/python/.coverage | 2 +- .../petstore/python/dev-requirements.txt.log | 7 + .../python/swagger_client/__init__.py | 3 + .../python/swagger_client/apis/pet_api.py | 797 ++++++++++++------ .../python/swagger_client/apis/store_api.py | 328 +++++-- .../python/swagger_client/apis/user_api.py | 474 +++++------ .../python/swagger_client/models/__init__.py | 3 + .../python/swagger_client/models/name.py | 29 +- 8 files changed, 1069 insertions(+), 574 deletions(-) diff --git a/samples/client/petstore/python/.coverage b/samples/client/petstore/python/.coverage index 0a07b3c83ebf..554238217d05 100644 --- a/samples/client/petstore/python/.coverage +++ b/samples/client/petstore/python/.coverage @@ -1 +1 @@ -!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 222, 97, 228, 178, 234, 108, 240, 119], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 132, 134, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 112, 114, 116, 122], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 215, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 206, 208, 209, 210, 211, 84, 213, 86, 57, 216, 218, 220, 222, 95, 97, 226, 228, 234, 108, 238, 240, 117, 119, 212, 106], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [135, 136, 137, 138, 139, 142, 19, 149, 22, 23, 25, 26, 157, 158, 31, 32, 34, 36, 37, 39, 40, 41, 170, 43, 172, 46, 47, 189, 179, 52, 54, 59, 61, 190, 63, 192, 224, 67, 69, 71, 200, 73, 204, 80, 81, 82, 84, 213, 86, 199, 88, 90, 219, 92, 221, 222, 223, 96, 225, 98, 100, 102, 230, 104, 167, 111, 76, 168, 122, 123, 42, 21], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [128, 129, 132, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 272, 145, 18, 20, 22, 23, 26, 28, 29, 32, 37, 39, 40, 41, 171, 44, 46, 48, 94, 67, 70, 71, 73, 93, 350, 96, 97, 104, 107, 108, 110, 112, 114, 116, 117, 246, 119, 376, 122, 123, 124], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 100, 102, 103, 104, 109, 112, 114, 116, 122], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [518, 525, 526, 527, 19, 21, 22, 23, 24, 537, 26, 27, 28, 29, 30, 31, 32, 33, 34, 547, 36, 37, 40, 42, 44, 45, 558, 47, 49, 52, 566, 568, 569, 570, 571, 572, 573, 575, 68, 69, 70, 75, 76, 77, 79, 80, 82, 84, 91, 96, 98, 102, 103, 104, 107, 108, 109, 111, 112, 115, 116, 117, 118, 119, 120, 123, 124, 125, 126, 129, 130, 131, 134, 137, 138, 141, 144, 145, 146, 147, 149, 152, 153, 155, 157, 158, 160, 162, 171, 172, 174, 176, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 204, 205, 212, 213, 214, 216, 217, 219, 231, 235, 236, 240, 242, 251, 252, 254, 255, 256, 257, 258, 260, 261, 262, 263, 267, 268, 269, 272, 274, 275, 276, 278, 279, 280, 281, 283, 286, 287, 288, 316, 317, 318, 319, 320, 322, 323, 324, 325, 326, 327, 328, 329, 330, 332, 333, 337, 338, 339, 340, 341, 345, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 369, 370, 371, 372, 379, 387, 389, 390, 392, 393, 394, 395, 548, 397, 398, 399, 400, 401, 402, 404, 406, 413, 414, 416, 418, 419, 421, 423, 430, 431, 433, 435, 436, 438, 440, 448, 450, 453, 454, 455, 456, 458, 459, 467, 546, 493, 502, 503, 508, 510], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [513, 126, 375, 516, 517, 519, 520, 521, 523, 109, 525, 527, 528, 344, 18, 20, 533, 22, 23, 26, 539, 28, 29, 543, 32, 545, 546, 547, 548, 37, 550, 39, 40, 41, 42, 556, 45, 46, 48, 435, 862, 121, 348, 95, 123, 96, 578, 68, 581, 582, 71, 584, 74, 439, 655, 867, 345, 105, 100, 607, 608, 610, 611, 612, 617, 618, 530, 110, 229, 625, 114, 627, 628, 629, 118, 631, 633, 553, 635, 636, 637, 638, 639, 640, 642, 132, 534, 646, 647, 136, 138, 535, 652, 141, 142, 621, 144, 657, 658, 659, 660, 149, 662, 663, 664, 665, 666, 668, 318, 624, 446, 169, 549, 172, 173, 175, 689, 371, 692, 693, 695, 722, 116, 347, 196, 197, 199, 200, 201, 119, 143, 717, 718, 207, 720, 721, 210, 211, 206, 215, 728, 217, 731, 220, 122, 222, 735, 224, 737, 738, 227, 228, 741, 743, 744, 233, 234, 747, 748, 237, 750, 239, 240, 753, 754, 243, 244, 245, 246, 247, 248, 127, 250, 763, 765, 766, 213, 768, 769, 770, 771, 772, 773, 774, 145, 776, 44, 128, 727, 346, 270, 554, 273, 274, 276, 798, 645, 801, 802, 219, 804, 146, 140, 297, 298, 300, 301, 302, 307, 308, 734, 311, 312, 314, 223, 828, 317, 830, 831, 832, 322, 651, 147, 837, 838, 328, 841, 330, 343, 844, 845, 551, 847, 848, 849, 335, 739, 340, 853, 342, 855, 856, 857, 858, 859, 860, 349, 540, 351, 865, 866, 827, 871, 872, 316, 875, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 745, 377, 661, 320, 98, 398, 399, 401, 402, 323, 409, 408, 106, 412, 413, 325, 133, 417, 418, 99, 139, 241, 424, 426, 242, 430, 431, 72, 755, 436, 329, 441, 442, 415, 444, 445, 429, 447, 448, 449, 450, 452, 403, 759, 112, 760, 419, 334, 472, 473, 851, 475, 476, 478, 421, 552, 374, 423, 338, 443, 499, 500, 502, 503, 504, 767, 509, 510, 341], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [791, 657, 18, 276, 149, 22, 23, 26, 28, 29, 32, 37, 39, 553, 684, 175, 48, 579, 456, 74, 378, 351, 481, 20, 250, 765], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 266, 272, 147, 21, 22, 25, 284, 29, 158, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 11, 12, 13, 16, 18, 20], "/Users/williamcheng/Code/wing328/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251]}} \ No newline at end of file +!coverage.py: This is a private format, don't read it directly!{"lines": {"/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/user_api.py": [774, 652, 272, 18, 147, 20, 22, 23, 26, 28, 29, 32, 37, 39, 173, 48, 447, 576, 74, 473, 549, 747, 677, 371, 246, 345], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 24, 26, 28], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/rest.py": [20, 21, 23, 24, 25, 26, 27, 28, 31, 33, 35, 36, 40, 42, 43, 45, 48, 51, 53, 54, 55, 56, 57, 59, 63, 65, 72, 74, 82, 83, 88, 92, 95, 98, 101, 102, 103, 104, 105, 106, 109, 110, 121, 122, 124, 129, 130, 132, 135, 137, 138, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 155, 156, 159, 160, 161, 162, 166, 170, 174, 176, 177, 179, 181, 182, 183, 184, 186, 191, 198, 199, 200, 201, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 217, 225, 227, 228, 229, 230, 231, 232, 239, 243, 244, 245, 246, 248, 249, 251], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/__init__.py": [1, 4, 5, 6], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_200_response.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/animal.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/special_model_name.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/category.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 122], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/user.py": [278, 136, 272, 147, 21, 22, 25, 284, 29, 158, 290, 169, 180, 30, 191, 70, 202, 81, 213, 92, 224, 103, 235, 114, 19, 246, 125], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/cat.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/store_api.py": [150, 274, 20, 22, 23, 26, 28, 541, 32, 48, 37, 39, 29, 176, 567, 74, 439, 465, 344, 18, 369, 249], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/name.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/inline_response_200.py": [130, 141, 19, 21, 22, 25, 29, 158, 169, 180, 30, 191, 64, 202, 75, 86, 97, 228, 234, 108, 240, 246, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/api_client.py": [513, 521, 528, 529, 530, 19, 21, 22, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 550, 551, 40, 42, 44, 45, 47, 561, 52, 569, 571, 572, 573, 574, 575, 576, 578, 68, 69, 74, 75, 76, 78, 79, 81, 82, 84, 86, 93, 98, 100, 104, 105, 106, 109, 110, 111, 113, 114, 117, 118, 119, 120, 121, 122, 125, 126, 127, 128, 131, 132, 133, 136, 139, 140, 143, 146, 147, 148, 149, 151, 154, 155, 157, 159, 162, 164, 540, 173, 174, 176, 178, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 206, 207, 214, 215, 216, 218, 219, 221, 549, 233, 237, 238, 242, 244, 253, 254, 256, 257, 258, 259, 260, 262, 263, 264, 265, 269, 270, 271, 274, 276, 277, 278, 280, 281, 282, 283, 285, 288, 289, 290, 49, 318, 319, 320, 321, 322, 334, 335, 339, 340, 341, 342, 343, 347, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 371, 372, 373, 374, 381, 389, 391, 392, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 407, 409, 416, 417, 419, 421, 422, 424, 426, 433, 434, 436, 438, 439, 441, 443, 451, 453, 456, 457, 458, 459, 461, 462, 470, 496, 505, 506, 511], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/__init__.py": [1, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/apis/pet_api.py": [1024, 1025, 1026, 617, 1030, 1032, 1033, 1034, 1035, 1036, 1037, 1039, 344, 18, 1043, 20, 430, 22, 23, 1048, 1028, 26, 1143, 28, 29, 410, 1055, 32, 944, 1058, 1059, 1060, 37, 550, 39, 40, 1065, 42, 1136, 45, 46, 48, 435, 570, 1119, 573, 574, 1087, 576, 608, 1090, 1091, 68, 1093, 650, 71, 72, 74, 951, 1134, 440, 611, 597, 598, 441, 600, 601, 1116, 1117, 95, 96, 1121, 98, 99, 100, 1126, 614, 615, 616, 105, 106, 619, 109, 110, 623, 112, 114, 1061, 116, 117, 630, 119, 120, 121, 1146, 635, 124, 125, 126, 639, 1152, 641, 130, 131, 644, 645, 134, 647, 136, 137, 138, 139, 652, 141, 142, 143, 144, 145, 1164, 147, 1172, 1130, 1049, 1135, 624, 678, 1052, 434, 173, 1165, 449, 1054, 1044, 1140, 629, 1056, 1142, 1057, 631, 1166, 1149, 1144, 1145, 621, 1147, 1062, 636, 1063, 1167, 1133, 754, 246, 41, 438, 1153, 44, 267, 780, 642, 270, 271, 273, 643, 646, 295, 296, 1127, 298, 299, 300, 402, 648, 306, 309, 649, 312, 313, 314, 315, 317, 319, 320, 321, 323, 324, 326, 140, 330, 331, 1042, 335, 336, 339, 341, 342, 343, 856, 345, 346, 347, 348, 349, 350, 352, 1168, 1154, 1169, 1120, 876, 1170, 879, 880, 882, 1171, 372, 626, 375, 376, 378, 1173, 1138, 903, 904, 906, 907, 908, 399, 400, 913, 914, 403, 404, 917, 918, 920, 409, 922, 924, 925, 414, 927, 928, 929, 418, 932, 933, 934, 423, 425, 938, 939, 428, 429, 942, 413, 1162, 945, 946, 947, 948, 949, 950, 329, 952, 953, 442, 955, 444, 445, 446, 447, 448, 416, 451, 417, 305, 977, 980, 981, 983, 420, 477, 1158, 422, 1020, 1006, 1007, 1009, 1010, 1011, 1016, 1017, 1159, 443, 1023], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/configuration.py": [19, 21, 22, 23, 25, 26, 31, 32, 34, 36, 37, 39, 40, 41, 42, 43, 46, 47, 52, 54, 59, 61, 63, 67, 69, 71, 73, 76, 80, 81, 82, 84, 86, 88, 90, 92, 96, 98, 100, 102, 104, 111, 122, 123, 135, 136, 137, 138, 139, 142, 149, 157, 158, 167, 168, 170, 172, 179, 189, 190, 192, 199, 200, 201, 204, 210, 211, 213, 219, 221, 222, 223, 224, 225, 228, 229, 230, 231, 232, 235, 236, 237, 238, 239, 242, 243, 244, 245, 246, 249, 250, 251, 252, 253, 256, 257, 258, 259, 260, 265], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/order.py": [130, 172, 141, 173, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 175, 48, 49, 50, 51, 180, 53, 54, 52, 58, 59, 60, 61, 62, 191, 64, 202, 75, 86, 57, 176, 97, 228, 178, 234, 108, 240, 246, 119], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/tag.py": [128, 134, 140, 19, 21, 22, 25, 29, 30, 39, 40, 41, 44, 45, 46, 49, 50, 52, 61, 63, 72, 74, 83, 85, 94, 96, 122], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/pet.py": [128, 130, 150, 172, 139, 141, 19, 21, 22, 152, 25, 29, 30, 161, 163, 39, 40, 41, 42, 43, 44, 45, 174, 48, 49, 50, 51, 52, 53, 54, 183, 185, 58, 59, 60, 61, 62, 64, 194, 195, 200, 73, 202, 75, 84, 86, 57, 95, 97, 228, 234, 108, 240, 117, 246, 119, 106], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/model_return.py": [97, 115, 71, 103, 109, 49, 19, 21, 22, 25, 60, 29, 30], "/Users/williamcheng/Code/swagger-codegen/samples/client/petstore/python/swagger_client/models/dog.py": [96, 128, 134, 74, 140, 19, 52, 21, 22, 85, 25, 122, 29, 30, 63]}} \ No newline at end of file diff --git a/samples/client/petstore/python/dev-requirements.txt.log b/samples/client/petstore/python/dev-requirements.txt.log index 9a337359484f..6c260212adc8 100644 --- a/samples/client/petstore/python/dev-requirements.txt.log +++ b/samples/client/petstore/python/dev-requirements.txt.log @@ -251,3 +251,10 @@ Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/li Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): nose in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 1)) +Requirement already satisfied (use --upgrade to upgrade): tox in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): coverage in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 3)) +Requirement already satisfied (use --upgrade to upgrade): randomize in ./venv/lib/python2.7/site-packages (from -r dev-requirements.txt (line 4)) +Requirement already satisfied (use --upgrade to upgrade): virtualenv>=1.11.2 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): py>=1.4.17 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) +Requirement already satisfied (use --upgrade to upgrade): pluggy<0.4.0,>=0.3.0 in ./venv/lib/python2.7/site-packages (from tox->-r dev-requirements.txt (line 2)) diff --git a/samples/client/petstore/python/swagger_client/__init__.py b/samples/client/petstore/python/swagger_client/__init__.py index 3b52f200834e..dbdd791ada2c 100644 --- a/samples/client/petstore/python/swagger_client/__init__.py +++ b/samples/client/petstore/python/swagger_client/__init__.py @@ -1,7 +1,10 @@ from __future__ import absolute_import # import models into sdk package +from .models.animal import Animal +from .models.cat import Cat from .models.category import Category +from .models.dog import Dog from .models.inline_response_200 import InlineResponse200 from .models.model_200_response import Model200Response from .models.model_return import ModelReturn diff --git a/samples/client/petstore/python/swagger_client/apis/pet_api.py b/samples/client/petstore/python/swagger_client/apis/pet_api.py index 134e299c0f90..ae7a828e9597 100644 --- a/samples/client/petstore/python/swagger_client/apis/pet_api.py +++ b/samples/client/petstore/python/swagger_client/apis/pet_api.py @@ -2,7 +2,7 @@ """ PetApi.py -Copyright 2015 SmartBear Software +Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,107 +45,6 @@ class PetApi(object): config.api_client = ApiClient() self.api_client = config.api_client - def update_pet(self, **kwargs): - """ - Update an existing pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.update_pet(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Pet body: Pet object that needs to be added to the store - :return: None - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.update_pet_with_http_info(**kwargs) - else: - (data, status_code, response_headers) = self.update_pet_with_http_info(**kwargs) - return data - - def update_pet_with_http_info(self, **kwargs): - """ - Update an existing pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.update_pet_with_http_info(callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param Pet body: Pet object that needs to be added to the store - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['body'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_pet" % key - ) - params[key] = val - del params['kwargs'] - - - resource_path = '/pet'.replace('{format}', 'json') - method = 'PUT' - - path_params = {} - - query_params = {} - - header_params = {} - - form_params = {} - files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type(['application/json', 'application/xml']) - - # Authentication setting - auth_settings = ['petstore_auth'] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - def add_pet(self, **kwargs): """ Add a new pet to the store @@ -208,16 +107,14 @@ class PetApi(object): resource_path = '/pet'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -236,13 +133,218 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def add_pet_using_byte_array(self, **kwargs): + """ + Fake endpoint to test byte array in body parameter for adding a new pet to the store + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.add_pet_using_byte_array(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str body: Pet object in the form of byte array + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.add_pet_using_byte_array_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.add_pet_using_byte_array_with_http_info(**kwargs) + return data + + def add_pet_using_byte_array_with_http_info(self, **kwargs): + """ + Fake endpoint to test byte array in body parameter for adding a new pet to the store + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.add_pet_using_byte_array_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str body: Pet object in the form of byte array + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method add_pet_using_byte_array" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/pet?testing_byte_array=true'.replace('{format}', 'json') + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def delete_pet(self, pet_id, **kwargs): + """ + Deletes a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_pet(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_pet_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.delete_pet_with_http_info(pet_id, **kwargs) + return data + + def delete_pet_with_http_info(self, pet_id, **kwargs): + """ + Deletes a pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_pet_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: Pet id to delete (required) + :param str api_key: + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id', 'api_key'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_pet" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") + + resource_path = '/pet/{petId}'.replace('{format}', 'json') + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + if 'api_key' in params: + header_params['api_key'] = params['api_key'] + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -250,7 +352,7 @@ class PetApi(object): def find_pets_by_status(self, **kwargs): """ Finds Pets by status - Multiple status values can be provided with comma seperated strings + Multiple status values can be provided with comma separated strings This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -262,7 +364,7 @@ class PetApi(object): :param callback function: The callback function for asynchronous request. (optional) - :param list[str] status: Status values that need to be considered for filter + :param list[str] status: Status values that need to be considered for query :return: list[Pet] If the method is called asynchronously, returns the request thread. @@ -276,7 +378,7 @@ class PetApi(object): def find_pets_by_status_with_http_info(self, **kwargs): """ Finds Pets by status - Multiple status values can be provided with comma seperated strings + Multiple status values can be provided with comma separated strings This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -288,7 +390,7 @@ class PetApi(object): :param callback function: The callback function for asynchronous request. (optional) - :param list[str] status: Status values that need to be considered for filter + :param list[str] status: Status values that need to be considered for query :return: list[Pet] If the method is called asynchronously, returns the request thread. @@ -309,8 +411,6 @@ class PetApi(object): resource_path = '/pet/findByStatus'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} @@ -319,8 +419,8 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -337,13 +437,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='list[Pet]', auth_settings=auth_settings, callback=params.get('callback')) @@ -410,8 +510,6 @@ class PetApi(object): resource_path = '/pet/findByTags'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} @@ -420,8 +518,8 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -438,13 +536,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='list[Pet]', auth_settings=auth_settings, callback=params.get('callback')) @@ -514,8 +612,6 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") resource_path = '/pet/{petId}'.replace('{format}', 'json') - method = 'GET' - path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -524,8 +620,8 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -540,19 +636,322 @@ class PetApi(object): select_header_content_type([]) # Authentication setting - auth_settings = ['api_key'] + auth_settings = ['api_key', 'petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='Pet', auth_settings=auth_settings, callback=params.get('callback')) + def get_pet_by_id_in_object(self, pet_id, **kwargs): + """ + Fake endpoint to test inline arbitrary object return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_pet_by_id_in_object(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: InlineResponse200 + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.get_pet_by_id_in_object_with_http_info(pet_id, **kwargs) + return data + + def get_pet_by_id_in_object_with_http_info(self, pet_id, **kwargs): + """ + Fake endpoint to test inline arbitrary object return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_pet_by_id_in_object_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: InlineResponse200 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_pet_by_id_in_object" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id_in_object`") + + resource_path = '/pet/{petId}?response=inline_arbitrary_object'.replace('{format}', 'json') + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['api_key', 'petstore_auth'] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse200', + auth_settings=auth_settings, + callback=params.get('callback')) + + def pet_pet_idtesting_byte_arraytrue_get(self, pet_id, **kwargs): + """ + Fake endpoint to test byte array return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.pet_pet_idtesting_byte_arraytrue_get(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) + else: + (data, status_code, response_headers) = self.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, **kwargs) + return data + + def pet_pet_idtesting_byte_arraytrue_get_with_http_info(self, pet_id, **kwargs): + """ + Fake endpoint to test byte array return by 'Find pet by ID' + Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.pet_pet_idtesting_byte_arraytrue_get_with_http_info(pet_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param int pet_id: ID of pet that needs to be fetched (required) + :return: str + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['pet_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method pet_pet_idtesting_byte_arraytrue_get" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'pet_id' is set + if ('pet_id' not in params) or (params['pet_id'] is None): + raise ValueError("Missing the required parameter `pet_id` when calling `pet_pet_idtesting_byte_arraytrue_get`") + + resource_path = '/pet/{petId}?testing_byte_array=true'.replace('{format}', 'json') + path_params = {} + if 'pet_id' in params: + path_params['petId'] = params['pet_id'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['api_key', 'petstore_auth'] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='str', + auth_settings=auth_settings, + callback=params.get('callback')) + + def update_pet(self, **kwargs): + """ + Update an existing pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.update_pet_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.update_pet_with_http_info(**kwargs) + return data + + def update_pet_with_http_info(self, **kwargs): + """ + Update an existing pet + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.update_pet_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param Pet body: Pet object that needs to be added to the store + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method update_pet" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/pet'.replace('{format}', 'json') + path_params = {} + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type(['application/json', 'application/xml']) + + # Authentication setting + auth_settings = ['petstore_auth'] + + return self.api_client.call_api(resource_path, 'PUT', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + def update_pet_with_form(self, pet_id, **kwargs): """ Updates a pet in the store with form data @@ -622,8 +1021,6 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") resource_path = '/pet/{petId}'.replace('{format}', 'json') - method = 'POST' - path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -632,12 +1029,12 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} if 'name' in params: - form_params['name'] = params['name'] + form_params.append(('name', params['name'])) if 'status' in params: - form_params['status'] = params['status'] + form_params.append(('status', params['status'])) body_params = None @@ -654,121 +1051,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - - def delete_pet(self, pet_id, **kwargs): - """ - Deletes a pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_pet(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: Pet id to delete (required) - :param str api_key: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.delete_pet_with_http_info(pet_id, **kwargs) - else: - (data, status_code, response_headers) = self.delete_pet_with_http_info(pet_id, **kwargs) - return data - - def delete_pet_with_http_info(self, pet_id, **kwargs): - """ - Deletes a pet - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_pet_with_http_info(pet_id, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param int pet_id: Pet id to delete (required) - :param str api_key: - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['pet_id', 'api_key'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_pet" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'pet_id' is set - if ('pet_id' not in params) or (params['pet_id'] is None): - raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") - - resource_path = '/pet/{petId}'.replace('{format}', 'json') - method = 'DELETE' - - path_params = {} - if 'pet_id' in params: - path_params['petId'] = params['pet_id'] - - query_params = {} - - header_params = {} - if 'api_key' in params: - header_params['api_key'] = params['api_key'] - - form_params = {} - files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = ['petstore_auth'] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -842,8 +1131,6 @@ class PetApi(object): raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") resource_path = '/pet/{petId}/uploadImage'.replace('{format}', 'json') - method = 'POST' - path_params = {} if 'pet_id' in params: path_params['petId'] = params['pet_id'] @@ -852,12 +1139,12 @@ class PetApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} if 'additional_metadata' in params: - form_params['additionalMetadata'] = params['additional_metadata'] + form_params.append(('additionalMetadata', params['additional_metadata'])) if 'file' in params: - files['file'] = params['file'] + local_var_files['file'] = params['file'] body_params = None @@ -874,13 +1161,13 @@ class PetApi(object): # Authentication setting auth_settings = ['petstore_auth'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) diff --git a/samples/client/petstore/python/swagger_client/apis/store_api.py b/samples/client/petstore/python/swagger_client/apis/store_api.py index ee6e2f7633dc..4d4ffca2ce5b 100644 --- a/samples/client/petstore/python/swagger_client/apis/store_api.py +++ b/samples/client/petstore/python/swagger_client/apis/store_api.py @@ -2,7 +2,7 @@ """ StoreApi.py -Copyright 2015 SmartBear Software +Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -45,6 +45,207 @@ class StoreApi(object): config.api_client = ApiClient() self.api_client = config.api_client + def delete_order(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_order(order_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_order_with_http_info(order_id, **kwargs) + else: + (data, status_code, response_headers) = self.delete_order_with_http_info(order_id, **kwargs) + return data + + def delete_order_with_http_info(self, order_id, **kwargs): + """ + Delete purchase order by ID + For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_order_with_http_info(order_id, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str order_id: ID of the order that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['order_id'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_order" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'order_id' is set + if ('order_id' not in params) or (params['order_id'] is None): + raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") + + resource_path = '/store/order/{orderId}'.replace('{format}', 'json') + path_params = {} + if 'order_id' in params: + path_params['orderId'] = params['order_id'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api(resource_path, 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def find_orders_by_status(self, **kwargs): + """ + Finds orders by status + A single status value can be provided as a string + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.find_orders_by_status(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str status: Status value that needs to be considered for query + :return: list[Order] + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.find_orders_by_status_with_http_info(**kwargs) + else: + (data, status_code, response_headers) = self.find_orders_by_status_with_http_info(**kwargs) + return data + + def find_orders_by_status_with_http_info(self, **kwargs): + """ + Finds orders by status + A single status value can be provided as a string + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.find_orders_by_status_with_http_info(callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str status: Status value that needs to be considered for query + :return: list[Order] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['status'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method find_orders_by_status" % key + ) + params[key] = val + del params['kwargs'] + + + resource_path = '/store/findByStatus'.replace('{format}', 'json') + path_params = {} + + query_params = {} + if 'status' in params: + query_params['status'] = params['status'] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['test_api_client_id', 'test_api_client_secret'] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Order]', + auth_settings=auth_settings, + callback=params.get('callback')) + def get_inventory(self, **kwargs): """ Returns pet inventories by status @@ -105,16 +306,14 @@ class StoreApi(object): resource_path = '/store/inventory'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -131,21 +330,21 @@ class StoreApi(object): # Authentication setting auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='dict(str, int)', auth_settings=auth_settings, callback=params.get('callback')) - def place_order(self, **kwargs): + def get_inventory_in_object(self, **kwargs): """ - Place an order for a pet - + Fake endpoint to test arbitrary object return by 'Get inventory' + Returns an arbitrary object which is actually a map of status codes to quantities This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -153,25 +352,24 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.place_order(callback=callback_function) + >>> thread = api.get_inventory_in_object(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param Order body: order placed for purchasing the pet - :return: Order + :return: object If the method is called asynchronously, returns the request thread. """ if kwargs.get('callback'): - return self.place_order_with_http_info(**kwargs) + return self.get_inventory_in_object_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.place_order_with_http_info(**kwargs) + (data, status_code, response_headers) = self.get_inventory_in_object_with_http_info(**kwargs) return data - def place_order_with_http_info(self, **kwargs): + def get_inventory_in_object_with_http_info(self, **kwargs): """ - Place an order for a pet - + Fake endpoint to test arbitrary object return by 'Get inventory' + Returns an arbitrary object which is actually a map of status codes to quantities This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -179,17 +377,16 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.place_order_with_http_info(callback=callback_function) + >>> thread = api.get_inventory_in_object_with_http_info(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param Order body: order placed for purchasing the pet - :return: Order + :return: object If the method is called asynchronously, returns the request thread. """ - all_params = ['body'] + all_params = [] all_params.append('callback') params = locals() @@ -197,27 +394,23 @@ class StoreApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method place_order" % key + " to method get_inventory_in_object" % key ) params[key] = val del params['kwargs'] - resource_path = '/store/order'.replace('{format}', 'json') - method = 'POST' - + resource_path = '/store/inventory?response=arbitrary_object'.replace('{format}', 'json') path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None - if 'body' in params: - body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -230,16 +423,16 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = [] + auth_settings = ['api_key'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type='Order', + files=local_var_files, + response_type='object', auth_settings=auth_settings, callback=params.get('callback')) @@ -308,8 +501,6 @@ class StoreApi(object): raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") resource_path = '/store/order/{orderId}'.replace('{format}', 'json') - method = 'GET' - path_params = {} if 'order_id' in params: path_params['orderId'] = params['order_id'] @@ -318,8 +509,8 @@ class StoreApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -334,23 +525,23 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = [] + auth_settings = ['test_api_key_header', 'test_api_key_query'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='Order', auth_settings=auth_settings, callback=params.get('callback')) - def delete_order(self, order_id, **kwargs): + def place_order(self, **kwargs): """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Place an order for a pet + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -358,25 +549,25 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.delete_order(order_id, callback=callback_function) + >>> thread = api.place_order(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param str order_id: ID of the order that needs to be deleted (required) - :return: None + :param Order body: order placed for purchasing the pet + :return: Order If the method is called asynchronously, returns the request thread. """ if kwargs.get('callback'): - return self.delete_order_with_http_info(order_id, **kwargs) + return self.place_order_with_http_info(**kwargs) else: - (data, status_code, response_headers) = self.delete_order_with_http_info(order_id, **kwargs) + (data, status_code, response_headers) = self.place_order_with_http_info(**kwargs) return data - def delete_order_with_http_info(self, order_id, **kwargs): + def place_order_with_http_info(self, **kwargs): """ - Delete purchase order by ID - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + Place an order for a pet + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function @@ -384,17 +575,17 @@ class StoreApi(object): >>> def callback_function(response): >>> pprint(response) >>> - >>> thread = api.delete_order_with_http_info(order_id, callback=callback_function) + >>> thread = api.place_order_with_http_info(callback=callback_function) :param callback function: The callback function for asynchronous request. (optional) - :param str order_id: ID of the order that needs to be deleted (required) - :return: None + :param Order body: order placed for purchasing the pet + :return: Order If the method is called asynchronously, returns the request thread. """ - all_params = ['order_id'] + all_params = ['body'] all_params.append('callback') params = locals() @@ -402,30 +593,25 @@ class StoreApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method delete_order" % key + " to method place_order" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'order_id' is set - if ('order_id' not in params) or (params['order_id'] is None): - raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") - - resource_path = '/store/order/{orderId}'.replace('{format}', 'json') - method = 'DELETE' + resource_path = '/store/order'.replace('{format}', 'json') path_params = {} - if 'order_id' in params: - path_params['orderId'] = params['order_id'] query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None + if 'body' in params: + body_params = params['body'] # HTTP header `Accept` header_params['Accept'] = self.api_client.\ @@ -438,15 +624,15 @@ class StoreApi(object): select_header_content_type([]) # Authentication setting - auth_settings = [] + auth_settings = ['test_api_client_id', 'test_api_client_secret'] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type=None, + files=local_var_files, + response_type='Order', auth_settings=auth_settings, callback=params.get('callback')) diff --git a/samples/client/petstore/python/swagger_client/apis/user_api.py b/samples/client/petstore/python/swagger_client/apis/user_api.py index 8ce1ddd151a0..39ab9148a15a 100644 --- a/samples/client/petstore/python/swagger_client/apis/user_api.py +++ b/samples/client/petstore/python/swagger_client/apis/user_api.py @@ -2,7 +2,7 @@ """ UserApi.py -Copyright 2015 SmartBear Software +Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -107,16 +107,14 @@ class UserApi(object): resource_path = '/user'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -135,13 +133,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -208,16 +206,14 @@ class UserApi(object): resource_path = '/user/createWithArray'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -236,13 +232,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) @@ -309,16 +305,14 @@ class UserApi(object): resource_path = '/user/createWithList'.replace('{format}', 'json') - method = 'POST' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -337,17 +331,221 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) + def delete_user(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_user(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.delete_user_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.delete_user_with_http_info(username, **kwargs) + return data + + def delete_user_with_http_info(self, username, **kwargs): + """ + Delete user + This can only be done by the logged in user. + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.delete_user_with_http_info(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be deleted (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method delete_user" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `delete_user`") + + resource_path = '/user/{username}'.replace('{format}', 'json') + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = ['test_http_basic'] + + return self.api_client.call_api(resource_path, 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, + auth_settings=auth_settings, + callback=params.get('callback')) + + def get_user_by_name(self, username, **kwargs): + """ + Get user by user name + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_user_by_name(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + if kwargs.get('callback'): + return self.get_user_by_name_with_http_info(username, **kwargs) + else: + (data, status_code, response_headers) = self.get_user_by_name_with_http_info(username, **kwargs) + return data + + def get_user_by_name_with_http_info(self, username, **kwargs): + """ + Get user by user name + + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please define a `callback` function + to be invoked when receiving the response. + >>> def callback_function(response): + >>> pprint(response) + >>> + >>> thread = api.get_user_by_name_with_http_info(username, callback=callback_function) + + :param callback function: The callback function + for asynchronous request. (optional) + :param str username: The name that needs to be fetched. Use user1 for testing. (required) + :return: User + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['username'] + all_params.append('callback') + + params = locals() + for key, val in iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_user_by_name" % key + ) + params[key] = val + del params['kwargs'] + + # verify the required parameter 'username' is set + if ('username' not in params) or (params['username'] is None): + raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") + + resource_path = '/user/{username}'.replace('{format}', 'json') + path_params = {} + if 'username' in params: + path_params['username'] = params['username'] + + query_params = {} + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + + # HTTP header `Accept` + header_params['Accept'] = self.api_client.\ + select_header_accept(['application/json', 'application/xml']) + if not header_params['Accept']: + del header_params['Accept'] + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.\ + select_header_content_type([]) + + # Authentication setting + auth_settings = [] + + return self.api_client.call_api(resource_path, 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='User', + auth_settings=auth_settings, + callback=params.get('callback')) + def login_user(self, **kwargs): """ Logs user into the system @@ -412,8 +610,6 @@ class UserApi(object): resource_path = '/user/login'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} @@ -424,8 +620,8 @@ class UserApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -442,13 +638,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type='str', auth_settings=auth_settings, callback=params.get('callback')) @@ -513,16 +709,14 @@ class UserApi(object): resource_path = '/user/logout'.replace('{format}', 'json') - method = 'GET' - path_params = {} query_params = {} header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None @@ -539,121 +733,17 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) - def get_user_by_name(self, username, **kwargs): - """ - Get user by user name - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.get_user_by_name(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :return: User - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.get_user_by_name_with_http_info(username, **kwargs) - else: - (data, status_code, response_headers) = self.get_user_by_name_with_http_info(username, **kwargs) - return data - - def get_user_by_name_with_http_info(self, username, **kwargs): - """ - Get user by user name - - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.get_user_by_name_with_http_info(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be fetched. Use user1 for testing. (required) - :return: User - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['username'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_user_by_name" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") - - resource_path = '/user/{username}'.replace('{format}', 'json') - method = 'GET' - - path_params = {} - if 'username' in params: - path_params['username'] = params['username'] - - query_params = {} - - header_params = {} - - form_params = {} - files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, - response_type='User', - auth_settings=auth_settings, - callback=params.get('callback')) - def update_user(self, username, **kwargs): """ Updated user @@ -721,8 +811,6 @@ class UserApi(object): raise ValueError("Missing the required parameter `username` when calling `update_user`") resource_path = '/user/{username}'.replace('{format}', 'json') - method = 'PUT' - path_params = {} if 'username' in params: path_params['username'] = params['username'] @@ -731,8 +819,8 @@ class UserApi(object): header_params = {} - form_params = {} - files = {} + form_params = [] + local_var_files = {} body_params = None if 'body' in params: @@ -751,117 +839,13 @@ class UserApi(object): # Authentication setting auth_settings = [] - return self.api_client.call_api(resource_path, method, + return self.api_client.call_api(resource_path, 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, - files=files, - response_type=None, - auth_settings=auth_settings, - callback=params.get('callback')) - - def delete_user(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_user(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be deleted (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - if kwargs.get('callback'): - return self.delete_user_with_http_info(username, **kwargs) - else: - (data, status_code, response_headers) = self.delete_user_with_http_info(username, **kwargs) - return data - - def delete_user_with_http_info(self, username, **kwargs): - """ - Delete user - This can only be done by the logged in user. - - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please define a `callback` function - to be invoked when receiving the response. - >>> def callback_function(response): - >>> pprint(response) - >>> - >>> thread = api.delete_user_with_http_info(username, callback=callback_function) - - :param callback function: The callback function - for asynchronous request. (optional) - :param str username: The name that needs to be deleted (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = ['username'] - all_params.append('callback') - - params = locals() - for key, val in iteritems(params['kwargs']): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user" % key - ) - params[key] = val - del params['kwargs'] - - # verify the required parameter 'username' is set - if ('username' not in params) or (params['username'] is None): - raise ValueError("Missing the required parameter `username` when calling `delete_user`") - - resource_path = '/user/{username}'.replace('{format}', 'json') - method = 'DELETE' - - path_params = {} - if 'username' in params: - path_params['username'] = params['username'] - - query_params = {} - - header_params = {} - - form_params = {} - files = {} - - body_params = None - - # HTTP header `Accept` - header_params['Accept'] = self.api_client.\ - select_header_accept(['application/json', 'application/xml']) - if not header_params['Accept']: - del header_params['Accept'] - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.\ - select_header_content_type([]) - - # Authentication setting - auth_settings = [] - - return self.api_client.call_api(resource_path, method, - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=files, + files=local_var_files, response_type=None, auth_settings=auth_settings, callback=params.get('callback')) diff --git a/samples/client/petstore/python/swagger_client/models/__init__.py b/samples/client/petstore/python/swagger_client/models/__init__.py index baccc53b4d61..c441500bc406 100644 --- a/samples/client/petstore/python/swagger_client/models/__init__.py +++ b/samples/client/petstore/python/swagger_client/models/__init__.py @@ -1,7 +1,10 @@ from __future__ import absolute_import # import models into model package +from .animal import Animal +from .cat import Cat from .category import Category +from .dog import Dog from .inline_response_200 import InlineResponse200 from .model_200_response import Model200Response from .model_return import ModelReturn diff --git a/samples/client/petstore/python/swagger_client/models/name.py b/samples/client/petstore/python/swagger_client/models/name.py index 52187bd7bc55..068bca97eea3 100644 --- a/samples/client/petstore/python/swagger_client/models/name.py +++ b/samples/client/petstore/python/swagger_client/models/name.py @@ -37,14 +37,17 @@ class Name(object): and the value is json key in definition. """ self.swagger_types = { - 'name': 'int' + 'name': 'int', + 'snake_case': 'int' } self.attribute_map = { - 'name': 'name' + 'name': 'name', + 'snake_case': 'snake_case' } self._name = None + self._snake_case = None @property def name(self): @@ -68,6 +71,28 @@ class Name(object): """ self._name = name + @property + def snake_case(self): + """ + Gets the snake_case of this Name. + + + :return: The snake_case of this Name. + :rtype: int + """ + return self._snake_case + + @snake_case.setter + def snake_case(self, snake_case): + """ + Sets the snake_case of this Name. + + + :param snake_case: The snake_case of this Name. + :type: int + """ + self._snake_case = snake_case + def to_dict(self): """ Returns the model properties as a dict