From b50189968b2cea2aad0ac8494cfcc458b36e9a4a Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Fri, 9 Jan 2026 09:14:06 +0000 Subject: [PATCH 1/3] [swift][client] Remove old objc samples --- .../client/petstore/objc/core-data/.gitignore | 53 -- .../objc/core-data/.openapi-generator-ignore | 23 - .../objc/core-data/.openapi-generator/FILES | 72 -- .../objc/core-data/.openapi-generator/VERSION | 1 - .../client/petstore/objc/core-data/README.md | 147 ---- .../objc/core-data/SwaggerClient.podspec | 36 - .../core-data/SwaggerClient/Api/SWGPetApi.h | 139 ---- .../core-data/SwaggerClient/Api/SWGPetApi.m | 578 -------------- .../core-data/SwaggerClient/Api/SWGStoreApi.h | 78 -- .../core-data/SwaggerClient/Api/SWGStoreApi.m | 297 -------- .../core-data/SwaggerClient/Api/SWGUserApi.h | 131 ---- .../core-data/SwaggerClient/Api/SWGUserApi.m | 542 -------------- .../Core/JSONValueTransformer+ISO8601.h | 19 - .../Core/JSONValueTransformer+ISO8601.m | 17 - .../core-data/SwaggerClient/Core/SWGApi.h | 29 - .../SwaggerClient/Core/SWGApiClient.h | 121 --- .../SwaggerClient/Core/SWGApiClient.m | 376 ---------- .../Core/SWGBasicAuthTokenProvider.h | 14 - .../Core/SWGBasicAuthTokenProvider.m | 19 - .../SwaggerClient/Core/SWGConfiguration.h | 89 --- .../Core/SWGDefaultConfiguration.h | 171 ----- .../Core/SWGDefaultConfiguration.m | 152 ---- .../Core/SWGJSONRequestSerializer.h | 18 - .../Core/SWGJSONRequestSerializer.m | 37 - .../Core/SWGJSONResponseSerializer.m | 39 - .../core-data/SwaggerClient/Core/SWGLogger.h | 61 -- .../core-data/SwaggerClient/Core/SWGLogger.m | 73 -- .../core-data/SwaggerClient/Core/SWGObject.h | 19 - .../core-data/SwaggerClient/Core/SWGObject.m | 44 -- .../Core/SWGQueryParamCollection.h | 24 - .../Core/SWGQueryParamCollection.m | 20 - .../Core/SWGResponseDeserializer.h | 57 -- .../Core/SWGResponseDeserializer.m | 247 ------ .../SwaggerClient/Core/SWGSanitizer.h | 63 -- .../SwaggerClient/Core/SWGSanitizer.m | 170 ----- .../SwaggerClient/Model/SWGCategory.h | 30 - .../SwaggerClient/Model/SWGCategory.m | 34 - .../Model/SWGCategoryManagedObject.h | 34 - .../Model/SWGCategoryManagedObject.m | 12 - .../Model/SWGCategoryManagedObjectBuilder.h | 35 - .../Model/SWGCategoryManagedObjectBuilder.m | 55 -- .../SwaggerClient/Model/SWGInlineObject.h | 32 - .../SwaggerClient/Model/SWGInlineObject.m | 34 - .../SwaggerClient/Model/SWGInlineObject1.h | 32 - .../SwaggerClient/Model/SWGInlineObject1.m | 34 - .../Model/SWGInlineObject1ManagedObject.h | 36 - .../Model/SWGInlineObject1ManagedObject.m | 12 - .../SWGInlineObject1ManagedObjectBuilder.h | 35 - .../SWGInlineObject1ManagedObjectBuilder.m | 55 -- .../Model/SWGInlineObjectManagedObject.h | 36 - .../Model/SWGInlineObjectManagedObject.m | 12 - .../SWGInlineObjectManagedObjectBuilder.h | 35 - .../SWGInlineObjectManagedObjectBuilder.m | 55 -- .../SWGModel.xcdatamodeld/.xccurrentversion | 8 - .../SWGModel.xcdatamodel/contents | 39 - .../core-data/SwaggerClient/Model/SWGOrder.h | 39 - .../core-data/SwaggerClient/Model/SWGOrder.m | 34 - .../Model/SWGOrderManagedObject.h | 43 -- .../Model/SWGOrderManagedObject.m | 16 - .../Model/SWGOrderManagedObjectBuilder.h | 35 - .../Model/SWGOrderManagedObjectBuilder.m | 63 -- .../core-data/SwaggerClient/Model/SWGPet.h | 45 -- .../core-data/SwaggerClient/Model/SWGPet.m | 34 - .../SwaggerClient/Model/SWGPetManagedObject.h | 49 -- .../SwaggerClient/Model/SWGPetManagedObject.m | 16 - .../Model/SWGPetManagedObjectBuilder.h | 39 - .../Model/SWGPetManagedObjectBuilder.m | 90 --- .../core-data/SwaggerClient/Model/SWGTag.h | 30 - .../core-data/SwaggerClient/Model/SWGTag.m | 34 - .../SwaggerClient/Model/SWGTagManagedObject.h | 34 - .../SwaggerClient/Model/SWGTagManagedObject.m | 12 - .../Model/SWGTagManagedObjectBuilder.h | 35 - .../Model/SWGTagManagedObjectBuilder.m | 55 -- .../core-data/SwaggerClient/Model/SWGUser.h | 43 -- .../core-data/SwaggerClient/Model/SWGUser.m | 34 - .../Model/SWGUserManagedObject.h | 47 -- .../Model/SWGUserManagedObject.m | 18 - .../Model/SWGUserManagedObjectBuilder.h | 35 - .../Model/SWGUserManagedObjectBuilder.m | 67 -- .../objc/core-data/SwaggerClientTests/Podfile | 12 - .../SwaggerClient.xcodeproj/project.pbxproj | 706 ------------------ .../contents.xcworkspacedata | 7 - .../xcshareddata/xcschemes/All Tests.xcscheme | 81 -- .../xcschemes/SwaggerClient-Example.xcscheme | 101 --- .../AppIcon.appiconset/Contents.json | 53 -- .../LaunchImage.launchimage/Contents.json | 51 -- .../SwaggerClient/Launch Screen.storyboard | 50 -- .../SwaggerClient/Main.storyboard | 27 - .../SwaggerClient/SWGAppDelegate.h | 15 - .../SwaggerClient/SWGAppDelegate.m | 19 - .../SwaggerClient/SWGViewController.h | 13 - .../SwaggerClient/SWGViewController.m | 60 -- .../SwaggerClient/SwaggerClient-Info.plist | 54 -- .../SwaggerClient/SwaggerClient-Prefix.pch | 16 - .../SwaggerClient/en.lproj/InfoPlist.strings | 2 - .../SwaggerClientTests/SwaggerClient/main.m | 17 - .../SwaggerClientTests/Tests/BuildersTest.m | 117 --- .../Tests/Helpers/DatabaseHelper.h | 14 - .../Tests/Helpers/DatabaseHelper.m | 42 -- .../SwaggerClientTests/Tests/Tests-Info.plist | 22 - .../SwaggerClientTests/Tests/Tests-Prefix.pch | 8 - .../Tests/en.lproj/InfoPlist.strings | 2 - .../objc/core-data/SwaggerClientTests/pom.xml | 43 -- .../SwaggerClientTests/run_xcodebuild.sh | 2 +- .../objc/core-data/docs/SWGCategory.md | 11 - .../objc/core-data/docs/SWGInlineObject.md | 11 - .../objc/core-data/docs/SWGInlineObject1.md | 11 - .../petstore/objc/core-data/docs/SWGOrder.md | 15 - .../petstore/objc/core-data/docs/SWGPet.md | 15 - .../petstore/objc/core-data/docs/SWGPetApi.md | 466 ------------ .../objc/core-data/docs/SWGStoreApi.md | 212 ------ .../petstore/objc/core-data/docs/SWGTag.md | 11 - .../petstore/objc/core-data/docs/SWGUser.md | 17 - .../objc/core-data/docs/SWGUserApi.md | 402 ---------- .../petstore/objc/core-data/git_push.sh | 57 -- .../client/petstore/objc/default/.gitignore | 53 -- .../objc/default/.openapi-generator-ignore | 23 - .../objc/default/.openapi-generator/FILES | 50 -- .../objc/default/.openapi-generator/VERSION | 1 - .../objc/default/OpenAPIClient.podspec | 37 - .../client/petstore/objc/default/README.md | 147 ---- .../objc/default/SwaggerClient.podspec | 36 - .../default/SwaggerClient/Api/SWGPetApi.h | 139 ---- .../default/SwaggerClient/Api/SWGPetApi.m | 578 -------------- .../default/SwaggerClient/Api/SWGStoreApi.h | 78 -- .../default/SwaggerClient/Api/SWGStoreApi.m | 297 -------- .../default/SwaggerClient/Api/SWGUserApi.h | 131 ---- .../default/SwaggerClient/Api/SWGUserApi.m | 542 -------------- .../Core/JSONValueTransformer+ISO8601.h | 19 - .../Core/JSONValueTransformer+ISO8601.m | 17 - .../objc/default/SwaggerClient/Core/SWGApi.h | 29 - .../default/SwaggerClient/Core/SWGApiClient.h | 121 --- .../default/SwaggerClient/Core/SWGApiClient.m | 376 ---------- .../Core/SWGBasicAuthTokenProvider.h | 14 - .../Core/SWGBasicAuthTokenProvider.m | 19 - .../SwaggerClient/Core/SWGConfiguration.h | 89 --- .../Core/SWGDefaultConfiguration.h | 171 ----- .../Core/SWGDefaultConfiguration.m | 152 ---- .../Core/SWGJSONRequestSerializer.h | 18 - .../Core/SWGJSONRequestSerializer.m | 37 - .../default/SwaggerClient/Core/SWGLogger.h | 61 -- .../default/SwaggerClient/Core/SWGLogger.m | 73 -- .../default/SwaggerClient/Core/SWGObject.h | 19 - .../default/SwaggerClient/Core/SWGObject.m | 44 -- .../Core/SWGQueryParamCollection.h | 24 - .../Core/SWGQueryParamCollection.m | 20 - .../Core/SWGResponseDeserializer.h | 57 -- .../Core/SWGResponseDeserializer.m | 247 ------ .../default/SwaggerClient/Core/SWGSanitizer.h | 63 -- .../default/SwaggerClient/Core/SWGSanitizer.m | 170 ----- .../default/SwaggerClient/Model/SWGCategory.h | 30 - .../default/SwaggerClient/Model/SWGCategory.m | 34 - .../SwaggerClient/Model/SWGInlineObject.h | 32 - .../SwaggerClient/Model/SWGInlineObject.m | 34 - .../SwaggerClient/Model/SWGInlineObject1.h | 32 - .../SwaggerClient/Model/SWGInlineObject1.m | 34 - .../default/SwaggerClient/Model/SWGOrder.h | 39 - .../default/SwaggerClient/Model/SWGOrder.m | 34 - .../objc/default/SwaggerClient/Model/SWGPet.h | 45 -- .../objc/default/SwaggerClient/Model/SWGPet.m | 34 - .../objc/default/SwaggerClient/Model/SWGTag.h | 30 - .../objc/default/SwaggerClient/Model/SWGTag.m | 34 - .../default/SwaggerClient/Model/SWGUser.h | 43 -- .../default/SwaggerClient/Model/SWGUser.m | 34 - .../objc/default/SwaggerClientTests/Podfile | 12 - .../SwaggerClient.xcodeproj/project.pbxproj | 592 --------------- .../contents.xcworkspacedata | 7 - .../xcshareddata/xcschemes/All Tests.xcscheme | 81 -- .../xcschemes/SwaggerClient-Example.xcscheme | 101 --- .../AppIcon.appiconset/Contents.json | 53 -- .../LaunchImage.launchimage/Contents.json | 51 -- .../SwaggerClient/Launch Screen.storyboard | 50 -- .../SwaggerClient/Main.storyboard | 27 - .../SwaggerClient/SWGAppDelegate.h | 15 - .../SwaggerClient/SWGAppDelegate.m | 46 -- .../SwaggerClient/SWGViewController.h | 13 - .../SwaggerClient/SWGViewController.m | 60 -- .../SwaggerClient/SwaggerClient-Info.plist | 54 -- .../SwaggerClient/SwaggerClient-Prefix.pch | 16 - .../SwaggerClient/en.lproj/InfoPlist.strings | 2 - .../SwaggerClientTests/SwaggerClient/main.m | 17 - .../Tests/DeserializationTest.m | 265 ------- .../Tests/Helpers/DatabaseHelper.h | 14 - .../Tests/Helpers/DatabaseHelper.m | 42 -- .../SwaggerClientTests/Tests/PetApiTest.m | 307 -------- .../SwaggerClientTests/Tests/PetTest.m | 37 - .../Tests/SWGApiClientTest.m | 191 ----- .../SwaggerClientTests/Tests/StoreApiTest.m | 44 -- .../SwaggerClientTests/Tests/Tests-Info.plist | 22 - .../SwaggerClientTests/Tests/Tests-Prefix.pch | 8 - .../default/SwaggerClientTests/Tests/Tests.m | 52 -- .../SwaggerClientTests/Tests/UserApiTest.m | 40 - .../Tests/en.lproj/InfoPlist.strings | 2 - .../objc/default/SwaggerClientTests/pom.xml | 43 -- .../SwaggerClientTests/run_xcodebuild.sh | 2 +- .../objc/default/docs/SWGApiResponse.md | 12 - .../petstore/objc/default/docs/SWGCategory.md | 11 - .../objc/default/docs/SWGInlineObject.md | 11 - .../objc/default/docs/SWGInlineObject1.md | 11 - .../petstore/objc/default/docs/SWGOrder.md | 15 - .../petstore/objc/default/docs/SWGPet.md | 15 - .../petstore/objc/default/docs/SWGPetApi.md | 466 ------------ .../petstore/objc/default/docs/SWGStoreApi.md | 212 ------ .../petstore/objc/default/docs/SWGTag.md | 11 - .../petstore/objc/default/docs/SWGUser.md | 17 - .../petstore/objc/default/docs/SWGUserApi.md | 402 ---------- .../client/petstore/objc/default/git_push.sh | 57 -- 207 files changed, 2 insertions(+), 16285 deletions(-) delete mode 100644 samples/client/petstore/objc/core-data/.gitignore delete mode 100644 samples/client/petstore/objc/core-data/.openapi-generator-ignore delete mode 100644 samples/client/petstore/objc/core-data/.openapi-generator/FILES delete mode 100644 samples/client/petstore/objc/core-data/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/objc/core-data/README.md delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient.podspec delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings delete mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml mode change 100755 => 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGCategory.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGInlineObject.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGOrder.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGPet.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGPetApi.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGStoreApi.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGTag.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGUser.md delete mode 100644 samples/client/petstore/objc/core-data/docs/SWGUserApi.md delete mode 100644 samples/client/petstore/objc/core-data/git_push.sh delete mode 100644 samples/client/petstore/objc/default/.gitignore delete mode 100644 samples/client/petstore/objc/default/.openapi-generator-ignore delete mode 100644 samples/client/petstore/objc/default/.openapi-generator/FILES delete mode 100644 samples/client/petstore/objc/default/.openapi-generator/VERSION delete mode 100644 samples/client/petstore/objc/default/OpenAPIClient.podspec delete mode 100644 samples/client/petstore/objc/default/README.md delete mode 100644 samples/client/petstore/objc/default/SwaggerClient.podspec delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Podfile delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings delete mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/pom.xml mode change 100755 => 100644 samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh delete mode 100644 samples/client/petstore/objc/default/docs/SWGApiResponse.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGCategory.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGInlineObject.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGInlineObject1.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGOrder.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGPet.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGPetApi.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGStoreApi.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGTag.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGUser.md delete mode 100644 samples/client/petstore/objc/default/docs/SWGUserApi.md delete mode 100644 samples/client/petstore/objc/default/git_push.sh diff --git a/samples/client/petstore/objc/core-data/.gitignore b/samples/client/petstore/objc/core-data/.gitignore deleted file mode 100644 index 01103f6f5ef6..000000000000 --- a/samples/client/petstore/objc/core-data/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/objc/core-data/.openapi-generator-ignore b/samples/client/petstore/objc/core-data/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/objc/core-data/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/FILES b/samples/client/petstore/objc/core-data/.openapi-generator/FILES deleted file mode 100644 index 6f6cd95849a0..000000000000 --- a/samples/client/petstore/objc/core-data/.openapi-generator/FILES +++ /dev/null @@ -1,72 +0,0 @@ -.gitignore -README.md -SwaggerClient.podspec -SwaggerClient/Api/SWGPetApi.h -SwaggerClient/Api/SWGPetApi.m -SwaggerClient/Api/SWGStoreApi.h -SwaggerClient/Api/SWGStoreApi.m -SwaggerClient/Api/SWGUserApi.h -SwaggerClient/Api/SWGUserApi.m -SwaggerClient/Core/JSONValueTransformer+ISO8601.h -SwaggerClient/Core/JSONValueTransformer+ISO8601.m -SwaggerClient/Core/SWGApi.h -SwaggerClient/Core/SWGApiClient.h -SwaggerClient/Core/SWGApiClient.m -SwaggerClient/Core/SWGBasicAuthTokenProvider.h -SwaggerClient/Core/SWGBasicAuthTokenProvider.m -SwaggerClient/Core/SWGConfiguration.h -SwaggerClient/Core/SWGDefaultConfiguration.h -SwaggerClient/Core/SWGDefaultConfiguration.m -SwaggerClient/Core/SWGJSONRequestSerializer.h -SwaggerClient/Core/SWGJSONRequestSerializer.m -SwaggerClient/Core/SWGLogger.h -SwaggerClient/Core/SWGLogger.m -SwaggerClient/Core/SWGObject.h -SwaggerClient/Core/SWGObject.m -SwaggerClient/Core/SWGQueryParamCollection.h -SwaggerClient/Core/SWGQueryParamCollection.m -SwaggerClient/Core/SWGResponseDeserializer.h -SwaggerClient/Core/SWGResponseDeserializer.m -SwaggerClient/Core/SWGSanitizer.h -SwaggerClient/Core/SWGSanitizer.m -SwaggerClient/Model/SWGCategory.h -SwaggerClient/Model/SWGCategory.m -SwaggerClient/Model/SWGCategoryManagedObject.h -SwaggerClient/Model/SWGCategoryManagedObject.m -SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h -SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m -SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion -SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents -SwaggerClient/Model/SWGOrder.h -SwaggerClient/Model/SWGOrder.m -SwaggerClient/Model/SWGOrderManagedObject.h -SwaggerClient/Model/SWGOrderManagedObject.m -SwaggerClient/Model/SWGOrderManagedObjectBuilder.h -SwaggerClient/Model/SWGOrderManagedObjectBuilder.m -SwaggerClient/Model/SWGPet.h -SwaggerClient/Model/SWGPet.m -SwaggerClient/Model/SWGPetManagedObject.h -SwaggerClient/Model/SWGPetManagedObject.m -SwaggerClient/Model/SWGPetManagedObjectBuilder.h -SwaggerClient/Model/SWGPetManagedObjectBuilder.m -SwaggerClient/Model/SWGTag.h -SwaggerClient/Model/SWGTag.m -SwaggerClient/Model/SWGTagManagedObject.h -SwaggerClient/Model/SWGTagManagedObject.m -SwaggerClient/Model/SWGTagManagedObjectBuilder.h -SwaggerClient/Model/SWGTagManagedObjectBuilder.m -SwaggerClient/Model/SWGUser.h -SwaggerClient/Model/SWGUser.m -SwaggerClient/Model/SWGUserManagedObject.h -SwaggerClient/Model/SWGUserManagedObject.m -SwaggerClient/Model/SWGUserManagedObjectBuilder.h -SwaggerClient/Model/SWGUserManagedObjectBuilder.m -docs/SWGCategory.md -docs/SWGOrder.md -docs/SWGPet.md -docs/SWGPetApi.md -docs/SWGStoreApi.md -docs/SWGTag.md -docs/SWGUser.md -docs/SWGUserApi.md -git_push.sh diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION deleted file mode 100644 index 909dcd0eca63..000000000000 --- a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.19.0-SNAPSHOT diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md deleted file mode 100644 index 1c81b8151b46..000000000000 --- a/samples/client/petstore/objc/core-data/README.md +++ /dev/null @@ -1,147 +0,0 @@ -# SwaggerClient - -This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters - -This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: -- Generator version: 7.19.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.ObjcClientCodegen - -## Requirements - -The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project. - -## Installation & Usage -### Install from Github using [CocoaPods](https://cocoapods.org/) - -Add the following to the Podfile: - -```ruby -pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' -``` - -To specify a particular branch, append `, :branch => 'branch-name-here'` - -To specify a particular commit, append `, :commit => '11aa22'` - -### Install from local path using [CocoaPods](https://cocoapods.org/) - -Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: - -```ruby -pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' -``` - -### Usage - -Import the following: - -```objc -#import -#import -// load models -#import -#import -#import -#import -#import -// load API classes for accessing endpoints -#import -#import -#import - -``` - -## Recommendation - -It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```objc - -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) - -SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; - -// Add a new pet to the store -[apiInstance addPetWithPet:pet - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error: %@", error); - } - }]; - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user -*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [SWGCategory](docs/SWGCategory.md) - - [SWGOrder](docs/SWGOrder.md) - - [SWGPet](docs/SWGPet.md) - - [SWGTag](docs/SWGTag.md) - - [SWGUser](docs/SWGUser.md) - - -## Documentation For Authorization - - -Authentication schemes defined for the API: -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec deleted file mode 100644 index 310ec4844743..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient.podspec +++ /dev/null @@ -1,36 +0,0 @@ -# -# Be sure to run `pod lib lint SwaggerClient.podspec' to ensure this is a -# valid spec and remove all comments before submitting the spec. -# -# Any lines starting with a # are optional, but encouraged -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -Pod::Spec.new do |s| - s.name = "SwaggerClient" - s.version = "1.0.0" - - s.summary = "OpenAPI Petstore" - s.description = <<-DESC - This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters - DESC - - s.platform = :ios, '7.0' - s.requires_arc = true - - s.frameworks = 'SystemConfiguration', 'CoreData' - - s.homepage = "https://github.com/openapitools/openapi-generator" - s.license = "Proprietary" - s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } - s.author = { "OpenAPI" => "team@openapitools.org" } - - s.source_files = 'SwaggerClient/**/*.{m,h}' - s.public_header_files = 'SwaggerClient/**/*.h' - s.resources = 'SwaggerClient/**/*.{xcdatamodeld,xcdatamodel}' - - s.dependency 'AFNetworking', '~> 3' - s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.6' -end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h deleted file mode 100644 index 1b1309c48761..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h +++ /dev/null @@ -1,139 +0,0 @@ -#import -#import "SWGPet.h" -#import "SWGApi.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - -@interface SWGPetApi: NSObject - -extern NSString* kSWGPetApiErrorDomain; -extern NSInteger kSWGPetApiMissingParamErrorCode; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; - -/// Add a new pet to the store -/// -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// code:405 message:"Invalid input" -/// -/// @return void --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; - - -/// Deletes a pet -/// -/// -/// @param petId Pet id to delete -/// @param apiKey (optional) -/// -/// code:400 message:"Invalid pet value" -/// -/// @return void --(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId - apiKey: (NSString*) apiKey - completionHandler: (void (^)(NSError* error)) handler; - - -/// Finds Pets by status -/// Multiple status values can be provided with comma separated strings -/// -/// @param status Status values that need to be considered for filter (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid status value" -/// -/// @return NSArray* --(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - - -/// Finds Pets by tags -/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// -/// @param tags Tags to filter by (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid tag value" -/// -/// @return NSArray* --(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - - -/// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// -/// @param petId ID of pet that needs to be fetched -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Pet not found" -/// -/// @return SWGPet* --(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; - - -/// Update an existing pet -/// -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Pet not found", -/// code:405 message:"Validation exception" -/// -/// @return void --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; - - -/// Updates a pet in the store with form data -/// -/// -/// @param petId ID of pet that needs to be updated -/// @param name Updated name of the pet (optional) -/// @param status Updated status of the pet (optional) -/// -/// code:405 message:"Invalid input" -/// -/// @return void --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId - name: (NSString*) name - status: (NSString*) status - completionHandler: (void (^)(NSError* error)) handler; - - -/// uploads an image -/// -/// -/// @param petId ID of pet to update -/// @param additionalMetadata Additional data to pass to server (optional) -/// @param file file to upload (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId - additionalMetadata: (NSString*) additionalMetadata - file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m deleted file mode 100644 index 9a774f3d9b7f..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m +++ /dev/null @@ -1,578 +0,0 @@ -#import "SWGPetApi.h" -#import "SWGQueryParamCollection.h" -#import "SWGApiClient.h" -#import "SWGPet.h" - - -@interface SWGPetApi () - -@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; - -@end - -@implementation SWGPetApi - -NSString* kSWGPetApiErrorDomain = @"SWGPetApiErrorDomain"; -NSInteger kSWGPetApiMissingParamErrorCode = 234513; - -@synthesize apiClient = _apiClient; - -#pragma mark - Initialize methods - -- (instancetype) init { - return [self initWithApiClient:[SWGApiClient sharedClient]]; -} - - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient { - self = [super init]; - if (self) { - _apiClient = apiClient; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - } - return self; -} - -#pragma mark - - --(NSString*) defaultHeaderForKey:(NSString*)key { - return self.mutableDefaultHeaders[key]; -} - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.mutableDefaultHeaders setValue:value forKey:key]; -} - --(NSDictionary *)defaultHeaders { - return self.mutableDefaultHeaders; -} - -#pragma mark - Api Methods - -/// -/// Add a new pet to the store -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Deletes a pet -/// -/// @param petId Pet id to delete -/// -/// @param apiKey (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId - apiKey: (NSString*) apiKey - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - if (apiKey != nil) { - headerParams[@"api_key"] = apiKey; - } - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"DELETE" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Finds Pets by status -/// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for filter (optional) -/// -/// @returns NSArray* -/// --(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSArray*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSArray*)data, error); - } - }]; -} - -/// -/// Finds Pets by tags -/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// @param tags Tags to filter by (optional) -/// -/// @returns NSArray* -/// --(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags - completionHandler: (void (^)(NSArray* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSArray*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSArray*)data, error); - } - }]; -} - -/// -/// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched -/// -/// @returns SWGPet* -/// --(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(nil, error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGPet*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGPet*)data, error); - } - }]; -} - -/// -/// Update an existing pet -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; - - return [self.apiClient requestWithPath: resourcePath - method: @"PUT" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Updates a pet in the store with form data -/// -/// @param petId ID of pet that needs to be updated -/// -/// @param name Updated name of the pet (optional) -/// -/// @param status Updated status of the pet (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId - name: (NSString*) name - status: (NSString*) status - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - if (name) { - formParams[@"name"] = name; - } - if (status) { - formParams[@"status"] = status; - } - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// uploads an image -/// -/// @param petId ID of pet to update -/// -/// @param additionalMetadata Additional data to pass to server (optional) -/// -/// @param file file to upload (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId - additionalMetadata: (NSString*) additionalMetadata - file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"multipart/form-data"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - if (additionalMetadata) { - formParams[@"additionalMetadata"] = additionalMetadata; - } - localVarFiles[@"file"] = file; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h deleted file mode 100644 index 935845f72151..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h +++ /dev/null @@ -1,78 +0,0 @@ -#import -#import "SWGOrder.h" -#import "SWGApi.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - -@interface SWGStoreApi: NSObject - -extern NSString* kSWGStoreApiErrorDomain; -extern NSInteger kSWGStoreApiMissingParamErrorCode; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; - -/// Delete purchase order by ID -/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -/// -/// @param orderId ID of the order that needs to be deleted -/// -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Order not found" -/// -/// @return void --(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId - completionHandler: (void (^)(NSError* error)) handler; - - -/// Returns pet inventories by status -/// Returns a map of status codes to quantities -/// -/// -/// code:200 message:"successful operation" -/// -/// @return NSDictionary* --(NSURLSessionTask*) getInventoryWithCompletionHandler: - (void (^)(NSDictionary* output, NSError* error)) handler; - - -/// Find purchase order by ID -/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -/// -/// @param orderId ID of pet that needs to be fetched -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Order not found" -/// -/// @return SWGOrder* --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - - -/// Place an order for a pet -/// -/// -/// @param order order placed for purchasing the pet (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid Order" -/// -/// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m deleted file mode 100644 index 14a5c4239217..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m +++ /dev/null @@ -1,297 +0,0 @@ -#import "SWGStoreApi.h" -#import "SWGQueryParamCollection.h" -#import "SWGApiClient.h" -#import "SWGOrder.h" - - -@interface SWGStoreApi () - -@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; - -@end - -@implementation SWGStoreApi - -NSString* kSWGStoreApiErrorDomain = @"SWGStoreApiErrorDomain"; -NSInteger kSWGStoreApiMissingParamErrorCode = 234513; - -@synthesize apiClient = _apiClient; - -#pragma mark - Initialize methods - -- (instancetype) init { - return [self initWithApiClient:[SWGApiClient sharedClient]]; -} - - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient { - self = [super init]; - if (self) { - _apiClient = apiClient; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - } - return self; -} - -#pragma mark - - --(NSString*) defaultHeaderForKey:(NSString*)key { - return self.mutableDefaultHeaders[key]; -} - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.mutableDefaultHeaders setValue:value forKey:key]; -} - --(NSDictionary *)defaultHeaders { - return self.mutableDefaultHeaders; -} - -#pragma mark - Api Methods - -/// -/// Delete purchase order by ID -/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -/// @param orderId ID of the order that needs to be deleted -/// -/// @returns void -/// --(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'orderId' is set - if (orderId == nil) { - NSParameterAssert(orderId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; - NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (orderId != nil) { - pathParams[@"orderId"] = orderId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"DELETE" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Returns pet inventories by status -/// Returns a map of status codes to quantities -/// @returns NSDictionary* -/// --(NSURLSessionTask*) getInventoryWithCompletionHandler: - (void (^)(NSDictionary* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"api_key"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSDictionary*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSDictionary*)data, error); - } - }]; -} - -/// -/// Find purchase order by ID -/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -/// @param orderId ID of pet that needs to be fetched -/// -/// @returns SWGOrder* -/// --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { - // verify the required parameter 'orderId' is set - if (orderId == nil) { - NSParameterAssert(orderId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; - NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; - handler(nil, error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (orderId != nil) { - pathParams[@"orderId"] = orderId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGOrder*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGOrder*)data, error); - } - }]; -} - -/// -/// Place an order for a pet -/// -/// @param order order placed for purchasing the pet (optional) -/// -/// @returns SWGOrder* -/// --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = order; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGOrder*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGOrder*)data, error); - } - }]; -} - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h deleted file mode 100644 index 98a3a1756d5d..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h +++ /dev/null @@ -1,131 +0,0 @@ -#import -#import "SWGUser.h" -#import "SWGApi.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - -@interface SWGUserApi: NSObject - -extern NSString* kSWGUserApiErrorDomain; -extern NSInteger kSWGUserApiMissingParamErrorCode; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; - -/// Create user -/// This can only be done by the logged in user. -/// -/// @param user Created user object (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; - - -/// Creates list of users with given input array -/// -/// -/// @param user List of user object (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; - - -/// Creates list of users with given input array -/// -/// -/// @param user List of user object (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; - - -/// Delete user -/// This can only be done by the logged in user. -/// -/// @param username The name that needs to be deleted -/// -/// code:400 message:"Invalid username supplied", -/// code:404 message:"User not found" -/// -/// @return void --(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username - completionHandler: (void (^)(NSError* error)) handler; - - -/// Get user by user name -/// -/// -/// @param username The name that needs to be fetched. Use user1 for testing. -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid username supplied", -/// code:404 message:"User not found" -/// -/// @return SWGUser* --(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username - completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; - - -/// Logs user into the system -/// -/// -/// @param username The user name for login (optional) -/// @param password The password for login in clear text (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid username/password supplied" -/// -/// @return NSString* --(NSURLSessionTask*) loginUserWithUsername: (NSString*) username - password: (NSString*) password - completionHandler: (void (^)(NSString* output, NSError* error)) handler; - - -/// Logs out current logged in user session -/// -/// -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) logoutUserWithCompletionHandler: - (void (^)(NSError* error)) handler; - - -/// Updated user -/// This can only be done by the logged in user. -/// -/// @param username name that need to be deleted -/// @param user Updated user object (optional) -/// -/// code:400 message:"Invalid user supplied", -/// code:404 message:"User not found" -/// -/// @return void --(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m deleted file mode 100644 index 94651c70282f..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m +++ /dev/null @@ -1,542 +0,0 @@ -#import "SWGUserApi.h" -#import "SWGQueryParamCollection.h" -#import "SWGApiClient.h" -#import "SWGUser.h" - - -@interface SWGUserApi () - -@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; - -@end - -@implementation SWGUserApi - -NSString* kSWGUserApiErrorDomain = @"SWGUserApiErrorDomain"; -NSInteger kSWGUserApiMissingParamErrorCode = 234513; - -@synthesize apiClient = _apiClient; - -#pragma mark - Initialize methods - -- (instancetype) init { - return [self initWithApiClient:[SWGApiClient sharedClient]]; -} - - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient { - self = [super init]; - if (self) { - _apiClient = apiClient; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - } - return self; -} - -#pragma mark - - --(NSString*) defaultHeaderForKey:(NSString*)key { - return self.mutableDefaultHeaders[key]; -} - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.mutableDefaultHeaders setValue:value forKey:key]; -} - --(NSDictionary *)defaultHeaders { - return self.mutableDefaultHeaders; -} - -#pragma mark - Api Methods - -/// -/// Create user -/// This can only be done by the logged in user. -/// @param user Created user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Creates list of users with given input array -/// -/// @param user List of user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Creates list of users with given input array -/// -/// @param user List of user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Delete user -/// This can only be done by the logged in user. -/// @param username The name that needs to be deleted -/// -/// @returns void -/// --(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'username' is set - if (username == nil) { - NSParameterAssert(username); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; - NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - pathParams[@"username"] = username; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"DELETE" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Get user by user name -/// -/// @param username The name that needs to be fetched. Use user1 for testing. -/// -/// @returns SWGUser* -/// --(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username - completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { - // verify the required parameter 'username' is set - if (username == nil) { - NSParameterAssert(username); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; - NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; - handler(nil, error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - pathParams[@"username"] = username; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGUser*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGUser*)data, error); - } - }]; -} - -/// -/// Logs user into the system -/// -/// @param username The user name for login (optional) -/// -/// @param password The password for login in clear text (optional) -/// -/// @returns NSString* -/// --(NSURLSessionTask*) loginUserWithUsername: (NSString*) username - password: (NSString*) password - completionHandler: (void (^)(NSString* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - queryParams[@"username"] = username; - } - if (password != nil) { - queryParams[@"password"] = password; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSString*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSString*)data, error); - } - }]; -} - -/// -/// Logs out current logged in user session -/// -/// @returns void -/// --(NSURLSessionTask*) logoutUserWithCompletionHandler: - (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Updated user -/// This can only be done by the logged in user. -/// @param username name that need to be deleted -/// -/// @param user Updated user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'username' is set - if (username == nil) { - NSParameterAssert(username); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; - NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - pathParams[@"username"] = username; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"PUT" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h deleted file mode 100644 index 5179ca2e99b8..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ /dev/null @@ -1,19 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface JSONValueTransformer (ISO8601) - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m deleted file mode 100644 index 0f458f0af010..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ /dev/null @@ -1,17 +0,0 @@ -#import -#import "JSONValueTransformer+ISO8601.h" -#import "SWGSanitizer.h" - -@implementation JSONValueTransformer (ISO8601) - -- (NSDate *) NSDateFromNSString:(NSString *)string -{ - return [NSDate dateWithISO8601String:string]; -} - -- (NSString *)JSONObjectFromNSDate:(NSDate *)date -{ - return [SWGSanitizer dateToString:date]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h deleted file mode 100644 index 6c0396f0cac5..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h +++ /dev/null @@ -1,29 +0,0 @@ -#import - -@class SWGApiClient; - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@protocol SWGApi - -@property(readonly, nonatomic, strong) SWGApiClient *apiClient; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient; - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; --(NSString*) defaultHeaderForKey:(NSString*)key; - --(NSDictionary *)defaultHeaders; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h deleted file mode 100644 index 761865f46933..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h +++ /dev/null @@ -1,121 +0,0 @@ -#import -#import "SWGConfiguration.h" -#import "SWGResponseDeserializer.h" -#import "SWGSanitizer.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -/** - * A key for `NSError` user info dictionaries. - * - * The corresponding value is the parsed response body for an HTTP error. - */ -extern NSString *const SWGResponseObjectErrorKey; - - -@interface SWGApiClient : AFHTTPSessionManager - -@property (nonatomic, strong, readonly) id configuration; - -@property(nonatomic, assign) NSTimeInterval timeoutInterval; - -@property(nonatomic, strong) id responseDeserializer; - -@property(nonatomic, strong) id sanitizer; - -/** - * Gets if the client is unreachable - * - * @return The client offline state - */ -+(BOOL) getOfflineState; - -/** - * Sets the client reachability, this may be overridden by the reachability manager if reachability changes - * - * @param status The client reachability status. - */ -+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; - -/** - * Gets the client reachability - * - * @return The client reachability. - */ -+(AFNetworkReachabilityStatus) getReachabilityStatus; - -@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; - -/** - * Gets client singleton instance - */ -+ (instancetype) sharedClient; - - -/** - * Updates header parameters and query parameters for authentication - * - * @param headers The header parameter will be updated, passed by pointer to pointer. - * @param queries The query parameters will be updated, passed by pointer to pointer. - * @param authSettings The authentication names NSArray. - */ -- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)queries WithAuthSettings:(NSArray *)authSettings; - - -/** - * Initializes the session manager with a configuration. - * - * @param configuration The configuration implementation - */ -- (instancetype)initWithConfiguration:(id)configuration; - -/** -* Initializes the session manager with a configuration and url -* -* @param url The base url -* @param configuration The configuration implementation -*/ -- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; - -/** - * Performs request - * - * @param path Request url. - * @param method Request method. - * @param pathParams Request path parameters. - * @param queryParams Request query parameters. - * @param body Request body. - * @param headerParams Request header parameters. - * @param authSettings Request authentication names. - * @param requestContentType Request content-type. - * @param responseContentType Response content-type. - * @param completionBlock The block will be executed when the request completed. - * - * @return The created session task. - */ -- (NSURLSessionTask*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m deleted file mode 100644 index 03f1cdda4e8a..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m +++ /dev/null @@ -1,376 +0,0 @@ - -#import "SWGLogger.h" -#import "SWGApiClient.h" -#import "SWGJSONRequestSerializer.h" -#import "SWGQueryParamCollection.h" -#import "SWGDefaultConfiguration.h" - -NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; - -static NSString * const kSWGContentDispositionKey = @"Content-Disposition"; - -static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { - if(![response isKindOfClass:[NSHTTPURLResponse class]]) { - return nil; - } - return ((NSHTTPURLResponse*)response).allHeaderFields; -} - -static NSString * SWG__fileNameForResponse(NSURLResponse *response) { - NSDictionary * headers = SWG__headerFieldsForResponse(response); - if(!headers[kSWGContentDispositionKey]) { - return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; - } - NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; - NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; - NSString *contentDispositionHeader = headers[kSWGContentDispositionKey]; - NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; - return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; -} - - -@interface SWGApiClient () - -@property (nonatomic, strong, readwrite) id configuration; - -@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; - -@end - -@implementation SWGApiClient - -#pragma mark - Singleton Methods - -+ (instancetype) sharedClient { - static SWGApiClient *sharedClient = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedClient = [[self alloc] init]; - }); - return sharedClient; -} - -#pragma mark - Initialize Methods - -- (instancetype)init { - return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; -} - -- (instancetype)initWithBaseURL:(NSURL *)url { - return [self initWithBaseURL:url configuration:[SWGDefaultConfiguration sharedConfig]]; -} - -- (instancetype)initWithConfiguration:(id)configuration { - return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; -} - -- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { - self = [super initWithBaseURL:url]; - if (self) { - _configuration = configuration; - _timeoutInterval = 60; - _responseDeserializer = [[SWGResponseDeserializer alloc] init]; - _sanitizer = [[SWGSanitizer alloc] init]; - - _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; - - AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; - SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; - _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, - @"application/x-www-form-urlencoded": afhttpRequestSerializer, - @"multipart/form-data": afhttpRequestSerializer - }; - self.securityPolicy = [self createSecurityPolicy]; - self.responseSerializer = [AFHTTPResponseSerializer serializer]; - } - return self; -} - -#pragma mark - Task Methods - -- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - - NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - SWGDebugLogResponse(response, responseObject,request,error); - if(!error) { - completionBlock(responseObject, nil); - return; - } - NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; - if (responseObject) { - // Add in the (parsed) response body. - userInfo[SWGResponseObjectErrorKey] = responseObject; - } - NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; - completionBlock(nil, augmentedError); - }]; - - return task; -} - -- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - - __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; - - NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - SWGDebugLogResponse(response, responseObject,request,error); - - if(error) { - NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; - if (responseObject) { - userInfo[SWGResponseObjectErrorKey] = responseObject; - } - NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; - completionBlock(nil, augmentedError); - return; - } - - NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); - NSString *filename = SWG__fileNameForResponse(response); - - NSString *filepath = [directory stringByAppendingPathComponent:filename]; - NSURL *file = [NSURL fileURLWithPath:filepath]; - - [responseObject writeToURL:file atomically:YES]; - - completionBlock(file, nil); - }]; - - return task; -} - -#pragma mark - Perform Request Methods - -- (NSURLSessionTask*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { - - AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; - - __weak id sanitizer = self.sanitizer; - - // sanitize parameters - pathParams = [sanitizer sanitizeForSerialization:pathParams]; - queryParams = [sanitizer sanitizeForSerialization:queryParams]; - headerParams = [sanitizer sanitizeForSerialization:headerParams]; - formParams = [sanitizer sanitizeForSerialization:formParams]; - if(![body isKindOfClass:[NSData class]]) { - body = [sanitizer sanitizeForSerialization:body]; - } - - // auth setting - [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; - - NSMutableString *resourcePath = [NSMutableString stringWithString:path]; - [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; - safeString = SWGPercentEscapedStringFromString(safeString); - [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; - }]; - - NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; - if ([pathWithQueryParams hasPrefix:@"/"]) { - pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; - } - - NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; - - NSError *requestCreateError = nil; - NSMutableURLRequest * request = nil; - if (files.count > 0) { - request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { - [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSString *objString = [sanitizer parameterToString:obj]; - NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; - [formData appendPartWithFormData:data name:key]; - }]; - [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSURL *filePath = (NSURL *)obj; - [formData appendPartWithFileURL:filePath name:key error:nil]; - }]; - } error:&requestCreateError]; - } - else { - if (formParams) { - request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; - } - if (body) { - request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; - } - } - if(!request) { - completionBlock(nil, requestCreateError); - return nil; - } - - if ([headerParams count] > 0){ - for(NSString * key in [headerParams keyEnumerator]){ - [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; - } - } - [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; - - [self postProcessRequest:request]; - - - NSURLSessionTask *task = nil; - - if ([self.downloadTaskResponseTypes containsObject:responseType]) { - task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { - completionBlock(data, error); - }]; - } else { - __weak typeof(self) weakSelf = self; - task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { - NSError * serializationError; - id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; - - if(!response && !error){ - error = serializationError; - } - completionBlock(response, error); - }]; - } - - [task resume]; - - return task; -} - --(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { - AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; - if(!serializer) { - NSAssert(NO, @"Unsupported request content type %@", requestContentType); - serializer = [AFHTTPRequestSerializer serializer]; - } - serializer.timeoutInterval = self.timeoutInterval; - return serializer; -} - -//Added for easier override to modify request --(void)postProcessRequest:(NSMutableURLRequest *)request { - -} - -#pragma mark - - -- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { - if(queryParams.count == 0) { - return path; - } - NSString * separator = nil; - NSUInteger counter = 0; - - NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; - - NSDictionary *separatorStyles = @{@"csv" : @",", - @"tsv" : @"\t", - @"pipes": @"|" - }; - for(NSString * key in [queryParams keyEnumerator]){ - if (counter == 0) { - separator = @"?"; - } else { - separator = @"&"; - } - id queryParam = [queryParams valueForKey:key]; - if(!queryParam) { - continue; - } - NSString *safeKey = SWGPercentEscapedStringFromString(key); - if ([queryParam isKindOfClass:[NSString class]]){ - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, SWGPercentEscapedStringFromString(queryParam)]]; - - } else if ([queryParam isKindOfClass:[SWGQueryParamCollection class]]){ - SWGQueryParamCollection * coll = (SWGQueryParamCollection*) queryParam; - NSArray* values = [coll values]; - NSString* format = [coll format]; - - if([format isEqualToString:@"multi"]) { - for(id obj in values) { - if (counter > 0) { - separator = @"&"; - } - NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; - counter += 1; - } - continue; - } - NSString * separatorStyle = separatorStyles[format]; - NSString * safeValue = SWGPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; - } else { - NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; - } - counter += 1; - } - return requestUrl; -} - -/** - * Update header and query params based on authentication settings - */ -- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)queries WithAuthSettings:(NSArray *)authSettings { - - if ([authSettings count] == 0) { - return; - } - - NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; - NSMutableDictionary *queriesWithAuth = [NSMutableDictionary dictionaryWithDictionary:*queries]; - - id config = self.configuration; - for (NSString *auth in authSettings) { - NSDictionary *authSetting = config.authSettings[auth]; - - if(!authSetting) { // auth setting is set only if the key is non-empty - continue; - } - NSString *type = authSetting[@"in"]; - NSString *key = authSetting[@"key"]; - NSString *value = authSetting[@"value"]; - if ([type isEqualToString:@"header"] && [key length] > 0 ) { - headersWithAuth[key] = value; - } else if ([type isEqualToString:@"query"] && [key length] != 0) { - queriesWithAuth[key] = value; - } - } - - *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; - *queries = [NSDictionary dictionaryWithDictionary:queriesWithAuth]; -} - -- (AFSecurityPolicy *) createSecurityPolicy { - AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - - id config = self.configuration; - - if (config.sslCaCert) { - NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; - } - - if (config.verifySSL) { - [securityPolicy setAllowInvalidCertificates:NO]; - } - else { - [securityPolicy setAllowInvalidCertificates:YES]; - [securityPolicy setValidatesDomainName:NO]; - } - - return securityPolicy; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h deleted file mode 100644 index bd10d59028b1..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h +++ /dev/null @@ -1,14 +0,0 @@ -/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password. - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#import - -@interface SWGBasicAuthTokenProvider : NSObject - -+ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; - -@end \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m deleted file mode 100644 index 3788009ec587..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m +++ /dev/null @@ -1,19 +0,0 @@ -#import "SWGBasicAuthTokenProvider.h" - -@implementation SWGBasicAuthTokenProvider - -+ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { - - // return empty string if username and password are empty - if (username.length == 0 && password.length == 0){ - return @""; - } - - NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; - NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; - basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - - return basicAuthCredentials; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h deleted file mode 100644 index f6b12de5c5c3..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h +++ /dev/null @@ -1,89 +0,0 @@ -#import - -@class SWGLogger; - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -static NSString * const kSWGAPIVersion = @"1.0.0"; - -@protocol SWGConfiguration - -/** - * Api logger - */ -@property (readonly, nonatomic) SWGLogger *logger; - -/** - * Base url - */ -@property (readonly, nonatomic) NSString *host; - -/** - * Api key values for Api Key type Authentication - */ -@property (readonly, nonatomic) NSDictionary *apiKey; - -/** - * Api key prefix values to be prepend to the respective api key - */ -@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; - -/** - * Username for HTTP Basic Authentication - */ -@property (readonly, nonatomic) NSString *username; - -/** - * Password for HTTP Basic Authentication - */ -@property (readonly, nonatomic) NSString *password; - -/** - * Access token for OAuth - */ -@property (readonly, nonatomic) NSString *accessToken; - -/** - * Temp folder for file download - */ -@property (readonly, nonatomic) NSString *tempFolderPath; - -/** - * Debug switch, default false - */ -@property (readonly, nonatomic) BOOL debug; - -/** - * SSL/TLS verification - * Set this to NO to skip verifying SSL certificate when calling API from https server - */ -@property (readonly, nonatomic) BOOL verifySSL; - -/** - * SSL/TLS verification - * Set this to customize the certificate file to verify the peer - */ -@property (readonly, nonatomic) NSString *sslCaCert; - -/** - * Authentication Settings - */ -@property (readonly, nonatomic) NSDictionary *authSettings; - -/** -* Default headers for all services -*/ -@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h deleted file mode 100644 index e141e0d092d5..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h +++ /dev/null @@ -1,171 +0,0 @@ -#import -#import "SWGConfiguration.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@class SWGApiClient; - -@interface SWGDefaultConfiguration : NSObject - - -/** - * Default api logger - */ -@property (nonatomic, strong) SWGLogger * logger; - -/** - * Default base url - */ -@property (nonatomic) NSString *host; - -/** - * Api key values for Api Key type Authentication - * - * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. - */ -@property (readonly, nonatomic, strong) NSDictionary *apiKey; - -/** - * Api key prefix values to be prepend to the respective api key - * - * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. - */ -@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; - -/** - * Username for HTTP Basic Authentication - */ - @property (nonatomic) NSString *username; - -/** - * Password for HTTP Basic Authentication - */ -@property (nonatomic) NSString *password; - -/** - * Access token for OAuth - */ -@property (nonatomic) NSString *accessToken; - -/** - * Temp folder for file download - */ -@property (nonatomic) NSString *tempFolderPath; - -/** - * Debug switch, default false - */ -@property (nonatomic) BOOL debug; - -/** - * Gets configuration singleton instance - */ -+ (instancetype) sharedConfig; - -/** - * SSL/TLS verification - * Set this to NO to skip verifying SSL certificate when calling API from https server - */ -@property (nonatomic) BOOL verifySSL; - -/** - * SSL/TLS verification - * Set this to customize the certificate file to verify the peer - */ -@property (nonatomic) NSString *sslCaCert; - -/** - * The time zone to use for date serialization - */ -@property (nonatomic) NSTimeZone *serializationTimeZone; - -/** - * Sets API key - * - * To remove an apiKey for an identifier, just set the apiKey to nil. - * - * @param apiKey API key or token. - * @param identifier API key identifier (authentication schema). - * - */ -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; - -/** - * Removes api key - * - * @param identifier API key identifier. - */ -- (void) removeApiKey:(NSString *)identifier; - -/** - * Sets the prefix for API key - * - * @param prefix API key prefix. - * @param identifier API key identifier. - */ -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; - -/** - * Removes api key prefix - * - * @param identifier API key identifier. - */ -- (void) removeApiKeyPrefix:(NSString *)identifier; - -/** - * Gets API key (with prefix if set) - */ -- (NSString *) getApiKeyWithPrefix:(NSString *) key; - -/** - * Gets Basic Auth token - */ -- (NSString *) getBasicAuthToken; - -/** - * Gets OAuth access token - */ -- (NSString *) getAccessToken; - -/** - * Gets Authentication Settings - */ -- (NSDictionary *) authSettings; - -/** -* Default headers for all services -*/ -@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; - -/** -* Removes header from defaultHeaders -* -* @param key Header name. -*/ --(void) removeDefaultHeaderForKey:(NSString*)key; - -/** -* Sets the header for key -* -* @param value Value for header name -* @param key Header name -*/ --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; - -/** -* @param key Header key name. -*/ --(NSString*) defaultHeaderForKey:(NSString*)key; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m deleted file mode 100644 index 4afe43359aaf..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m +++ /dev/null @@ -1,152 +0,0 @@ -#import "SWGDefaultConfiguration.h" -#import "SWGBasicAuthTokenProvider.h" -#import "SWGLogger.h" - -@interface SWGDefaultConfiguration () - -@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; -@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; -@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; - -@end - -@implementation SWGDefaultConfiguration - -#pragma mark - Singleton Methods - -+ (instancetype) sharedConfig { - static SWGDefaultConfiguration *shardConfig = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - shardConfig = [[self alloc] init]; - }); - return shardConfig; -} - -#pragma mark - Initialize Methods - -- (instancetype) init { - self = [super init]; - if (self) { - _host = @"http://petstore.swagger.io/v2"; - _username = @""; - _password = @""; - _accessToken= @""; - _verifySSL = YES; - _mutableApiKey = [NSMutableDictionary dictionary]; - _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - - _logger = [SWGLogger sharedLogger]; - } - return self; -} - -#pragma mark - Instance Methods - -- (NSString *) getApiKeyWithPrefix:(NSString *)key { - NSString *prefix = self.apiKeyPrefix[key]; - NSString *apiKey = self.apiKey[key]; - if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set - return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; - } - else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix - return [NSString stringWithFormat:@"%@", self.apiKey[key]]; - } - else { // return empty string if nothing is set - return @""; - } -} - -- (NSString *) getBasicAuthToken { - - NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; - return basicAuthToken; -} - -- (NSString *) getAccessToken { - if (self.accessToken.length == 0) { // token not set, return empty string - return @""; - } else { - return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; - } -} - -#pragma mark - Setter Methods - -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { - [self.mutableApiKey setValue:apiKey forKey:identifier]; -} - -- (void) removeApiKey:(NSString *)identifier { - [self.mutableApiKey removeObjectForKey:identifier]; -} - -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { - [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; -} - -- (void) removeApiKeyPrefix:(NSString *)identifier { - [self.mutableApiKeyPrefix removeObjectForKey:identifier]; -} - -#pragma mark - Getter Methods - -- (NSDictionary *) apiKey { - return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; -} - -- (NSDictionary *) apiKeyPrefix { - return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; -} - -#pragma mark - - -- (NSDictionary *) authSettings { - return @{ - @"api_key": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"api_key", - @"value": [self getApiKeyWithPrefix:@"api_key"] - }, - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, - }; -} - --(BOOL)debug { - return self.logger.isEnabled; -} - --(void)setDebug:(BOOL)debug { - self.logger.enabled = debug; -} - -- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { - if(!value) { - [self.mutableDefaultHeaders removeObjectForKey:key]; - return; - } - self.mutableDefaultHeaders[key] = value; -} - --(void) removeDefaultHeaderForKey:(NSString*)key { - [self.mutableDefaultHeaders removeObjectForKey:key]; -} - -- (NSString *)defaultHeaderForKey:(NSString *)key { - return self.mutableDefaultHeaders[key]; -} - -- (NSDictionary *)defaultHeaders { - return [self.mutableDefaultHeaders copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h deleted file mode 100644 index 943ab1323133..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ /dev/null @@ -1,18 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGJSONRequestSerializer : AFJSONRequestSerializer -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m deleted file mode 100644 index 221765e48397..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m +++ /dev/null @@ -1,37 +0,0 @@ -#import "SWGJSONRequestSerializer.h" - -@implementation SWGJSONRequestSerializer - -/// -/// When customize a request serializer, -/// the serializer must conform the protocol `AFURLRequestSerialization` -/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` -/// -/// @param request The original request. -/// @param parameters The parameters to be encoded. -/// @param error The error that occurred while attempting to encode the request parameters. -/// -/// @return A serialized request. -/// -- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request - withParameters:(id)parameters - error:(NSError *__autoreleasing *)error -{ - if (!parameters) { - return request; - } - // If the body data which will be serialized isn't NSArray or NSDictionary - // then put the data in the http request body directly. - if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { - return [super requestBySerializingRequest:request withParameters:parameters error:error]; - } - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - if([parameters isKindOfClass:[NSData class]]) { - [mutableRequest setHTTPBody:parameters]; - } else { - [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; - } - return mutableRequest; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m deleted file mode 100644 index 73c696d341a3..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m +++ /dev/null @@ -1,39 +0,0 @@ -#import "SWGJSONResponseSerializer.h" - -@implementation SWGJSONResponseSerializer - -/// -/// When customize a response serializer, -/// the serializer must conform the protocol `AFURLResponseSerialization` -/// and implements the protocol method `responseObjectForResponse:error:` -/// -/// @param response The response to be processed. -/// @param data The response data to be decoded. -/// @param error The error that occurred while attempting to decode the response data. -/// -/// @return The object decoded from the specified response data. -/// -- (id) responseObjectForResponse:(NSURLResponse *)response - data:(NSData *)data - error:(NSError *__autoreleasing *)error { - NSDictionary *responseJson = [super responseObjectForResponse:response data:data error:error]; - - // if response data is not a valid json, return string of data. - if ([self isParseError:*error]) { - *error = nil; - NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - return responseString; - } - - return responseJson; -} - --(BOOL)isParseError:(NSError *)error { - return [error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840; -} - -+ (instancetype)serializer { - return [self serializerWithReadingOptions:NSJSONReadingAllowFragments]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h deleted file mode 100644 index 23f57acd7b8a..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h +++ /dev/null @@ -1,61 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#ifndef SWGDebugLogResponse -#define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; -#endif - -/** - * Log debug message macro - */ -#ifndef SWGDebugLog -#define SWGDebugLog(format, ...) [[SWGLogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; -#endif - -@interface SWGLogger : NSObject - -+(instancetype)sharedLogger; - -/** - * Enabled switch, default NO - default set by SWGConfiguration debug property - */ -@property (nonatomic, assign, getter=isEnabled) BOOL enabled; - -/** - * Debug file location, default log in console - */ -@property (nonatomic, strong) NSString *loggingFile; - -/** - * Log file handler, this property is used by sdk internally. - */ -@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; - -/** - * Log debug message - */ --(void)debugLog:(NSString *)method message:(NSString *)format, ...; - -/** - * Logs request and response - * - * @param response NSURLResponse for the HTTP request. - * @param responseObject response object of the HTTP request. - * @param request The HTTP request. - * @param error The error of the HTTP request. - */ -- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m deleted file mode 100644 index 2a96e5ec54d3..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m +++ /dev/null @@ -1,73 +0,0 @@ -#import "SWGLogger.h" - -@interface SWGLogger () - -@end - -@implementation SWGLogger - -+ (instancetype) sharedLogger { - static SWGLogger *shardLogger = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - shardLogger = [[self alloc] init]; - }); - return shardLogger; -} - -#pragma mark - Log Methods - -- (void)debugLog:(NSString *)method message:(NSString *)format, ... { - if (!self.isEnabled) { - return; - } - - NSMutableString *message = [NSMutableString stringWithCapacity:1]; - - if (method) { - [message appendFormat:@"%@: ", method]; - } - - va_list args; - va_start(args, format); - - [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; - - // If set logging file handler, log into file, - // otherwise log into console. - if (self.loggingFileHandler) { - [self.loggingFileHandler seekToEndOfFile]; - [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; - } else { - NSLog(@"%@", message); - } - - va_end(args); -} - -- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { - NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ - "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", - [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], - responseObject]; - - SWGDebugLog(message); -} - -- (void) setLoggingFile:(NSString *)loggingFile { - if(_loggingFile == loggingFile) { - return; - } - // close old file handler - if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { - [self.loggingFileHandler closeFile]; - } - _loggingFile = loggingFile; - _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; - if (_loggingFileHandler == nil) { - [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; - _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; - } -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h deleted file mode 100644 index 7d7112c5976a..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h +++ /dev/null @@ -1,19 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGObject : JSONModel - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m deleted file mode 100644 index f985195d4b12..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m +++ /dev/null @@ -1,44 +0,0 @@ -#import "SWGObject.h" - -@implementation SWGObject - -/** - * Workaround for JSONModel multithreading issues - * https://github.com/icanzilb/JSONModel/issues/441 - */ -- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { - static NSMutableSet *classNames; - static NSObject *lock; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - classNames = [NSMutableSet new]; - lock = [NSObject new]; - }); - - BOOL initSync; - @synchronized(lock) - { - NSString *className = NSStringFromClass([self class]); - initSync = ![classNames containsObject:className]; - if(initSync) - { - [classNames addObject:className]; - self = [super initWithDictionary:dict error:err]; - } - } - if(!initSync) - { - self = [super initWithDictionary:dict error:err]; - } - return self; -} - -/** - * Gets the string presentation of the object. - * This method will be called when logging model object using `NSLog`. - */ -- (NSString *)description { - return [[self toDictionary] description]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h deleted file mode 100644 index 4bd35d86f352..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h +++ /dev/null @@ -1,24 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGQueryParamCollection : NSObject - -@property(nonatomic, readonly) NSArray* values; -@property(nonatomic, readonly) NSString* format; - -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m deleted file mode 100644 index 5f9306219edd..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m +++ /dev/null @@ -1,20 +0,0 @@ -#import "SWGQueryParamCollection.h" - -@implementation SWGQueryParamCollection - -@synthesize values = _values; -@synthesize format = _format; - -- (id)initWithValuesAndFormat:(NSArray *)values - format:(NSString *)format { - - self = [super init]; - if (self) { - _values = values; - _format = format; - } - - return self; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h deleted file mode 100644 index 68f83704f495..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h +++ /dev/null @@ -1,57 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -/** - * A key for deserialization ErrorDomain - */ -extern NSString *const SWGDeserializationErrorDomainKey; - -/** - * Code for deserialization type mismatch error - */ -extern NSInteger const SWGTypeMismatchErrorCode; - -/** - * Code for deserialization empty value error - */ -extern NSInteger const SWGEmptyValueOccurredErrorCode; - -/** - * Error code for unknown response - */ -extern NSInteger const SWGUnknownResponseObjectErrorCode; - -@protocol SWGResponseDeserializer - -/** - * Deserializes the given data to Objective-C object. - * - * @param data The data will be deserialized. - * @param className The type of objective-c object. - * @param error The error - */ -- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; - -@end - -@interface SWGResponseDeserializer : NSObject - -/** - * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored - * @default NO - */ -@property (nonatomic, assign) BOOL treatNullAsError; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m deleted file mode 100644 index 46d4b460fc74..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m +++ /dev/null @@ -1,247 +0,0 @@ -#import "SWGResponseDeserializer.h" -#import -#import - -NSString *const SWGDeserializationErrorDomainKey = @"SWGDeserializationErrorDomainKey"; - -NSInteger const SWGTypeMismatchErrorCode = 143553; - -NSInteger const SWGEmptyValueOccurredErrorCode = 143509; - -NSInteger const SWGUnknownResponseObjectErrorCode = 143528; - - -@interface SWGResponseDeserializer () - -@property (nonatomic, strong) NSNumberFormatter* numberFormatter; -@property (nonatomic, strong) NSArray *primitiveTypes; -@property (nonatomic, strong) NSArray *basicReturnTypes; -@property (nonatomic, strong) NSArray *dataReturnTypes; - -@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; -@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; -@property (nonatomic, strong) NSRegularExpression* dictPatExpression; -@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; - -@end - -@implementation SWGResponseDeserializer - -- (instancetype)init { - self = [super init]; - if (self) { - NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - formatter.numberStyle = NSNumberFormatterDecimalStyle; - _numberFormatter = formatter; - _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; - _basicReturnTypes = @[@"NSObject", @"id"]; - _dataReturnTypes = @[@"NSData"]; - - _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" - options:NSRegularExpressionCaseInsensitive - error:nil]; - _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" - options:NSRegularExpressionCaseInsensitive - error:nil]; - _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" - options:NSRegularExpressionCaseInsensitive - error:nil]; - _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" - options:NSRegularExpressionCaseInsensitive - error:nil]; - } - return self; -} - -#pragma mark - Deserialize methods - -- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { - if (!data || !className) { - return nil; - } - - if ([className hasSuffix:@"*"]) { - className = [className substringToIndex:[className length] - 1]; - } - if([self.dataReturnTypes containsObject:className]) { - return data; - } - id jsonData = nil; - if([data isKindOfClass:[NSData class]]) { - jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; - } else { - jsonData = data; - } - if(!jsonData) { - jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - } else if([jsonData isKindOfClass:[NSNull class]]) { - return nil; - } - - // pure object - if ([self.basicReturnTypes containsObject:className]) { - return jsonData; - } - - // primitives - if ([self.primitiveTypes containsObject:className]) { - return [self deserializePrimitiveValue:jsonData class:className error:error]; - } - - NSTextCheckingResult *match = nil; - NSRange range = NSMakeRange(0, [className length]); - // list of models - match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:jsonData innerType:innerType error:error]; - } - - // list of primitives - match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:jsonData innerType:innerType error:error]; - } - - // map - match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; - } - - match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; - } - - // model - Class ModelClass = NSClassFromString(className); - if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { - return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; - } - - if(error) { - *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; - } - return nil; -} - -- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { - if(![data isKindOfClass: [NSDictionary class]]) { - if(error) { - *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; - } - return nil; - } - __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; - for (id key in [data allKeys]) { - id obj = [data valueForKey:key]; - id dicObj = [self deserialize:obj class:valueType error:error]; - if(dicObj) { - [resultDict setValue:dicObj forKey:key]; - } else if([obj isKindOfClass:[NSNull class]]) { - if(self.treatNullAsError) { - if (error) { - *error = [self emptyValueOccurredError]; - } - resultDict = nil; - break; - } - } else { - resultDict = nil; - break; - } - } - return resultDict; -} - -- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { - if(![data isKindOfClass: [NSArray class]]) { - if(error) { - *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; - } - return nil; - } - NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; - for (id obj in data) { - id arrObj = [self deserialize:obj class:innerType error:error]; - if(arrObj) { - [resultArray addObject:arrObj]; - } else if([obj isKindOfClass:[NSNull class]]) { - if(self.treatNullAsError) { - if (error) { - *error = [self emptyValueOccurredError]; - } - resultArray = nil; - break; - } - } else { - resultArray = nil; - break; - } - } - return resultArray; -}; - -- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { - if ([className isEqualToString:@"NSString"]) { - return [NSString stringWithFormat:@"%@",data]; - } - else if ([className isEqualToString:@"NSDate"]) { - return [self deserializeDateValue:data error:error]; - } - else if ([className isEqualToString:@"NSNumber"]) { - // NSNumber from NSNumber - if ([data isKindOfClass:[NSNumber class]]) { - return data; - } - else if ([data isKindOfClass:[NSString class]]) { - // NSNumber (NSCFBoolean) from NSString - if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { - return @([data boolValue]); - // NSNumber from NSString - } else { - NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; - if(!formattedValue && [data length] > 0 && error) { - *error = [self typeMismatchErrorWithExpectedType:className data:data]; - } - return formattedValue; - } - } - } - if(error) { - *error = [self typeMismatchErrorWithExpectedType:className data:data]; - } - return nil; -} - -- (id) deserializeDateValue:(id) data error:(NSError**)error { - NSDate *date =[NSDate dateWithISO8601String:data]; - if(!date && [data length] > 0 && error) { - *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; - } - return date; -}; - --(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { - NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; - return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGTypeMismatchErrorCode userInfo:userInfo]; -} - --(NSError *)emptyValueOccurredError { - NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; - return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGEmptyValueOccurredErrorCode userInfo:userInfo]; -} - --(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { - NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; - return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGUnknownResponseObjectErrorCode userInfo:userInfo]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h deleted file mode 100644 index 83853bec8cf0..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h +++ /dev/null @@ -1,63 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -extern NSString * SWGPercentEscapedStringFromString(NSString *string); - -extern NSString * const kSWGApplicationJSONType; - -@protocol SWGSanitizer - -/** - * Sanitize object for request - * - * @param object The query/path/header/form/body param to be sanitized. - */ -- (id) sanitizeForSerialization:(id) object; - -/** - * Convert parameter to NSString - */ -- (NSString *) parameterToString: (id) param; - -/** - * Convert date to NSString - */ -+ (NSString *)dateToString:(id)date; - -/** - * Detects Accept header from accepts NSArray - * - * @param accepts NSArray of header - * - * @return The Accept header - */ --(NSString *) selectHeaderAccept:(NSArray *)accepts; - -/** - * Detects Content-Type header from contentTypes NSArray - * - * @param contentTypes NSArray of header - * - * @return The Content-Type header - */ --(NSString *) selectHeaderContentType:(NSArray *)contentTypes; - -@end - -@interface SWGSanitizer : NSObject - - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m deleted file mode 100644 index 1b3e0e10b0d5..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m +++ /dev/null @@ -1,170 +0,0 @@ -#import "SWGSanitizer.h" -#import "SWGObject.h" -#import "SWGQueryParamCollection.h" -#import "SWGDefaultConfiguration.h" -#import - -NSString * const kSWGApplicationJSONType = @"application/json"; - -NSString * SWGPercentEscapedStringFromString(NSString *string) { - static NSString * const kSWGCharactersGeneralDelimitersToEncode = @":#[]@"; - static NSString * const kSWGCharactersSubDelimitersToEncode = @"!$&'()*+,;="; - - NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; - [allowedCharacterSet removeCharactersInString:[kSWGCharactersGeneralDelimitersToEncode stringByAppendingString:kSWGCharactersSubDelimitersToEncode]]; - - static NSUInteger const batchSize = 50; - - NSUInteger index = 0; - NSMutableString *escaped = @"".mutableCopy; - - while (index < string.length) { - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wgnu" - NSUInteger length = MIN(string.length - index, batchSize); - #pragma GCC diagnostic pop - NSRange range = NSMakeRange(index, length); - - // To avoid breaking up character sequences such as 👴🏻👮🏽 - range = [string rangeOfComposedCharacterSequencesForRange:range]; - - NSString *substring = [string substringWithRange:range]; - NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; - [escaped appendString:encoded]; - - index += range.length; - } - - return escaped; -} - -@interface SWGSanitizer () - -@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; - -@end - -@implementation SWGSanitizer - --(instancetype)init { - self = [super init]; - if ( !self ) { - return nil; - } - _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; - return self; -} - - -- (id) sanitizeForSerialization:(id) object { - if (object == nil) { - return nil; - } - else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[SWGQueryParamCollection class]]) { - return object; - } - else if ([object isKindOfClass:[NSDate class]]) { - return [SWGSanitizer dateToString:object]; - } - else if ([object isKindOfClass:[NSArray class]]) { - NSArray *objectArray = object; - NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; - [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - id sanitizedObj = [self sanitizeForSerialization:obj]; - if (sanitizedObj) { - [sanitizedObjs addObject:sanitizedObj]; - } - }]; - return sanitizedObjs; - } - else if ([object isKindOfClass:[NSDictionary class]]) { - NSDictionary *objectDict = object; - NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; - [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - id sanitizedObj = [self sanitizeForSerialization:obj]; - if (sanitizedObj) { - sanitizedObjs[key] = sanitizedObj; - } - }]; - return sanitizedObjs; - } - else if ([object isKindOfClass:[SWGObject class]]) { - return [object toDictionary]; - } - else { - NSException *e = [NSException - exceptionWithName:@"InvalidObjectArgumentException" - reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] - userInfo:nil]; - @throw e; - } -} - -- (NSString *) parameterToString:(id)param { - if ([param isKindOfClass:[NSString class]]) { - return param; - } - else if ([param isKindOfClass:[NSNumber class]]) { - return [param stringValue]; - } - else if ([param isKindOfClass:[NSDate class]]) { - return [SWGSanitizer dateToString:param]; - } - else if ([param isKindOfClass:[NSArray class]]) { - NSMutableArray *mutableParam = [NSMutableArray array]; - [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [mutableParam addObject:[self parameterToString:obj]]; - }]; - return [mutableParam componentsJoinedByString:@","]; - } - else { - NSException *e = [NSException - exceptionWithName:@"InvalidObjectArgumentException" - reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] - userInfo:nil]; - @throw e; - } -} - -+ (NSString *)dateToString:(id)date { - NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; - return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; -} - -#pragma mark - Utility Methods - -/* - * Detect `Accept` from accepts - */ -- (NSString *) selectHeaderAccept:(NSArray *)accepts { - if (accepts.count == 0) { - return @""; - } - NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; - for (NSString *string in accepts) { - if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { - return kSWGApplicationJSONType; - } - [lowerAccepts addObject:[string lowercaseString]]; - } - return [lowerAccepts componentsJoinedByString:@", "]; -} - -/* - * Detect `Content-Type` from contentTypes - */ -- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { - if (contentTypes.count == 0) { - return kSWGApplicationJSONType; - } - NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; - for (NSString *string in contentTypes) { - if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ - return kSWGApplicationJSONType; - } - [lowerContentTypes addObject:[string lowercaseString]]; - } - return [lowerContentTypes firstObject]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h deleted file mode 100644 index 31eb9e6b31ca..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h +++ /dev/null @@ -1,30 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGCategory -@end - -@interface SWGCategory : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSString* name; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m deleted file mode 100644 index 21e354b30e9e..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGCategory.h" - -@implementation SWGCategory - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"name"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h deleted file mode 100644 index 8bcb655d0fbc..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h +++ /dev/null @@ -1,34 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGCategoryManagedObject : NSManagedObject - - -@property (nullable, nonatomic, retain) NSNumber* _id; - -@property (nullable, nonatomic, retain) NSString* name; -@end - -@interface SWGCategoryManagedObject (GeneratedAccessors) - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m deleted file mode 100644 index 08d3a08a91ae..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m +++ /dev/null @@ -1,12 +0,0 @@ -#import "SWGCategoryManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGCategoryManagedObject - -@dynamic _id; -@dynamic name; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h deleted file mode 100644 index 18863d14baf7..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#import -#import - - -#import "SWGCategoryManagedObject.h" -#import "SWGCategory.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGCategoryManagedObjectBuilder : NSObject - - - --(SWGCategoryManagedObject*)createNewSWGCategoryManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGCategoryManagedObject*)SWGCategoryManagedObjectFromSWGCategory:(SWGCategory*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGCategoryManagedObject:(SWGCategoryManagedObject*)object withSWGCategory:(SWGCategory*)object2; - --(SWGCategory*)SWGCategoryFromSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj; - --(void)updateSWGCategory:(SWGCategory*)object withSWGCategoryManagedObject:(SWGCategoryManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m deleted file mode 100644 index 12ab96205f6d..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m +++ /dev/null @@ -1,55 +0,0 @@ - - -#import "SWGCategoryManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGCategoryManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - } - return self; -} - --(SWGCategoryManagedObject*)createNewSWGCategoryManagedObjectInContext:(NSManagedObjectContext*)context { - SWGCategoryManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGCategoryManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGCategoryManagedObject*)SWGCategoryManagedObjectFromSWGCategory:(SWGCategory*)object context:(NSManagedObjectContext*)context { - SWGCategoryManagedObject* newSWGCategory = [self createNewSWGCategoryManagedObjectInContext:context]; - [self updateSWGCategoryManagedObject:newSWGCategory withSWGCategory:object]; - return newSWGCategory; -} - --(void)updateSWGCategoryManagedObject:(SWGCategoryManagedObject*)managedObject withSWGCategory:(SWGCategory*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject._id = [object._id copy]; - managedObject.name = [object.name copy]; - -} - --(SWGCategory*)SWGCategoryFromSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj { - if(!obj) { - return nil; - } - SWGCategory* newSWGCategory = [[SWGCategory alloc] init]; - [self updateSWGCategory:newSWGCategory withSWGCategoryManagedObject:obj]; - return newSWGCategory; -} - --(void)updateSWGCategory:(SWGCategory*)newSWGCategory withSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj { - newSWGCategory._id = [obj._id copy]; - newSWGCategory.name = [obj.name copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h deleted file mode 100644 index 1d3390dab8c4..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h +++ /dev/null @@ -1,32 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGInlineObject -@end - -@interface SWGInlineObject : SWGObject - -/* Updated name of the pet [optional] - */ -@property(nonatomic) NSString* name; -/* Updated status of the pet [optional] - */ -@property(nonatomic) NSString* status; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m deleted file mode 100644 index a10d7060973a..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGInlineObject.h" - -@implementation SWGInlineObject - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"name", @"status"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h deleted file mode 100644 index 36d1a7194cdd..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h +++ /dev/null @@ -1,32 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGInlineObject1 -@end - -@interface SWGInlineObject1 : SWGObject - -/* Additional data to pass to server [optional] - */ -@property(nonatomic) NSString* additionalMetadata; -/* file to upload [optional] - */ -@property(nonatomic) NSURL* file; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m deleted file mode 100644 index 825dbcc286ae..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGInlineObject1.h" - -@implementation SWGInlineObject1 - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"additionalMetadata", @"file"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h deleted file mode 100644 index 67d37a6fc9c2..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h +++ /dev/null @@ -1,36 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGInlineObject1ManagedObject : NSManagedObject - -/* Additional data to pass to server [optional] - */ -@property (nullable, nonatomic, retain) NSString* additionalMetadata; -/* file to upload [optional] - */ -@property (nullable, nonatomic, retain) NSURL* file; -@end - -@interface SWGInlineObject1ManagedObject (GeneratedAccessors) - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m deleted file mode 100644 index 8b83f2e40b99..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m +++ /dev/null @@ -1,12 +0,0 @@ -#import "SWGInlineObject1ManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGInlineObject1ManagedObject - -@dynamic additionalMetadata; -@dynamic file; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h deleted file mode 100644 index 35f82beb9a9e..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#import -#import - - -#import "SWGInlineObject1ManagedObject.h" -#import "SWGInlineObject1.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGInlineObject1ManagedObjectBuilder : NSObject - - - --(SWGInlineObject1ManagedObject*)createNewSWGInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGInlineObject1ManagedObject*)SWGInlineObject1ManagedObjectFromSWGInlineObject1:(SWGInlineObject1*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)object withSWGInlineObject1:(SWGInlineObject1*)object2; - --(SWGInlineObject1*)SWGInlineObject1FromSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj; - --(void)updateSWGInlineObject1:(SWGInlineObject1*)object withSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m deleted file mode 100644 index 75031ff775da..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m +++ /dev/null @@ -1,55 +0,0 @@ - - -#import "SWGInlineObject1ManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGInlineObject1ManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - } - return self; -} - --(SWGInlineObject1ManagedObject*)createNewSWGInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context { - SWGInlineObject1ManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGInlineObject1ManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGInlineObject1ManagedObject*)SWGInlineObject1ManagedObjectFromSWGInlineObject1:(SWGInlineObject1*)object context:(NSManagedObjectContext*)context { - SWGInlineObject1ManagedObject* newSWGInlineObject1 = [self createNewSWGInlineObject1ManagedObjectInContext:context]; - [self updateSWGInlineObject1ManagedObject:newSWGInlineObject1 withSWGInlineObject1:object]; - return newSWGInlineObject1; -} - --(void)updateSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)managedObject withSWGInlineObject1:(SWGInlineObject1*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject.additionalMetadata = [object.additionalMetadata copy]; - managedObject.file = [object.file copy]; - -} - --(SWGInlineObject1*)SWGInlineObject1FromSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj { - if(!obj) { - return nil; - } - SWGInlineObject1* newSWGInlineObject1 = [[SWGInlineObject1 alloc] init]; - [self updateSWGInlineObject1:newSWGInlineObject1 withSWGInlineObject1ManagedObject:obj]; - return newSWGInlineObject1; -} - --(void)updateSWGInlineObject1:(SWGInlineObject1*)newSWGInlineObject1 withSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj { - newSWGInlineObject1.additionalMetadata = [obj.additionalMetadata copy]; - newSWGInlineObject1.file = [obj.file copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h deleted file mode 100644 index c7c95fca41c4..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h +++ /dev/null @@ -1,36 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGInlineObjectManagedObject : NSManagedObject - -/* Updated name of the pet [optional] - */ -@property (nullable, nonatomic, retain) NSString* name; -/* Updated status of the pet [optional] - */ -@property (nullable, nonatomic, retain) NSString* status; -@end - -@interface SWGInlineObjectManagedObject (GeneratedAccessors) - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m deleted file mode 100644 index b1eaec9c492b..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m +++ /dev/null @@ -1,12 +0,0 @@ -#import "SWGInlineObjectManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGInlineObjectManagedObject - -@dynamic name; -@dynamic status; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h deleted file mode 100644 index 7937b22ea1d8..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#import -#import - - -#import "SWGInlineObjectManagedObject.h" -#import "SWGInlineObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGInlineObjectManagedObjectBuilder : NSObject - - - --(SWGInlineObjectManagedObject*)createNewSWGInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)object withSWGInlineObject:(SWGInlineObject*)object2; - --(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj; - --(void)updateSWGInlineObject:(SWGInlineObject*)object withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m deleted file mode 100644 index 7d15720a5465..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m +++ /dev/null @@ -1,55 +0,0 @@ - - -#import "SWGInlineObjectManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGInlineObjectManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - } - return self; -} - --(SWGInlineObjectManagedObject*)createNewSWGInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context { - SWGInlineObjectManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGInlineObjectManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context { - SWGInlineObjectManagedObject* newSWGInlineObject = [self createNewSWGInlineObjectManagedObjectInContext:context]; - [self updateSWGInlineObjectManagedObject:newSWGInlineObject withSWGInlineObject:object]; - return newSWGInlineObject; -} - --(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)managedObject withSWGInlineObject:(SWGInlineObject*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject.name = [object.name copy]; - managedObject.status = [object.status copy]; - -} - --(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj { - if(!obj) { - return nil; - } - SWGInlineObject* newSWGInlineObject = [[SWGInlineObject alloc] init]; - [self updateSWGInlineObject:newSWGInlineObject withSWGInlineObjectManagedObject:obj]; - return newSWGInlineObject; -} - --(void)updateSWGInlineObject:(SWGInlineObject*)newSWGInlineObject withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj { - newSWGInlineObject.name = [obj.name copy]; - newSWGInlineObject.status = [obj.status copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion deleted file mode 100644 index 3a67e4c5a2a2..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion +++ /dev/null @@ -1,8 +0,0 @@ - - - - - _XCCurrentVersionName - SWGModel.xcdatamodel - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents deleted file mode 100644 index 4ec7a3b456b3..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h deleted file mode 100644 index 5ea7a94cfcbe..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h +++ /dev/null @@ -1,39 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGOrder -@end - -@interface SWGOrder : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSNumber* petId; - -@property(nonatomic) NSNumber* quantity; - -@property(nonatomic) NSDate* shipDate; -/* Order Status [optional] - */ -@property(nonatomic) NSString* status; - -@property(nonatomic) NSNumber* complete; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m deleted file mode 100644 index 7f93b0212c48..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGOrder.h" - -@implementation SWGOrder - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h deleted file mode 100644 index 05f83ca11fd6..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h +++ /dev/null @@ -1,43 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGOrderManagedObject : NSManagedObject - - -@property (nullable, nonatomic, retain) NSNumber* _id; - -@property (nullable, nonatomic, retain) NSNumber* petId; - -@property (nullable, nonatomic, retain) NSNumber* quantity; - -@property (nullable, nonatomic, retain) NSDate* shipDate; -/* Order Status [optional] - */ -@property (nullable, nonatomic, retain) NSString* status; - -@property (nullable, nonatomic, retain) NSNumber* complete; -@end - -@interface SWGOrderManagedObject (GeneratedAccessors) - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m deleted file mode 100644 index c0c36798cb73..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m +++ /dev/null @@ -1,16 +0,0 @@ -#import "SWGOrderManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGOrderManagedObject - -@dynamic _id; -@dynamic petId; -@dynamic quantity; -@dynamic shipDate; -@dynamic status; -@dynamic complete; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h deleted file mode 100644 index f67159446bc9..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#import -#import - - -#import "SWGOrderManagedObject.h" -#import "SWGOrder.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGOrderManagedObjectBuilder : NSObject - - - --(SWGOrderManagedObject*)createNewSWGOrderManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGOrderManagedObject*)SWGOrderManagedObjectFromSWGOrder:(SWGOrder*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGOrderManagedObject:(SWGOrderManagedObject*)object withSWGOrder:(SWGOrder*)object2; - --(SWGOrder*)SWGOrderFromSWGOrderManagedObject:(SWGOrderManagedObject*)obj; - --(void)updateSWGOrder:(SWGOrder*)object withSWGOrderManagedObject:(SWGOrderManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m deleted file mode 100644 index 24a937fd0488..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m +++ /dev/null @@ -1,63 +0,0 @@ - - -#import "SWGOrderManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGOrderManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - } - return self; -} - --(SWGOrderManagedObject*)createNewSWGOrderManagedObjectInContext:(NSManagedObjectContext*)context { - SWGOrderManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGOrderManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGOrderManagedObject*)SWGOrderManagedObjectFromSWGOrder:(SWGOrder*)object context:(NSManagedObjectContext*)context { - SWGOrderManagedObject* newSWGOrder = [self createNewSWGOrderManagedObjectInContext:context]; - [self updateSWGOrderManagedObject:newSWGOrder withSWGOrder:object]; - return newSWGOrder; -} - --(void)updateSWGOrderManagedObject:(SWGOrderManagedObject*)managedObject withSWGOrder:(SWGOrder*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject._id = [object._id copy]; - managedObject.petId = [object.petId copy]; - managedObject.quantity = [object.quantity copy]; - managedObject.shipDate = [object.shipDate copy]; - managedObject.status = [object.status copy]; - managedObject.complete = [object.complete copy]; - -} - --(SWGOrder*)SWGOrderFromSWGOrderManagedObject:(SWGOrderManagedObject*)obj { - if(!obj) { - return nil; - } - SWGOrder* newSWGOrder = [[SWGOrder alloc] init]; - [self updateSWGOrder:newSWGOrder withSWGOrderManagedObject:obj]; - return newSWGOrder; -} - --(void)updateSWGOrder:(SWGOrder*)newSWGOrder withSWGOrderManagedObject:(SWGOrderManagedObject*)obj { - newSWGOrder._id = [obj._id copy]; - newSWGOrder.petId = [obj.petId copy]; - newSWGOrder.quantity = [obj.quantity copy]; - newSWGOrder.shipDate = [obj.shipDate copy]; - newSWGOrder.status = [obj.status copy]; - newSWGOrder.complete = [obj.complete copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h deleted file mode 100644 index 4b3729193265..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h +++ /dev/null @@ -1,45 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#import "SWGCategory.h" -#import "SWGTag.h" -@protocol SWGCategory; -@class SWGCategory; -@protocol SWGTag; -@class SWGTag; - - - -@protocol SWGPet -@end - -@interface SWGPet : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) SWGCategory* category; - -@property(nonatomic) NSString* name; - -@property(nonatomic) NSArray* photoUrls; - -@property(nonatomic) NSArray* tags; -/* pet status in the store [optional] - */ -@property(nonatomic) NSString* status; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m deleted file mode 100644 index 8c958695c888..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGPet.h" - -@implementation SWGPet - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h deleted file mode 100644 index 6ad378e95f76..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h +++ /dev/null @@ -1,49 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#import "SWGCategoryManagedObject.h" -#import "SWGTagManagedObject.h" - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGPetManagedObject : NSManagedObject - - -@property (nullable, nonatomic, retain) NSNumber* _id; - -@property (nullable, nonatomic, retain) SWGCategoryManagedObject* category; - -@property (nullable, nonatomic, retain) NSString* name; - -@property (nullable, nonatomic, retain) NSArray* photoUrls; - -@property (nullable, nonatomic, retain) NSOrderedSet* tags; -/* pet status in the store [optional] - */ -@property (nullable, nonatomic, retain) NSString* status; -@end - -@interface SWGPetManagedObject (GeneratedAccessors) -- (void)addTagsObject:(SWGTagManagedObject *)value; -- (void)removeTagsObject:(SWGTagManagedObject *)value; -- (void)addTags:(NSOrderedSet *)values; -- (void)removeTags:(NSOrderedSet *)values; - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m deleted file mode 100644 index 7b1bcc0cd092..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m +++ /dev/null @@ -1,16 +0,0 @@ -#import "SWGPetManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGPetManagedObject - -@dynamic _id; -@dynamic category; -@dynamic name; -@dynamic photoUrls; -@dynamic tags; -@dynamic status; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h deleted file mode 100644 index 112ba8bbff4f..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h +++ /dev/null @@ -1,39 +0,0 @@ -#import -#import - -#import "SWGCategoryManagedObjectBuilder.h" -#import "SWGTagManagedObjectBuilder.h" - -#import "SWGPetManagedObject.h" -#import "SWGPet.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGPetManagedObjectBuilder : NSObject - -@property (nonatomic, strong) SWGCategoryManagedObjectBuilder * categoryBuilder; -@property (nonatomic, strong) SWGTagManagedObjectBuilder * tagsBuilder; - - --(SWGPetManagedObject*)createNewSWGPetManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGPetManagedObject*)SWGPetManagedObjectFromSWGPet:(SWGPet*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGPetManagedObject:(SWGPetManagedObject*)object withSWGPet:(SWGPet*)object2; - --(SWGPet*)SWGPetFromSWGPetManagedObject:(SWGPetManagedObject*)obj; - --(void)updateSWGPet:(SWGPet*)object withSWGPetManagedObject:(SWGPetManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m deleted file mode 100644 index c297ea975325..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m +++ /dev/null @@ -1,90 +0,0 @@ - - -#import "SWGPetManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGPetManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - _categoryBuilder = [[SWGCategoryManagedObjectBuilder alloc] init]; - _tagsBuilder = [[SWGTagManagedObjectBuilder alloc] init]; - } - return self; -} - --(SWGPetManagedObject*)createNewSWGPetManagedObjectInContext:(NSManagedObjectContext*)context { - SWGPetManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGPetManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGPetManagedObject*)SWGPetManagedObjectFromSWGPet:(SWGPet*)object context:(NSManagedObjectContext*)context { - SWGPetManagedObject* newSWGPet = [self createNewSWGPetManagedObjectInContext:context]; - [self updateSWGPetManagedObject:newSWGPet withSWGPet:object]; - return newSWGPet; -} - --(void)updateSWGPetManagedObject:(SWGPetManagedObject*)managedObject withSWGPet:(SWGPet*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject._id = [object._id copy]; - - if(!managedObject.category) { - managedObject.category = [self.categoryBuilder SWGCategoryManagedObjectFromSWGCategory:object.category context:managedObject.managedObjectContext]; - } else { - [self.categoryBuilder updateSWGCategoryManagedObject:managedObject.category withSWGCategory:object.category]; - } - managedObject.name = [object.name copy]; - managedObject.photoUrls = [object.photoUrls copy]; - if(managedObject.tags) { - for (id object in managedObject.tags) { - [context deleteObject:object]; - } - } - if(object.tags) { - NSMutableOrderedSet * convertedObjs = [NSMutableOrderedSet orderedSet]; - for (id innerObject in object.tags) { - id convertedObj = [self.tagsBuilder SWGTagManagedObjectFromSWGTag:innerObject context:managedObject.managedObjectContext]; - [convertedObjs addObject:convertedObj]; - } - managedObject.tags = convertedObjs; - } - managedObject.status = [object.status copy]; - -} - --(SWGPet*)SWGPetFromSWGPetManagedObject:(SWGPetManagedObject*)obj { - if(!obj) { - return nil; - } - SWGPet* newSWGPet = [[SWGPet alloc] init]; - [self updateSWGPet:newSWGPet withSWGPetManagedObject:obj]; - return newSWGPet; -} - --(void)updateSWGPet:(SWGPet*)newSWGPet withSWGPetManagedObject:(SWGPetManagedObject*)obj { - newSWGPet._id = [obj._id copy]; - newSWGPet.category = [self.categoryBuilder SWGCategoryFromSWGCategoryManagedObject:obj.category]; - newSWGPet.name = [obj.name copy]; - newSWGPet.photoUrls = [obj.photoUrls copy]; - if(obj.tags != nil) { - NSMutableArray* convertedObjs = [NSMutableArray array]; - for (id innerObject in obj.tags) { - id convertedObj = [self.tagsBuilder SWGTagFromSWGTagManagedObject:innerObject]; - [convertedObjs addObject:convertedObj]; - } - newSWGPet.tags = (NSArray*)convertedObjs; - } - - newSWGPet.status = [obj.status copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h deleted file mode 100644 index cdcedfd916bb..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h +++ /dev/null @@ -1,30 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGTag -@end - -@interface SWGTag : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSString* name; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m deleted file mode 100644 index 3a62bcbb9a12..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGTag.h" - -@implementation SWGTag - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"name"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h deleted file mode 100644 index a646e643d70c..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h +++ /dev/null @@ -1,34 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGTagManagedObject : NSManagedObject - - -@property (nullable, nonatomic, retain) NSNumber* _id; - -@property (nullable, nonatomic, retain) NSString* name; -@end - -@interface SWGTagManagedObject (GeneratedAccessors) - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m deleted file mode 100644 index 0118c1be3c8c..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m +++ /dev/null @@ -1,12 +0,0 @@ -#import "SWGTagManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGTagManagedObject - -@dynamic _id; -@dynamic name; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h deleted file mode 100644 index fe1abf098e0c..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#import -#import - - -#import "SWGTagManagedObject.h" -#import "SWGTag.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGTagManagedObjectBuilder : NSObject - - - --(SWGTagManagedObject*)createNewSWGTagManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGTagManagedObject:(SWGTagManagedObject*)object withSWGTag:(SWGTag*)object2; - --(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj; - --(void)updateSWGTag:(SWGTag*)object withSWGTagManagedObject:(SWGTagManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m deleted file mode 100644 index 62baa7b41f2e..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m +++ /dev/null @@ -1,55 +0,0 @@ - - -#import "SWGTagManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGTagManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - } - return self; -} - --(SWGTagManagedObject*)createNewSWGTagManagedObjectInContext:(NSManagedObjectContext*)context { - SWGTagManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGTagManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)object context:(NSManagedObjectContext*)context { - SWGTagManagedObject* newSWGTag = [self createNewSWGTagManagedObjectInContext:context]; - [self updateSWGTagManagedObject:newSWGTag withSWGTag:object]; - return newSWGTag; -} - --(void)updateSWGTagManagedObject:(SWGTagManagedObject*)managedObject withSWGTag:(SWGTag*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject._id = [object._id copy]; - managedObject.name = [object.name copy]; - -} - --(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj { - if(!obj) { - return nil; - } - SWGTag* newSWGTag = [[SWGTag alloc] init]; - [self updateSWGTag:newSWGTag withSWGTagManagedObject:obj]; - return newSWGTag; -} - --(void)updateSWGTag:(SWGTag*)newSWGTag withSWGTagManagedObject:(SWGTagManagedObject*)obj { - newSWGTag._id = [obj._id copy]; - newSWGTag.name = [obj.name copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h deleted file mode 100644 index 7786883ed29c..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h +++ /dev/null @@ -1,43 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGUser -@end - -@interface SWGUser : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSString* username; - -@property(nonatomic) NSString* firstName; - -@property(nonatomic) NSString* lastName; - -@property(nonatomic) NSString* email; - -@property(nonatomic) NSString* password; - -@property(nonatomic) NSString* phone; -/* User Status [optional] - */ -@property(nonatomic) NSNumber* userStatus; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m deleted file mode 100644 index fd50c02e2c9c..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGUser.h" - -@implementation SWGUser - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h deleted file mode 100644 index 89f0f4938d81..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h +++ /dev/null @@ -1,47 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - -NS_ASSUME_NONNULL_BEGIN - -@interface SWGUserManagedObject : NSManagedObject - - -@property (nullable, nonatomic, retain) NSNumber* _id; - -@property (nullable, nonatomic, retain) NSString* username; - -@property (nullable, nonatomic, retain) NSString* firstName; - -@property (nullable, nonatomic, retain) NSString* lastName; - -@property (nullable, nonatomic, retain) NSString* email; - -@property (nullable, nonatomic, retain) NSString* password; - -@property (nullable, nonatomic, retain) NSString* phone; -/* User Status [optional] - */ -@property (nullable, nonatomic, retain) NSNumber* userStatus; -@end - -@interface SWGUserManagedObject (GeneratedAccessors) - -@end - - -NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m deleted file mode 100644 index 33a67b0ba001..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m +++ /dev/null @@ -1,18 +0,0 @@ -#import "SWGUserManagedObject.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ -@implementation SWGUserManagedObject - -@dynamic _id; -@dynamic username; -@dynamic firstName; -@dynamic lastName; -@dynamic email; -@dynamic password; -@dynamic phone; -@dynamic userStatus; -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h deleted file mode 100644 index de1c284cde24..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h +++ /dev/null @@ -1,35 +0,0 @@ -#import -#import - - -#import "SWGUserManagedObject.h" -#import "SWGUser.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGUserManagedObjectBuilder : NSObject - - - --(SWGUserManagedObject*)createNewSWGUserManagedObjectInContext:(NSManagedObjectContext*)context; - --(SWGUserManagedObject*)SWGUserManagedObjectFromSWGUser:(SWGUser*)object context:(NSManagedObjectContext*)context; - --(void)updateSWGUserManagedObject:(SWGUserManagedObject*)object withSWGUser:(SWGUser*)object2; - --(SWGUser*)SWGUserFromSWGUserManagedObject:(SWGUserManagedObject*)obj; - --(void)updateSWGUser:(SWGUser*)object withSWGUserManagedObject:(SWGUserManagedObject*)object2; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m deleted file mode 100644 index 2f7247526758..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m +++ /dev/null @@ -1,67 +0,0 @@ - - -#import "SWGUserManagedObjectBuilder.h" - -/** -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - -@implementation SWGUserManagedObjectBuilder - --(instancetype)init { - self = [super init]; - if (self != nil) { - } - return self; -} - --(SWGUserManagedObject*)createNewSWGUserManagedObjectInContext:(NSManagedObjectContext*)context { - SWGUserManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGUserManagedObject class]) inManagedObjectContext:context]; - return managedObject; -} - --(SWGUserManagedObject*)SWGUserManagedObjectFromSWGUser:(SWGUser*)object context:(NSManagedObjectContext*)context { - SWGUserManagedObject* newSWGUser = [self createNewSWGUserManagedObjectInContext:context]; - [self updateSWGUserManagedObject:newSWGUser withSWGUser:object]; - return newSWGUser; -} - --(void)updateSWGUserManagedObject:(SWGUserManagedObject*)managedObject withSWGUser:(SWGUser*)object { - if(!managedObject || !object) { - return; - } - NSManagedObjectContext* context = managedObject.managedObjectContext; - managedObject._id = [object._id copy]; - managedObject.username = [object.username copy]; - managedObject.firstName = [object.firstName copy]; - managedObject.lastName = [object.lastName copy]; - managedObject.email = [object.email copy]; - managedObject.password = [object.password copy]; - managedObject.phone = [object.phone copy]; - managedObject.userStatus = [object.userStatus copy]; - -} - --(SWGUser*)SWGUserFromSWGUserManagedObject:(SWGUserManagedObject*)obj { - if(!obj) { - return nil; - } - SWGUser* newSWGUser = [[SWGUser alloc] init]; - [self updateSWGUser:newSWGUser withSWGUserManagedObject:obj]; - return newSWGUser; -} - --(void)updateSWGUser:(SWGUser*)newSWGUser withSWGUserManagedObject:(SWGUserManagedObject*)obj { - newSWGUser._id = [obj._id copy]; - newSWGUser.username = [obj.username copy]; - newSWGUser.firstName = [obj.firstName copy]; - newSWGUser.lastName = [obj.lastName copy]; - newSWGUser.email = [obj.email copy]; - newSWGUser.password = [obj.password copy]; - newSWGUser.phone = [obj.phone copy]; - newSWGUser.userStatus = [obj.userStatus copy]; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile b/samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile deleted file mode 100644 index 22654e6adda3..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile +++ /dev/null @@ -1,12 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient_Example' do - pod "SwaggerClient", :path => "../" -end - -target 'SwaggerClient_Tests' do - pod "SwaggerClient", :path => "../" - - pod 'Specta' - pod 'Expecta' -end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index 462f141372dd..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,706 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */; }; - 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; - 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; - 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; - 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; - 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; - 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; }; - 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; }; - 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; - 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; - 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; - 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; - B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */; }; - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6003F582195388D10070C39A /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6003F589195388D20070C39A; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig"; sourceTree = ""; }; - 4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 6003F58A195388D20070C39A /* SwaggerClient_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 6003F595195388D20070C39A /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = ""; }; - 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = ""; }; - 6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = ""; }; - 6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = ""; }; - 6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = ""; }; - 6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = ""; }; - 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClient_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; - 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; - 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = ""; }; - 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; - B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; - B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; - B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildersTest.m; sourceTree = ""; }; - BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = ""; }; - E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.debug.xcconfig"; sourceTree = ""; }; - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = ""; }; - FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6003F587195388D20070C39A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, - 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, - 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, - 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AB195388D20070C39A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, - 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, - 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, - 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 6003F581195388D10070C39A = { - isa = PBXGroup; - children = ( - 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, - 6003F593195388D20070C39A /* Example for SwaggerClient */, - 6003F5B5195388D20070C39A /* Tests */, - 6003F58C195388D20070C39A /* Frameworks */, - 6003F58B195388D20070C39A /* Products */, - CCE77F10C6D41F74B075ECD0 /* Pods */, - ); - sourceTree = ""; - }; - 6003F58B195388D20070C39A /* Products */ = { - isa = PBXGroup; - children = ( - 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, - 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, - ); - name = Products; - sourceTree = ""; - }; - 6003F58C195388D20070C39A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 6003F58D195388D20070C39A /* Foundation.framework */, - 6003F58F195388D20070C39A /* CoreGraphics.framework */, - 6003F591195388D20070C39A /* UIKit.framework */, - 6003F5AF195388D20070C39A /* XCTest.framework */, - 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */, - FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6003F593195388D20070C39A /* Example for SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6003F59C195388D20070C39A /* SWGAppDelegate.h */, - 6003F59D195388D20070C39A /* SWGAppDelegate.m */, - 6003F5A5195388D20070C39A /* SWGViewController.h */, - 6003F5A6195388D20070C39A /* SWGViewController.m */, - 6003F594195388D20070C39A /* Supporting Files */, - ); - name = "Example for SwaggerClient"; - path = SwaggerClient; - sourceTree = ""; - }; - 6003F594195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F595195388D20070C39A /* SwaggerClient-Info.plist */, - 6003F596195388D20070C39A /* InfoPlist.strings */, - 6003F599195388D20070C39A /* main.m */, - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 6003F5B5195388D20070C39A /* Tests */ = { - isa = PBXGroup; - children = ( - 6003F5B6195388D20070C39A /* Supporting Files */, - B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */, - B2ADCA62DE4AC0F5BAB42208 /* Helpers */, - ); - path = Tests; - sourceTree = ""; - }; - 6003F5B6195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F5B7195388D20070C39A /* Tests-Info.plist */, - 6003F5B8195388D20070C39A /* InfoPlist.strings */, - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, - 4CCE21315897B7D544C83242 /* README.md */, - B2ADC7027D4B025ABCA7999F /* Main.storyboard */, - B2ADC65E342ADA697322D68C /* Images.xcassets */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; - B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { - isa = PBXGroup; - children = ( - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, - ); - path = Helpers; - sourceTree = ""; - }; - CCE77F10C6D41F74B075ECD0 /* Pods */ = { - isa = PBXGroup; - children = ( - E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */, - BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */, - 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */, - 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6003F589195388D20070C39A /* SwaggerClient_Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */; - buildPhases = ( - 841AD69C2F0A6609E3057F05 /* [CP] Check Pods Manifest.lock */, - 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */, - 6003F586195388D20070C39A /* Sources */, - 6003F587195388D20070C39A /* Frameworks */, - 6003F588195388D20070C39A /* Resources */, - 429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */, - FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */, - DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient_Example; - productName = SwaggerClient; - productReference = 6003F58A195388D20070C39A /* SwaggerClient_Example.app */; - productType = "com.apple.product-type.application"; - }; - 6003F5AD195388D20070C39A /* SwaggerClient_Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */; - buildPhases = ( - E0F523B17966072A199F040E /* [CP] Check Pods Manifest.lock */, - 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */, - 6003F5AA195388D20070C39A /* Sources */, - 6003F5AB195388D20070C39A /* Frameworks */, - 6003F5AC195388D20070C39A /* Resources */, - E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */, - AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */, - E994E0232EFD15F8EE665A4D /* Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 6003F5B4195388D20070C39A /* PBXTargetDependency */, - ); - name = SwaggerClient_Tests; - productName = SwaggerClientTests; - productReference = 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6003F582195388D10070C39A /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = SWG; - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = geekerzp; - }; - buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6003F581195388D10070C39A; - productRefGroup = 6003F58B195388D20070C39A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6003F589195388D20070C39A /* SwaggerClient_Example */, - 6003F5AD195388D20070C39A /* SwaggerClient_Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6003F588195388D20070C39A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AC195388D20070C39A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh", - "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld", - "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.momd", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.mom", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 841AD69C2F0A6609E3057F05 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Example-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - E0F523B17966072A199F040E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Tests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh", - "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld", - "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.momd", - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.mom", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - E994E0232EFD15F8EE665A4D /* Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "📦 Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6003F586195388D20070C39A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */, - 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */, - 6003F59A195388D20070C39A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AA195388D20070C39A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */, - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6003F589195388D20070C39A /* SwaggerClient_Example */; - targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6003F596195388D20070C39A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 6003F597195388D20070C39A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 6003F5B9195388D20070C39A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6003F5BD195388D20070C39A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6003F5BE195388D20070C39A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 7.1; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6003F5C0195388D20070C39A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; - INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 6003F5C1195388D20070C39A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; - INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - 6003F5C3195388D20070C39A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "Tests/Tests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xctest; - }; - name = Debug; - }; - 6003F5C4195388D20070C39A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; - INFOPLIST_FILE = "Tests/Tests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xctest; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6003F5BD195388D20070C39A /* Debug */, - 6003F5BE195388D20070C39A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6003F5C0195388D20070C39A /* Debug */, - 6003F5C1195388D20070C39A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6003F5C3195388D20070C39A /* Debug */, - 6003F5C4195388D20070C39A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6003F582195388D10070C39A /* Project object */; -} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 13bdd8ab8b75..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme deleted file mode 100644 index 24c1ef20c794..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme deleted file mode 100644 index 29c43710dffc..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index f697f61f4aaf..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 4458b40c0558..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "subtype" : "retina4", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard deleted file mode 100644 index 36df4e16819b..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard deleted file mode 100644 index f204320d3339..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h deleted file mode 100644 index eb867594fdee..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// SWGAppDelegate.h -// SwaggerClient -// -// Created by CocoaPods on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -@import UIKit; - -@interface SWGAppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m deleted file mode 100644 index 25ad44a411e3..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m +++ /dev/null @@ -1,19 +0,0 @@ -// -// SWGAppDelegate.m -// SwaggerClient -// -// Created by CocoaPods on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -#import "SWGAppDelegate.h" - -@implementation SWGAppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - return YES; -} - - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h deleted file mode 100644 index 7847f2d05b1d..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// SWGViewController.h -// SwaggerClient -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -@import UIKit; - -@interface SWGViewController : UIViewController - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m deleted file mode 100644 index d1ee531e2f05..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m +++ /dev/null @@ -1,60 +0,0 @@ -// -// SWGViewController.m -// SwaggerClient -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -#import "SWGViewController.h" -#import -#import -#import -#import - -@interface SWGViewController () - -@end - -@implementation SWGViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; - config.debug = YES; - - SWGPetApi *api = [[SWGPetApi alloc] init]; - NSURL *file = [NSURL fileURLWithPath:@"/Users/geekerzp/tmp/test.jpg"]; - [api uploadFileWithPetId:@2 additionalMetadata:@"2" file:file completionHandler:^(NSError *error) { - NSLog(@"*** error: %@", error); - }]; -} - -- (SWGPet*) createPet { - SWGPet * pet = [[SWGPet alloc] init]; - pet._id = @((long) [[NSDate date] timeIntervalSince1970]); - pet.name = @"monkey"; - - SWGCategory * category = [[SWGCategory alloc] init]; - category._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - category.name = @"super-happy"; - pet.category = category; - - SWGTag *tag1 = [[SWGTag alloc] init]; - tag1._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - tag1.name = @"test tag 1"; - SWGTag *tag2 = [[SWGTag alloc] init]; - tag2._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - tag2.name = @"test tag 2"; - pet.tags = (NSArray *) @[tag1, tag2]; - - pet.status = @"available"; - - NSArray * photos = @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]; - pet.photoUrls = photos; - return pet; -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist deleted file mode 100644 index 0c641d12c147..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist +++ /dev/null @@ -1,54 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - UILaunchStoryboardName - Launch Screen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch deleted file mode 100644 index 7825372cbdda..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch +++ /dev/null @@ -1,16 +0,0 @@ -// -// Prefix header -// -// The contents of this file are implicitly included at the beginning of every source file. -// - -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - @import UIKit; - @import Foundation; -#endif diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f86..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m deleted file mode 100644 index 4a47f1fd69e4..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// SwaggerClient -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -@import UIKit; -#import "SWGAppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWGAppDelegate class])); - } -} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m deleted file mode 100644 index c822d59d7996..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m +++ /dev/null @@ -1,117 +0,0 @@ -// -// BuildersTest.m -// SwaggerClient -// -// Created by mmackowiak on 16.05.2016. -// Copyright (c) 2016 geekerzp. All rights reserved. -// - -#import -#import -#import "SWGPetManagedObject.h" -#import "SWGPetManagedObjectBuilder.h" -#import "DatabaseHelper.h" -#import "SWGUserManagedObject.h" -#import "SWGUserManagedObjectBuilder.h" -#import "SWGOrderManagedObjectBuilder.h" - -@interface BuildersTest : XCTestCase { - SWGPet *pet; - SWGUser* user; - SWGOrder *order; - NSManagedObjectContext *context; -} - -@end - -@implementation BuildersTest - -- (void)setUp { - [super setUp]; - - NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", - @"status": @"sold", - @"photoUrls": @[@"string"], - @"category": @{ @"id": @1, @"name": @"test category" }, - @"tags": @[ @{ @"id": @1, @"name": @"test tag" }], - }; - NSError * error; - pet = [[SWGPet alloc] initWithDictionary:petDict error:&error]; - XCTAssertNil(error); - - NSDictionary *userDict = @{ - @"id": @1, - @"email": @"test@test.com", - @"firstName": @"firstName", - @"lastName": @"lastName", - @"password": @"password", - @"username": @"username", - @"phone": @"57676767", - }; - error = nil; - user = [[SWGUser alloc] initWithDictionary:userDict error:&error]; - XCTAssertNil(error); - - NSDictionary *orderDict = @{ - @"id": @324, - @"petId": @234, - @"quantity": @12, - @"shipDate": @"1997-07-16T19:20:30+00:00", - @"status": @"status", - @"complete": @1, - }; - error = nil; - order = [[SWGOrder alloc] initWithDictionary:orderDict error:&error]; - XCTAssertNil(error); - - context = [DatabaseHelper createContextWithModelName:@"SWGModel"]; - - -} - -- (void)testSWGPetExample { - SWGPetManagedObjectBuilder* builder = [[SWGPetManagedObjectBuilder alloc] init]; - - SWGPetManagedObject * managedObject = [builder SWGPetManagedObjectFromSWGPet:pet context:context]; - SWGPet *pet2 = [builder SWGPetFromSWGPetManagedObject:managedObject]; - NSError * error; - XCTAssertTrue([context save:&error]); - XCTAssertNil(error); - [context deleteObject:managedObject]; - XCTAssertTrue([context save:&error]); - XCTAssertNil(error); - XCTAssertEqualObjects(pet.description,pet2.description); - -} - - -- (void)testSWGUserExample { - SWGUserManagedObjectBuilder * builder = [[SWGUserManagedObjectBuilder alloc] init]; - SWGUserManagedObject * managedObject = [builder SWGUserManagedObjectFromSWGUser:user context:context]; - SWGUser *user2 = [builder SWGUserFromSWGUserManagedObject:managedObject]; - NSError * error; - XCTAssertTrue([context save:&error]); - XCTAssertNil(error); - [context deleteObject:managedObject]; - XCTAssertTrue([context save:&error]); - XCTAssertNil(error); - XCTAssertEqualObjects(user.description,user2.description); - -} - -- (void)testSWGOrderExample { - SWGOrderManagedObjectBuilder * builder = [[SWGOrderManagedObjectBuilder alloc] init]; - SWGOrderManagedObject * managedObject = [builder SWGOrderManagedObjectFromSWGOrder:order context:context]; - SWGOrder *order2 = [builder SWGOrderFromSWGOrderManagedObject:managedObject]; - NSError * error; - XCTAssertTrue([context save:&error]); - XCTAssertNil(error); - [context deleteObject:managedObject]; - XCTAssertTrue([context save:&error]); - XCTAssertNil(error); - - XCTAssertEqualObjects(order.description,order2.description); - -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h deleted file mode 100644 index 8216e012a32a..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h +++ /dev/null @@ -1,14 +0,0 @@ -#import -#import - -@interface DatabaseHelper : NSObject - -+ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName; - -+ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName; - -+ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName; - -+ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model; - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m deleted file mode 100644 index 3433ac19ddbf..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m +++ /dev/null @@ -1,42 +0,0 @@ -#import "DatabaseHelper.h" - -@implementation DatabaseHelper - - -+ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName { - NSManagedObjectModel *model = [self createModelWithModelName:mName]; - return [self createDatabaseWithModel:model]; -} - -+ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model { - NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; - [coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil]; - - NSManagedObjectContext *testingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; - [testingContext setPersistentStoreCoordinator:coordinator]; - [testingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy]; - return testingContext; -} - -+ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *path = [bundle pathForResource:mName ofType:@"momd"]; - NSAssert(path, @"Missing Model for name: %@",mName); - NSURL *modURL = [NSURL fileURLWithPath:path]; - return [[NSManagedObjectModel alloc] initWithContentsOfURL:modURL]; -} - -+ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName { - NSFetchRequest *fetch = [[NSFetchRequest alloc] init]; - [fetch setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:ctx]]; - NSError *error = nil; - NSArray *result = [ctx executeFetchRequest:fetch error:&error]; - if (error) { - NSLog(@"Failed clearing context from entities with name [%@]", error); - } - for (id basket in result) { - [ctx deleteObject:basket]; - } -} - -@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist deleted file mode 100644 index 169b6f710ecc..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch deleted file mode 100644 index 6d08c288215a..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// The contents of this file are implicitly included at the beginning of every test case source file. - -#ifdef __OBJC__ - - //@import Specta; - //@import Expecta; - -#endif diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f86..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml b/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml deleted file mode 100644 index d5cbe4b51d0d..000000000000 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - ObjcCoreDataPetstoreClientTests - pom - 1.0-SNAPSHOT - Objective-C Core Data Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh old mode 100755 new mode 100644 index 5f88b8fcd74c..c63c525fc247 --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]} +(cd $DIRECTORY/tests ; xcodebuild -scheme TestClientTests-Package test -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}) diff --git a/samples/client/petstore/objc/core-data/docs/SWGCategory.md b/samples/client/petstore/objc/core-data/docs/SWGCategory.md deleted file mode 100644 index 93a8d14ecb98..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGCategory.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGCategory - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**name** | **NSString*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGInlineObject.md b/samples/client/petstore/objc/core-data/docs/SWGInlineObject.md deleted file mode 100644 index 1d66818927f4..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGInlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGInlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **NSString*** | Updated name of the pet | [optional] -**status** | **NSString*** | Updated status of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md b/samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md deleted file mode 100644 index c59e84858851..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGInlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional] -**file** | **NSURL*** | file to upload | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGOrder.md b/samples/client/petstore/objc/core-data/docs/SWGOrder.md deleted file mode 100644 index b2a9f25eae95..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGOrder.md +++ /dev/null @@ -1,15 +0,0 @@ -# SWGOrder - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**petId** | **NSNumber*** | | [optional] -**quantity** | **NSNumber*** | | [optional] -**shipDate** | **NSDate*** | | [optional] -**status** | **NSString*** | Order Status | [optional] -**complete** | **NSNumber*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGPet.md b/samples/client/petstore/objc/core-data/docs/SWGPet.md deleted file mode 100644 index c8298c66bf14..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGPet.md +++ /dev/null @@ -1,15 +0,0 @@ -# SWGPet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**category** | [**SWGCategory***](SWGCategory.md) | | [optional] -**name** | **NSString*** | | -**photoUrls** | **NSArray<NSString*>*** | | -**tags** | [**NSArray<SWGTag>***](SWGTag.md) | | [optional] -**status** | **NSString*** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGPetApi.md b/samples/client/petstore/objc/core-data/docs/SWGPetApi.md deleted file mode 100644 index 47b1b14d8d26..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGPetApi.md +++ /dev/null @@ -1,466 +0,0 @@ -# SWGPetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image - - -# **addPet** -```objc --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; -``` - -Add a new pet to the store - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Add a new pet to the store -[apiInstance addPetWithPet:pet - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->addPet: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```objc --(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId - apiKey: (NSString*) apiKey - completionHandler: (void (^)(NSError* error)) handler; -``` - -Deletes a pet - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSNumber* petId = @56; // Pet id to delete -NSString* apiKey = @"apiKey_example"; // (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Deletes a pet -[apiInstance deletePetWithPetId:petId - apiKey:apiKey - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->deletePet: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| Pet id to delete | - **apiKey** | **NSString***| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```objc --(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSArray* status = @[@"status_example"]; // Status values that need to be considered for filter (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Finds Pets by status -[apiInstance findPetsByStatusWithStatus:status - completionHandler: ^(NSArray* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGPetApi->findPetsByStatus: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | [optional] - -### Return type - -[**NSArray***](SWGPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```objc --(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSArray* tags = @[@"tags_example"]; // Tags to filter by (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Finds Pets by tags -[apiInstance findPetsByTagsWithTags:tags - completionHandler: ^(NSArray* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGPetApi->findPetsByTags: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | [optional] - -### Return type - -[**NSArray***](SWGPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```objc --(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; -``` - -Find pet by ID - -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - -// Configure API key authorization: (authentication scheme: api_key) -[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; - - -NSNumber* petId = @56; // ID of pet that needs to be fetched - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Find pet by ID -[apiInstance getPetByIdWithPetId:petId - completionHandler: ^(SWGPet* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGPetApi->getPetById: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| ID of pet that needs to be fetched | - -### Return type - -[**SWGPet***](SWGPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```objc --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; -``` - -Update an existing pet - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Update an existing pet -[apiInstance updatePetWithPet:pet - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->updatePet: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```objc --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId - name: (NSString*) name - status: (NSString*) status - completionHandler: (void (^)(NSError* error)) handler; -``` - -Updates a pet in the store with form data - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSString* petId = @"petId_example"; // ID of pet that needs to be updated -NSString* name = @"name_example"; // Updated name of the pet (optional) -NSString* status = @"status_example"; // Updated status of the pet (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Updates a pet in the store with form data -[apiInstance updatePetWithFormWithPetId:petId - name:name - status:status - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->updatePetWithForm: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSString***| ID of pet that needs to be updated | - **name** | **NSString***| Updated name of the pet | [optional] - **status** | **NSString***| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```objc --(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId - additionalMetadata: (NSString*) additionalMetadata - file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; -``` - -uploads an image - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSNumber* petId = @56; // ID of pet to update -NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional) -NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file to upload (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// uploads an image -[apiInstance uploadFileWithPetId:petId - additionalMetadata:additionalMetadata - file:file - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->uploadFile: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| ID of pet to update | - **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] - **file** | **NSURL*****NSURL***| file to upload | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md b/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md deleted file mode 100644 index 3c13b68eaff6..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md +++ /dev/null @@ -1,212 +0,0 @@ -# SWGStoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```objc --(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId - completionHandler: (void (^)(NSError* error)) handler; -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```objc - -NSString* orderId = @"orderId_example"; // ID of the order that needs to be deleted - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Delete purchase order by ID -[apiInstance deleteOrderWithOrderId:orderId - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGStoreApi->deleteOrder: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **NSString***| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```objc --(NSURLSessionTask*) getInventoryWithCompletionHandler: - (void (^)(NSDictionary* output, NSError* error)) handler; -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure API key authorization: (authentication scheme: api_key) -[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; - - - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Returns pet inventories by status -[apiInstance getInventoryWithCompletionHandler: - ^(NSDictionary* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGStoreApi->getInventory: %@", error); - } - }]; -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**NSDictionary*** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```objc --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```objc - -NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Find purchase order by ID -[apiInstance getOrderByIdWithOrderId:orderId - completionHandler: ^(SWGOrder* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGStoreApi->getOrderById: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **NSString***| ID of pet that needs to be fetched | - -### Return type - -[**SWGOrder***](SWGOrder.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```objc --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; -``` - -Place an order for a pet - - - -### Example -```objc - -SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Place an order for a pet -[apiInstance placeOrderWithOrder:order - completionHandler: ^(SWGOrder* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGStoreApi->placeOrder: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] - -### Return type - -[**SWGOrder***](SWGOrder.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/objc/core-data/docs/SWGTag.md b/samples/client/petstore/objc/core-data/docs/SWGTag.md deleted file mode 100644 index 5495d5c8a99f..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGTag.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGTag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**name** | **NSString*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGUser.md b/samples/client/petstore/objc/core-data/docs/SWGUser.md deleted file mode 100644 index 35bf5540cad0..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGUser.md +++ /dev/null @@ -1,17 +0,0 @@ -# SWGUser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**username** | **NSString*** | | [optional] -**firstName** | **NSString*** | | [optional] -**lastName** | **NSString*** | | [optional] -**email** | **NSString*** | | [optional] -**password** | **NSString*** | | [optional] -**phone** | **NSString*** | | [optional] -**userStatus** | **NSNumber*** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/core-data/docs/SWGUserApi.md b/samples/client/petstore/objc/core-data/docs/SWGUserApi.md deleted file mode 100644 index 51792caed6bd..000000000000 --- a/samples/client/petstore/objc/core-data/docs/SWGUserApi.md +++ /dev/null @@ -1,402 +0,0 @@ -# SWGUserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](SWGUserApi.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```objc --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Create user - -This can only be done by the logged in user. - -### Example -```objc - -SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Create user -[apiInstance createUserWithUser:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->createUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```objc --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Creates list of users with given input array - - - -### Example -```objc - -NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Creates list of users with given input array -[apiInstance createUsersWithArrayInputWithUser:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```objc --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Creates list of users with given input array - - - -### Example -```objc - -NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Creates list of users with given input array -[apiInstance createUsersWithListInputWithUser:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```objc --(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username - completionHandler: (void (^)(NSError* error)) handler; -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```objc - -NSString* username = @"username_example"; // The name that needs to be deleted - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Delete user -[apiInstance deleteUserWithUsername:username - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->deleteUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```objc --(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username - completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; -``` - -Get user by user name - - - -### Example -```objc - -NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Get user by user name -[apiInstance getUserByNameWithUsername:username - completionHandler: ^(SWGUser* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGUserApi->getUserByName: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**SWGUser***](SWGUser.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```objc --(NSURLSessionTask*) loginUserWithUsername: (NSString*) username - password: (NSString*) password - completionHandler: (void (^)(NSString* output, NSError* error)) handler; -``` - -Logs user into the system - - - -### Example -```objc - -NSString* username = @"username_example"; // The user name for login (optional) -NSString* password = @"password_example"; // The password for login in clear text (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Logs user into the system -[apiInstance loginUserWithUsername:username - password:password - completionHandler: ^(NSString* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGUserApi->loginUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The user name for login | [optional] - **password** | **NSString***| The password for login in clear text | [optional] - -### Return type - -**NSString*** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```objc --(NSURLSessionTask*) logoutUserWithCompletionHandler: - (void (^)(NSError* error)) handler; -``` - -Logs out current logged in user session - - - -### Example -```objc - - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Logs out current logged in user session -[apiInstance logoutUserWithCompletionHandler: - ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->logoutUser: %@", error); - } - }]; -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```objc --(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```objc - -NSString* username = @"username_example"; // name that need to be deleted -SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Updated user -[apiInstance updateUserWithUsername:username - user:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->updateUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| name that need to be deleted | - **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/objc/core-data/git_push.sh b/samples/client/petstore/objc/core-data/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/objc/core-data/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/objc/default/.gitignore b/samples/client/petstore/objc/default/.gitignore deleted file mode 100644 index 01103f6f5ef6..000000000000 --- a/samples/client/petstore/objc/default/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# Xcode -# -# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore - -## Build generated -build/ -DerivedData - -## Various settings -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata - -## Other -*.xccheckout -*.moved-aside -*.xcuserstate -*.xcscmblueprint - -## Obj-C/Swift specific -*.hmap -*.ipa - -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control -# -# Pods/ - -# Carthage -# -# Add this line if you want to avoid checking in source code from Carthage dependencies. -# Carthage/Checkouts - -Carthage/Build - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md - -fastlane/report.xml -fastlane/screenshots diff --git a/samples/client/petstore/objc/default/.openapi-generator-ignore b/samples/client/petstore/objc/default/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/objc/default/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/objc/default/.openapi-generator/FILES b/samples/client/petstore/objc/default/.openapi-generator/FILES deleted file mode 100644 index 02311083874d..000000000000 --- a/samples/client/petstore/objc/default/.openapi-generator/FILES +++ /dev/null @@ -1,50 +0,0 @@ -.gitignore -README.md -SwaggerClient.podspec -SwaggerClient/Api/SWGPetApi.h -SwaggerClient/Api/SWGPetApi.m -SwaggerClient/Api/SWGStoreApi.h -SwaggerClient/Api/SWGStoreApi.m -SwaggerClient/Api/SWGUserApi.h -SwaggerClient/Api/SWGUserApi.m -SwaggerClient/Core/JSONValueTransformer+ISO8601.h -SwaggerClient/Core/JSONValueTransformer+ISO8601.m -SwaggerClient/Core/SWGApi.h -SwaggerClient/Core/SWGApiClient.h -SwaggerClient/Core/SWGApiClient.m -SwaggerClient/Core/SWGBasicAuthTokenProvider.h -SwaggerClient/Core/SWGBasicAuthTokenProvider.m -SwaggerClient/Core/SWGConfiguration.h -SwaggerClient/Core/SWGDefaultConfiguration.h -SwaggerClient/Core/SWGDefaultConfiguration.m -SwaggerClient/Core/SWGJSONRequestSerializer.h -SwaggerClient/Core/SWGJSONRequestSerializer.m -SwaggerClient/Core/SWGLogger.h -SwaggerClient/Core/SWGLogger.m -SwaggerClient/Core/SWGObject.h -SwaggerClient/Core/SWGObject.m -SwaggerClient/Core/SWGQueryParamCollection.h -SwaggerClient/Core/SWGQueryParamCollection.m -SwaggerClient/Core/SWGResponseDeserializer.h -SwaggerClient/Core/SWGResponseDeserializer.m -SwaggerClient/Core/SWGSanitizer.h -SwaggerClient/Core/SWGSanitizer.m -SwaggerClient/Model/SWGCategory.h -SwaggerClient/Model/SWGCategory.m -SwaggerClient/Model/SWGOrder.h -SwaggerClient/Model/SWGOrder.m -SwaggerClient/Model/SWGPet.h -SwaggerClient/Model/SWGPet.m -SwaggerClient/Model/SWGTag.h -SwaggerClient/Model/SWGTag.m -SwaggerClient/Model/SWGUser.h -SwaggerClient/Model/SWGUser.m -docs/SWGCategory.md -docs/SWGOrder.md -docs/SWGPet.md -docs/SWGPetApi.md -docs/SWGStoreApi.md -docs/SWGTag.md -docs/SWGUser.md -docs/SWGUserApi.md -git_push.sh diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION deleted file mode 100644 index 909dcd0eca63..000000000000 --- a/samples/client/petstore/objc/default/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -7.19.0-SNAPSHOT diff --git a/samples/client/petstore/objc/default/OpenAPIClient.podspec b/samples/client/petstore/objc/default/OpenAPIClient.podspec deleted file mode 100644 index 36156fa1484d..000000000000 --- a/samples/client/petstore/objc/default/OpenAPIClient.podspec +++ /dev/null @@ -1,37 +0,0 @@ -# -# Be sure to run `pod lib lint OpenAPIClient.podspec' to ensure this is a -# valid spec and remove all comments before submitting the spec. -# -# Any lines starting with a # are optional, but encouraged -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -Pod::Spec.new do |s| - s.name = "OpenAPIClient" - s.version = "1.0.0" - - s.summary = "OpenAPI Petstore" - s.description = <<-DESC - This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters - DESC - - s.platform = :ios, '7.0' - s.requires_arc = true - - s.framework = 'SystemConfiguration' - - s.homepage = "https://github.com/openapitools/openapi-generator" - s.license = "Proprietary" - s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } - s.author = { "OpenAPI" => "team@openapitools.org" } - - s.source_files = 'OpenAPIClient/**/*.{m,h}' - s.public_header_files = 'OpenAPIClient/**/*.h' - - - s.dependency 'AFNetworking', '~> 3' - s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.6' -end - diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md deleted file mode 100644 index 1c81b8151b46..000000000000 --- a/samples/client/petstore/objc/default/README.md +++ /dev/null @@ -1,147 +0,0 @@ -# SwaggerClient - -This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters - -This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - -- API version: 1.0.0 -- Package version: -- Generator version: 7.19.0-SNAPSHOT -- Build package: org.openapitools.codegen.languages.ObjcClientCodegen - -## Requirements - -The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project. - -## Installation & Usage -### Install from Github using [CocoaPods](https://cocoapods.org/) - -Add the following to the Podfile: - -```ruby -pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' -``` - -To specify a particular branch, append `, :branch => 'branch-name-here'` - -To specify a particular commit, append `, :commit => '11aa22'` - -### Install from local path using [CocoaPods](https://cocoapods.org/) - -Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: - -```ruby -pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' -``` - -### Usage - -Import the following: - -```objc -#import -#import -// load models -#import -#import -#import -#import -#import -// load API classes for accessing endpoints -#import -#import -#import - -``` - -## Recommendation - -It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. - -## Getting Started - -Please follow the [installation procedure](#installation--usage) and then run the following: - -```objc - -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) - -SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; - -// Add a new pet to the store -[apiInstance addPetWithPet:pet - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error: %@", error); - } - }]; - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image -*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet -*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user -*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -## Documentation For Models - - - [SWGCategory](docs/SWGCategory.md) - - [SWGOrder](docs/SWGOrder.md) - - [SWGPet](docs/SWGPet.md) - - [SWGTag](docs/SWGTag.md) - - [SWGUser](docs/SWGUser.md) - - -## Documentation For Authorization - - -Authentication schemes defined for the API: -### api_key - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: HTTP header - -### petstore_auth - -- **Type**: OAuth -- **Flow**: implicit -- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog -- **Scopes**: - - **write:pets**: modify pets in your account - - **read:pets**: read your pets - - -## Author - - - diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec deleted file mode 100644 index c58a3f751b16..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient.podspec +++ /dev/null @@ -1,36 +0,0 @@ -# -# Be sure to run `pod lib lint SwaggerClient.podspec' to ensure this is a -# valid spec and remove all comments before submitting the spec. -# -# Any lines starting with a # are optional, but encouraged -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# - -Pod::Spec.new do |s| - s.name = "SwaggerClient" - s.version = "1.0.0" - - s.summary = "OpenAPI Petstore" - s.description = <<-DESC - This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters - DESC - - s.platform = :ios, '7.0' - s.requires_arc = true - - s.framework = 'SystemConfiguration' - - s.homepage = "https://github.com/openapitools/openapi-generator" - s.license = "Proprietary" - s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } - s.author = { "OpenAPI" => "team@openapitools.org" } - - s.source_files = 'SwaggerClient/**/*.{m,h}' - s.public_header_files = 'SwaggerClient/**/*.h' - - - s.dependency 'AFNetworking', '~> 3' - s.dependency 'JSONModel', '~> 1.2' - s.dependency 'ISO8601', '~> 0.6' -end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h deleted file mode 100644 index 1b1309c48761..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h +++ /dev/null @@ -1,139 +0,0 @@ -#import -#import "SWGPet.h" -#import "SWGApi.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - -@interface SWGPetApi: NSObject - -extern NSString* kSWGPetApiErrorDomain; -extern NSInteger kSWGPetApiMissingParamErrorCode; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; - -/// Add a new pet to the store -/// -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// code:405 message:"Invalid input" -/// -/// @return void --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; - - -/// Deletes a pet -/// -/// -/// @param petId Pet id to delete -/// @param apiKey (optional) -/// -/// code:400 message:"Invalid pet value" -/// -/// @return void --(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId - apiKey: (NSString*) apiKey - completionHandler: (void (^)(NSError* error)) handler; - - -/// Finds Pets by status -/// Multiple status values can be provided with comma separated strings -/// -/// @param status Status values that need to be considered for filter (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid status value" -/// -/// @return NSArray* --(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - - -/// Finds Pets by tags -/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// -/// @param tags Tags to filter by (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid tag value" -/// -/// @return NSArray* --(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; - - -/// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// -/// @param petId ID of pet that needs to be fetched -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Pet not found" -/// -/// @return SWGPet* --(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; - - -/// Update an existing pet -/// -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Pet not found", -/// code:405 message:"Validation exception" -/// -/// @return void --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; - - -/// Updates a pet in the store with form data -/// -/// -/// @param petId ID of pet that needs to be updated -/// @param name Updated name of the pet (optional) -/// @param status Updated status of the pet (optional) -/// -/// code:405 message:"Invalid input" -/// -/// @return void --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId - name: (NSString*) name - status: (NSString*) status - completionHandler: (void (^)(NSError* error)) handler; - - -/// uploads an image -/// -/// -/// @param petId ID of pet to update -/// @param additionalMetadata Additional data to pass to server (optional) -/// @param file file to upload (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId - additionalMetadata: (NSString*) additionalMetadata - file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m deleted file mode 100644 index 9a774f3d9b7f..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m +++ /dev/null @@ -1,578 +0,0 @@ -#import "SWGPetApi.h" -#import "SWGQueryParamCollection.h" -#import "SWGApiClient.h" -#import "SWGPet.h" - - -@interface SWGPetApi () - -@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; - -@end - -@implementation SWGPetApi - -NSString* kSWGPetApiErrorDomain = @"SWGPetApiErrorDomain"; -NSInteger kSWGPetApiMissingParamErrorCode = 234513; - -@synthesize apiClient = _apiClient; - -#pragma mark - Initialize methods - -- (instancetype) init { - return [self initWithApiClient:[SWGApiClient sharedClient]]; -} - - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient { - self = [super init]; - if (self) { - _apiClient = apiClient; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - } - return self; -} - -#pragma mark - - --(NSString*) defaultHeaderForKey:(NSString*)key { - return self.mutableDefaultHeaders[key]; -} - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.mutableDefaultHeaders setValue:value forKey:key]; -} - --(NSDictionary *)defaultHeaders { - return self.mutableDefaultHeaders; -} - -#pragma mark - Api Methods - -/// -/// Add a new pet to the store -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Deletes a pet -/// -/// @param petId Pet id to delete -/// -/// @param apiKey (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId - apiKey: (NSString*) apiKey - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - if (apiKey != nil) { - headerParams[@"api_key"] = apiKey; - } - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"DELETE" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Finds Pets by status -/// Multiple status values can be provided with comma separated strings -/// @param status Status values that need to be considered for filter (optional) -/// -/// @returns NSArray* -/// --(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (status != nil) { - queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSArray*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSArray*)data, error); - } - }]; -} - -/// -/// Finds Pets by tags -/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. -/// @param tags Tags to filter by (optional) -/// -/// @returns NSArray* -/// --(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags - completionHandler: (void (^)(NSArray* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (tags != nil) { - queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSArray*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSArray*)data, error); - } - }]; -} - -/// -/// Find pet by ID -/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions -/// @param petId ID of pet that needs to be fetched -/// -/// @returns SWGPet* -/// --(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(nil, error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth", @"api_key"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGPet*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGPet*)data, error); - } - }]; -} - -/// -/// Update an existing pet -/// -/// @param pet Pet object that needs to be added to the store (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = pet; - - return [self.apiClient requestWithPath: resourcePath - method: @"PUT" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Updates a pet in the store with form data -/// -/// @param petId ID of pet that needs to be updated -/// -/// @param name Updated name of the pet (optional) -/// -/// @param status Updated status of the pet (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId - name: (NSString*) name - status: (NSString*) status - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - if (name) { - formParams[@"name"] = name; - } - if (status) { - formParams[@"status"] = status; - } - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// uploads an image -/// -/// @param petId ID of pet to update -/// -/// @param additionalMetadata Additional data to pass to server (optional) -/// -/// @param file file to upload (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId - additionalMetadata: (NSString*) additionalMetadata - file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'petId' is set - if (petId == nil) { - NSParameterAssert(petId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; - NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (petId != nil) { - pathParams[@"petId"] = petId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"multipart/form-data"]]; - - // Authentication setting - NSArray *authSettings = @[@"petstore_auth"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - if (additionalMetadata) { - formParams[@"additionalMetadata"] = additionalMetadata; - } - localVarFiles[@"file"] = file; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h deleted file mode 100644 index 935845f72151..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h +++ /dev/null @@ -1,78 +0,0 @@ -#import -#import "SWGOrder.h" -#import "SWGApi.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - -@interface SWGStoreApi: NSObject - -extern NSString* kSWGStoreApiErrorDomain; -extern NSInteger kSWGStoreApiMissingParamErrorCode; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; - -/// Delete purchase order by ID -/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -/// -/// @param orderId ID of the order that needs to be deleted -/// -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Order not found" -/// -/// @return void --(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId - completionHandler: (void (^)(NSError* error)) handler; - - -/// Returns pet inventories by status -/// Returns a map of status codes to quantities -/// -/// -/// code:200 message:"successful operation" -/// -/// @return NSDictionary* --(NSURLSessionTask*) getInventoryWithCompletionHandler: - (void (^)(NSDictionary* output, NSError* error)) handler; - - -/// Find purchase order by ID -/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -/// -/// @param orderId ID of pet that needs to be fetched -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid ID supplied", -/// code:404 message:"Order not found" -/// -/// @return SWGOrder* --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - - -/// Place an order for a pet -/// -/// -/// @param order order placed for purchasing the pet (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid Order" -/// -/// @return SWGOrder* --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m deleted file mode 100644 index 14a5c4239217..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m +++ /dev/null @@ -1,297 +0,0 @@ -#import "SWGStoreApi.h" -#import "SWGQueryParamCollection.h" -#import "SWGApiClient.h" -#import "SWGOrder.h" - - -@interface SWGStoreApi () - -@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; - -@end - -@implementation SWGStoreApi - -NSString* kSWGStoreApiErrorDomain = @"SWGStoreApiErrorDomain"; -NSInteger kSWGStoreApiMissingParamErrorCode = 234513; - -@synthesize apiClient = _apiClient; - -#pragma mark - Initialize methods - -- (instancetype) init { - return [self initWithApiClient:[SWGApiClient sharedClient]]; -} - - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient { - self = [super init]; - if (self) { - _apiClient = apiClient; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - } - return self; -} - -#pragma mark - - --(NSString*) defaultHeaderForKey:(NSString*)key { - return self.mutableDefaultHeaders[key]; -} - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.mutableDefaultHeaders setValue:value forKey:key]; -} - --(NSDictionary *)defaultHeaders { - return self.mutableDefaultHeaders; -} - -#pragma mark - Api Methods - -/// -/// Delete purchase order by ID -/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors -/// @param orderId ID of the order that needs to be deleted -/// -/// @returns void -/// --(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'orderId' is set - if (orderId == nil) { - NSParameterAssert(orderId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; - NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (orderId != nil) { - pathParams[@"orderId"] = orderId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"DELETE" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Returns pet inventories by status -/// Returns a map of status codes to quantities -/// @returns NSDictionary* -/// --(NSURLSessionTask*) getInventoryWithCompletionHandler: - (void (^)(NSDictionary* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[@"api_key"]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSDictionary*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSDictionary*)data, error); - } - }]; -} - -/// -/// Find purchase order by ID -/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions -/// @param orderId ID of pet that needs to be fetched -/// -/// @returns SWGOrder* -/// --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { - // verify the required parameter 'orderId' is set - if (orderId == nil) { - NSParameterAssert(orderId); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; - NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; - handler(nil, error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (orderId != nil) { - pathParams[@"orderId"] = orderId; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGOrder*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGOrder*)data, error); - } - }]; -} - -/// -/// Place an order for a pet -/// -/// @param order order placed for purchasing the pet (optional) -/// -/// @returns SWGOrder* -/// --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = order; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGOrder*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGOrder*)data, error); - } - }]; -} - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h deleted file mode 100644 index 98a3a1756d5d..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h +++ /dev/null @@ -1,131 +0,0 @@ -#import -#import "SWGUser.h" -#import "SWGApi.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - -@interface SWGUserApi: NSObject - -extern NSString* kSWGUserApiErrorDomain; -extern NSInteger kSWGUserApiMissingParamErrorCode; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; - -/// Create user -/// This can only be done by the logged in user. -/// -/// @param user Created user object (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; - - -/// Creates list of users with given input array -/// -/// -/// @param user List of user object (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; - - -/// Creates list of users with given input array -/// -/// -/// @param user List of user object (optional) -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; - - -/// Delete user -/// This can only be done by the logged in user. -/// -/// @param username The name that needs to be deleted -/// -/// code:400 message:"Invalid username supplied", -/// code:404 message:"User not found" -/// -/// @return void --(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username - completionHandler: (void (^)(NSError* error)) handler; - - -/// Get user by user name -/// -/// -/// @param username The name that needs to be fetched. Use user1 for testing. -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid username supplied", -/// code:404 message:"User not found" -/// -/// @return SWGUser* --(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username - completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; - - -/// Logs user into the system -/// -/// -/// @param username The user name for login (optional) -/// @param password The password for login in clear text (optional) -/// -/// code:200 message:"successful operation", -/// code:400 message:"Invalid username/password supplied" -/// -/// @return NSString* --(NSURLSessionTask*) loginUserWithUsername: (NSString*) username - password: (NSString*) password - completionHandler: (void (^)(NSString* output, NSError* error)) handler; - - -/// Logs out current logged in user session -/// -/// -/// -/// code:0 message:"successful operation" -/// -/// @return void --(NSURLSessionTask*) logoutUserWithCompletionHandler: - (void (^)(NSError* error)) handler; - - -/// Updated user -/// This can only be done by the logged in user. -/// -/// @param username name that need to be deleted -/// @param user Updated user object (optional) -/// -/// code:400 message:"Invalid user supplied", -/// code:404 message:"User not found" -/// -/// @return void --(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m deleted file mode 100644 index 94651c70282f..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m +++ /dev/null @@ -1,542 +0,0 @@ -#import "SWGUserApi.h" -#import "SWGQueryParamCollection.h" -#import "SWGApiClient.h" -#import "SWGUser.h" - - -@interface SWGUserApi () - -@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; - -@end - -@implementation SWGUserApi - -NSString* kSWGUserApiErrorDomain = @"SWGUserApiErrorDomain"; -NSInteger kSWGUserApiMissingParamErrorCode = 234513; - -@synthesize apiClient = _apiClient; - -#pragma mark - Initialize methods - -- (instancetype) init { - return [self initWithApiClient:[SWGApiClient sharedClient]]; -} - - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient { - self = [super init]; - if (self) { - _apiClient = apiClient; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - } - return self; -} - -#pragma mark - - --(NSString*) defaultHeaderForKey:(NSString*)key { - return self.mutableDefaultHeaders[key]; -} - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { - [self.mutableDefaultHeaders setValue:value forKey:key]; -} - --(NSDictionary *)defaultHeaders { - return self.mutableDefaultHeaders; -} - -#pragma mark - Api Methods - -/// -/// Create user -/// This can only be done by the logged in user. -/// @param user Created user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Creates list of users with given input array -/// -/// @param user List of user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Creates list of users with given input array -/// -/// @param user List of user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"POST" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Delete user -/// This can only be done by the logged in user. -/// @param username The name that needs to be deleted -/// -/// @returns void -/// --(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'username' is set - if (username == nil) { - NSParameterAssert(username); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; - NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - pathParams[@"username"] = username; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"DELETE" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Get user by user name -/// -/// @param username The name that needs to be fetched. Use user1 for testing. -/// -/// @returns SWGUser* -/// --(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username - completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { - // verify the required parameter 'username' is set - if (username == nil) { - NSParameterAssert(username); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; - NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; - handler(nil, error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - pathParams[@"username"] = username; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"SWGUser*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((SWGUser*)data, error); - } - }]; -} - -/// -/// Logs user into the system -/// -/// @param username The user name for login (optional) -/// -/// @param password The password for login in clear text (optional) -/// -/// @returns NSString* -/// --(NSURLSessionTask*) loginUserWithUsername: (NSString*) username - password: (NSString*) password - completionHandler: (void (^)(NSString* output, NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - queryParams[@"username"] = username; - } - if (password != nil) { - queryParams[@"password"] = password; - } - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: @"NSString*" - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler((NSString*)data, error); - } - }]; -} - -/// -/// Logs out current logged in user session -/// -/// @returns void -/// --(NSURLSessionTask*) logoutUserWithCompletionHandler: - (void (^)(NSError* error)) handler { - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - - return [self.apiClient requestWithPath: resourcePath - method: @"GET" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - -/// -/// Updated user -/// This can only be done by the logged in user. -/// @param username name that need to be deleted -/// -/// @param user Updated user object (optional) -/// -/// @returns void -/// --(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler { - // verify the required parameter 'username' is set - if (username == nil) { - NSParameterAssert(username); - if(handler) { - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; - NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; - handler(error); - } - return nil; - } - - NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; - - NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; - if (username != nil) { - pathParams[@"username"] = username; - } - - NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; - [headerParams addEntriesFromDictionary:self.defaultHeaders]; - // HTTP header `Accept` - NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; - if(acceptHeader.length > 0) { - headerParams[@"Accept"] = acceptHeader; - } - - // response content type - NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; - - // request content type - NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; - - // Authentication setting - NSArray *authSettings = @[]; - - id bodyParam = nil; - NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; - NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; - bodyParam = user; - - return [self.apiClient requestWithPath: resourcePath - method: @"PUT" - pathParams: pathParams - queryParams: queryParams - formParams: formParams - files: localVarFiles - body: bodyParam - headerParams: headerParams - authSettings: authSettings - requestContentType: requestContentType - responseContentType: responseContentType - responseType: nil - completionBlock: ^(id data, NSError *error) { - if(handler) { - handler(error); - } - }]; -} - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h deleted file mode 100644 index 5179ca2e99b8..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h +++ /dev/null @@ -1,19 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface JSONValueTransformer (ISO8601) - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m deleted file mode 100644 index 0f458f0af010..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m +++ /dev/null @@ -1,17 +0,0 @@ -#import -#import "JSONValueTransformer+ISO8601.h" -#import "SWGSanitizer.h" - -@implementation JSONValueTransformer (ISO8601) - -- (NSDate *) NSDateFromNSString:(NSString *)string -{ - return [NSDate dateWithISO8601String:string]; -} - -- (NSString *)JSONObjectFromNSDate:(NSDate *)date -{ - return [SWGSanitizer dateToString:date]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h deleted file mode 100644 index 6c0396f0cac5..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h +++ /dev/null @@ -1,29 +0,0 @@ -#import - -@class SWGApiClient; - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@protocol SWGApi - -@property(readonly, nonatomic, strong) SWGApiClient *apiClient; - --(instancetype) initWithApiClient:(SWGApiClient *)apiClient; - --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; --(NSString*) defaultHeaderForKey:(NSString*)key; - --(NSDictionary *)defaultHeaders; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h deleted file mode 100644 index 761865f46933..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h +++ /dev/null @@ -1,121 +0,0 @@ -#import -#import "SWGConfiguration.h" -#import "SWGResponseDeserializer.h" -#import "SWGSanitizer.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -/** - * A key for `NSError` user info dictionaries. - * - * The corresponding value is the parsed response body for an HTTP error. - */ -extern NSString *const SWGResponseObjectErrorKey; - - -@interface SWGApiClient : AFHTTPSessionManager - -@property (nonatomic, strong, readonly) id configuration; - -@property(nonatomic, assign) NSTimeInterval timeoutInterval; - -@property(nonatomic, strong) id responseDeserializer; - -@property(nonatomic, strong) id sanitizer; - -/** - * Gets if the client is unreachable - * - * @return The client offline state - */ -+(BOOL) getOfflineState; - -/** - * Sets the client reachability, this may be overridden by the reachability manager if reachability changes - * - * @param status The client reachability status. - */ -+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; - -/** - * Gets the client reachability - * - * @return The client reachability. - */ -+(AFNetworkReachabilityStatus) getReachabilityStatus; - -@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; - -/** - * Gets client singleton instance - */ -+ (instancetype) sharedClient; - - -/** - * Updates header parameters and query parameters for authentication - * - * @param headers The header parameter will be updated, passed by pointer to pointer. - * @param queries The query parameters will be updated, passed by pointer to pointer. - * @param authSettings The authentication names NSArray. - */ -- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)queries WithAuthSettings:(NSArray *)authSettings; - - -/** - * Initializes the session manager with a configuration. - * - * @param configuration The configuration implementation - */ -- (instancetype)initWithConfiguration:(id)configuration; - -/** -* Initializes the session manager with a configuration and url -* -* @param url The base url -* @param configuration The configuration implementation -*/ -- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; - -/** - * Performs request - * - * @param path Request url. - * @param method Request method. - * @param pathParams Request path parameters. - * @param queryParams Request query parameters. - * @param body Request body. - * @param headerParams Request header parameters. - * @param authSettings Request authentication names. - * @param requestContentType Request content-type. - * @param responseContentType Response content-type. - * @param completionBlock The block will be executed when the request completed. - * - * @return The created session task. - */ -- (NSURLSessionTask*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m deleted file mode 100644 index 03f1cdda4e8a..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m +++ /dev/null @@ -1,376 +0,0 @@ - -#import "SWGLogger.h" -#import "SWGApiClient.h" -#import "SWGJSONRequestSerializer.h" -#import "SWGQueryParamCollection.h" -#import "SWGDefaultConfiguration.h" - -NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; - -static NSString * const kSWGContentDispositionKey = @"Content-Disposition"; - -static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { - if(![response isKindOfClass:[NSHTTPURLResponse class]]) { - return nil; - } - return ((NSHTTPURLResponse*)response).allHeaderFields; -} - -static NSString * SWG__fileNameForResponse(NSURLResponse *response) { - NSDictionary * headers = SWG__headerFieldsForResponse(response); - if(!headers[kSWGContentDispositionKey]) { - return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; - } - NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; - NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; - NSString *contentDispositionHeader = headers[kSWGContentDispositionKey]; - NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; - return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; -} - - -@interface SWGApiClient () - -@property (nonatomic, strong, readwrite) id configuration; - -@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; - -@end - -@implementation SWGApiClient - -#pragma mark - Singleton Methods - -+ (instancetype) sharedClient { - static SWGApiClient *sharedClient = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - sharedClient = [[self alloc] init]; - }); - return sharedClient; -} - -#pragma mark - Initialize Methods - -- (instancetype)init { - return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; -} - -- (instancetype)initWithBaseURL:(NSURL *)url { - return [self initWithBaseURL:url configuration:[SWGDefaultConfiguration sharedConfig]]; -} - -- (instancetype)initWithConfiguration:(id)configuration { - return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; -} - -- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { - self = [super initWithBaseURL:url]; - if (self) { - _configuration = configuration; - _timeoutInterval = 60; - _responseDeserializer = [[SWGResponseDeserializer alloc] init]; - _sanitizer = [[SWGSanitizer alloc] init]; - - _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; - - AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; - SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; - _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, - @"application/x-www-form-urlencoded": afhttpRequestSerializer, - @"multipart/form-data": afhttpRequestSerializer - }; - self.securityPolicy = [self createSecurityPolicy]; - self.responseSerializer = [AFHTTPResponseSerializer serializer]; - } - return self; -} - -#pragma mark - Task Methods - -- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - - NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { - SWGDebugLogResponse(response, responseObject,request,error); - if(!error) { - completionBlock(responseObject, nil); - return; - } - NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; - if (responseObject) { - // Add in the (parsed) response body. - userInfo[SWGResponseObjectErrorKey] = responseObject; - } - NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; - completionBlock(nil, augmentedError); - }]; - - return task; -} - -- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { - - __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; - - NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { - SWGDebugLogResponse(response, responseObject,request,error); - - if(error) { - NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; - if (responseObject) { - userInfo[SWGResponseObjectErrorKey] = responseObject; - } - NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; - completionBlock(nil, augmentedError); - return; - } - - NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); - NSString *filename = SWG__fileNameForResponse(response); - - NSString *filepath = [directory stringByAppendingPathComponent:filename]; - NSURL *file = [NSURL fileURLWithPath:filepath]; - - [responseObject writeToURL:file atomically:YES]; - - completionBlock(file, nil); - }]; - - return task; -} - -#pragma mark - Perform Request Methods - -- (NSURLSessionTask*) requestWithPath: (NSString*) path - method: (NSString*) method - pathParams: (NSDictionary *) pathParams - queryParams: (NSDictionary*) queryParams - formParams: (NSDictionary *) formParams - files: (NSDictionary *) files - body: (id) body - headerParams: (NSDictionary*) headerParams - authSettings: (NSArray *) authSettings - requestContentType: (NSString*) requestContentType - responseContentType: (NSString*) responseContentType - responseType: (NSString *) responseType - completionBlock: (void (^)(id, NSError *))completionBlock { - - AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; - - __weak id sanitizer = self.sanitizer; - - // sanitize parameters - pathParams = [sanitizer sanitizeForSerialization:pathParams]; - queryParams = [sanitizer sanitizeForSerialization:queryParams]; - headerParams = [sanitizer sanitizeForSerialization:headerParams]; - formParams = [sanitizer sanitizeForSerialization:formParams]; - if(![body isKindOfClass:[NSData class]]) { - body = [sanitizer sanitizeForSerialization:body]; - } - - // auth setting - [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; - - NSMutableString *resourcePath = [NSMutableString stringWithString:path]; - [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; - safeString = SWGPercentEscapedStringFromString(safeString); - [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; - }]; - - NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; - if ([pathWithQueryParams hasPrefix:@"/"]) { - pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; - } - - NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; - - NSError *requestCreateError = nil; - NSMutableURLRequest * request = nil; - if (files.count > 0) { - request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { - [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSString *objString = [sanitizer parameterToString:obj]; - NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; - [formData appendPartWithFormData:data name:key]; - }]; - [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - NSURL *filePath = (NSURL *)obj; - [formData appendPartWithFileURL:filePath name:key error:nil]; - }]; - } error:&requestCreateError]; - } - else { - if (formParams) { - request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; - } - if (body) { - request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; - } - } - if(!request) { - completionBlock(nil, requestCreateError); - return nil; - } - - if ([headerParams count] > 0){ - for(NSString * key in [headerParams keyEnumerator]){ - [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; - } - } - [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; - - [self postProcessRequest:request]; - - - NSURLSessionTask *task = nil; - - if ([self.downloadTaskResponseTypes containsObject:responseType]) { - task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { - completionBlock(data, error); - }]; - } else { - __weak typeof(self) weakSelf = self; - task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { - NSError * serializationError; - id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; - - if(!response && !error){ - error = serializationError; - } - completionBlock(response, error); - }]; - } - - [task resume]; - - return task; -} - --(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { - AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; - if(!serializer) { - NSAssert(NO, @"Unsupported request content type %@", requestContentType); - serializer = [AFHTTPRequestSerializer serializer]; - } - serializer.timeoutInterval = self.timeoutInterval; - return serializer; -} - -//Added for easier override to modify request --(void)postProcessRequest:(NSMutableURLRequest *)request { - -} - -#pragma mark - - -- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { - if(queryParams.count == 0) { - return path; - } - NSString * separator = nil; - NSUInteger counter = 0; - - NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; - - NSDictionary *separatorStyles = @{@"csv" : @",", - @"tsv" : @"\t", - @"pipes": @"|" - }; - for(NSString * key in [queryParams keyEnumerator]){ - if (counter == 0) { - separator = @"?"; - } else { - separator = @"&"; - } - id queryParam = [queryParams valueForKey:key]; - if(!queryParam) { - continue; - } - NSString *safeKey = SWGPercentEscapedStringFromString(key); - if ([queryParam isKindOfClass:[NSString class]]){ - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, SWGPercentEscapedStringFromString(queryParam)]]; - - } else if ([queryParam isKindOfClass:[SWGQueryParamCollection class]]){ - SWGQueryParamCollection * coll = (SWGQueryParamCollection*) queryParam; - NSArray* values = [coll values]; - NSString* format = [coll format]; - - if([format isEqualToString:@"multi"]) { - for(id obj in values) { - if (counter > 0) { - separator = @"&"; - } - NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; - counter += 1; - } - continue; - } - NSString * separatorStyle = separatorStyles[format]; - NSString * safeValue = SWGPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; - } else { - NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); - [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; - } - counter += 1; - } - return requestUrl; -} - -/** - * Update header and query params based on authentication settings - */ -- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)queries WithAuthSettings:(NSArray *)authSettings { - - if ([authSettings count] == 0) { - return; - } - - NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; - NSMutableDictionary *queriesWithAuth = [NSMutableDictionary dictionaryWithDictionary:*queries]; - - id config = self.configuration; - for (NSString *auth in authSettings) { - NSDictionary *authSetting = config.authSettings[auth]; - - if(!authSetting) { // auth setting is set only if the key is non-empty - continue; - } - NSString *type = authSetting[@"in"]; - NSString *key = authSetting[@"key"]; - NSString *value = authSetting[@"value"]; - if ([type isEqualToString:@"header"] && [key length] > 0 ) { - headersWithAuth[key] = value; - } else if ([type isEqualToString:@"query"] && [key length] != 0) { - queriesWithAuth[key] = value; - } - } - - *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; - *queries = [NSDictionary dictionaryWithDictionary:queriesWithAuth]; -} - -- (AFSecurityPolicy *) createSecurityPolicy { - AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; - - id config = self.configuration; - - if (config.sslCaCert) { - NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; - [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; - } - - if (config.verifySSL) { - [securityPolicy setAllowInvalidCertificates:NO]; - } - else { - [securityPolicy setAllowInvalidCertificates:YES]; - [securityPolicy setValidatesDomainName:NO]; - } - - return securityPolicy; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h deleted file mode 100644 index bd10d59028b1..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h +++ /dev/null @@ -1,14 +0,0 @@ -/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password. - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#import - -@interface SWGBasicAuthTokenProvider : NSObject - -+ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; - -@end \ No newline at end of file diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m deleted file mode 100644 index 3788009ec587..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m +++ /dev/null @@ -1,19 +0,0 @@ -#import "SWGBasicAuthTokenProvider.h" - -@implementation SWGBasicAuthTokenProvider - -+ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { - - // return empty string if username and password are empty - if (username.length == 0 && password.length == 0){ - return @""; - } - - NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; - NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; - basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - - return basicAuthCredentials; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h deleted file mode 100644 index f6b12de5c5c3..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h +++ /dev/null @@ -1,89 +0,0 @@ -#import - -@class SWGLogger; - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -static NSString * const kSWGAPIVersion = @"1.0.0"; - -@protocol SWGConfiguration - -/** - * Api logger - */ -@property (readonly, nonatomic) SWGLogger *logger; - -/** - * Base url - */ -@property (readonly, nonatomic) NSString *host; - -/** - * Api key values for Api Key type Authentication - */ -@property (readonly, nonatomic) NSDictionary *apiKey; - -/** - * Api key prefix values to be prepend to the respective api key - */ -@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; - -/** - * Username for HTTP Basic Authentication - */ -@property (readonly, nonatomic) NSString *username; - -/** - * Password for HTTP Basic Authentication - */ -@property (readonly, nonatomic) NSString *password; - -/** - * Access token for OAuth - */ -@property (readonly, nonatomic) NSString *accessToken; - -/** - * Temp folder for file download - */ -@property (readonly, nonatomic) NSString *tempFolderPath; - -/** - * Debug switch, default false - */ -@property (readonly, nonatomic) BOOL debug; - -/** - * SSL/TLS verification - * Set this to NO to skip verifying SSL certificate when calling API from https server - */ -@property (readonly, nonatomic) BOOL verifySSL; - -/** - * SSL/TLS verification - * Set this to customize the certificate file to verify the peer - */ -@property (readonly, nonatomic) NSString *sslCaCert; - -/** - * Authentication Settings - */ -@property (readonly, nonatomic) NSDictionary *authSettings; - -/** -* Default headers for all services -*/ -@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h deleted file mode 100644 index e141e0d092d5..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h +++ /dev/null @@ -1,171 +0,0 @@ -#import -#import "SWGConfiguration.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@class SWGApiClient; - -@interface SWGDefaultConfiguration : NSObject - - -/** - * Default api logger - */ -@property (nonatomic, strong) SWGLogger * logger; - -/** - * Default base url - */ -@property (nonatomic) NSString *host; - -/** - * Api key values for Api Key type Authentication - * - * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. - */ -@property (readonly, nonatomic, strong) NSDictionary *apiKey; - -/** - * Api key prefix values to be prepend to the respective api key - * - * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. - */ -@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; - -/** - * Username for HTTP Basic Authentication - */ - @property (nonatomic) NSString *username; - -/** - * Password for HTTP Basic Authentication - */ -@property (nonatomic) NSString *password; - -/** - * Access token for OAuth - */ -@property (nonatomic) NSString *accessToken; - -/** - * Temp folder for file download - */ -@property (nonatomic) NSString *tempFolderPath; - -/** - * Debug switch, default false - */ -@property (nonatomic) BOOL debug; - -/** - * Gets configuration singleton instance - */ -+ (instancetype) sharedConfig; - -/** - * SSL/TLS verification - * Set this to NO to skip verifying SSL certificate when calling API from https server - */ -@property (nonatomic) BOOL verifySSL; - -/** - * SSL/TLS verification - * Set this to customize the certificate file to verify the peer - */ -@property (nonatomic) NSString *sslCaCert; - -/** - * The time zone to use for date serialization - */ -@property (nonatomic) NSTimeZone *serializationTimeZone; - -/** - * Sets API key - * - * To remove an apiKey for an identifier, just set the apiKey to nil. - * - * @param apiKey API key or token. - * @param identifier API key identifier (authentication schema). - * - */ -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; - -/** - * Removes api key - * - * @param identifier API key identifier. - */ -- (void) removeApiKey:(NSString *)identifier; - -/** - * Sets the prefix for API key - * - * @param prefix API key prefix. - * @param identifier API key identifier. - */ -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; - -/** - * Removes api key prefix - * - * @param identifier API key identifier. - */ -- (void) removeApiKeyPrefix:(NSString *)identifier; - -/** - * Gets API key (with prefix if set) - */ -- (NSString *) getApiKeyWithPrefix:(NSString *) key; - -/** - * Gets Basic Auth token - */ -- (NSString *) getBasicAuthToken; - -/** - * Gets OAuth access token - */ -- (NSString *) getAccessToken; - -/** - * Gets Authentication Settings - */ -- (NSDictionary *) authSettings; - -/** -* Default headers for all services -*/ -@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; - -/** -* Removes header from defaultHeaders -* -* @param key Header name. -*/ --(void) removeDefaultHeaderForKey:(NSString*)key; - -/** -* Sets the header for key -* -* @param value Value for header name -* @param key Header name -*/ --(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; - -/** -* @param key Header key name. -*/ --(NSString*) defaultHeaderForKey:(NSString*)key; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m deleted file mode 100644 index 4afe43359aaf..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m +++ /dev/null @@ -1,152 +0,0 @@ -#import "SWGDefaultConfiguration.h" -#import "SWGBasicAuthTokenProvider.h" -#import "SWGLogger.h" - -@interface SWGDefaultConfiguration () - -@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; -@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; -@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; - -@end - -@implementation SWGDefaultConfiguration - -#pragma mark - Singleton Methods - -+ (instancetype) sharedConfig { - static SWGDefaultConfiguration *shardConfig = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - shardConfig = [[self alloc] init]; - }); - return shardConfig; -} - -#pragma mark - Initialize Methods - -- (instancetype) init { - self = [super init]; - if (self) { - _host = @"http://petstore.swagger.io/v2"; - _username = @""; - _password = @""; - _accessToken= @""; - _verifySSL = YES; - _mutableApiKey = [NSMutableDictionary dictionary]; - _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; - _mutableDefaultHeaders = [NSMutableDictionary dictionary]; - - _logger = [SWGLogger sharedLogger]; - } - return self; -} - -#pragma mark - Instance Methods - -- (NSString *) getApiKeyWithPrefix:(NSString *)key { - NSString *prefix = self.apiKeyPrefix[key]; - NSString *apiKey = self.apiKey[key]; - if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set - return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; - } - else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix - return [NSString stringWithFormat:@"%@", self.apiKey[key]]; - } - else { // return empty string if nothing is set - return @""; - } -} - -- (NSString *) getBasicAuthToken { - - NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; - return basicAuthToken; -} - -- (NSString *) getAccessToken { - if (self.accessToken.length == 0) { // token not set, return empty string - return @""; - } else { - return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; - } -} - -#pragma mark - Setter Methods - -- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { - [self.mutableApiKey setValue:apiKey forKey:identifier]; -} - -- (void) removeApiKey:(NSString *)identifier { - [self.mutableApiKey removeObjectForKey:identifier]; -} - -- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { - [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; -} - -- (void) removeApiKeyPrefix:(NSString *)identifier { - [self.mutableApiKeyPrefix removeObjectForKey:identifier]; -} - -#pragma mark - Getter Methods - -- (NSDictionary *) apiKey { - return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; -} - -- (NSDictionary *) apiKeyPrefix { - return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; -} - -#pragma mark - - -- (NSDictionary *) authSettings { - return @{ - @"api_key": - @{ - @"type": @"api_key", - @"in": @"header", - @"key": @"api_key", - @"value": [self getApiKeyWithPrefix:@"api_key"] - }, - @"petstore_auth": - @{ - @"type": @"oauth", - @"in": @"header", - @"key": @"Authorization", - @"value": [self getAccessToken] - }, - }; -} - --(BOOL)debug { - return self.logger.isEnabled; -} - --(void)setDebug:(BOOL)debug { - self.logger.enabled = debug; -} - -- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { - if(!value) { - [self.mutableDefaultHeaders removeObjectForKey:key]; - return; - } - self.mutableDefaultHeaders[key] = value; -} - --(void) removeDefaultHeaderForKey:(NSString*)key { - [self.mutableDefaultHeaders removeObjectForKey:key]; -} - -- (NSString *)defaultHeaderForKey:(NSString *)key { - return self.mutableDefaultHeaders[key]; -} - -- (NSDictionary *)defaultHeaders { - return [self.mutableDefaultHeaders copy]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h deleted file mode 100644 index 943ab1323133..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h +++ /dev/null @@ -1,18 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGJSONRequestSerializer : AFJSONRequestSerializer -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m deleted file mode 100644 index 221765e48397..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m +++ /dev/null @@ -1,37 +0,0 @@ -#import "SWGJSONRequestSerializer.h" - -@implementation SWGJSONRequestSerializer - -/// -/// When customize a request serializer, -/// the serializer must conform the protocol `AFURLRequestSerialization` -/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` -/// -/// @param request The original request. -/// @param parameters The parameters to be encoded. -/// @param error The error that occurred while attempting to encode the request parameters. -/// -/// @return A serialized request. -/// -- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request - withParameters:(id)parameters - error:(NSError *__autoreleasing *)error -{ - if (!parameters) { - return request; - } - // If the body data which will be serialized isn't NSArray or NSDictionary - // then put the data in the http request body directly. - if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { - return [super requestBySerializingRequest:request withParameters:parameters error:error]; - } - NSMutableURLRequest *mutableRequest = [request mutableCopy]; - if([parameters isKindOfClass:[NSData class]]) { - [mutableRequest setHTTPBody:parameters]; - } else { - [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; - } - return mutableRequest; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h deleted file mode 100644 index 23f57acd7b8a..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h +++ /dev/null @@ -1,61 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#ifndef SWGDebugLogResponse -#define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; -#endif - -/** - * Log debug message macro - */ -#ifndef SWGDebugLog -#define SWGDebugLog(format, ...) [[SWGLogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; -#endif - -@interface SWGLogger : NSObject - -+(instancetype)sharedLogger; - -/** - * Enabled switch, default NO - default set by SWGConfiguration debug property - */ -@property (nonatomic, assign, getter=isEnabled) BOOL enabled; - -/** - * Debug file location, default log in console - */ -@property (nonatomic, strong) NSString *loggingFile; - -/** - * Log file handler, this property is used by sdk internally. - */ -@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; - -/** - * Log debug message - */ --(void)debugLog:(NSString *)method message:(NSString *)format, ...; - -/** - * Logs request and response - * - * @param response NSURLResponse for the HTTP request. - * @param responseObject response object of the HTTP request. - * @param request The HTTP request. - * @param error The error of the HTTP request. - */ -- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m deleted file mode 100644 index 2a96e5ec54d3..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m +++ /dev/null @@ -1,73 +0,0 @@ -#import "SWGLogger.h" - -@interface SWGLogger () - -@end - -@implementation SWGLogger - -+ (instancetype) sharedLogger { - static SWGLogger *shardLogger = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - shardLogger = [[self alloc] init]; - }); - return shardLogger; -} - -#pragma mark - Log Methods - -- (void)debugLog:(NSString *)method message:(NSString *)format, ... { - if (!self.isEnabled) { - return; - } - - NSMutableString *message = [NSMutableString stringWithCapacity:1]; - - if (method) { - [message appendFormat:@"%@: ", method]; - } - - va_list args; - va_start(args, format); - - [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; - - // If set logging file handler, log into file, - // otherwise log into console. - if (self.loggingFileHandler) { - [self.loggingFileHandler seekToEndOfFile]; - [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; - } else { - NSLog(@"%@", message); - } - - va_end(args); -} - -- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { - NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ - "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", - [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], - responseObject]; - - SWGDebugLog(message); -} - -- (void) setLoggingFile:(NSString *)loggingFile { - if(_loggingFile == loggingFile) { - return; - } - // close old file handler - if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { - [self.loggingFileHandler closeFile]; - } - _loggingFile = loggingFile; - _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; - if (_loggingFileHandler == nil) { - [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; - _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; - } -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h deleted file mode 100644 index 7d7112c5976a..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h +++ /dev/null @@ -1,19 +0,0 @@ -#import -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGObject : JSONModel - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m deleted file mode 100644 index f985195d4b12..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m +++ /dev/null @@ -1,44 +0,0 @@ -#import "SWGObject.h" - -@implementation SWGObject - -/** - * Workaround for JSONModel multithreading issues - * https://github.com/icanzilb/JSONModel/issues/441 - */ -- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { - static NSMutableSet *classNames; - static NSObject *lock; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - classNames = [NSMutableSet new]; - lock = [NSObject new]; - }); - - BOOL initSync; - @synchronized(lock) - { - NSString *className = NSStringFromClass([self class]); - initSync = ![classNames containsObject:className]; - if(initSync) - { - [classNames addObject:className]; - self = [super initWithDictionary:dict error:err]; - } - } - if(!initSync) - { - self = [super initWithDictionary:dict error:err]; - } - return self; -} - -/** - * Gets the string presentation of the object. - * This method will be called when logging model object using `NSLog`. - */ -- (NSString *)description { - return [[self toDictionary] description]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h deleted file mode 100644 index 4bd35d86f352..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h +++ /dev/null @@ -1,24 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -@interface SWGQueryParamCollection : NSObject - -@property(nonatomic, readonly) NSArray* values; -@property(nonatomic, readonly) NSString* format; - -- (id) initWithValuesAndFormat: (NSArray*) values - format: (NSString*) format; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m deleted file mode 100644 index 5f9306219edd..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m +++ /dev/null @@ -1,20 +0,0 @@ -#import "SWGQueryParamCollection.h" - -@implementation SWGQueryParamCollection - -@synthesize values = _values; -@synthesize format = _format; - -- (id)initWithValuesAndFormat:(NSArray *)values - format:(NSString *)format { - - self = [super init]; - if (self) { - _values = values; - _format = format; - } - - return self; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h deleted file mode 100644 index 68f83704f495..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h +++ /dev/null @@ -1,57 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -/** - * A key for deserialization ErrorDomain - */ -extern NSString *const SWGDeserializationErrorDomainKey; - -/** - * Code for deserialization type mismatch error - */ -extern NSInteger const SWGTypeMismatchErrorCode; - -/** - * Code for deserialization empty value error - */ -extern NSInteger const SWGEmptyValueOccurredErrorCode; - -/** - * Error code for unknown response - */ -extern NSInteger const SWGUnknownResponseObjectErrorCode; - -@protocol SWGResponseDeserializer - -/** - * Deserializes the given data to Objective-C object. - * - * @param data The data will be deserialized. - * @param className The type of objective-c object. - * @param error The error - */ -- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; - -@end - -@interface SWGResponseDeserializer : NSObject - -/** - * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored - * @default NO - */ -@property (nonatomic, assign) BOOL treatNullAsError; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m deleted file mode 100644 index 46d4b460fc74..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m +++ /dev/null @@ -1,247 +0,0 @@ -#import "SWGResponseDeserializer.h" -#import -#import - -NSString *const SWGDeserializationErrorDomainKey = @"SWGDeserializationErrorDomainKey"; - -NSInteger const SWGTypeMismatchErrorCode = 143553; - -NSInteger const SWGEmptyValueOccurredErrorCode = 143509; - -NSInteger const SWGUnknownResponseObjectErrorCode = 143528; - - -@interface SWGResponseDeserializer () - -@property (nonatomic, strong) NSNumberFormatter* numberFormatter; -@property (nonatomic, strong) NSArray *primitiveTypes; -@property (nonatomic, strong) NSArray *basicReturnTypes; -@property (nonatomic, strong) NSArray *dataReturnTypes; - -@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; -@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; -@property (nonatomic, strong) NSRegularExpression* dictPatExpression; -@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; - -@end - -@implementation SWGResponseDeserializer - -- (instancetype)init { - self = [super init]; - if (self) { - NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; - formatter.numberStyle = NSNumberFormatterDecimalStyle; - _numberFormatter = formatter; - _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; - _basicReturnTypes = @[@"NSObject", @"id"]; - _dataReturnTypes = @[@"NSData"]; - - _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" - options:NSRegularExpressionCaseInsensitive - error:nil]; - _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" - options:NSRegularExpressionCaseInsensitive - error:nil]; - _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" - options:NSRegularExpressionCaseInsensitive - error:nil]; - _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" - options:NSRegularExpressionCaseInsensitive - error:nil]; - } - return self; -} - -#pragma mark - Deserialize methods - -- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { - if (!data || !className) { - return nil; - } - - if ([className hasSuffix:@"*"]) { - className = [className substringToIndex:[className length] - 1]; - } - if([self.dataReturnTypes containsObject:className]) { - return data; - } - id jsonData = nil; - if([data isKindOfClass:[NSData class]]) { - jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; - } else { - jsonData = data; - } - if(!jsonData) { - jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; - } else if([jsonData isKindOfClass:[NSNull class]]) { - return nil; - } - - // pure object - if ([self.basicReturnTypes containsObject:className]) { - return jsonData; - } - - // primitives - if ([self.primitiveTypes containsObject:className]) { - return [self deserializePrimitiveValue:jsonData class:className error:error]; - } - - NSTextCheckingResult *match = nil; - NSRange range = NSMakeRange(0, [className length]); - // list of models - match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:jsonData innerType:innerType error:error]; - } - - // list of primitives - match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; - return [self deserializeArrayValue:jsonData innerType:innerType error:error]; - } - - // map - match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; - } - - match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; - if (match) { - NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; - return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; - } - - // model - Class ModelClass = NSClassFromString(className); - if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { - return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; - } - - if(error) { - *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; - } - return nil; -} - -- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { - if(![data isKindOfClass: [NSDictionary class]]) { - if(error) { - *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; - } - return nil; - } - __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; - for (id key in [data allKeys]) { - id obj = [data valueForKey:key]; - id dicObj = [self deserialize:obj class:valueType error:error]; - if(dicObj) { - [resultDict setValue:dicObj forKey:key]; - } else if([obj isKindOfClass:[NSNull class]]) { - if(self.treatNullAsError) { - if (error) { - *error = [self emptyValueOccurredError]; - } - resultDict = nil; - break; - } - } else { - resultDict = nil; - break; - } - } - return resultDict; -} - -- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { - if(![data isKindOfClass: [NSArray class]]) { - if(error) { - *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; - } - return nil; - } - NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; - for (id obj in data) { - id arrObj = [self deserialize:obj class:innerType error:error]; - if(arrObj) { - [resultArray addObject:arrObj]; - } else if([obj isKindOfClass:[NSNull class]]) { - if(self.treatNullAsError) { - if (error) { - *error = [self emptyValueOccurredError]; - } - resultArray = nil; - break; - } - } else { - resultArray = nil; - break; - } - } - return resultArray; -}; - -- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { - if ([className isEqualToString:@"NSString"]) { - return [NSString stringWithFormat:@"%@",data]; - } - else if ([className isEqualToString:@"NSDate"]) { - return [self deserializeDateValue:data error:error]; - } - else if ([className isEqualToString:@"NSNumber"]) { - // NSNumber from NSNumber - if ([data isKindOfClass:[NSNumber class]]) { - return data; - } - else if ([data isKindOfClass:[NSString class]]) { - // NSNumber (NSCFBoolean) from NSString - if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { - return @([data boolValue]); - // NSNumber from NSString - } else { - NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; - if(!formattedValue && [data length] > 0 && error) { - *error = [self typeMismatchErrorWithExpectedType:className data:data]; - } - return formattedValue; - } - } - } - if(error) { - *error = [self typeMismatchErrorWithExpectedType:className data:data]; - } - return nil; -} - -- (id) deserializeDateValue:(id) data error:(NSError**)error { - NSDate *date =[NSDate dateWithISO8601String:data]; - if(!date && [data length] > 0 && error) { - *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; - } - return date; -}; - --(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { - NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; - return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGTypeMismatchErrorCode userInfo:userInfo]; -} - --(NSError *)emptyValueOccurredError { - NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; - return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGEmptyValueOccurredErrorCode userInfo:userInfo]; -} - --(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { - NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; - NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; - return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGUnknownResponseObjectErrorCode userInfo:userInfo]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h deleted file mode 100644 index 83853bec8cf0..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h +++ /dev/null @@ -1,63 +0,0 @@ -#import - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -extern NSString * SWGPercentEscapedStringFromString(NSString *string); - -extern NSString * const kSWGApplicationJSONType; - -@protocol SWGSanitizer - -/** - * Sanitize object for request - * - * @param object The query/path/header/form/body param to be sanitized. - */ -- (id) sanitizeForSerialization:(id) object; - -/** - * Convert parameter to NSString - */ -- (NSString *) parameterToString: (id) param; - -/** - * Convert date to NSString - */ -+ (NSString *)dateToString:(id)date; - -/** - * Detects Accept header from accepts NSArray - * - * @param accepts NSArray of header - * - * @return The Accept header - */ --(NSString *) selectHeaderAccept:(NSArray *)accepts; - -/** - * Detects Content-Type header from contentTypes NSArray - * - * @param contentTypes NSArray of header - * - * @return The Content-Type header - */ --(NSString *) selectHeaderContentType:(NSArray *)contentTypes; - -@end - -@interface SWGSanitizer : NSObject - - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m deleted file mode 100644 index 1b3e0e10b0d5..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m +++ /dev/null @@ -1,170 +0,0 @@ -#import "SWGSanitizer.h" -#import "SWGObject.h" -#import "SWGQueryParamCollection.h" -#import "SWGDefaultConfiguration.h" -#import - -NSString * const kSWGApplicationJSONType = @"application/json"; - -NSString * SWGPercentEscapedStringFromString(NSString *string) { - static NSString * const kSWGCharactersGeneralDelimitersToEncode = @":#[]@"; - static NSString * const kSWGCharactersSubDelimitersToEncode = @"!$&'()*+,;="; - - NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; - [allowedCharacterSet removeCharactersInString:[kSWGCharactersGeneralDelimitersToEncode stringByAppendingString:kSWGCharactersSubDelimitersToEncode]]; - - static NSUInteger const batchSize = 50; - - NSUInteger index = 0; - NSMutableString *escaped = @"".mutableCopy; - - while (index < string.length) { - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wgnu" - NSUInteger length = MIN(string.length - index, batchSize); - #pragma GCC diagnostic pop - NSRange range = NSMakeRange(index, length); - - // To avoid breaking up character sequences such as 👴🏻👮🏽 - range = [string rangeOfComposedCharacterSequencesForRange:range]; - - NSString *substring = [string substringWithRange:range]; - NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; - [escaped appendString:encoded]; - - index += range.length; - } - - return escaped; -} - -@interface SWGSanitizer () - -@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; - -@end - -@implementation SWGSanitizer - --(instancetype)init { - self = [super init]; - if ( !self ) { - return nil; - } - _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; - return self; -} - - -- (id) sanitizeForSerialization:(id) object { - if (object == nil) { - return nil; - } - else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[SWGQueryParamCollection class]]) { - return object; - } - else if ([object isKindOfClass:[NSDate class]]) { - return [SWGSanitizer dateToString:object]; - } - else if ([object isKindOfClass:[NSArray class]]) { - NSArray *objectArray = object; - NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; - [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - id sanitizedObj = [self sanitizeForSerialization:obj]; - if (sanitizedObj) { - [sanitizedObjs addObject:sanitizedObj]; - } - }]; - return sanitizedObjs; - } - else if ([object isKindOfClass:[NSDictionary class]]) { - NSDictionary *objectDict = object; - NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; - [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { - id sanitizedObj = [self sanitizeForSerialization:obj]; - if (sanitizedObj) { - sanitizedObjs[key] = sanitizedObj; - } - }]; - return sanitizedObjs; - } - else if ([object isKindOfClass:[SWGObject class]]) { - return [object toDictionary]; - } - else { - NSException *e = [NSException - exceptionWithName:@"InvalidObjectArgumentException" - reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] - userInfo:nil]; - @throw e; - } -} - -- (NSString *) parameterToString:(id)param { - if ([param isKindOfClass:[NSString class]]) { - return param; - } - else if ([param isKindOfClass:[NSNumber class]]) { - return [param stringValue]; - } - else if ([param isKindOfClass:[NSDate class]]) { - return [SWGSanitizer dateToString:param]; - } - else if ([param isKindOfClass:[NSArray class]]) { - NSMutableArray *mutableParam = [NSMutableArray array]; - [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - [mutableParam addObject:[self parameterToString:obj]]; - }]; - return [mutableParam componentsJoinedByString:@","]; - } - else { - NSException *e = [NSException - exceptionWithName:@"InvalidObjectArgumentException" - reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] - userInfo:nil]; - @throw e; - } -} - -+ (NSString *)dateToString:(id)date { - NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; - return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; -} - -#pragma mark - Utility Methods - -/* - * Detect `Accept` from accepts - */ -- (NSString *) selectHeaderAccept:(NSArray *)accepts { - if (accepts.count == 0) { - return @""; - } - NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; - for (NSString *string in accepts) { - if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { - return kSWGApplicationJSONType; - } - [lowerAccepts addObject:[string lowercaseString]]; - } - return [lowerAccepts componentsJoinedByString:@", "]; -} - -/* - * Detect `Content-Type` from contentTypes - */ -- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { - if (contentTypes.count == 0) { - return kSWGApplicationJSONType; - } - NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; - for (NSString *string in contentTypes) { - if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ - return kSWGApplicationJSONType; - } - [lowerContentTypes addObject:[string lowercaseString]]; - } - return [lowerContentTypes firstObject]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h deleted file mode 100644 index 31eb9e6b31ca..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h +++ /dev/null @@ -1,30 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGCategory -@end - -@interface SWGCategory : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSString* name; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m deleted file mode 100644 index 21e354b30e9e..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGCategory.h" - -@implementation SWGCategory - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"name"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h deleted file mode 100644 index 1d3390dab8c4..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h +++ /dev/null @@ -1,32 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGInlineObject -@end - -@interface SWGInlineObject : SWGObject - -/* Updated name of the pet [optional] - */ -@property(nonatomic) NSString* name; -/* Updated status of the pet [optional] - */ -@property(nonatomic) NSString* status; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m deleted file mode 100644 index a10d7060973a..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGInlineObject.h" - -@implementation SWGInlineObject - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"name", @"status"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h deleted file mode 100644 index 36d1a7194cdd..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h +++ /dev/null @@ -1,32 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGInlineObject1 -@end - -@interface SWGInlineObject1 : SWGObject - -/* Additional data to pass to server [optional] - */ -@property(nonatomic) NSString* additionalMetadata; -/* file to upload [optional] - */ -@property(nonatomic) NSURL* file; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m deleted file mode 100644 index 825dbcc286ae..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGInlineObject1.h" - -@implementation SWGInlineObject1 - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"additionalMetadata", @"file"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h deleted file mode 100644 index 5ea7a94cfcbe..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h +++ /dev/null @@ -1,39 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGOrder -@end - -@interface SWGOrder : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSNumber* petId; - -@property(nonatomic) NSNumber* quantity; - -@property(nonatomic) NSDate* shipDate; -/* Order Status [optional] - */ -@property(nonatomic) NSString* status; - -@property(nonatomic) NSNumber* complete; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m deleted file mode 100644 index 7f93b0212c48..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGOrder.h" - -@implementation SWGOrder - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h deleted file mode 100644 index 4b3729193265..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h +++ /dev/null @@ -1,45 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - -#import "SWGCategory.h" -#import "SWGTag.h" -@protocol SWGCategory; -@class SWGCategory; -@protocol SWGTag; -@class SWGTag; - - - -@protocol SWGPet -@end - -@interface SWGPet : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) SWGCategory* category; - -@property(nonatomic) NSString* name; - -@property(nonatomic) NSArray* photoUrls; - -@property(nonatomic) NSArray* tags; -/* pet status in the store [optional] - */ -@property(nonatomic) NSString* status; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m deleted file mode 100644 index 8c958695c888..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGPet.h" - -@implementation SWGPet - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h deleted file mode 100644 index cdcedfd916bb..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h +++ /dev/null @@ -1,30 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGTag -@end - -@interface SWGTag : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSString* name; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m deleted file mode 100644 index 3a62bcbb9a12..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGTag.h" - -@implementation SWGTag - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"name"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h deleted file mode 100644 index 7786883ed29c..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h +++ /dev/null @@ -1,43 +0,0 @@ -#import -#import "SWGObject.h" - -/** -* OpenAPI Petstore -* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters -* -* The version of the OpenAPI document: 1.0.0 -* -* -* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). -* https://openapi-generator.tech -* Do not edit the class manually. -*/ - - - - - -@protocol SWGUser -@end - -@interface SWGUser : SWGObject - - -@property(nonatomic) NSNumber* _id; - -@property(nonatomic) NSString* username; - -@property(nonatomic) NSString* firstName; - -@property(nonatomic) NSString* lastName; - -@property(nonatomic) NSString* email; - -@property(nonatomic) NSString* password; - -@property(nonatomic) NSString* phone; -/* User Status [optional] - */ -@property(nonatomic) NSNumber* userStatus; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m deleted file mode 100644 index fd50c02e2c9c..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m +++ /dev/null @@ -1,34 +0,0 @@ -#import "SWGUser.h" - -@implementation SWGUser - -- (instancetype)init { - self = [super init]; - if (self) { - // initialize property's default value, if any - - } - return self; -} - - -/** - * Maps json key to property name. - * This method is used by `JSONModel`. - */ -+ (JSONKeyMapper *)keyMapper { - return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; -} - -/** - * Indicates whether the property with the given name is optional. - * If `propertyName` is optional, then return `YES`, otherwise return `NO`. - * This method is used by `JSONModel`. - */ -+ (BOOL)propertyIsOptional:(NSString *)propertyName { - - NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; - return [optionalProperties containsObject:propertyName]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Podfile b/samples/client/petstore/objc/default/SwaggerClientTests/Podfile deleted file mode 100644 index 22654e6adda3..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Podfile +++ /dev/null @@ -1,12 +0,0 @@ -source 'https://github.com/CocoaPods/Specs.git' - -target 'SwaggerClient_Example' do - pod "SwaggerClient", :path => "../" -end - -target 'SwaggerClient_Tests' do - pod "SwaggerClient", :path => "../" - - pod 'Specta' - pod 'Expecta' -end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj deleted file mode 100644 index 6407077fccd8..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj +++ /dev/null @@ -1,592 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */; }; - 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; - 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; - 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; - 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; - 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; - 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; }; - 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; }; - 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; - 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; - 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; - 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; - 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; - CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0ADB471B5F95D6008A2729 /* PetTest.m */; }; - CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF8F71381B5F73AC00162980 /* DeserializationTest.m */; }; - CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */; }; - CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */; }; - CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */; }; - CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 6003F582195388D10070C39A /* Project object */; - proxyType = 1; - remoteGlobalIDString = 6003F589195388D20070C39A; - remoteInfo = SwaggerClient; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig"; sourceTree = ""; }; - 4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; - 6003F58A195388D20070C39A /* SwaggerClient_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; - 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; - 6003F595195388D20070C39A /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = ""; }; - 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = ""; }; - 6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = ""; }; - 6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = ""; }; - 6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = ""; }; - 6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = ""; }; - 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClient_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; - 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; - 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; - 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; - 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = ""; }; - 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; - B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; - B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; - BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = ""; }; - CF0ADB471B5F95D6008A2729 /* PetTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetTest.m; sourceTree = ""; }; - CF8F71381B5F73AC00162980 /* DeserializationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeserializationTest.m; sourceTree = ""; }; - CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = ""; }; - CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = ""; }; - CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = ""; }; - CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = ""; }; - E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.debug.xcconfig"; sourceTree = ""; }; - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = ""; }; - FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 6003F587195388D20070C39A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, - 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, - 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, - 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AB195388D20070C39A /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, - 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, - 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, - 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 6003F581195388D10070C39A = { - isa = PBXGroup; - children = ( - 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, - 6003F593195388D20070C39A /* Example for SwaggerClient */, - 6003F5B5195388D20070C39A /* Tests */, - 6003F58C195388D20070C39A /* Frameworks */, - 6003F58B195388D20070C39A /* Products */, - CCE77F10C6D41F74B075ECD0 /* Pods */, - ); - sourceTree = ""; - }; - 6003F58B195388D20070C39A /* Products */ = { - isa = PBXGroup; - children = ( - 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, - 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, - B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, - ); - name = Products; - sourceTree = ""; - }; - 6003F58C195388D20070C39A /* Frameworks */ = { - isa = PBXGroup; - children = ( - 6003F58D195388D20070C39A /* Foundation.framework */, - 6003F58F195388D20070C39A /* CoreGraphics.framework */, - 6003F591195388D20070C39A /* UIKit.framework */, - 6003F5AF195388D20070C39A /* XCTest.framework */, - 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */, - FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 6003F593195388D20070C39A /* Example for SwaggerClient */ = { - isa = PBXGroup; - children = ( - 6003F59C195388D20070C39A /* SWGAppDelegate.h */, - 6003F59D195388D20070C39A /* SWGAppDelegate.m */, - 6003F5A5195388D20070C39A /* SWGViewController.h */, - 6003F5A6195388D20070C39A /* SWGViewController.m */, - 6003F594195388D20070C39A /* Supporting Files */, - ); - name = "Example for SwaggerClient"; - path = SwaggerClient; - sourceTree = ""; - }; - 6003F594195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F595195388D20070C39A /* SwaggerClient-Info.plist */, - 6003F596195388D20070C39A /* InfoPlist.strings */, - 6003F599195388D20070C39A /* main.m */, - 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 6003F5B5195388D20070C39A /* Tests */ = { - isa = PBXGroup; - children = ( - CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */, - CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */, - CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */, - CF0ADB471B5F95D6008A2729 /* PetTest.m */, - CF8F71381B5F73AC00162980 /* DeserializationTest.m */, - CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */, - 6003F5BB195388D20070C39A /* Tests.m */, - 6003F5B6195388D20070C39A /* Supporting Files */, - B2ADCA62DE4AC0F5BAB42208 /* Helpers */, - ); - path = Tests; - sourceTree = ""; - }; - 6003F5B6195388D20070C39A /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 6003F5B7195388D20070C39A /* Tests-Info.plist */, - 6003F5B8195388D20070C39A /* InfoPlist.strings */, - 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { - isa = PBXGroup; - children = ( - E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, - 4CCE21315897B7D544C83242 /* README.md */, - B2ADC7027D4B025ABCA7999F /* Main.storyboard */, - B2ADC65E342ADA697322D68C /* Images.xcassets */, - ); - name = "Podspec Metadata"; - sourceTree = ""; - }; - B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { - isa = PBXGroup; - children = ( - B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, - B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, - ); - path = Helpers; - sourceTree = ""; - }; - CCE77F10C6D41F74B075ECD0 /* Pods */ = { - isa = PBXGroup; - children = ( - E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */, - BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */, - 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */, - 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 6003F589195388D20070C39A /* SwaggerClient_Example */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */; - buildPhases = ( - 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */, - 6003F586195388D20070C39A /* Sources */, - 6003F587195388D20070C39A /* Frameworks */, - 6003F588195388D20070C39A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = SwaggerClient_Example; - productName = SwaggerClient; - productReference = 6003F58A195388D20070C39A /* SwaggerClient_Example.app */; - productType = "com.apple.product-type.application"; - }; - 6003F5AD195388D20070C39A /* SwaggerClient_Tests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */; - buildPhases = ( - 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */, - 6003F5AA195388D20070C39A /* Sources */, - 6003F5AB195388D20070C39A /* Frameworks */, - 6003F5AC195388D20070C39A /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 6003F5B4195388D20070C39A /* PBXTargetDependency */, - ); - name = SwaggerClient_Tests; - productName = SwaggerClientTests; - productReference = 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 6003F582195388D10070C39A /* Project object */ = { - isa = PBXProject; - attributes = { - CLASSPREFIX = SWG; - LastUpgradeCheck = 0730; - ORGANIZATIONNAME = geekerzp; - }; - buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 6003F581195388D10070C39A; - productRefGroup = 6003F58B195388D20070C39A /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 6003F589195388D20070C39A /* SwaggerClient_Example */, - 6003F5AD195388D20070C39A /* SwaggerClient_Tests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 6003F588195388D20070C39A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, - B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, - B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, - B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AC195388D20070C39A /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Example-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Tests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 6003F586195388D20070C39A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */, - 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */, - 6003F59A195388D20070C39A /* main.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 6003F5AA195388D20070C39A /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */, - CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */, - CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */, - 6003F5BC195388D20070C39A /* Tests.m in Sources */, - CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */, - CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */, - CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */, - B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 6003F589195388D20070C39A /* SwaggerClient_Example */; - targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 6003F596195388D20070C39A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 6003F597195388D20070C39A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 6003F5B9195388D20070C39A /* en */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 6003F5BD195388D20070C39A /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 6003F5BE195388D20070C39A /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 6003F5C0195388D20070C39A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; - INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Debug; - }; - 6003F5C1195388D20070C39A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; - INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; - MODULE_NAME = ExampleApp; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = app; - }; - name = Release; - }; - 6003F5C3195388D20070C39A /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = "Tests/Tests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xctest; - }; - name = Debug; - }; - 6003F5C4195388D20070C39A /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */; - buildSettings = { - FRAMEWORK_SEARCH_PATHS = ( - "$(SDKROOT)/Developer/Library/Frameworks", - "$(inherited)", - "$(DEVELOPER_FRAMEWORKS_DIR)", - ); - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; - INFOPLIST_FILE = "Tests/Tests-Info.plist"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - WRAPPER_EXTENSION = xctest; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6003F5BD195388D20070C39A /* Debug */, - 6003F5BE195388D20070C39A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6003F5C0195388D20070C39A /* Debug */, - 6003F5C1195388D20070C39A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 6003F5C3195388D20070C39A /* Debug */, - 6003F5C4195388D20070C39A /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 6003F582195388D10070C39A /* Project object */; -} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 13bdd8ab8b75..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme deleted file mode 100644 index 24c1ef20c794..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme deleted file mode 100644 index 29c43710dffc..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index f697f61f4aaf..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "images" : [ - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json deleted file mode 100644 index 4458b40c0558..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "images" : [ - { - "orientation" : "portrait", - "idiom" : "iphone", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "iphone", - "subtype" : "retina4", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "1x" - }, - { - "orientation" : "portrait", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - }, - { - "orientation" : "landscape", - "idiom" : "ipad", - "extent" : "full-screen", - "minimum-system-version" : "7.0", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard deleted file mode 100644 index 36df4e16819b..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard deleted file mode 100644 index f204320d3339..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h deleted file mode 100644 index eb867594fdee..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// SWGAppDelegate.h -// SwaggerClient -// -// Created by CocoaPods on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -@import UIKit; - -@interface SWGAppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m deleted file mode 100644 index 492c6026d6bc..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m +++ /dev/null @@ -1,46 +0,0 @@ -// -// SWGAppDelegate.m -// SwaggerClient -// -// Created by CocoaPods on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -#import "SWGAppDelegate.h" - -@implementation SWGAppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions -{ - // Override point for customization after application launch. - return YES; -} - -- (void)applicationWillResignActive:(UIApplication *)application -{ - // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. - // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. -} - -- (void)applicationDidEnterBackground:(UIApplication *)application -{ - // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. - // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. -} - -- (void)applicationWillEnterForeground:(UIApplication *)application -{ - // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. -} - -- (void)applicationDidBecomeActive:(UIApplication *)application -{ - // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. -} - -- (void)applicationWillTerminate:(UIApplication *)application -{ - // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h deleted file mode 100644 index 7847f2d05b1d..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// SWGViewController.h -// SwaggerClient -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -@import UIKit; - -@interface SWGViewController : UIViewController - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m deleted file mode 100644 index d1ee531e2f05..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m +++ /dev/null @@ -1,60 +0,0 @@ -// -// SWGViewController.m -// SwaggerClient -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -#import "SWGViewController.h" -#import -#import -#import -#import - -@interface SWGViewController () - -@end - -@implementation SWGViewController - -- (void)viewDidLoad -{ - [super viewDidLoad]; - - SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; - config.debug = YES; - - SWGPetApi *api = [[SWGPetApi alloc] init]; - NSURL *file = [NSURL fileURLWithPath:@"/Users/geekerzp/tmp/test.jpg"]; - [api uploadFileWithPetId:@2 additionalMetadata:@"2" file:file completionHandler:^(NSError *error) { - NSLog(@"*** error: %@", error); - }]; -} - -- (SWGPet*) createPet { - SWGPet * pet = [[SWGPet alloc] init]; - pet._id = @((long) [[NSDate date] timeIntervalSince1970]); - pet.name = @"monkey"; - - SWGCategory * category = [[SWGCategory alloc] init]; - category._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - category.name = @"super-happy"; - pet.category = category; - - SWGTag *tag1 = [[SWGTag alloc] init]; - tag1._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - tag1.name = @"test tag 1"; - SWGTag *tag2 = [[SWGTag alloc] init]; - tag2._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - tag2.name = @"test tag 2"; - pet.tags = (NSArray *) @[tag1, tag2]; - - pet.status = @"available"; - - NSArray * photos = @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]; - pet.photoUrls = photos; - return pet; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist deleted file mode 100644 index 0c641d12c147..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist +++ /dev/null @@ -1,54 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ${PRODUCT_NAME} - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - UILaunchStoryboardName - Launch Screen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch deleted file mode 100644 index 7825372cbdda..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch +++ /dev/null @@ -1,16 +0,0 @@ -// -// Prefix header -// -// The contents of this file are implicitly included at the beginning of every source file. -// - -#import - -#ifndef __IPHONE_5_0 -#warning "This project uses features only available in iOS SDK 5.0 and later." -#endif - -#ifdef __OBJC__ - @import UIKit; - @import Foundation; -#endif diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f86..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m deleted file mode 100644 index 4a47f1fd69e4..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m +++ /dev/null @@ -1,17 +0,0 @@ -// -// main.m -// SwaggerClient -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2014 geekerzp. All rights reserved. -// - -@import UIKit; -#import "SWGAppDelegate.h" - -int main(int argc, char * argv[]) -{ - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWGAppDelegate class])); - } -} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m deleted file mode 100644 index d24f349419cd..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m +++ /dev/null @@ -1,265 +0,0 @@ -#import -#import -#import -#import - -@interface DeserializationTest : XCTestCase { - -@private SWGApiClient *apiClient; - -} - -@end - -@implementation DeserializationTest - -- (void)setUp { - [super setUp]; - apiClient = [[SWGApiClient alloc] init]; -} - -- (void)testDeserializeDate { - NSString *dateStr = @"2012-09-27"; - - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - NSTimeZone *timezone = [NSTimeZone timeZoneWithName:@"UTC"]; - [formatter setTimeZone:timezone]; - [formatter setDateFormat:@"yyyy-MM-dd"]; - NSDate *date = [formatter dateFromString:dateStr]; - NSError* error; - NSDate *deserializedDate = [apiClient.responseDeserializer deserialize:dateStr class:@"NSDate*" error:&error]; - XCTAssertNil(error); - XCTAssertEqualWithAccuracy([date timeIntervalSinceReferenceDate], [deserializedDate timeIntervalSinceReferenceDate], 0.001); -} - -- (void)testDeserializeInvalidDate { - NSString *dateStr = @"random string"; - - NSError* error; - NSDate *deserializedDate = [apiClient.responseDeserializer deserialize:dateStr class:@"NSDate*" error:&error]; - XCTAssertNotNil(error); - XCTAssertNil(deserializedDate); -} - -- (void)testDeserializeEmptyDate { - NSString *dateStr = @""; - NSError* error; - NSDate *deserializedDate = [apiClient.responseDeserializer deserialize:dateStr class:@"NSDate*" error:&error]; - XCTAssertNil(error); - XCTAssertNil(deserializedDate); -} - -- (void)testDeserializeDateTime { - NSString *dateTimeStr = @"1997-07-16T19:20:30+00:00"; - - NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; - [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; - NSDate *dateTime = [formatter dateFromString:dateTimeStr]; - NSError* error; - NSDate *deserializedDateTime = [apiClient.responseDeserializer deserialize:dateTimeStr class:@"NSDate*" error:&error]; - XCTAssertNil(error); - XCTAssertEqualWithAccuracy([dateTime timeIntervalSinceReferenceDate], [deserializedDateTime timeIntervalSinceReferenceDate], 0.001); -} - -- (void)testDeserializeUnknownObject { - NSString *data = @"random string"; - NSError* error; - NSNumber *result = [apiClient.responseDeserializer deserialize:data class:@"DeserializationTest*" error:&error]; - XCTAssertNotNil(error); - XCTAssertNil(result); -} - -- (void)testDeserializeObject { - NSNumber *data = @1; - NSError* error; - NSNumber *result = [apiClient.responseDeserializer deserialize:data class:@"NSObject*" error:&error]; - XCTAssertNil(error); - XCTAssertEqualObjects(data, result); -} - -- (void)testDeserializeString { - NSString *data = @"test string"; - NSError* error; - NSString *result = [apiClient.responseDeserializer deserialize:data class:@"NSString*" error:&error]; - XCTAssertNil(error); - XCTAssertTrue([result isEqualToString:data]); -} - -- (void)testDeserializeListOfString { - NSArray *data = @[@"test string"]; - NSError* error; - NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; - XCTAssertNil(error); - XCTAssertTrue([result isKindOfClass:[NSArray class]]); - XCTAssertTrue([result[0] isKindOfClass:[NSString class]]); -} - -- (void)testDeserializeInvalidListOfNumbers { - NSArray *data = @[@"test string"]; - NSError* error; - NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; - XCTAssertNotNil(error); - XCTAssertNil(result); -} - -- (void)testDeserializeListOfNumbers { - NSArray *data = @[@"1.0"]; - NSError* error; - NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; - XCTAssertNil(error); - XCTAssertTrue([result isKindOfClass:[NSArray class]]); - XCTAssertTrue([result[0] isKindOfClass:[NSNumber class]]); -} - -- (void)testDeserializeListOfModels { - NSArray *data = - @[ - @{ - @"id": @119, - @"category": @{ - @"id": @0, - @"name": @"string" - }, - @"name": @"doggie", - @"photoUrls": @[ - @"string" - ], - @"tags": @[ - @{ - @"id": @0, - @"name": @"string" - } - ], - @"status": @"available" - - }]; - NSError* error; - NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; - - XCTAssertTrue([result isKindOfClass:[NSArray class]]); - XCTAssertTrue([[result firstObject] isKindOfClass:[SWGPet class]]); - SWGPet*pet = [result firstObject]; - XCTAssertEqualObjects([pet.photoUrls firstObject],@"string"); - XCTAssertTrue([[pet.tags firstObject] isKindOfClass:[SWGTag class]]); - SWGTag* tag = [pet.tags firstObject]; - XCTAssertEqualObjects(tag._id, @0); - XCTAssertEqualObjects(tag.name, @"string"); - XCTAssertEqualObjects(pet._id, @119); -} - -- (void)testDeserializeMapOfModels { - NSDictionary *data = - @{ - @"pet": @{ - @"id": @119, - @"category": @{ - @"id": @0, - @"name": @"string" - }, - @"name": @"doggie", - @"photoUrls": @[ - @"string" - ], - @"tags": @[ - @{ - @"id": @0, - @"name": @"string" - } - ], - @"status": @"available" - - } - }; - NSError* error; - NSDictionary *result = [apiClient.responseDeserializer deserialize:data class:@"NSDictionary* /* NSString, SWGPet */" error:&error]; - - XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"pet"] isKindOfClass:[SWGPet class]]); - XCTAssertEqualObjects([result[@"pet"] _id], @119); -} - -- (void)testDeserializeNestedMap { - NSDictionary *data = - @{ - @"foo": @{ - @"bar": @1, - @"bar2": [NSNull null] - } - }; - SWGResponseDeserializer* responseDeserializer = [[SWGResponseDeserializer alloc] init]; - NSError* error; - NSDictionary *result = [responseDeserializer deserialize:data class:@"NSDictionary* /* NSString, NSDictionary* /* NSString, NSNumber */ */" error:&error]; - - XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"foo"] isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"foo"][@"bar"] isKindOfClass:[NSNumber class]]); -} - - -- (void)testDeserializeNestedMapWithNullValue { - NSDictionary *data = - @{ - @"foo": @{ - @"bar": @1, - @"bar2": [NSNull null] - } - }; - SWGResponseDeserializer* responseDeserializer = [[SWGResponseDeserializer alloc] init]; - responseDeserializer.treatNullAsError = YES; - NSError* error; - NSDictionary *result = [responseDeserializer deserialize:data class:@"NSDictionary* /* NSString, NSDictionary* /* NSString, NSNumber */ */" error:&error]; - XCTAssertNil(result); - XCTAssertNotNil(error); -} - -- (void)testDeserializeNestedMap2 { - NSDictionary *data = @{ - @"foo": @{ - @"bar": @1 - } - }; - NSError* error; - NSDictionary *result = [apiClient.responseDeserializer deserialize:data class:@"NSDictionary*>*" error:&error]; - - XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"foo"] isKindOfClass:[NSDictionary class]]); - XCTAssertTrue([result[@"foo"][@"bar"] isKindOfClass:[NSNumber class]]); -} - -- (void)testDeserializeNestedList { - NSArray *data = @[@[@"foo"]]; - NSError* error; - NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray* /* NSArray* /* NSString */ */" error:&error]; - - XCTAssertTrue([result isKindOfClass:[NSArray class]]); - XCTAssertTrue([result[0] isKindOfClass:[NSArray class]]); - XCTAssertTrue([result[0][0] isKindOfClass:[NSString class]]); -} - -- (void)testDeserializeBool { - NSString *data; - NSNumber *result; - - data = @"true"; - NSError* error; - result = [apiClient.responseDeserializer deserialize:data class:@"NSNumber*" error:&error]; - XCTAssertTrue([result isEqual:@YES]); - - data = @"false"; - result = [apiClient.responseDeserializer deserialize:data class:@"NSNumber*" error:&error]; - XCTAssertTrue([result isEqual:@NO]); -} - -- (void)testDeserializeStringData { - NSString *data = @"1233"; - - NSError* error; - NSString * returnValue = [apiClient.responseDeserializer deserialize:[data dataUsingEncoding:NSUTF8StringEncoding] class:@"NSString*" error:&error]; - XCTAssertTrue([returnValue isEqual:data]); - - NSNumber *returnNumber = [apiClient.responseDeserializer deserialize:[data dataUsingEncoding:NSUTF8StringEncoding] class:@"NSNumber*" error:&error]; - XCTAssertTrue([returnNumber isEqual:@1233]); -} - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h deleted file mode 100644 index 8216e012a32a..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h +++ /dev/null @@ -1,14 +0,0 @@ -#import -#import - -@interface DatabaseHelper : NSObject - -+ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName; - -+ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName; - -+ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName; - -+ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model; - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m deleted file mode 100644 index 3433ac19ddbf..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m +++ /dev/null @@ -1,42 +0,0 @@ -#import "DatabaseHelper.h" - -@implementation DatabaseHelper - - -+ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName { - NSManagedObjectModel *model = [self createModelWithModelName:mName]; - return [self createDatabaseWithModel:model]; -} - -+ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model { - NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; - [coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil]; - - NSManagedObjectContext *testingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; - [testingContext setPersistentStoreCoordinator:coordinator]; - [testingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy]; - return testingContext; -} - -+ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName { - NSBundle *bundle = [NSBundle bundleForClass:[self class]]; - NSString *path = [bundle pathForResource:mName ofType:@"momd"]; - NSAssert(path, @"Missing Model for name: %@",mName); - NSURL *modURL = [NSURL fileURLWithPath:path]; - return [[NSManagedObjectModel alloc] initWithContentsOfURL:modURL]; -} - -+ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName { - NSFetchRequest *fetch = [[NSFetchRequest alloc] init]; - [fetch setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:ctx]]; - NSError *error = nil; - NSArray *result = [ctx executeFetchRequest:fetch error:&error]; - if (error) { - NSLog(@"Failed clearing context from entities with name [%@]", error); - } - for (id basket in result) { - [ctx deleteObject:basket]; - } -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m deleted file mode 100644 index 52c3213c37f5..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m +++ /dev/null @@ -1,307 +0,0 @@ -#import -#import -#import - -@interface PetApiTest : XCTestCase { -@private - SWGPetApi * api; -} - -@end - -@implementation PetApiTest - -- (void)setUp { - [super setUp]; - api = [[SWGPetApi alloc ]init]; -} - -- (void)tearDown { - [super tearDown]; -} - -- (void)testCreatePetApi { - SWGPetApi *api1 = [[SWGPetApi alloc] init]; - SWGPetApi *api2 = [[SWGPetApi alloc] init]; - XCTAssertEqual(api1.apiClient, api2.apiClient); - - SWGApiClient *client = [[SWGApiClient alloc] init]; - SWGPetApi *api3 = [[SWGPetApi alloc] initWithApiClient:client]; - XCTAssertNotEqual(api1.apiClient, api3.apiClient); -} - -- (void)testCreateAndGetPet { - XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetById"]; - SWGPet* pet = [self createPet]; - - [api addPetWithPet:pet completionHandler:^(NSError *error) { - if(error){ - XCTFail(@"got error %@", error); - } - NSLog(@"%@", [pet _id]); - [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { - if(error){ - XCTFail(@"got error %@", error); - } - if(output){ - XCTAssertNotNil([output _id], @"token was nil"); - - // test category of pet is correct - XCTAssertEqualObjects(output.category._id, pet.category._id); - XCTAssertEqualObjects(output.category.name, pet.category.name); - - // test tags of pet is correct - XCTAssertTrue([output.tags isKindOfClass:[NSArray class]]); - [pet.tags enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - SWGTag *foundTag = [[SWGTag alloc] init]; - for (SWGTag *tag in output.tags) { - if ([tag _id] == [obj _id]) { - foundTag = tag; - } - } - XCTAssertNotNil(foundTag); - XCTAssertEqualObjects([foundTag _id], [obj _id]); - XCTAssertEqualObjects([foundTag name], [obj name]); - }]; - } - [expectation fulfill]; - }]; - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -- (void) testUpdatePet { - XCTestExpectation *expectation = [self expectationWithDescription:@"testUpdatePet"]; - SWGPet* pet = [self createPet]; - - [api addPetWithPet:pet completionHandler:^(NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - else { - [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - if(output == nil){ - NSLog(@"failed to fetch pet"); - } - else { - SWGPet* pet = [[SWGPet alloc] initWithDictionary:[output toDictionary] error:nil]; - NSLog(@"got the pet"); - - [pet setName:@"programmer"]; - [pet setStatus:@"confused"]; - - [api updatePetWithPet:pet - completionHandler:^(NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - if(output == nil){ - NSLog(@"failed to fetch pet"); - } - else { - SWGPet* pet = [[SWGPet alloc] initWithDictionary:[output toDictionary] error:nil]; - XCTAssertNotNil([pet _id], @"pet was nil"); - XCTAssertEqualObjects([pet name], @"programmer", @"pet name was not updated"); - XCTAssertEqualObjects([pet status], @"confused", @"pet status was not updated"); - } - [expectation fulfill]; - - }]; - }]; - } - }]; - } - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -/* -wing328@20151130: comment out the test case below as some data do not contain the 'name' attribute, -which causes an exception when deserializing the data - -- (void)testGetPetByStatus { - XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByStatus"]; - SWGPet* pet = [self createPet]; - - [api addPetWithCompletionBlock:pet completionHandler:^(NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - NSArray* status = [[NSArray alloc] initWithObjects:@"available", nil]; - [api findPetsByStatusWithCompletionBlock:status completionHandler:^(NSArray *output, NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - if(output == nil){ - XCTFail(@"failed to fetch pets"); - } - else { - bool found = false; - for(SWGPet* fetched in output) { - if([pet _id] == [fetched _id]) { - found = true; - } - } - if(found) - [expectation fulfill]; - } - }]; - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} -*/ - -- (void)testGetPetByTags { - XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByTags"]; - SWGPet* pet = [self createPet]; - SWGTag* tag = [[SWGTag alloc] init]; - tag.name = @"tony"; - NSLog(@"%@", pet._id); - pet.tags = (id) @[tag]; - - [api addPetWithPet:pet completionHandler:^(NSError *error) { - if(error) { - XCTFail(@"got error %@", error); - } - NSArray* tags = @[@"tony",@"tony2"]; - - [api findPetsByTagsWithTags:tags completionHandler:^(NSArray *output, NSError *error) { - if(error){ - XCTFail(@"got error %@", error); - } - if(output){ - bool hasTag = false; - for(SWGPet * fetched in output) { - for(SWGTag * tag in [fetched tags]){ - if(fetched._id == pet._id && [[tag name] isEqualToString:@"tony"]) - hasTag = true; - } - } - if(!hasTag) - XCTFail(@"failed to find tag in pet"); - if(hasTag) - [expectation fulfill]; - } - }]; - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -- (void)testDeletePet { - XCTestExpectation *expectation = [self expectationWithDescription:@"testDeletePet"]; - - SWGPet* pet = [self createPet]; - - [api addPetWithPet:pet completionHandler:^(NSError *error) { - if(error){ - XCTFail(@"got error %@", error); - } - [api deletePetWithPetId:pet._id apiKey:@"" completionHandler:^(NSError *error) { - if(error){ - XCTFail(@"got error %@", error); - } - [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { - if(error) { - // good - [expectation fulfill]; - - } - else { - XCTFail(@"expected a failure"); - } - }]; - }]; - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -- (void)testUploadFileWithFormParameter { - XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFileWithFormParameter"]; - - NSURL *fileURL = [self createTempFile]; - - [api uploadFileWithPetId:@1 additionalMetadata:@"special-metadata" file:fileURL completionHandler:^(NSError *error) { - if(error) { - // good - XCTFail(@"expected a failure"); - - } - else { - [expectation fulfill]; - } - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -- (void)testUploadFile { - XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadFile"]; - - NSURL *fileURL = [self createTempFile]; - - [api uploadFileWithPetId:@1 additionalMetadata:nil file:fileURL completionHandler:^(NSError *error) { - if (error) { - XCTFail(@"expected a failure"); - } - else { - [expectation fulfill]; - } - }]; - - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -- (void)TestUploadWithoutFile { - XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"]; - - [api uploadFileWithPetId:@1 additionalMetadata:@"special-metadata" file:nil completionHandler:^(NSError *error) { - if(error) { - XCTFail(@"failed to upload"); - - } - else { - [expectation fulfill]; - } - }]; - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -- (SWGPet*) createPet { - SWGPet * pet = [[SWGPet alloc] init]; - pet._id = @((long) [[NSDate date] timeIntervalSince1970]); - pet.name = @"monkey"; - - SWGCategory * category = [[SWGCategory alloc] init]; - category._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - category.name = @"super-happy"; - pet.category = category; - - SWGTag *tag1 = [[SWGTag alloc] init]; - tag1._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - tag1.name = @"test tag 1"; - SWGTag *tag2 = [[SWGTag alloc] init]; - tag2._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; - tag2.name = @"test tag 2"; - pet.tags = (NSArray *) @[tag1, tag2]; - - pet.status = @"available"; - - NSArray * photos = @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]; - pet.photoUrls = photos; - return pet; -} - -- (NSURL *) createTempFile { - NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]]; - NSData *data = [@"test string" dataUsingEncoding:NSUTF8StringEncoding]; - [data writeToFile:filePath atomically:YES]; - - return [NSURL fileURLWithPath:filePath]; -} -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m deleted file mode 100644 index 9dbde13310b5..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m +++ /dev/null @@ -1,37 +0,0 @@ -#import -#import -#import - -@interface PetTest : XCTestCase { - -@private SWGPet *pet; - -} - -@end - -@implementation PetTest - -- (void)setUp { - [super setUp]; - - NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", - @"status": @"sold", - @"photoUrls": @[@"string"], - @"category": @{ @"id": @1, @"name": @"test category" }, - @"tags": @[ @{ @"id": @1, @"name": @"test tag" } ]}; - pet = [[SWGPet alloc] initWithDictionary:petDict error:nil]; -} - -- (void)testDescription { - NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", - @"status": @"sold", - @"photoUrls": @[@"string"], - @"category": @{ @"id": @1, @"name": @"test category" }, - @"tags": @[ @{ @"id": @1, @"name": @"test tag" } ]}; - NSString *petStr = [petDict description]; - - XCTAssertTrue([[pet description] isEqualToString:petStr]); -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m deleted file mode 100644 index b6bee5a719a9..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m +++ /dev/null @@ -1,191 +0,0 @@ -#import -#import -#import -#import -#import -#import -#import - -@interface SWGApiClientTest : XCTestCase - -@property (nonatomic) SWGApiClient *apiClient; - -@end - -@implementation SWGApiClientTest - -- (void)setUp { - [super setUp]; - self.apiClient = [[SWGApiClient alloc] init]; -} - -- (void)tearDown { - // Put teardown code here. This method is called after the invocation of each test method in the class. - [super tearDown]; -} - -- (void)testSelectHeaderAccept { - NSArray *accepts = nil; - - accepts = @[@"APPLICATION/JSON", @"APPLICATION/XML"]; - SWGSanitizer * sanitizer = [[SWGSanitizer alloc] init]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"application/json", @"application/xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"APPLICATION/xml", @"APPLICATION/json"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"application/vnd.github+json", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"application/json;charset=utf-8", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"application/vnd.github.v3.html+json", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"application/vnd.github.v3.html+json"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); - - accepts = @[@"text/plain", @"application/xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"text/plain, application/xml"); - - accepts = @[]; - XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @""); -} - -- (void)testSelectHeaderContentType { - NSArray *contentTypes = nil; - SWGSanitizer * sanitizer = [[SWGSanitizer alloc] init]; - - contentTypes = @[@"APPLICATION/JSON", @"APPLICATION/XML"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"application/json", @"application/xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"APPLICATION/xml", @"APPLICATION/json"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"application/vnd.github+json", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"application/json;charset=utf-8", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"application/json;charset=utf-8", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"application/vnd.github.v3.html+json", @"application/vnd.github+xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); - - contentTypes = @[@"text/plain", @"application/xml"]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"text/plain"); - - contentTypes = @[]; - XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); -} - -- (void)testConfiguration { - SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; - [config setApiKey:@"123456" forApiKeyIdentifier:@"api_key"]; - [config setApiKeyPrefix:@"PREFIX" forApiKeyPrefixIdentifier:@"api_key"]; - config.username = @"test_username"; - config.password = @"test_password"; - - NSDictionary *headerParams = @{@"test1": @"value1"}; - NSDictionary *queryParams = @{@"test2": @"value2"}; - NSArray *authSettings = @[@"api_key", @"unknown"]; - - // test prefix - XCTAssertEqualObjects(@"PREFIX", config.apiKeyPrefix[@"api_key"]); - [self.apiClient updateHeaderParams:&headerParams - queryParams:&queryParams - WithAuthSettings:authSettings]; - - // test api key auth - XCTAssertEqualObjects(headerParams[@"test1"], @"value1"); - XCTAssertEqualObjects(headerParams[@"api_key"], @"PREFIX 123456"); - XCTAssertEqualObjects(queryParams[@"test2"], @"value2"); - - // test basic auth - XCTAssertEqualObjects(@"test_username", config.username); - XCTAssertEqualObjects(@"test_password", config.password); -} - -- (void)testGetBasicAuthToken { - SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; - config.username = @"test_username"; - config.password = @"test_password"; - - NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", config.username, config.password]; - NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; - basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; - - XCTAssertEqualObjects(basicAuthCredentials, [config getBasicAuthToken]); -} - -- (void)testSanitizeForSerialization { - id result; - id data; - - // nil - data = nil; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, data); - - // NSString - data = @"test string"; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, data); - - // NSNumber - data = @1; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, data); - - // SWGQueryParamCollection - data = [[SWGQueryParamCollection alloc] init]; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, data); - - // NSDate - data = [NSDate dateWithISO8601String:@"1997-07-16T19:20:30.45+01:00"]; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, [data ISO8601StringWithTimeZone:nil usingCalendar:nil]); - - data = [NSDate dateWithISO8601String:@"1997-07-16"]; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, [data ISO8601StringWithTimeZone:nil usingCalendar:nil]); - - // model - NSDictionary *petDict = @{@"id": @1, @"name": @"monkey", - @"category": @{@"id": @1, @"name": @"test category"}, - @"tags": @[@{@"id": @1, @"name": @"test tag1"}, - @{@"id": @2, @"name": @"test tag2"}], - @"status": @"available", - @"photoUrls": @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]}; - data = [[SWGPet alloc] initWithDictionary:petDict error:nil]; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, petDict); - - // NSArray - data = @[@1]; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, data); - - // NSArray of models - NSArray *arrayOfPetDict = @[petDict]; - data = @[[[SWGPet alloc] initWithDictionary:petDict error:nil]]; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, arrayOfPetDict); - - // NSDictionary - data = @{@"test key": @"test value"}; - result = [self.apiClient.sanitizer sanitizeForSerialization:data]; - XCTAssertEqualObjects(result, data); -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m deleted file mode 100644 index 334258fdaf13..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m +++ /dev/null @@ -1,44 +0,0 @@ -#import -#import -#import - -@interface StoreApiTest : XCTestCase - -@property (nonatomic) SWGStoreApi *api; - -@end - -@implementation StoreApiTest - -- (void)setUp { - [super setUp]; - self.api = [[SWGStoreApi alloc] init]; -} - -- (void)tearDown { - [super tearDown]; -} - -- (void)testGetInventory { - XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByStatus"]; - - [self.api getInventoryWithCompletionHandler:^(NSDictionary *output, NSError *error) { - - if (error) { - XCTFail(@"got error %@", error); - } - - if (!output) { - XCTFail(@"failed to fetch inventory"); - } - - XCTAssertNotNil(output.allKeys); - - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist deleted file mode 100644 index 169b6f710ecc..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch deleted file mode 100644 index 6d08c288215a..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// The contents of this file are implicitly included at the beginning of every test case source file. - -#ifdef __OBJC__ - - //@import Specta; - //@import Expecta; - -#endif diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m deleted file mode 100644 index 527c8abd3481..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m +++ /dev/null @@ -1,52 +0,0 @@ -// -// SwaggerClientTests.m -// SwaggerClientTests -// -// Created by geekerzp on 06/26/2015. -// Copyright (c) 2015 geekerzp. All rights reserved. -// - -// https://github.com/Specta/Specta - -/** - * show cases for Specta - ** - -SpecBegin(InitialSpecs) - -describe(@"these will fail", ^{ - - it(@"can do maths", ^{ - expect(1).to.equal(2); - }); - - it(@"can read", ^{ - expect(@"number").to.equal(@"string"); - }); - - it(@"will wait for 10 seconds and fail", ^{ - waitUntil(^(DoneCallback done) { - - }); - }); -}); - -describe(@"these will pass", ^{ - - it(@"can do maths", ^{ - expect(1).beLessThan(23); - }); - - it(@"can read", ^{ - expect(@"team").toNot.contain(@"I"); - }); - - it(@"will wait and succeed", ^{ - waitUntil(^(DoneCallback done) { - done(); - }); - }); -}); - -SpecEnd -*/ diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m deleted file mode 100644 index dd895d705aa0..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m +++ /dev/null @@ -1,40 +0,0 @@ -#import -#import -#import - -@interface UserApiTest : XCTestCase - -@property (nonatomic) SWGUserApi *api; - -@end - -@implementation UserApiTest - -- (void)setUp { - [super setUp]; - self.api = [[SWGUserApi alloc] init]; -} - -- (void)tearDown { - [super tearDown]; -} - -- (void)testLoginUser { - XCTestExpectation *expectation = [self expectationWithDescription:@"test login user"]; - - [self.api loginUserWithUsername:@"test username" password:@"test password" completionHandler:^(NSString *output, NSError *error) { - if (error) { - XCTFail(@"got error %@", error); - } - - if (!output) { - XCTFail(@"response can't be nil"); - } - XCTAssertTrue([output rangeOfString:@"logged in user"].location != NSNotFound); - [expectation fulfill]; - }]; - - [self waitForExpectationsWithTimeout:10.0 handler:nil]; -} - -@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings deleted file mode 100644 index 477b28ff8f86..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings +++ /dev/null @@ -1,2 +0,0 @@ -/* Localized versions of Info.plist keys */ - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/pom.xml b/samples/client/petstore/objc/default/SwaggerClientTests/pom.xml deleted file mode 100644 index a2f239310a27..000000000000 --- a/samples/client/petstore/objc/default/SwaggerClientTests/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - io.swagger - ObjcPetstoreClientTests - pom - 1.0-SNAPSHOT - Objective-C Swagger Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - xcodebuild-test - integration-test - - exec - - - ./run_xcodebuild.sh - - - - - - - diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh old mode 100755 new mode 100644 index 5f88b8fcd74c..c63c525fc247 --- a/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]} +(cd $DIRECTORY/tests ; xcodebuild -scheme TestClientTests-Package test -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}) diff --git a/samples/client/petstore/objc/default/docs/SWGApiResponse.md b/samples/client/petstore/objc/default/docs/SWGApiResponse.md deleted file mode 100644 index 88ff755faf74..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# SWGApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **NSNumber*** | | [optional] -**type** | **NSString*** | | [optional] -**message** | **NSString*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGCategory.md b/samples/client/petstore/objc/default/docs/SWGCategory.md deleted file mode 100644 index 93a8d14ecb98..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGCategory.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGCategory - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**name** | **NSString*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGInlineObject.md b/samples/client/petstore/objc/default/docs/SWGInlineObject.md deleted file mode 100644 index 1d66818927f4..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGInlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGInlineObject - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **NSString*** | Updated name of the pet | [optional] -**status** | **NSString*** | Updated status of the pet | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGInlineObject1.md b/samples/client/petstore/objc/default/docs/SWGInlineObject1.md deleted file mode 100644 index c59e84858851..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGInlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGInlineObject1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional] -**file** | **NSURL*** | file to upload | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGOrder.md b/samples/client/petstore/objc/default/docs/SWGOrder.md deleted file mode 100644 index b2a9f25eae95..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGOrder.md +++ /dev/null @@ -1,15 +0,0 @@ -# SWGOrder - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**petId** | **NSNumber*** | | [optional] -**quantity** | **NSNumber*** | | [optional] -**shipDate** | **NSDate*** | | [optional] -**status** | **NSString*** | Order Status | [optional] -**complete** | **NSNumber*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGPet.md b/samples/client/petstore/objc/default/docs/SWGPet.md deleted file mode 100644 index c8298c66bf14..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGPet.md +++ /dev/null @@ -1,15 +0,0 @@ -# SWGPet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**category** | [**SWGCategory***](SWGCategory.md) | | [optional] -**name** | **NSString*** | | -**photoUrls** | **NSArray<NSString*>*** | | -**tags** | [**NSArray<SWGTag>***](SWGTag.md) | | [optional] -**status** | **NSString*** | pet status in the store | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md deleted file mode 100644 index 47b1b14d8d26..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGPetApi.md +++ /dev/null @@ -1,466 +0,0 @@ -# SWGPetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store -[**deletePet**](SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image - - -# **addPet** -```objc --(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; -``` - -Add a new pet to the store - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Add a new pet to the store -[apiInstance addPetWithPet:pet - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->addPet: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deletePet** -```objc --(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId - apiKey: (NSString*) apiKey - completionHandler: (void (^)(NSError* error)) handler; -``` - -Deletes a pet - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSNumber* petId = @56; // Pet id to delete -NSString* apiKey = @"apiKey_example"; // (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Deletes a pet -[apiInstance deletePetWithPetId:petId - apiKey:apiKey - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->deletePet: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| Pet id to delete | - **apiKey** | **NSString***| | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByStatus** -```objc --(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; -``` - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSArray* status = @[@"status_example"]; // Status values that need to be considered for filter (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Finds Pets by status -[apiInstance findPetsByStatusWithStatus:status - completionHandler: ^(NSArray* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGPetApi->findPetsByStatus: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | [optional] - -### Return type - -[**NSArray***](SWGPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **findPetsByTags** -```objc --(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags - completionHandler: (void (^)(NSArray* output, NSError* error)) handler; -``` - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSArray* tags = @[@"tags_example"]; // Tags to filter by (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Finds Pets by tags -[apiInstance findPetsByTagsWithTags:tags - completionHandler: ^(NSArray* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGPetApi->findPetsByTags: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | [optional] - -### Return type - -[**NSArray***](SWGPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getPetById** -```objc --(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId - completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; -``` - -Find pet by ID - -Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - -// Configure API key authorization: (authentication scheme: api_key) -[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; - - -NSNumber* petId = @56; // ID of pet that needs to be fetched - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Find pet by ID -[apiInstance getPetByIdWithPetId:petId - completionHandler: ^(SWGPet* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGPetApi->getPetById: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| ID of pet that needs to be fetched | - -### Return type - -[**SWGPet***](SWGPet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePet** -```objc --(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet - completionHandler: (void (^)(NSError* error)) handler; -``` - -Update an existing pet - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Update an existing pet -[apiInstance updatePetWithPet:pet - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->updatePet: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updatePetWithForm** -```objc --(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId - name: (NSString*) name - status: (NSString*) status - completionHandler: (void (^)(NSError* error)) handler; -``` - -Updates a pet in the store with form data - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSString* petId = @"petId_example"; // ID of pet that needs to be updated -NSString* name = @"name_example"; // Updated name of the pet (optional) -NSString* status = @"status_example"; // Updated status of the pet (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// Updates a pet in the store with form data -[apiInstance updatePetWithFormWithPetId:petId - name:name - status:status - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->updatePetWithForm: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSString***| ID of pet that needs to be updated | - **name** | **NSString***| Updated name of the pet | [optional] - **status** | **NSString***| Updated status of the pet | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **uploadFile** -```objc --(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId - additionalMetadata: (NSString*) additionalMetadata - file: (NSURL*) file - completionHandler: (void (^)(NSError* error)) handler; -``` - -uploads an image - - - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) -[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; - - -NSNumber* petId = @56; // ID of pet to update -NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional) -NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file to upload (optional) - -SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; - -// uploads an image -[apiInstance uploadFileWithPetId:petId - additionalMetadata:additionalMetadata - file:file - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGPetApi->uploadFile: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **NSNumber***| ID of pet to update | - **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] - **file** | **NSURL*****NSURL***| file to upload | [optional] - -### Return type - -void (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md deleted file mode 100644 index 3c13b68eaff6..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGStoreApi.md +++ /dev/null @@ -1,212 +0,0 @@ -# SWGStoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet - - -# **deleteOrder** -```objc --(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId - completionHandler: (void (^)(NSError* error)) handler; -``` - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```objc - -NSString* orderId = @"orderId_example"; // ID of the order that needs to be deleted - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Delete purchase order by ID -[apiInstance deleteOrderWithOrderId:orderId - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGStoreApi->deleteOrder: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **NSString***| ID of the order that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getInventory** -```objc --(NSURLSessionTask*) getInventoryWithCompletionHandler: - (void (^)(NSDictionary* output, NSError* error)) handler; -``` - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```objc -SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; - -// Configure API key authorization: (authentication scheme: api_key) -[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; -// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed -//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; - - - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Returns pet inventories by status -[apiInstance getInventoryWithCompletionHandler: - ^(NSDictionary* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGStoreApi->getInventory: %@", error); - } - }]; -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**NSDictionary*** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getOrderById** -```objc --(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; -``` - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - -### Example -```objc - -NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Find purchase order by ID -[apiInstance getOrderByIdWithOrderId:orderId - completionHandler: ^(SWGOrder* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGStoreApi->getOrderById: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **NSString***| ID of pet that needs to be fetched | - -### Return type - -[**SWGOrder***](SWGOrder.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **placeOrder** -```objc --(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order - completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; -``` - -Place an order for a pet - - - -### Example -```objc - -SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) - -SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; - -// Place an order for a pet -[apiInstance placeOrderWithOrder:order - completionHandler: ^(SWGOrder* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGStoreApi->placeOrder: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] - -### Return type - -[**SWGOrder***](SWGOrder.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/objc/default/docs/SWGTag.md b/samples/client/petstore/objc/default/docs/SWGTag.md deleted file mode 100644 index 5495d5c8a99f..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGTag.md +++ /dev/null @@ -1,11 +0,0 @@ -# SWGTag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**name** | **NSString*** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGUser.md b/samples/client/petstore/objc/default/docs/SWGUser.md deleted file mode 100644 index 35bf5540cad0..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGUser.md +++ /dev/null @@ -1,17 +0,0 @@ -# SWGUser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_id** | **NSNumber*** | | [optional] -**username** | **NSString*** | | [optional] -**firstName** | **NSString*** | | [optional] -**lastName** | **NSString*** | | [optional] -**email** | **NSString*** | | [optional] -**password** | **NSString*** | | [optional] -**phone** | **NSString*** | | [optional] -**userStatus** | **NSNumber*** | User Status | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md deleted file mode 100644 index 51792caed6bd..000000000000 --- a/samples/client/petstore/objc/default/docs/SWGUserApi.md +++ /dev/null @@ -1,402 +0,0 @@ -# SWGUserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](SWGUserApi.md#createuser) | **POST** /user | Create user -[**createUsersWithArrayInput**](SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name -[**loginUser**](SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system -[**logoutUser**](SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user - - -# **createUser** -```objc --(NSURLSessionTask*) createUserWithUser: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Create user - -This can only be done by the logged in user. - -### Example -```objc - -SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Create user -[apiInstance createUserWithUser:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->createUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithArrayInput** -```objc --(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Creates list of users with given input array - - - -### Example -```objc - -NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Creates list of users with given input array -[apiInstance createUsersWithArrayInputWithUser:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **createUsersWithListInput** -```objc --(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Creates list of users with given input array - - - -### Example -```objc - -NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Creates list of users with given input array -[apiInstance createUsersWithListInputWithUser:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **deleteUser** -```objc --(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username - completionHandler: (void (^)(NSError* error)) handler; -``` - -Delete user - -This can only be done by the logged in user. - -### Example -```objc - -NSString* username = @"username_example"; // The name that needs to be deleted - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Delete user -[apiInstance deleteUserWithUsername:username - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->deleteUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **getUserByName** -```objc --(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username - completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; -``` - -Get user by user name - - - -### Example -```objc - -NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Get user by user name -[apiInstance getUserByNameWithUsername:username - completionHandler: ^(SWGUser* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGUserApi->getUserByName: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**SWGUser***](SWGUser.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **loginUser** -```objc --(NSURLSessionTask*) loginUserWithUsername: (NSString*) username - password: (NSString*) password - completionHandler: (void (^)(NSString* output, NSError* error)) handler; -``` - -Logs user into the system - - - -### Example -```objc - -NSString* username = @"username_example"; // The user name for login (optional) -NSString* password = @"password_example"; // The password for login in clear text (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Logs user into the system -[apiInstance loginUserWithUsername:username - password:password - completionHandler: ^(NSString* output, NSError* error) { - if (output) { - NSLog(@"%@", output); - } - if (error) { - NSLog(@"Error calling SWGUserApi->loginUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| The user name for login | [optional] - **password** | **NSString***| The password for login in clear text | [optional] - -### Return type - -**NSString*** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **logoutUser** -```objc --(NSURLSessionTask*) logoutUserWithCompletionHandler: - (void (^)(NSError* error)) handler; -``` - -Logs out current logged in user session - - - -### Example -```objc - - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Logs out current logged in user session -[apiInstance logoutUserWithCompletionHandler: - ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->logoutUser: %@", error); - } - }]; -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **updateUser** -```objc --(NSURLSessionTask*) updateUserWithUsername: (NSString*) username - user: (SWGUser*) user - completionHandler: (void (^)(NSError* error)) handler; -``` - -Updated user - -This can only be done by the logged in user. - -### Example -```objc - -NSString* username = @"username_example"; // name that need to be deleted -SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) - -SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; - -// Updated user -[apiInstance updateUserWithUsername:username - user:user - completionHandler: ^(NSError* error) { - if (error) { - NSLog(@"Error calling SWGUserApi->updateUser: %@", error); - } - }]; -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **NSString***| name that need to be deleted | - **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] - -### Return type - -void (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh deleted file mode 100644 index f53a75d4fabe..000000000000 --- a/samples/client/petstore/objc/default/git_push.sh +++ /dev/null @@ -1,57 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 -git_host=$4 - -if [ "$git_host" = "" ]; then - git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" -fi - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' From fd06c79f54729b0a3c0a4daa0cd18611ed733d50 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Fri, 9 Jan 2026 09:14:31 +0000 Subject: [PATCH 2/3] [swift][client] Update CI to use Xcode 26 --- bitrise.yml | 2 +- samples/client/petstore/swift-combine/swift-combine_test_all.sh | 2 +- .../alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift5/default/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../apiNonStaticMethod/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../combineDeferredLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift6/combineLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift6/default/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../swift6/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- .../urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index b4af07734108..54ce23c6c534 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -48,4 +48,4 @@ workflows: meta: bitrise.io: - stack: osx-xcode-16.3.x + stack: osx-xcode-26.2.x diff --git a/samples/client/petstore/swift-combine/swift-combine_test_all.sh b/samples/client/petstore/swift-combine/swift-combine_test_all.sh index 7cf230096a22..07596498e85b 100755 --- a/samples/client/petstore/swift-combine/swift-combine_test_all.sh +++ b/samples/client/petstore/swift-combine/swift-combine_test_all.sh @@ -3,4 +3,4 @@ set -e DIRECTORY=`dirname $0` -(cd $DIRECTORY/tests ; xcodebuild -scheme TestClientTests-Package test -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}) +(cd $DIRECTORY/tests ; xcodebuild -scheme TestClientTests-Package test -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}) diff --git a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/combineLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift5/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/alamofireLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/apiNonStaticMethod/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/asyncAwaitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/combineDeferredLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/combineDeferredLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/combineDeferredLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/combineDeferredLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/combineLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/combineLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/combineLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/combineLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/default/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/promisekitLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/rxswiftLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh index bf788fc94cc9..06de6eb78c2c 100755 --- a/samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/swift6/urlsessionLibrary/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 16,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} +xcodebuild clean build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]} From 1e46514e70fdcf31c4ff171da597338978773789 Mon Sep 17 00:00:00 2001 From: Bruno Coelho <4brunu@gmail.com> Date: Fri, 9 Jan 2026 10:00:05 +0000 Subject: [PATCH 3/3] Revert "[swift][client] Remove old objc samples" This reverts commit b50189968b2cea2aad0ac8494cfcc458b36e9a4a. --- .../client/petstore/objc/core-data/.gitignore | 53 ++ .../objc/core-data/.openapi-generator-ignore | 23 + .../objc/core-data/.openapi-generator/FILES | 72 ++ .../objc/core-data/.openapi-generator/VERSION | 1 + .../client/petstore/objc/core-data/README.md | 147 ++++ .../objc/core-data/SwaggerClient.podspec | 36 + .../core-data/SwaggerClient/Api/SWGPetApi.h | 139 ++++ .../core-data/SwaggerClient/Api/SWGPetApi.m | 578 ++++++++++++++ .../core-data/SwaggerClient/Api/SWGStoreApi.h | 78 ++ .../core-data/SwaggerClient/Api/SWGStoreApi.m | 297 ++++++++ .../core-data/SwaggerClient/Api/SWGUserApi.h | 131 ++++ .../core-data/SwaggerClient/Api/SWGUserApi.m | 542 ++++++++++++++ .../Core/JSONValueTransformer+ISO8601.h | 19 + .../Core/JSONValueTransformer+ISO8601.m | 17 + .../core-data/SwaggerClient/Core/SWGApi.h | 29 + .../SwaggerClient/Core/SWGApiClient.h | 121 +++ .../SwaggerClient/Core/SWGApiClient.m | 376 ++++++++++ .../Core/SWGBasicAuthTokenProvider.h | 14 + .../Core/SWGBasicAuthTokenProvider.m | 19 + .../SwaggerClient/Core/SWGConfiguration.h | 89 +++ .../Core/SWGDefaultConfiguration.h | 171 +++++ .../Core/SWGDefaultConfiguration.m | 152 ++++ .../Core/SWGJSONRequestSerializer.h | 18 + .../Core/SWGJSONRequestSerializer.m | 37 + .../Core/SWGJSONResponseSerializer.m | 39 + .../core-data/SwaggerClient/Core/SWGLogger.h | 61 ++ .../core-data/SwaggerClient/Core/SWGLogger.m | 73 ++ .../core-data/SwaggerClient/Core/SWGObject.h | 19 + .../core-data/SwaggerClient/Core/SWGObject.m | 44 ++ .../Core/SWGQueryParamCollection.h | 24 + .../Core/SWGQueryParamCollection.m | 20 + .../Core/SWGResponseDeserializer.h | 57 ++ .../Core/SWGResponseDeserializer.m | 247 ++++++ .../SwaggerClient/Core/SWGSanitizer.h | 63 ++ .../SwaggerClient/Core/SWGSanitizer.m | 170 +++++ .../SwaggerClient/Model/SWGCategory.h | 30 + .../SwaggerClient/Model/SWGCategory.m | 34 + .../Model/SWGCategoryManagedObject.h | 34 + .../Model/SWGCategoryManagedObject.m | 12 + .../Model/SWGCategoryManagedObjectBuilder.h | 35 + .../Model/SWGCategoryManagedObjectBuilder.m | 55 ++ .../SwaggerClient/Model/SWGInlineObject.h | 32 + .../SwaggerClient/Model/SWGInlineObject.m | 34 + .../SwaggerClient/Model/SWGInlineObject1.h | 32 + .../SwaggerClient/Model/SWGInlineObject1.m | 34 + .../Model/SWGInlineObject1ManagedObject.h | 36 + .../Model/SWGInlineObject1ManagedObject.m | 12 + .../SWGInlineObject1ManagedObjectBuilder.h | 35 + .../SWGInlineObject1ManagedObjectBuilder.m | 55 ++ .../Model/SWGInlineObjectManagedObject.h | 36 + .../Model/SWGInlineObjectManagedObject.m | 12 + .../SWGInlineObjectManagedObjectBuilder.h | 35 + .../SWGInlineObjectManagedObjectBuilder.m | 55 ++ .../SWGModel.xcdatamodeld/.xccurrentversion | 8 + .../SWGModel.xcdatamodel/contents | 39 + .../core-data/SwaggerClient/Model/SWGOrder.h | 39 + .../core-data/SwaggerClient/Model/SWGOrder.m | 34 + .../Model/SWGOrderManagedObject.h | 43 ++ .../Model/SWGOrderManagedObject.m | 16 + .../Model/SWGOrderManagedObjectBuilder.h | 35 + .../Model/SWGOrderManagedObjectBuilder.m | 63 ++ .../core-data/SwaggerClient/Model/SWGPet.h | 45 ++ .../core-data/SwaggerClient/Model/SWGPet.m | 34 + .../SwaggerClient/Model/SWGPetManagedObject.h | 49 ++ .../SwaggerClient/Model/SWGPetManagedObject.m | 16 + .../Model/SWGPetManagedObjectBuilder.h | 39 + .../Model/SWGPetManagedObjectBuilder.m | 90 +++ .../core-data/SwaggerClient/Model/SWGTag.h | 30 + .../core-data/SwaggerClient/Model/SWGTag.m | 34 + .../SwaggerClient/Model/SWGTagManagedObject.h | 34 + .../SwaggerClient/Model/SWGTagManagedObject.m | 12 + .../Model/SWGTagManagedObjectBuilder.h | 35 + .../Model/SWGTagManagedObjectBuilder.m | 55 ++ .../core-data/SwaggerClient/Model/SWGUser.h | 43 ++ .../core-data/SwaggerClient/Model/SWGUser.m | 34 + .../Model/SWGUserManagedObject.h | 47 ++ .../Model/SWGUserManagedObject.m | 18 + .../Model/SWGUserManagedObjectBuilder.h | 35 + .../Model/SWGUserManagedObjectBuilder.m | 67 ++ .../objc/core-data/SwaggerClientTests/Podfile | 12 + .../SwaggerClient.xcodeproj/project.pbxproj | 706 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/xcschemes/All Tests.xcscheme | 81 ++ .../xcschemes/SwaggerClient-Example.xcscheme | 101 +++ .../AppIcon.appiconset/Contents.json | 53 ++ .../LaunchImage.launchimage/Contents.json | 51 ++ .../SwaggerClient/Launch Screen.storyboard | 50 ++ .../SwaggerClient/Main.storyboard | 27 + .../SwaggerClient/SWGAppDelegate.h | 15 + .../SwaggerClient/SWGAppDelegate.m | 19 + .../SwaggerClient/SWGViewController.h | 13 + .../SwaggerClient/SWGViewController.m | 60 ++ .../SwaggerClient/SwaggerClient-Info.plist | 54 ++ .../SwaggerClient/SwaggerClient-Prefix.pch | 16 + .../SwaggerClient/en.lproj/InfoPlist.strings | 2 + .../SwaggerClientTests/SwaggerClient/main.m | 17 + .../SwaggerClientTests/Tests/BuildersTest.m | 117 +++ .../Tests/Helpers/DatabaseHelper.h | 14 + .../Tests/Helpers/DatabaseHelper.m | 42 ++ .../SwaggerClientTests/Tests/Tests-Info.plist | 22 + .../SwaggerClientTests/Tests/Tests-Prefix.pch | 8 + .../Tests/en.lproj/InfoPlist.strings | 2 + .../objc/core-data/SwaggerClientTests/pom.xml | 43 ++ .../SwaggerClientTests/run_xcodebuild.sh | 2 +- .../objc/core-data/docs/SWGCategory.md | 11 + .../objc/core-data/docs/SWGInlineObject.md | 11 + .../objc/core-data/docs/SWGInlineObject1.md | 11 + .../petstore/objc/core-data/docs/SWGOrder.md | 15 + .../petstore/objc/core-data/docs/SWGPet.md | 15 + .../petstore/objc/core-data/docs/SWGPetApi.md | 466 ++++++++++++ .../objc/core-data/docs/SWGStoreApi.md | 212 ++++++ .../petstore/objc/core-data/docs/SWGTag.md | 11 + .../petstore/objc/core-data/docs/SWGUser.md | 17 + .../objc/core-data/docs/SWGUserApi.md | 402 ++++++++++ .../petstore/objc/core-data/git_push.sh | 57 ++ .../client/petstore/objc/default/.gitignore | 53 ++ .../objc/default/.openapi-generator-ignore | 23 + .../objc/default/.openapi-generator/FILES | 50 ++ .../objc/default/.openapi-generator/VERSION | 1 + .../objc/default/OpenAPIClient.podspec | 37 + .../client/petstore/objc/default/README.md | 147 ++++ .../objc/default/SwaggerClient.podspec | 36 + .../default/SwaggerClient/Api/SWGPetApi.h | 139 ++++ .../default/SwaggerClient/Api/SWGPetApi.m | 578 ++++++++++++++ .../default/SwaggerClient/Api/SWGStoreApi.h | 78 ++ .../default/SwaggerClient/Api/SWGStoreApi.m | 297 ++++++++ .../default/SwaggerClient/Api/SWGUserApi.h | 131 ++++ .../default/SwaggerClient/Api/SWGUserApi.m | 542 ++++++++++++++ .../Core/JSONValueTransformer+ISO8601.h | 19 + .../Core/JSONValueTransformer+ISO8601.m | 17 + .../objc/default/SwaggerClient/Core/SWGApi.h | 29 + .../default/SwaggerClient/Core/SWGApiClient.h | 121 +++ .../default/SwaggerClient/Core/SWGApiClient.m | 376 ++++++++++ .../Core/SWGBasicAuthTokenProvider.h | 14 + .../Core/SWGBasicAuthTokenProvider.m | 19 + .../SwaggerClient/Core/SWGConfiguration.h | 89 +++ .../Core/SWGDefaultConfiguration.h | 171 +++++ .../Core/SWGDefaultConfiguration.m | 152 ++++ .../Core/SWGJSONRequestSerializer.h | 18 + .../Core/SWGJSONRequestSerializer.m | 37 + .../default/SwaggerClient/Core/SWGLogger.h | 61 ++ .../default/SwaggerClient/Core/SWGLogger.m | 73 ++ .../default/SwaggerClient/Core/SWGObject.h | 19 + .../default/SwaggerClient/Core/SWGObject.m | 44 ++ .../Core/SWGQueryParamCollection.h | 24 + .../Core/SWGQueryParamCollection.m | 20 + .../Core/SWGResponseDeserializer.h | 57 ++ .../Core/SWGResponseDeserializer.m | 247 ++++++ .../default/SwaggerClient/Core/SWGSanitizer.h | 63 ++ .../default/SwaggerClient/Core/SWGSanitizer.m | 170 +++++ .../default/SwaggerClient/Model/SWGCategory.h | 30 + .../default/SwaggerClient/Model/SWGCategory.m | 34 + .../SwaggerClient/Model/SWGInlineObject.h | 32 + .../SwaggerClient/Model/SWGInlineObject.m | 34 + .../SwaggerClient/Model/SWGInlineObject1.h | 32 + .../SwaggerClient/Model/SWGInlineObject1.m | 34 + .../default/SwaggerClient/Model/SWGOrder.h | 39 + .../default/SwaggerClient/Model/SWGOrder.m | 34 + .../objc/default/SwaggerClient/Model/SWGPet.h | 45 ++ .../objc/default/SwaggerClient/Model/SWGPet.m | 34 + .../objc/default/SwaggerClient/Model/SWGTag.h | 30 + .../objc/default/SwaggerClient/Model/SWGTag.m | 34 + .../default/SwaggerClient/Model/SWGUser.h | 43 ++ .../default/SwaggerClient/Model/SWGUser.m | 34 + .../objc/default/SwaggerClientTests/Podfile | 12 + .../SwaggerClient.xcodeproj/project.pbxproj | 592 +++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/xcschemes/All Tests.xcscheme | 81 ++ .../xcschemes/SwaggerClient-Example.xcscheme | 101 +++ .../AppIcon.appiconset/Contents.json | 53 ++ .../LaunchImage.launchimage/Contents.json | 51 ++ .../SwaggerClient/Launch Screen.storyboard | 50 ++ .../SwaggerClient/Main.storyboard | 27 + .../SwaggerClient/SWGAppDelegate.h | 15 + .../SwaggerClient/SWGAppDelegate.m | 46 ++ .../SwaggerClient/SWGViewController.h | 13 + .../SwaggerClient/SWGViewController.m | 60 ++ .../SwaggerClient/SwaggerClient-Info.plist | 54 ++ .../SwaggerClient/SwaggerClient-Prefix.pch | 16 + .../SwaggerClient/en.lproj/InfoPlist.strings | 2 + .../SwaggerClientTests/SwaggerClient/main.m | 17 + .../Tests/DeserializationTest.m | 265 +++++++ .../Tests/Helpers/DatabaseHelper.h | 14 + .../Tests/Helpers/DatabaseHelper.m | 42 ++ .../SwaggerClientTests/Tests/PetApiTest.m | 307 ++++++++ .../SwaggerClientTests/Tests/PetTest.m | 37 + .../Tests/SWGApiClientTest.m | 191 +++++ .../SwaggerClientTests/Tests/StoreApiTest.m | 44 ++ .../SwaggerClientTests/Tests/Tests-Info.plist | 22 + .../SwaggerClientTests/Tests/Tests-Prefix.pch | 8 + .../default/SwaggerClientTests/Tests/Tests.m | 52 ++ .../SwaggerClientTests/Tests/UserApiTest.m | 40 + .../Tests/en.lproj/InfoPlist.strings | 2 + .../objc/default/SwaggerClientTests/pom.xml | 43 ++ .../SwaggerClientTests/run_xcodebuild.sh | 2 +- .../objc/default/docs/SWGApiResponse.md | 12 + .../petstore/objc/default/docs/SWGCategory.md | 11 + .../objc/default/docs/SWGInlineObject.md | 11 + .../objc/default/docs/SWGInlineObject1.md | 11 + .../petstore/objc/default/docs/SWGOrder.md | 15 + .../petstore/objc/default/docs/SWGPet.md | 15 + .../petstore/objc/default/docs/SWGPetApi.md | 466 ++++++++++++ .../petstore/objc/default/docs/SWGStoreApi.md | 212 ++++++ .../petstore/objc/default/docs/SWGTag.md | 11 + .../petstore/objc/default/docs/SWGUser.md | 17 + .../petstore/objc/default/docs/SWGUserApi.md | 402 ++++++++++ .../client/petstore/objc/default/git_push.sh | 57 ++ 207 files changed, 16285 insertions(+), 2 deletions(-) create mode 100644 samples/client/petstore/objc/core-data/.gitignore create mode 100644 samples/client/petstore/objc/core-data/.openapi-generator-ignore create mode 100644 samples/client/petstore/objc/core-data/.openapi-generator/FILES create mode 100644 samples/client/petstore/objc/core-data/.openapi-generator/VERSION create mode 100644 samples/client/petstore/objc/core-data/README.md create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient.podspec create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings create mode 100644 samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml mode change 100644 => 100755 samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh create mode 100644 samples/client/petstore/objc/core-data/docs/SWGCategory.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGInlineObject.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGOrder.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGPet.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGPetApi.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGStoreApi.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGTag.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGUser.md create mode 100644 samples/client/petstore/objc/core-data/docs/SWGUserApi.md create mode 100644 samples/client/petstore/objc/core-data/git_push.sh create mode 100644 samples/client/petstore/objc/default/.gitignore create mode 100644 samples/client/petstore/objc/default/.openapi-generator-ignore create mode 100644 samples/client/petstore/objc/default/.openapi-generator/FILES create mode 100644 samples/client/petstore/objc/default/.openapi-generator/VERSION create mode 100644 samples/client/petstore/objc/default/OpenAPIClient.podspec create mode 100644 samples/client/petstore/objc/default/README.md create mode 100644 samples/client/petstore/objc/default/SwaggerClient.podspec create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h create mode 100644 samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Podfile create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings create mode 100644 samples/client/petstore/objc/default/SwaggerClientTests/pom.xml mode change 100644 => 100755 samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh create mode 100644 samples/client/petstore/objc/default/docs/SWGApiResponse.md create mode 100644 samples/client/petstore/objc/default/docs/SWGCategory.md create mode 100644 samples/client/petstore/objc/default/docs/SWGInlineObject.md create mode 100644 samples/client/petstore/objc/default/docs/SWGInlineObject1.md create mode 100644 samples/client/petstore/objc/default/docs/SWGOrder.md create mode 100644 samples/client/petstore/objc/default/docs/SWGPet.md create mode 100644 samples/client/petstore/objc/default/docs/SWGPetApi.md create mode 100644 samples/client/petstore/objc/default/docs/SWGStoreApi.md create mode 100644 samples/client/petstore/objc/default/docs/SWGTag.md create mode 100644 samples/client/petstore/objc/default/docs/SWGUser.md create mode 100644 samples/client/petstore/objc/default/docs/SWGUserApi.md create mode 100644 samples/client/petstore/objc/default/git_push.sh diff --git a/samples/client/petstore/objc/core-data/.gitignore b/samples/client/petstore/objc/core-data/.gitignore new file mode 100644 index 000000000000..01103f6f5ef6 --- /dev/null +++ b/samples/client/petstore/objc/core-data/.gitignore @@ -0,0 +1,53 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/samples/client/petstore/objc/core-data/.openapi-generator-ignore b/samples/client/petstore/objc/core-data/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/objc/core-data/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/FILES b/samples/client/petstore/objc/core-data/.openapi-generator/FILES new file mode 100644 index 000000000000..6f6cd95849a0 --- /dev/null +++ b/samples/client/petstore/objc/core-data/.openapi-generator/FILES @@ -0,0 +1,72 @@ +.gitignore +README.md +SwaggerClient.podspec +SwaggerClient/Api/SWGPetApi.h +SwaggerClient/Api/SWGPetApi.m +SwaggerClient/Api/SWGStoreApi.h +SwaggerClient/Api/SWGStoreApi.m +SwaggerClient/Api/SWGUserApi.h +SwaggerClient/Api/SWGUserApi.m +SwaggerClient/Core/JSONValueTransformer+ISO8601.h +SwaggerClient/Core/JSONValueTransformer+ISO8601.m +SwaggerClient/Core/SWGApi.h +SwaggerClient/Core/SWGApiClient.h +SwaggerClient/Core/SWGApiClient.m +SwaggerClient/Core/SWGBasicAuthTokenProvider.h +SwaggerClient/Core/SWGBasicAuthTokenProvider.m +SwaggerClient/Core/SWGConfiguration.h +SwaggerClient/Core/SWGDefaultConfiguration.h +SwaggerClient/Core/SWGDefaultConfiguration.m +SwaggerClient/Core/SWGJSONRequestSerializer.h +SwaggerClient/Core/SWGJSONRequestSerializer.m +SwaggerClient/Core/SWGLogger.h +SwaggerClient/Core/SWGLogger.m +SwaggerClient/Core/SWGObject.h +SwaggerClient/Core/SWGObject.m +SwaggerClient/Core/SWGQueryParamCollection.h +SwaggerClient/Core/SWGQueryParamCollection.m +SwaggerClient/Core/SWGResponseDeserializer.h +SwaggerClient/Core/SWGResponseDeserializer.m +SwaggerClient/Core/SWGSanitizer.h +SwaggerClient/Core/SWGSanitizer.m +SwaggerClient/Model/SWGCategory.h +SwaggerClient/Model/SWGCategory.m +SwaggerClient/Model/SWGCategoryManagedObject.h +SwaggerClient/Model/SWGCategoryManagedObject.m +SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h +SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m +SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion +SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents +SwaggerClient/Model/SWGOrder.h +SwaggerClient/Model/SWGOrder.m +SwaggerClient/Model/SWGOrderManagedObject.h +SwaggerClient/Model/SWGOrderManagedObject.m +SwaggerClient/Model/SWGOrderManagedObjectBuilder.h +SwaggerClient/Model/SWGOrderManagedObjectBuilder.m +SwaggerClient/Model/SWGPet.h +SwaggerClient/Model/SWGPet.m +SwaggerClient/Model/SWGPetManagedObject.h +SwaggerClient/Model/SWGPetManagedObject.m +SwaggerClient/Model/SWGPetManagedObjectBuilder.h +SwaggerClient/Model/SWGPetManagedObjectBuilder.m +SwaggerClient/Model/SWGTag.h +SwaggerClient/Model/SWGTag.m +SwaggerClient/Model/SWGTagManagedObject.h +SwaggerClient/Model/SWGTagManagedObject.m +SwaggerClient/Model/SWGTagManagedObjectBuilder.h +SwaggerClient/Model/SWGTagManagedObjectBuilder.m +SwaggerClient/Model/SWGUser.h +SwaggerClient/Model/SWGUser.m +SwaggerClient/Model/SWGUserManagedObject.h +SwaggerClient/Model/SWGUserManagedObject.m +SwaggerClient/Model/SWGUserManagedObjectBuilder.h +SwaggerClient/Model/SWGUserManagedObjectBuilder.m +docs/SWGCategory.md +docs/SWGOrder.md +docs/SWGPet.md +docs/SWGPetApi.md +docs/SWGStoreApi.md +docs/SWGTag.md +docs/SWGUser.md +docs/SWGUserApi.md +git_push.sh diff --git a/samples/client/petstore/objc/core-data/.openapi-generator/VERSION b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION new file mode 100644 index 000000000000..909dcd0eca63 --- /dev/null +++ b/samples/client/petstore/objc/core-data/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.19.0-SNAPSHOT diff --git a/samples/client/petstore/objc/core-data/README.md b/samples/client/petstore/objc/core-data/README.md new file mode 100644 index 000000000000..1c81b8151b46 --- /dev/null +++ b/samples/client/petstore/objc/core-data/README.md @@ -0,0 +1,147 @@ +# SwaggerClient + +This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + +This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: +- Generator version: 7.19.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.ObjcClientCodegen + +## Requirements + +The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project. + +## Installation & Usage +### Install from Github using [CocoaPods](https://cocoapods.org/) + +Add the following to the Podfile: + +```ruby +pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +``` + +To specify a particular branch, append `, :branch => 'branch-name-here'` + +To specify a particular commit, append `, :commit => '11aa22'` + +### Install from local path using [CocoaPods](https://cocoapods.org/) + +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: + +```ruby +pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' +``` + +### Usage + +Import the following: + +```objc +#import +#import +// load models +#import +#import +#import +#import +#import +// load API classes for accessing endpoints +#import +#import +#import + +``` + +## Recommendation + +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```objc + +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + +// Add a new pet to the store +[apiInstance addPetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user +*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [SWGCategory](docs/SWGCategory.md) + - [SWGOrder](docs/SWGOrder.md) + - [SWGPet](docs/SWGPet.md) + - [SWGTag](docs/SWGTag.md) + - [SWGUser](docs/SWGUser.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClient.podspec b/samples/client/petstore/objc/core-data/SwaggerClient.podspec new file mode 100644 index 000000000000..310ec4844743 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient.podspec @@ -0,0 +1,36 @@ +# +# Be sure to run `pod lib lint SwaggerClient.podspec' to ensure this is a +# valid spec and remove all comments before submitting the spec. +# +# Any lines starting with a # are optional, but encouraged +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = "SwaggerClient" + s.version = "1.0.0" + + s.summary = "OpenAPI Petstore" + s.description = <<-DESC + This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + DESC + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.frameworks = 'SystemConfiguration', 'CoreData' + + s.homepage = "https://github.com/openapitools/openapi-generator" + s.license = "Proprietary" + s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } + s.author = { "OpenAPI" => "team@openapitools.org" } + + s.source_files = 'SwaggerClient/**/*.{m,h}' + s.public_header_files = 'SwaggerClient/**/*.h' + s.resources = 'SwaggerClient/**/*.{xcdatamodeld,xcdatamodel}' + + s.dependency 'AFNetworking', '~> 3' + s.dependency 'JSONModel', '~> 1.2' + s.dependency 'ISO8601', '~> 0.6' +end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h new file mode 100644 index 000000000000..1b1309c48761 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.h @@ -0,0 +1,139 @@ +#import +#import "SWGPet.h" +#import "SWGApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface SWGPetApi: NSObject + +extern NSString* kSWGPetApiErrorDomain; +extern NSInteger kSWGPetApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Add a new pet to the store +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Deletes a pet +/// +/// +/// @param petId Pet id to delete +/// @param apiKey (optional) +/// +/// code:400 message:"Invalid pet value" +/// +/// @return void +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; + + +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// +/// @param status Status values that need to be considered for filter (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid status value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// +/// @param tags Tags to filter by (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid tag value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// +/// @param petId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found" +/// +/// @return SWGPet* +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; + + +/// Update an existing pet +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found", +/// code:405 message:"Validation exception" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Updates a pet in the store with form data +/// +/// +/// @param petId ID of pet that needs to be updated +/// @param name Updated name of the pet (optional) +/// @param status Updated status of the pet (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; + + +/// uploads an image +/// +/// +/// @param petId ID of pet to update +/// @param additionalMetadata Additional data to pass to server (optional) +/// @param file file to upload (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m new file mode 100644 index 000000000000..9a774f3d9b7f --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGPetApi.m @@ -0,0 +1,578 @@ +#import "SWGPetApi.h" +#import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" +#import "SWGPet.h" + + +@interface SWGPetApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation SWGPetApi + +NSString* kSWGPetApiErrorDomain = @"SWGPetApiErrorDomain"; +NSInteger kSWGPetApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[SWGApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Add a new pet to the store +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Deletes a pet +/// +/// @param petId Pet id to delete +/// +/// @param apiKey (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (apiKey != nil) { + headerParams[@"api_key"] = apiKey; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// @param status Status values that need to be considered for filter (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (status != nil) { + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// @param tags Tags to filter by (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (tags != nil) { + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// @param petId ID of pet that needs to be fetched +/// +/// @returns SWGPet* +/// +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGPet*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGPet*)data, error); + } + }]; +} + +/// +/// Update an existing pet +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updates a pet in the store with form data +/// +/// @param petId ID of pet that needs to be updated +/// +/// @param name Updated name of the pet (optional) +/// +/// @param status Updated status of the pet (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (name) { + formParams[@"name"] = name; + } + if (status) { + formParams[@"status"] = status; + } + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// uploads an image +/// +/// @param petId ID of pet to update +/// +/// @param additionalMetadata Additional data to pass to server (optional) +/// +/// @param file file to upload (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"multipart/form-data"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (additionalMetadata) { + formParams[@"additionalMetadata"] = additionalMetadata; + } + localVarFiles[@"file"] = file; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h new file mode 100644 index 000000000000..935845f72151 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.h @@ -0,0 +1,78 @@ +#import +#import "SWGOrder.h" +#import "SWGApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface SWGStoreApi: NSObject + +extern NSString* kSWGStoreApiErrorDomain; +extern NSInteger kSWGStoreApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// +/// @param orderId ID of the order that needs to be deleted +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return void +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; + + +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// +/// +/// code:200 message:"successful operation" +/// +/// @return NSDictionary* +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; + + +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +/// +/// @param orderId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return SWGOrder* +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; + + +/// Place an order for a pet +/// +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid Order" +/// +/// @return SWGOrder* +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m new file mode 100644 index 000000000000..14a5c4239217 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGStoreApi.m @@ -0,0 +1,297 @@ +#import "SWGStoreApi.h" +#import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" +#import "SWGOrder.h" + + +@interface SWGStoreApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation SWGStoreApi + +NSString* kSWGStoreApiErrorDomain = @"SWGStoreApiErrorDomain"; +NSInteger kSWGStoreApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[SWGApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// @param orderId ID of the order that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// @returns NSDictionary* +/// +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSDictionary*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSDictionary*)data, error); + } + }]; +} + +/// +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +/// @param orderId ID of pet that needs to be fetched +/// +/// @returns SWGOrder* +/// +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGOrder*)data, error); + } + }]; +} + +/// +/// Place an order for a pet +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// @returns SWGOrder* +/// +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = order; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGOrder*)data, error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h new file mode 100644 index 000000000000..98a3a1756d5d --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.h @@ -0,0 +1,131 @@ +#import +#import "SWGUser.h" +#import "SWGApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface SWGUserApi: NSObject + +extern NSString* kSWGUserApiErrorDomain; +extern NSInteger kSWGUserApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Create user +/// This can only be done by the logged in user. +/// +/// @param user Created user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Delete user +/// This can only be done by the logged in user. +/// +/// @param username The name that needs to be deleted +/// +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; + + +/// Get user by user name +/// +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return SWGUser* +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; + + +/// Logs user into the system +/// +/// +/// @param username The user name for login (optional) +/// @param password The password for login in clear text (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username/password supplied" +/// +/// @return NSString* +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; + + +/// Logs out current logged in user session +/// +/// +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Updated user +/// This can only be done by the logged in user. +/// +/// @param username name that need to be deleted +/// @param user Updated user object (optional) +/// +/// code:400 message:"Invalid user supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m new file mode 100644 index 000000000000..94651c70282f --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Api/SWGUserApi.m @@ -0,0 +1,542 @@ +#import "SWGUserApi.h" +#import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" +#import "SWGUser.h" + + +@interface SWGUserApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation SWGUserApi + +NSString* kSWGUserApiErrorDomain = @"SWGUserApiErrorDomain"; +NSInteger kSWGUserApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[SWGApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Create user +/// This can only be done by the logged in user. +/// @param user Created user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Delete user +/// This can only be done by the logged in user. +/// @param username The name that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Get user by user name +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// @returns SWGUser* +/// +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGUser*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGUser*)data, error); + } + }]; +} + +/// +/// Logs user into the system +/// +/// @param username The user name for login (optional) +/// +/// @param password The password for login in clear text (optional) +/// +/// @returns NSString* +/// +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + queryParams[@"username"] = username; + } + if (password != nil) { + queryParams[@"password"] = password; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSString*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSString*)data, error); + } + }]; +} + +/// +/// Logs out current logged in user session +/// +/// @returns void +/// +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updated user +/// This can only be done by the logged in user. +/// @param username name that need to be deleted +/// +/// @param user Updated user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h new file mode 100644 index 000000000000..5179ca2e99b8 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface JSONValueTransformer (ISO8601) + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m new file mode 100644 index 000000000000..0f458f0af010 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -0,0 +1,17 @@ +#import +#import "JSONValueTransformer+ISO8601.h" +#import "SWGSanitizer.h" + +@implementation JSONValueTransformer (ISO8601) + +- (NSDate *) NSDateFromNSString:(NSString *)string +{ + return [NSDate dateWithISO8601String:string]; +} + +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [SWGSanitizer dateToString:date]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h new file mode 100644 index 000000000000..6c0396f0cac5 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApi.h @@ -0,0 +1,29 @@ +#import + +@class SWGApiClient; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@protocol SWGApi + +@property(readonly, nonatomic, strong) SWGApiClient *apiClient; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; +-(NSString*) defaultHeaderForKey:(NSString*)key; + +-(NSDictionary *)defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h new file mode 100644 index 000000000000..761865f46933 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.h @@ -0,0 +1,121 @@ +#import +#import "SWGConfiguration.h" +#import "SWGResponseDeserializer.h" +#import "SWGSanitizer.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for `NSError` user info dictionaries. + * + * The corresponding value is the parsed response body for an HTTP error. + */ +extern NSString *const SWGResponseObjectErrorKey; + + +@interface SWGApiClient : AFHTTPSessionManager + +@property (nonatomic, strong, readonly) id configuration; + +@property(nonatomic, assign) NSTimeInterval timeoutInterval; + +@property(nonatomic, strong) id responseDeserializer; + +@property(nonatomic, strong) id sanitizer; + +/** + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; + +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + + +/** + * Updates header parameters and query parameters for authentication + * + * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param queries The query parameters will be updated, passed by pointer to pointer. + * @param authSettings The authentication names NSArray. + */ +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)queries WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; + +/** + * Performs request + * + * @param path Request url. + * @param method Request method. + * @param pathParams Request path parameters. + * @param queryParams Request query parameters. + * @param body Request body. + * @param headerParams Request header parameters. + * @param authSettings Request authentication names. + * @param requestContentType Request content-type. + * @param responseContentType Response content-type. + * @param completionBlock The block will be executed when the request completed. + * + * @return The created session task. + */ +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m new file mode 100644 index 000000000000..03f1cdda4e8a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGApiClient.m @@ -0,0 +1,376 @@ + +#import "SWGLogger.h" +#import "SWGApiClient.h" +#import "SWGJSONRequestSerializer.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" + +NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; + +static NSString * const kSWGContentDispositionKey = @"Content-Disposition"; + +static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { + if(![response isKindOfClass:[NSHTTPURLResponse class]]) { + return nil; + } + return ((NSHTTPURLResponse*)response).allHeaderFields; +} + +static NSString * SWG__fileNameForResponse(NSURLResponse *response) { + NSDictionary * headers = SWG__headerFieldsForResponse(response); + if(!headers[kSWGContentDispositionKey]) { + return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; + } + NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kSWGContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; + return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; +} + + +@interface SWGApiClient () + +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; + +@end + +@implementation SWGApiClient + +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static SWGApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + +- (instancetype)init { + return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[SWGDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { + self = [super initWithBaseURL:url]; + if (self) { + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[SWGResponseDeserializer alloc] init]; + _sanitizer = [[SWGSanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; + } + return self; +} + +#pragma mark - Task Methods + +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + SWGDebugLogResponse(response, responseObject,request,error); + if(!error) { + completionBlock(responseObject, nil); + return; + } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + // Add in the (parsed) response body. + userInfo[SWGResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + }]; + + return task; +} + +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + SWGDebugLogResponse(response, responseObject,request,error); + + if(error) { + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + userInfo[SWGResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + return; + } + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = SWG__fileNameForResponse(response); + + NSString *filepath = [directory stringByAppendingPathComponent:filename]; + NSURL *file = [NSURL fileURLWithPath:filepath]; + + [responseObject writeToURL:file atomically:YES]; + + completionBlock(file, nil); + }]; + + return task; +} + +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { + + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; + + // sanitize parameters + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; + if(![body isKindOfClass:[NSData class]]) { + body = [sanitizer sanitizeForSerialization:body]; + } + + // auth setting + [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; + + NSMutableString *resourcePath = [NSMutableString stringWithString:path]; + [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; + safeString = SWGPercentEscapedStringFromString(safeString); + [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; + }]; + + NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; + if ([pathWithQueryParams hasPrefix:@"/"]) { + pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; + } + + NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; + if (files.count > 0) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { + [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString *objString = [sanitizer parameterToString:obj]; + NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; + [formData appendPartWithFormData:data name:key]; + }]; + [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSURL *filePath = (NSURL *)obj; + [formData appendPartWithFileURL:filePath name:key error:nil]; + }]; + } error:&requestCreateError]; + } + else { + if (formParams) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; + } + if (body) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; + } + } + if(!request) { + completionBlock(nil, requestCreateError); + return nil; + } + + if ([headerParams count] > 0){ + for(NSString * key in [headerParams keyEnumerator]){ + [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; + } + } + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + + [self postProcessRequest:request]; + + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + completionBlock(data, error); + }]; + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + NSError * serializationError; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); + }]; + } + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; +} + +//Added for easier override to modify request +-(void)postProcessRequest:(NSMutableURLRequest *)request { + +} + +#pragma mark - + +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { + if(queryParams.count == 0) { + return path; + } + NSString * separator = nil; + NSUInteger counter = 0; + + NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; + + NSDictionary *separatorStyles = @{@"csv" : @",", + @"tsv" : @"\t", + @"pipes": @"|" + }; + for(NSString * key in [queryParams keyEnumerator]){ + if (counter == 0) { + separator = @"?"; + } else { + separator = @"&"; + } + id queryParam = [queryParams valueForKey:key]; + if(!queryParam) { + continue; + } + NSString *safeKey = SWGPercentEscapedStringFromString(key); + if ([queryParam isKindOfClass:[NSString class]]){ + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, SWGPercentEscapedStringFromString(queryParam)]]; + + } else if ([queryParam isKindOfClass:[SWGQueryParamCollection class]]){ + SWGQueryParamCollection * coll = (SWGQueryParamCollection*) queryParam; + NSArray* values = [coll values]; + NSString* format = [coll format]; + + if([format isEqualToString:@"multi"]) { + for(id obj in values) { + if (counter > 0) { + separator = @"&"; + } + NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + counter += 1; + } + continue; + } + NSString * separatorStyle = separatorStyles[format]; + NSString * safeValue = SWGPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } else { + NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } + counter += 1; + } + return requestUrl; +} + +/** + * Update header and query params based on authentication settings + */ +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)queries WithAuthSettings:(NSArray *)authSettings { + + if ([authSettings count] == 0) { + return; + } + + NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; + NSMutableDictionary *queriesWithAuth = [NSMutableDictionary dictionaryWithDictionary:*queries]; + + id config = self.configuration; + for (NSString *auth in authSettings) { + NSDictionary *authSetting = config.authSettings[auth]; + + if(!authSetting) { // auth setting is set only if the key is non-empty + continue; + } + NSString *type = authSetting[@"in"]; + NSString *key = authSetting[@"key"]; + NSString *value = authSetting[@"value"]; + if ([type isEqualToString:@"header"] && [key length] > 0 ) { + headersWithAuth[key] = value; + } else if ([type isEqualToString:@"query"] && [key length] != 0) { + queriesWithAuth[key] = value; + } + } + + *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; + *queries = [NSDictionary dictionaryWithDictionary:queriesWithAuth]; +} + +- (AFSecurityPolicy *) createSecurityPolicy { + AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + + id config = self.configuration; + + if (config.sslCaCert) { + NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; + } + + if (config.verifySSL) { + [securityPolicy setAllowInvalidCertificates:NO]; + } + else { + [securityPolicy setAllowInvalidCertificates:YES]; + [securityPolicy setValidatesDomainName:NO]; + } + + return securityPolicy; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h new file mode 100644 index 000000000000..bd10d59028b1 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#import + +@interface SWGBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m new file mode 100644 index 000000000000..3788009ec587 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "SWGBasicAuthTokenProvider.h" + +@implementation SWGBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h new file mode 100644 index 000000000000..f6b12de5c5c3 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGConfiguration.h @@ -0,0 +1,89 @@ +#import + +@class SWGLogger; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +static NSString * const kSWGAPIVersion = @"1.0.0"; + +@protocol SWGConfiguration + +/** + * Api logger + */ +@property (readonly, nonatomic) SWGLogger *logger; + +/** + * Base url + */ +@property (readonly, nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + */ +@property (readonly, nonatomic) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + */ +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (readonly, nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (readonly, nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (readonly, nonatomic) BOOL debug; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (readonly, nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (readonly, nonatomic) NSString *sslCaCert; + +/** + * Authentication Settings + */ +@property (readonly, nonatomic) NSDictionary *authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h new file mode 100644 index 000000000000..e141e0d092d5 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -0,0 +1,171 @@ +#import +#import "SWGConfiguration.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@class SWGApiClient; + +@interface SWGDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) SWGLogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + +/** + * Sets API key + * + * To remove an apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param prefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param key Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param key Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m new file mode 100644 index 000000000000..4afe43359aaf --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -0,0 +1,152 @@ +#import "SWGDefaultConfiguration.h" +#import "SWGBasicAuthTokenProvider.h" +#import "SWGLogger.h" + +@interface SWGDefaultConfiguration () + +@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; + +@end + +@implementation SWGDefaultConfiguration + +#pragma mark - Singleton Methods + ++ (instancetype) sharedConfig { + static SWGDefaultConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; +} + +#pragma mark - Initialize Methods + +- (instancetype) init { + self = [super init]; + if (self) { + _host = @"http://petstore.swagger.io/v2"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + + _logger = [SWGLogger sharedLogger]; + } + return self; +} + +#pragma mark - Instance Methods + +- (NSString *) getApiKeyWithPrefix:(NSString *)key { + NSString *prefix = self.apiKeyPrefix[key]; + NSString *apiKey = self.apiKey[key]; + if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set + return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; + } + else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix + return [NSString stringWithFormat:@"%@", self.apiKey[key]]; + } + else { // return empty string if nothing is set + return @""; + } +} + +- (NSString *) getBasicAuthToken { + + NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; +} + +- (NSString *) getAccessToken { + if (self.accessToken.length == 0) { // token not set, return empty string + return @""; + } else { + return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; + } +} + +#pragma mark - Setter Methods + +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { + [self.mutableApiKey setValue:apiKey forKey:identifier]; +} + +- (void) removeApiKey:(NSString *)identifier { + [self.mutableApiKey removeObjectForKey:identifier]; +} + +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { + [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; +} + +- (void) removeApiKeyPrefix:(NSString *)identifier { + [self.mutableApiKeyPrefix removeObjectForKey:identifier]; +} + +#pragma mark - Getter Methods + +- (NSDictionary *) apiKey { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; +} + +- (NSDictionary *) apiKeyPrefix { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; +} + +#pragma mark - + +- (NSDictionary *) authSettings { + return @{ + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, + }; +} + +-(BOOL)debug { + return self.logger.isEnabled; +} + +-(void)setDebug:(BOOL)debug { + self.logger.enabled = debug; +} + +- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { + if(!value) { + [self.mutableDefaultHeaders removeObjectForKey:key]; + return; + } + self.mutableDefaultHeaders[key] = value; +} + +-(void) removeDefaultHeaderForKey:(NSString*)key { + [self.mutableDefaultHeaders removeObjectForKey:key]; +} + +- (NSString *)defaultHeaderForKey:(NSString *)key { + return self.mutableDefaultHeaders[key]; +} + +- (NSDictionary *)defaultHeaders { + return [self.mutableDefaultHeaders copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h new file mode 100644 index 000000000000..943ab1323133 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -0,0 +1,18 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGJSONRequestSerializer : AFJSONRequestSerializer +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m new file mode 100644 index 000000000000..221765e48397 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONRequestSerializer.m @@ -0,0 +1,37 @@ +#import "SWGJSONRequestSerializer.h" + +@implementation SWGJSONRequestSerializer + +/// +/// When customize a request serializer, +/// the serializer must conform the protocol `AFURLRequestSerialization` +/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` +/// +/// @param request The original request. +/// @param parameters The parameters to be encoded. +/// @param error The error that occurred while attempting to encode the request parameters. +/// +/// @return A serialized request. +/// +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + if (!parameters) { + return request; + } + // If the body data which will be serialized isn't NSArray or NSDictionary + // then put the data in the http request body directly. + if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + if([parameters isKindOfClass:[NSData class]]) { + [mutableRequest setHTTPBody:parameters]; + } else { + [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; + } + return mutableRequest; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m new file mode 100644 index 000000000000..73c696d341a3 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGJSONResponseSerializer.m @@ -0,0 +1,39 @@ +#import "SWGJSONResponseSerializer.h" + +@implementation SWGJSONResponseSerializer + +/// +/// When customize a response serializer, +/// the serializer must conform the protocol `AFURLResponseSerialization` +/// and implements the protocol method `responseObjectForResponse:error:` +/// +/// @param response The response to be processed. +/// @param data The response data to be decoded. +/// @param error The error that occurred while attempting to decode the response data. +/// +/// @return The object decoded from the specified response data. +/// +- (id) responseObjectForResponse:(NSURLResponse *)response + data:(NSData *)data + error:(NSError *__autoreleasing *)error { + NSDictionary *responseJson = [super responseObjectForResponse:response data:data error:error]; + + // if response data is not a valid json, return string of data. + if ([self isParseError:*error]) { + *error = nil; + NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + return responseString; + } + + return responseJson; +} + +-(BOOL)isParseError:(NSError *)error { + return [error.domain isEqualToString:NSCocoaErrorDomain] && error.code == 3840; +} + ++ (instancetype)serializer { + return [self serializerWithReadingOptions:NSJSONReadingAllowFragments]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h new file mode 100644 index 000000000000..23f57acd7b8a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.h @@ -0,0 +1,61 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#ifndef SWGDebugLogResponse +#define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; +#endif + +/** + * Log debug message macro + */ +#ifndef SWGDebugLog +#define SWGDebugLog(format, ...) [[SWGLogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; +#endif + +@interface SWGLogger : NSObject + ++(instancetype)sharedLogger; + +/** + * Enabled switch, default NO - default set by SWGConfiguration debug property + */ +@property (nonatomic, assign, getter=isEnabled) BOOL enabled; + +/** + * Debug file location, default log in console + */ +@property (nonatomic, strong) NSString *loggingFile; + +/** + * Log file handler, this property is used by sdk internally. + */ +@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; + +/** + * Log debug message + */ +-(void)debugLog:(NSString *)method message:(NSString *)format, ...; + +/** + * Logs request and response + * + * @param response NSURLResponse for the HTTP request. + * @param responseObject response object of the HTTP request. + * @param request The HTTP request. + * @param error The error of the HTTP request. + */ +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m new file mode 100644 index 000000000000..2a96e5ec54d3 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGLogger.m @@ -0,0 +1,73 @@ +#import "SWGLogger.h" + +@interface SWGLogger () + +@end + +@implementation SWGLogger + ++ (instancetype) sharedLogger { + static SWGLogger *shardLogger = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardLogger = [[self alloc] init]; + }); + return shardLogger; +} + +#pragma mark - Log Methods + +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { + if (!self.isEnabled) { + return; + } + + NSMutableString *message = [NSMutableString stringWithCapacity:1]; + + if (method) { + [message appendFormat:@"%@: ", method]; + } + + va_list args; + va_start(args, format); + + [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; + + // If set logging file handler, log into file, + // otherwise log into console. + if (self.loggingFileHandler) { + [self.loggingFileHandler seekToEndOfFile]; + [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; + } else { + NSLog(@"%@", message); + } + + va_end(args); +} + +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ + "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", + [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], + responseObject]; + + SWGDebugLog(message); +} + +- (void) setLoggingFile:(NSString *)loggingFile { + if(_loggingFile == loggingFile) { + return; + } + // close old file handler + if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { + [self.loggingFileHandler closeFile]; + } + _loggingFile = loggingFile; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + if (_loggingFileHandler == nil) { + [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + } +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h new file mode 100644 index 000000000000..7d7112c5976a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGObject : JSONModel + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m new file mode 100644 index 000000000000..f985195d4b12 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGObject.m @@ -0,0 +1,44 @@ +#import "SWGObject.h" + +@implementation SWGObject + +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static NSObject *lock; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + lock = [NSObject new]; + }); + + BOOL initSync; + @synchronized(lock) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + +/** + * Gets the string presentation of the object. + * This method will be called when logging model object using `NSLog`. + */ +- (NSString *)description { + return [[self toDictionary] description]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h new file mode 100644 index 000000000000..4bd35d86f352 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.h @@ -0,0 +1,24 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGQueryParamCollection : NSObject + +@property(nonatomic, readonly) NSArray* values; +@property(nonatomic, readonly) NSString* format; + +- (id) initWithValuesAndFormat: (NSArray*) values + format: (NSString*) format; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m new file mode 100644 index 000000000000..5f9306219edd --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGQueryParamCollection.m @@ -0,0 +1,20 @@ +#import "SWGQueryParamCollection.h" + +@implementation SWGQueryParamCollection + +@synthesize values = _values; +@synthesize format = _format; + +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + + self = [super init]; + if (self) { + _values = values; + _format = format; + } + + return self; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h new file mode 100644 index 000000000000..68f83704f495 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.h @@ -0,0 +1,57 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const SWGDeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const SWGTypeMismatchErrorCode; + +/** + * Code for deserialization empty value error + */ +extern NSInteger const SWGEmptyValueOccurredErrorCode; + +/** + * Error code for unknown response + */ +extern NSInteger const SWGUnknownResponseObjectErrorCode; + +@protocol SWGResponseDeserializer + +/** + * Deserializes the given data to Objective-C object. + * + * @param data The data will be deserialized. + * @param className The type of objective-c object. + * @param error The error + */ +- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; + +@end + +@interface SWGResponseDeserializer : NSObject + +/** + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * @default NO + */ +@property (nonatomic, assign) BOOL treatNullAsError; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m new file mode 100644 index 000000000000..46d4b460fc74 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGResponseDeserializer.m @@ -0,0 +1,247 @@ +#import "SWGResponseDeserializer.h" +#import +#import + +NSString *const SWGDeserializationErrorDomainKey = @"SWGDeserializationErrorDomainKey"; + +NSInteger const SWGTypeMismatchErrorCode = 143553; + +NSInteger const SWGEmptyValueOccurredErrorCode = 143509; + +NSInteger const SWGUnknownResponseObjectErrorCode = 143528; + + +@interface SWGResponseDeserializer () + +@property (nonatomic, strong) NSNumberFormatter* numberFormatter; +@property (nonatomic, strong) NSArray *primitiveTypes; +@property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; + +@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; +@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; + +@end + +@implementation SWGResponseDeserializer + +- (instancetype)init { + self = [super init]; + if (self) { + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + _numberFormatter = formatter; + _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + } + return self; +} + +#pragma mark - Deserialize methods + +- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { + if (!data || !className) { + return nil; + } + + if ([className hasSuffix:@"*"]) { + className = [className substringToIndex:[className length] - 1]; + } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + + // pure object + if ([self.basicReturnTypes containsObject:className]) { + return jsonData; + } + + // primitives + if ([self.primitiveTypes containsObject:className]) { + return [self deserializePrimitiveValue:jsonData class:className error:error]; + } + + NSTextCheckingResult *match = nil; + NSRange range = NSMakeRange(0, [className length]); + // list of models + match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // list of primitives + match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // map + match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + // model + Class ModelClass = NSClassFromString(className); + if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; + } + + if(error) { + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; + } + return nil; +} + +- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { + if(![data isKindOfClass: [NSDictionary class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; + } + return nil; + } + __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; + for (id key in [data allKeys]) { + id obj = [data valueForKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultDict = nil; + break; + } + } else { + resultDict = nil; + break; + } + } + return resultDict; +} + +- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; + } + return nil; + } + NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; + for (id obj in data) { + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultArray = nil; + break; + } + } else { + resultArray = nil; + break; + } + } + return resultArray; +}; + +- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { + if ([className isEqualToString:@"NSString"]) { + return [NSString stringWithFormat:@"%@",data]; + } + else if ([className isEqualToString:@"NSDate"]) { + return [self deserializeDateValue:data error:error]; + } + else if ([className isEqualToString:@"NSNumber"]) { + // NSNumber from NSNumber + if ([data isKindOfClass:[NSNumber class]]) { + return data; + } + else if ([data isKindOfClass:[NSString class]]) { + // NSNumber (NSCFBoolean) from NSString + if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { + return @([data boolValue]); + // NSNumber from NSString + } else { + NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; + if(!formattedValue && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return formattedValue; + } + } + } + if(error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return nil; +} + +- (id) deserializeDateValue:(id) data error:(NSError**)error { + NSDate *date =[NSDate dateWithISO8601String:data]; + if(!date && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; + } + return date; +}; + +-(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGTypeMismatchErrorCode userInfo:userInfo]; +} + +-(NSError *)emptyValueOccurredError { + NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGEmptyValueOccurredErrorCode userInfo:userInfo]; +} + +-(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGUnknownResponseObjectErrorCode userInfo:userInfo]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h new file mode 100644 index 000000000000..83853bec8cf0 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.h @@ -0,0 +1,63 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +extern NSString * SWGPercentEscapedStringFromString(NSString *string); + +extern NSString * const kSWGApplicationJSONType; + +@protocol SWGSanitizer + +/** + * Sanitize object for request + * + * @param object The query/path/header/form/body param to be sanitized. + */ +- (id) sanitizeForSerialization:(id) object; + +/** + * Convert parameter to NSString + */ +- (NSString *) parameterToString: (id) param; + +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + +/** + * Detects Accept header from accepts NSArray + * + * @param accepts NSArray of header + * + * @return The Accept header + */ +-(NSString *) selectHeaderAccept:(NSArray *)accepts; + +/** + * Detects Content-Type header from contentTypes NSArray + * + * @param contentTypes NSArray of header + * + * @return The Content-Type header + */ +-(NSString *) selectHeaderContentType:(NSArray *)contentTypes; + +@end + +@interface SWGSanitizer : NSObject + + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m new file mode 100644 index 000000000000..1b3e0e10b0d5 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Core/SWGSanitizer.m @@ -0,0 +1,170 @@ +#import "SWGSanitizer.h" +#import "SWGObject.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" +#import + +NSString * const kSWGApplicationJSONType = @"application/json"; + +NSString * SWGPercentEscapedStringFromString(NSString *string) { + static NSString * const kSWGCharactersGeneralDelimitersToEncode = @":#[]@"; + static NSString * const kSWGCharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kSWGCharactersGeneralDelimitersToEncode stringByAppendingString:kSWGCharactersSubDelimitersToEncode]]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); + #pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +@interface SWGSanitizer () + +@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; + +@end + +@implementation SWGSanitizer + +-(instancetype)init { + self = [super init]; + if ( !self ) { + return nil; + } + _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; + return self; +} + + +- (id) sanitizeForSerialization:(id) object { + if (object == nil) { + return nil; + } + else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[SWGQueryParamCollection class]]) { + return object; + } + else if ([object isKindOfClass:[NSDate class]]) { + return [SWGSanitizer dateToString:object]; + } + else if ([object isKindOfClass:[NSArray class]]) { + NSArray *objectArray = object; + NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; + [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + [sanitizedObjs addObject:sanitizedObj]; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[NSDictionary class]]) { + NSDictionary *objectDict = object; + NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; + [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + sanitizedObjs[key] = sanitizedObj; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[SWGObject class]]) { + return [object toDictionary]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] + userInfo:nil]; + @throw e; + } +} + +- (NSString *) parameterToString:(id)param { + if ([param isKindOfClass:[NSString class]]) { + return param; + } + else if ([param isKindOfClass:[NSNumber class]]) { + return [param stringValue]; + } + else if ([param isKindOfClass:[NSDate class]]) { + return [SWGSanitizer dateToString:param]; + } + else if ([param isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableParam = [NSMutableArray array]; + [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mutableParam addObject:[self parameterToString:obj]]; + }]; + return [mutableParam componentsJoinedByString:@","]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] + userInfo:nil]; + @throw e; + } +} + ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; +} + +#pragma mark - Utility Methods + +/* + * Detect `Accept` from accepts + */ +- (NSString *) selectHeaderAccept:(NSArray *)accepts { + if (accepts.count == 0) { + return @""; + } + NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; + for (NSString *string in accepts) { + if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { + return kSWGApplicationJSONType; + } + [lowerAccepts addObject:[string lowercaseString]]; + } + return [lowerAccepts componentsJoinedByString:@", "]; +} + +/* + * Detect `Content-Type` from contentTypes + */ +- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { + if (contentTypes.count == 0) { + return kSWGApplicationJSONType; + } + NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; + for (NSString *string in contentTypes) { + if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ + return kSWGApplicationJSONType; + } + [lowerContentTypes addObject:[string lowercaseString]]; + } + return [lowerContentTypes firstObject]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h new file mode 100644 index 000000000000..31eb9e6b31ca --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.h @@ -0,0 +1,30 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGCategory +@end + +@interface SWGCategory : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m new file mode 100644 index 000000000000..21e354b30e9e --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategory.m @@ -0,0 +1,34 @@ +#import "SWGCategory.h" + +@implementation SWGCategory + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h new file mode 100644 index 000000000000..8bcb655d0fbc --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.h @@ -0,0 +1,34 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGCategoryManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* name; +@end + +@interface SWGCategoryManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m new file mode 100644 index 000000000000..08d3a08a91ae --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObject.m @@ -0,0 +1,12 @@ +#import "SWGCategoryManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGCategoryManagedObject + +@dynamic _id; +@dynamic name; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h new file mode 100644 index 000000000000..18863d14baf7 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGCategoryManagedObject.h" +#import "SWGCategory.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGCategoryManagedObjectBuilder : NSObject + + + +-(SWGCategoryManagedObject*)createNewSWGCategoryManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGCategoryManagedObject*)SWGCategoryManagedObjectFromSWGCategory:(SWGCategory*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGCategoryManagedObject:(SWGCategoryManagedObject*)object withSWGCategory:(SWGCategory*)object2; + +-(SWGCategory*)SWGCategoryFromSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj; + +-(void)updateSWGCategory:(SWGCategory*)object withSWGCategoryManagedObject:(SWGCategoryManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m new file mode 100644 index 000000000000..12ab96205f6d --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGCategoryManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "SWGCategoryManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGCategoryManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGCategoryManagedObject*)createNewSWGCategoryManagedObjectInContext:(NSManagedObjectContext*)context { + SWGCategoryManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGCategoryManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGCategoryManagedObject*)SWGCategoryManagedObjectFromSWGCategory:(SWGCategory*)object context:(NSManagedObjectContext*)context { + SWGCategoryManagedObject* newSWGCategory = [self createNewSWGCategoryManagedObjectInContext:context]; + [self updateSWGCategoryManagedObject:newSWGCategory withSWGCategory:object]; + return newSWGCategory; +} + +-(void)updateSWGCategoryManagedObject:(SWGCategoryManagedObject*)managedObject withSWGCategory:(SWGCategory*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.name = [object.name copy]; + +} + +-(SWGCategory*)SWGCategoryFromSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj { + if(!obj) { + return nil; + } + SWGCategory* newSWGCategory = [[SWGCategory alloc] init]; + [self updateSWGCategory:newSWGCategory withSWGCategoryManagedObject:obj]; + return newSWGCategory; +} + +-(void)updateSWGCategory:(SWGCategory*)newSWGCategory withSWGCategoryManagedObject:(SWGCategoryManagedObject*)obj { + newSWGCategory._id = [obj._id copy]; + newSWGCategory.name = [obj.name copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h new file mode 100644 index 000000000000..1d3390dab8c4 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.h @@ -0,0 +1,32 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGInlineObject +@end + +@interface SWGInlineObject : SWGObject + +/* Updated name of the pet [optional] + */ +@property(nonatomic) NSString* name; +/* Updated status of the pet [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m new file mode 100644 index 000000000000..a10d7060973a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject.m @@ -0,0 +1,34 @@ +#import "SWGInlineObject.h" + +@implementation SWGInlineObject + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"name", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h new file mode 100644 index 000000000000..36d1a7194cdd --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.h @@ -0,0 +1,32 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGInlineObject1 +@end + +@interface SWGInlineObject1 : SWGObject + +/* Additional data to pass to server [optional] + */ +@property(nonatomic) NSString* additionalMetadata; +/* file to upload [optional] + */ +@property(nonatomic) NSURL* file; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m new file mode 100644 index 000000000000..825dbcc286ae --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1.m @@ -0,0 +1,34 @@ +#import "SWGInlineObject1.h" + +@implementation SWGInlineObject1 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"additionalMetadata", @"file"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h new file mode 100644 index 000000000000..67d37a6fc9c2 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.h @@ -0,0 +1,36 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGInlineObject1ManagedObject : NSManagedObject + +/* Additional data to pass to server [optional] + */ +@property (nullable, nonatomic, retain) NSString* additionalMetadata; +/* file to upload [optional] + */ +@property (nullable, nonatomic, retain) NSURL* file; +@end + +@interface SWGInlineObject1ManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m new file mode 100644 index 000000000000..8b83f2e40b99 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObject.m @@ -0,0 +1,12 @@ +#import "SWGInlineObject1ManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGInlineObject1ManagedObject + +@dynamic additionalMetadata; +@dynamic file; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h new file mode 100644 index 000000000000..35f82beb9a9e --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGInlineObject1ManagedObject.h" +#import "SWGInlineObject1.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGInlineObject1ManagedObjectBuilder : NSObject + + + +-(SWGInlineObject1ManagedObject*)createNewSWGInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGInlineObject1ManagedObject*)SWGInlineObject1ManagedObjectFromSWGInlineObject1:(SWGInlineObject1*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)object withSWGInlineObject1:(SWGInlineObject1*)object2; + +-(SWGInlineObject1*)SWGInlineObject1FromSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj; + +-(void)updateSWGInlineObject1:(SWGInlineObject1*)object withSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m new file mode 100644 index 000000000000..75031ff775da --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObject1ManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "SWGInlineObject1ManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGInlineObject1ManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGInlineObject1ManagedObject*)createNewSWGInlineObject1ManagedObjectInContext:(NSManagedObjectContext*)context { + SWGInlineObject1ManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGInlineObject1ManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGInlineObject1ManagedObject*)SWGInlineObject1ManagedObjectFromSWGInlineObject1:(SWGInlineObject1*)object context:(NSManagedObjectContext*)context { + SWGInlineObject1ManagedObject* newSWGInlineObject1 = [self createNewSWGInlineObject1ManagedObjectInContext:context]; + [self updateSWGInlineObject1ManagedObject:newSWGInlineObject1 withSWGInlineObject1:object]; + return newSWGInlineObject1; +} + +-(void)updateSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)managedObject withSWGInlineObject1:(SWGInlineObject1*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject.additionalMetadata = [object.additionalMetadata copy]; + managedObject.file = [object.file copy]; + +} + +-(SWGInlineObject1*)SWGInlineObject1FromSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj { + if(!obj) { + return nil; + } + SWGInlineObject1* newSWGInlineObject1 = [[SWGInlineObject1 alloc] init]; + [self updateSWGInlineObject1:newSWGInlineObject1 withSWGInlineObject1ManagedObject:obj]; + return newSWGInlineObject1; +} + +-(void)updateSWGInlineObject1:(SWGInlineObject1*)newSWGInlineObject1 withSWGInlineObject1ManagedObject:(SWGInlineObject1ManagedObject*)obj { + newSWGInlineObject1.additionalMetadata = [obj.additionalMetadata copy]; + newSWGInlineObject1.file = [obj.file copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h new file mode 100644 index 000000000000..c7c95fca41c4 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.h @@ -0,0 +1,36 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGInlineObjectManagedObject : NSManagedObject + +/* Updated name of the pet [optional] + */ +@property (nullable, nonatomic, retain) NSString* name; +/* Updated status of the pet [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; +@end + +@interface SWGInlineObjectManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m new file mode 100644 index 000000000000..b1eaec9c492b --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObject.m @@ -0,0 +1,12 @@ +#import "SWGInlineObjectManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGInlineObjectManagedObject + +@dynamic name; +@dynamic status; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h new file mode 100644 index 000000000000..7937b22ea1d8 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGInlineObjectManagedObject.h" +#import "SWGInlineObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGInlineObjectManagedObjectBuilder : NSObject + + + +-(SWGInlineObjectManagedObject*)createNewSWGInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)object withSWGInlineObject:(SWGInlineObject*)object2; + +-(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj; + +-(void)updateSWGInlineObject:(SWGInlineObject*)object withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m new file mode 100644 index 000000000000..7d15720a5465 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGInlineObjectManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "SWGInlineObjectManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGInlineObjectManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGInlineObjectManagedObject*)createNewSWGInlineObjectManagedObjectInContext:(NSManagedObjectContext*)context { + SWGInlineObjectManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGInlineObjectManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGInlineObjectManagedObject*)SWGInlineObjectManagedObjectFromSWGInlineObject:(SWGInlineObject*)object context:(NSManagedObjectContext*)context { + SWGInlineObjectManagedObject* newSWGInlineObject = [self createNewSWGInlineObjectManagedObjectInContext:context]; + [self updateSWGInlineObjectManagedObject:newSWGInlineObject withSWGInlineObject:object]; + return newSWGInlineObject; +} + +-(void)updateSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)managedObject withSWGInlineObject:(SWGInlineObject*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject.name = [object.name copy]; + managedObject.status = [object.status copy]; + +} + +-(SWGInlineObject*)SWGInlineObjectFromSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj { + if(!obj) { + return nil; + } + SWGInlineObject* newSWGInlineObject = [[SWGInlineObject alloc] init]; + [self updateSWGInlineObject:newSWGInlineObject withSWGInlineObjectManagedObject:obj]; + return newSWGInlineObject; +} + +-(void)updateSWGInlineObject:(SWGInlineObject*)newSWGInlineObject withSWGInlineObjectManagedObject:(SWGInlineObjectManagedObject*)obj { + newSWGInlineObject.name = [obj.name copy]; + newSWGInlineObject.status = [obj.status copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion new file mode 100644 index 000000000000..3a67e4c5a2a2 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/.xccurrentversion @@ -0,0 +1,8 @@ + + + + + _XCCurrentVersionName + SWGModel.xcdatamodel + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents new file mode 100644 index 000000000000..4ec7a3b456b3 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel/contents @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h new file mode 100644 index 000000000000..5ea7a94cfcbe --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.h @@ -0,0 +1,39 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGOrder +@end + +@interface SWGOrder : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSNumber* petId; + +@property(nonatomic) NSNumber* quantity; + +@property(nonatomic) NSDate* shipDate; +/* Order Status [optional] + */ +@property(nonatomic) NSString* status; + +@property(nonatomic) NSNumber* complete; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m new file mode 100644 index 000000000000..7f93b0212c48 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrder.m @@ -0,0 +1,34 @@ +#import "SWGOrder.h" + +@implementation SWGOrder + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h new file mode 100644 index 000000000000..05f83ca11fd6 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.h @@ -0,0 +1,43 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGOrderManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSNumber* petId; + +@property (nullable, nonatomic, retain) NSNumber* quantity; + +@property (nullable, nonatomic, retain) NSDate* shipDate; +/* Order Status [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; + +@property (nullable, nonatomic, retain) NSNumber* complete; +@end + +@interface SWGOrderManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m new file mode 100644 index 000000000000..c0c36798cb73 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObject.m @@ -0,0 +1,16 @@ +#import "SWGOrderManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGOrderManagedObject + +@dynamic _id; +@dynamic petId; +@dynamic quantity; +@dynamic shipDate; +@dynamic status; +@dynamic complete; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h new file mode 100644 index 000000000000..f67159446bc9 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGOrderManagedObject.h" +#import "SWGOrder.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGOrderManagedObjectBuilder : NSObject + + + +-(SWGOrderManagedObject*)createNewSWGOrderManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGOrderManagedObject*)SWGOrderManagedObjectFromSWGOrder:(SWGOrder*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGOrderManagedObject:(SWGOrderManagedObject*)object withSWGOrder:(SWGOrder*)object2; + +-(SWGOrder*)SWGOrderFromSWGOrderManagedObject:(SWGOrderManagedObject*)obj; + +-(void)updateSWGOrder:(SWGOrder*)object withSWGOrderManagedObject:(SWGOrderManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m new file mode 100644 index 000000000000..24a937fd0488 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGOrderManagedObjectBuilder.m @@ -0,0 +1,63 @@ + + +#import "SWGOrderManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGOrderManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGOrderManagedObject*)createNewSWGOrderManagedObjectInContext:(NSManagedObjectContext*)context { + SWGOrderManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGOrderManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGOrderManagedObject*)SWGOrderManagedObjectFromSWGOrder:(SWGOrder*)object context:(NSManagedObjectContext*)context { + SWGOrderManagedObject* newSWGOrder = [self createNewSWGOrderManagedObjectInContext:context]; + [self updateSWGOrderManagedObject:newSWGOrder withSWGOrder:object]; + return newSWGOrder; +} + +-(void)updateSWGOrderManagedObject:(SWGOrderManagedObject*)managedObject withSWGOrder:(SWGOrder*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.petId = [object.petId copy]; + managedObject.quantity = [object.quantity copy]; + managedObject.shipDate = [object.shipDate copy]; + managedObject.status = [object.status copy]; + managedObject.complete = [object.complete copy]; + +} + +-(SWGOrder*)SWGOrderFromSWGOrderManagedObject:(SWGOrderManagedObject*)obj { + if(!obj) { + return nil; + } + SWGOrder* newSWGOrder = [[SWGOrder alloc] init]; + [self updateSWGOrder:newSWGOrder withSWGOrderManagedObject:obj]; + return newSWGOrder; +} + +-(void)updateSWGOrder:(SWGOrder*)newSWGOrder withSWGOrderManagedObject:(SWGOrderManagedObject*)obj { + newSWGOrder._id = [obj._id copy]; + newSWGOrder.petId = [obj.petId copy]; + newSWGOrder.quantity = [obj.quantity copy]; + newSWGOrder.shipDate = [obj.shipDate copy]; + newSWGOrder.status = [obj.status copy]; + newSWGOrder.complete = [obj.complete copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h new file mode 100644 index 000000000000..4b3729193265 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.h @@ -0,0 +1,45 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "SWGCategory.h" +#import "SWGTag.h" +@protocol SWGCategory; +@class SWGCategory; +@protocol SWGTag; +@class SWGTag; + + + +@protocol SWGPet +@end + +@interface SWGPet : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) SWGCategory* category; + +@property(nonatomic) NSString* name; + +@property(nonatomic) NSArray* photoUrls; + +@property(nonatomic) NSArray* tags; +/* pet status in the store [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m new file mode 100644 index 000000000000..8c958695c888 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPet.m @@ -0,0 +1,34 @@ +#import "SWGPet.h" + +@implementation SWGPet + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h new file mode 100644 index 000000000000..6ad378e95f76 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.h @@ -0,0 +1,49 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "SWGCategoryManagedObject.h" +#import "SWGTagManagedObject.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGPetManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) SWGCategoryManagedObject* category; + +@property (nullable, nonatomic, retain) NSString* name; + +@property (nullable, nonatomic, retain) NSArray* photoUrls; + +@property (nullable, nonatomic, retain) NSOrderedSet* tags; +/* pet status in the store [optional] + */ +@property (nullable, nonatomic, retain) NSString* status; +@end + +@interface SWGPetManagedObject (GeneratedAccessors) +- (void)addTagsObject:(SWGTagManagedObject *)value; +- (void)removeTagsObject:(SWGTagManagedObject *)value; +- (void)addTags:(NSOrderedSet *)values; +- (void)removeTags:(NSOrderedSet *)values; + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m new file mode 100644 index 000000000000..7b1bcc0cd092 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObject.m @@ -0,0 +1,16 @@ +#import "SWGPetManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGPetManagedObject + +@dynamic _id; +@dynamic category; +@dynamic name; +@dynamic photoUrls; +@dynamic tags; +@dynamic status; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h new file mode 100644 index 000000000000..112ba8bbff4f --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.h @@ -0,0 +1,39 @@ +#import +#import + +#import "SWGCategoryManagedObjectBuilder.h" +#import "SWGTagManagedObjectBuilder.h" + +#import "SWGPetManagedObject.h" +#import "SWGPet.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGPetManagedObjectBuilder : NSObject + +@property (nonatomic, strong) SWGCategoryManagedObjectBuilder * categoryBuilder; +@property (nonatomic, strong) SWGTagManagedObjectBuilder * tagsBuilder; + + +-(SWGPetManagedObject*)createNewSWGPetManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGPetManagedObject*)SWGPetManagedObjectFromSWGPet:(SWGPet*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGPetManagedObject:(SWGPetManagedObject*)object withSWGPet:(SWGPet*)object2; + +-(SWGPet*)SWGPetFromSWGPetManagedObject:(SWGPetManagedObject*)obj; + +-(void)updateSWGPet:(SWGPet*)object withSWGPetManagedObject:(SWGPetManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m new file mode 100644 index 000000000000..c297ea975325 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGPetManagedObjectBuilder.m @@ -0,0 +1,90 @@ + + +#import "SWGPetManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGPetManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + _categoryBuilder = [[SWGCategoryManagedObjectBuilder alloc] init]; + _tagsBuilder = [[SWGTagManagedObjectBuilder alloc] init]; + } + return self; +} + +-(SWGPetManagedObject*)createNewSWGPetManagedObjectInContext:(NSManagedObjectContext*)context { + SWGPetManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGPetManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGPetManagedObject*)SWGPetManagedObjectFromSWGPet:(SWGPet*)object context:(NSManagedObjectContext*)context { + SWGPetManagedObject* newSWGPet = [self createNewSWGPetManagedObjectInContext:context]; + [self updateSWGPetManagedObject:newSWGPet withSWGPet:object]; + return newSWGPet; +} + +-(void)updateSWGPetManagedObject:(SWGPetManagedObject*)managedObject withSWGPet:(SWGPet*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + + if(!managedObject.category) { + managedObject.category = [self.categoryBuilder SWGCategoryManagedObjectFromSWGCategory:object.category context:managedObject.managedObjectContext]; + } else { + [self.categoryBuilder updateSWGCategoryManagedObject:managedObject.category withSWGCategory:object.category]; + } + managedObject.name = [object.name copy]; + managedObject.photoUrls = [object.photoUrls copy]; + if(managedObject.tags) { + for (id object in managedObject.tags) { + [context deleteObject:object]; + } + } + if(object.tags) { + NSMutableOrderedSet * convertedObjs = [NSMutableOrderedSet orderedSet]; + for (id innerObject in object.tags) { + id convertedObj = [self.tagsBuilder SWGTagManagedObjectFromSWGTag:innerObject context:managedObject.managedObjectContext]; + [convertedObjs addObject:convertedObj]; + } + managedObject.tags = convertedObjs; + } + managedObject.status = [object.status copy]; + +} + +-(SWGPet*)SWGPetFromSWGPetManagedObject:(SWGPetManagedObject*)obj { + if(!obj) { + return nil; + } + SWGPet* newSWGPet = [[SWGPet alloc] init]; + [self updateSWGPet:newSWGPet withSWGPetManagedObject:obj]; + return newSWGPet; +} + +-(void)updateSWGPet:(SWGPet*)newSWGPet withSWGPetManagedObject:(SWGPetManagedObject*)obj { + newSWGPet._id = [obj._id copy]; + newSWGPet.category = [self.categoryBuilder SWGCategoryFromSWGCategoryManagedObject:obj.category]; + newSWGPet.name = [obj.name copy]; + newSWGPet.photoUrls = [obj.photoUrls copy]; + if(obj.tags != nil) { + NSMutableArray* convertedObjs = [NSMutableArray array]; + for (id innerObject in obj.tags) { + id convertedObj = [self.tagsBuilder SWGTagFromSWGTagManagedObject:innerObject]; + [convertedObjs addObject:convertedObj]; + } + newSWGPet.tags = (NSArray*)convertedObjs; + } + + newSWGPet.status = [obj.status copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h new file mode 100644 index 000000000000..cdcedfd916bb --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.h @@ -0,0 +1,30 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGTag +@end + +@interface SWGTag : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m new file mode 100644 index 000000000000..3a62bcbb9a12 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTag.m @@ -0,0 +1,34 @@ +#import "SWGTag.h" + +@implementation SWGTag + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h new file mode 100644 index 000000000000..a646e643d70c --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.h @@ -0,0 +1,34 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGTagManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* name; +@end + +@interface SWGTagManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m new file mode 100644 index 000000000000..0118c1be3c8c --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObject.m @@ -0,0 +1,12 @@ +#import "SWGTagManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGTagManagedObject + +@dynamic _id; +@dynamic name; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h new file mode 100644 index 000000000000..fe1abf098e0c --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGTagManagedObject.h" +#import "SWGTag.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGTagManagedObjectBuilder : NSObject + + + +-(SWGTagManagedObject*)createNewSWGTagManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGTagManagedObject:(SWGTagManagedObject*)object withSWGTag:(SWGTag*)object2; + +-(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj; + +-(void)updateSWGTag:(SWGTag*)object withSWGTagManagedObject:(SWGTagManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m new file mode 100644 index 000000000000..62baa7b41f2e --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGTagManagedObjectBuilder.m @@ -0,0 +1,55 @@ + + +#import "SWGTagManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGTagManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGTagManagedObject*)createNewSWGTagManagedObjectInContext:(NSManagedObjectContext*)context { + SWGTagManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGTagManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGTagManagedObject*)SWGTagManagedObjectFromSWGTag:(SWGTag*)object context:(NSManagedObjectContext*)context { + SWGTagManagedObject* newSWGTag = [self createNewSWGTagManagedObjectInContext:context]; + [self updateSWGTagManagedObject:newSWGTag withSWGTag:object]; + return newSWGTag; +} + +-(void)updateSWGTagManagedObject:(SWGTagManagedObject*)managedObject withSWGTag:(SWGTag*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.name = [object.name copy]; + +} + +-(SWGTag*)SWGTagFromSWGTagManagedObject:(SWGTagManagedObject*)obj { + if(!obj) { + return nil; + } + SWGTag* newSWGTag = [[SWGTag alloc] init]; + [self updateSWGTag:newSWGTag withSWGTagManagedObject:obj]; + return newSWGTag; +} + +-(void)updateSWGTag:(SWGTag*)newSWGTag withSWGTagManagedObject:(SWGTagManagedObject*)obj { + newSWGTag._id = [obj._id copy]; + newSWGTag.name = [obj.name copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h new file mode 100644 index 000000000000..7786883ed29c --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.h @@ -0,0 +1,43 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGUser +@end + +@interface SWGUser : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* username; + +@property(nonatomic) NSString* firstName; + +@property(nonatomic) NSString* lastName; + +@property(nonatomic) NSString* email; + +@property(nonatomic) NSString* password; + +@property(nonatomic) NSString* phone; +/* User Status [optional] + */ +@property(nonatomic) NSNumber* userStatus; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m new file mode 100644 index 000000000000..fd50c02e2c9c --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUser.m @@ -0,0 +1,34 @@ +#import "SWGUser.h" + +@implementation SWGUser + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h new file mode 100644 index 000000000000..89f0f4938d81 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.h @@ -0,0 +1,47 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + +NS_ASSUME_NONNULL_BEGIN + +@interface SWGUserManagedObject : NSManagedObject + + +@property (nullable, nonatomic, retain) NSNumber* _id; + +@property (nullable, nonatomic, retain) NSString* username; + +@property (nullable, nonatomic, retain) NSString* firstName; + +@property (nullable, nonatomic, retain) NSString* lastName; + +@property (nullable, nonatomic, retain) NSString* email; + +@property (nullable, nonatomic, retain) NSString* password; + +@property (nullable, nonatomic, retain) NSString* phone; +/* User Status [optional] + */ +@property (nullable, nonatomic, retain) NSNumber* userStatus; +@end + +@interface SWGUserManagedObject (GeneratedAccessors) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m new file mode 100644 index 000000000000..33a67b0ba001 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObject.m @@ -0,0 +1,18 @@ +#import "SWGUserManagedObject.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ +@implementation SWGUserManagedObject + +@dynamic _id; +@dynamic username; +@dynamic firstName; +@dynamic lastName; +@dynamic email; +@dynamic password; +@dynamic phone; +@dynamic userStatus; +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h new file mode 100644 index 000000000000..de1c284cde24 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.h @@ -0,0 +1,35 @@ +#import +#import + + +#import "SWGUserManagedObject.h" +#import "SWGUser.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGUserManagedObjectBuilder : NSObject + + + +-(SWGUserManagedObject*)createNewSWGUserManagedObjectInContext:(NSManagedObjectContext*)context; + +-(SWGUserManagedObject*)SWGUserManagedObjectFromSWGUser:(SWGUser*)object context:(NSManagedObjectContext*)context; + +-(void)updateSWGUserManagedObject:(SWGUserManagedObject*)object withSWGUser:(SWGUser*)object2; + +-(SWGUser*)SWGUserFromSWGUserManagedObject:(SWGUserManagedObject*)obj; + +-(void)updateSWGUser:(SWGUser*)object withSWGUserManagedObject:(SWGUserManagedObject*)object2; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m new file mode 100644 index 000000000000..2f7247526758 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClient/Model/SWGUserManagedObjectBuilder.m @@ -0,0 +1,67 @@ + + +#import "SWGUserManagedObjectBuilder.h" + +/** +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + +@implementation SWGUserManagedObjectBuilder + +-(instancetype)init { + self = [super init]; + if (self != nil) { + } + return self; +} + +-(SWGUserManagedObject*)createNewSWGUserManagedObjectInContext:(NSManagedObjectContext*)context { + SWGUserManagedObject *managedObject = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([SWGUserManagedObject class]) inManagedObjectContext:context]; + return managedObject; +} + +-(SWGUserManagedObject*)SWGUserManagedObjectFromSWGUser:(SWGUser*)object context:(NSManagedObjectContext*)context { + SWGUserManagedObject* newSWGUser = [self createNewSWGUserManagedObjectInContext:context]; + [self updateSWGUserManagedObject:newSWGUser withSWGUser:object]; + return newSWGUser; +} + +-(void)updateSWGUserManagedObject:(SWGUserManagedObject*)managedObject withSWGUser:(SWGUser*)object { + if(!managedObject || !object) { + return; + } + NSManagedObjectContext* context = managedObject.managedObjectContext; + managedObject._id = [object._id copy]; + managedObject.username = [object.username copy]; + managedObject.firstName = [object.firstName copy]; + managedObject.lastName = [object.lastName copy]; + managedObject.email = [object.email copy]; + managedObject.password = [object.password copy]; + managedObject.phone = [object.phone copy]; + managedObject.userStatus = [object.userStatus copy]; + +} + +-(SWGUser*)SWGUserFromSWGUserManagedObject:(SWGUserManagedObject*)obj { + if(!obj) { + return nil; + } + SWGUser* newSWGUser = [[SWGUser alloc] init]; + [self updateSWGUser:newSWGUser withSWGUserManagedObject:obj]; + return newSWGUser; +} + +-(void)updateSWGUser:(SWGUser*)newSWGUser withSWGUserManagedObject:(SWGUserManagedObject*)obj { + newSWGUser._id = [obj._id copy]; + newSWGUser.username = [obj.username copy]; + newSWGUser.firstName = [obj.firstName copy]; + newSWGUser.lastName = [obj.lastName copy]; + newSWGUser.email = [obj.email copy]; + newSWGUser.password = [obj.password copy]; + newSWGUser.phone = [obj.phone copy]; + newSWGUser.userStatus = [obj.userStatus copy]; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile b/samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..22654e6adda3 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Podfile @@ -0,0 +1,12 @@ +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient_Example' do + pod "SwaggerClient", :path => "../" +end + +target 'SwaggerClient_Tests' do + pod "SwaggerClient", :path => "../" + + pod 'Specta' + pod 'Expecta' +end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..462f141372dd --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,706 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */; }; + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; + 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; }; + 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; }; + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; + 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; + B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; + B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; + B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; + B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */; }; + B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6003F582195388D10070C39A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6003F589195388D20070C39A; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig"; sourceTree = ""; }; + 4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + 6003F58A195388D20070C39A /* SwaggerClient_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 6003F595195388D20070C39A /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = ""; }; + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = ""; }; + 6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = ""; }; + 6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = ""; }; + 6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = ""; }; + 6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = ""; }; + 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClient_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = ""; }; + 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; + B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; + B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; + B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; + B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; + B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BuildersTest.m; sourceTree = ""; }; + BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = ""; }; + E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.debug.xcconfig"; sourceTree = ""; }; + E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = ""; }; + FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6003F587195388D20070C39A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, + 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AB195388D20070C39A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, + 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6003F581195388D10070C39A = { + isa = PBXGroup; + children = ( + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, + 6003F593195388D20070C39A /* Example for SwaggerClient */, + 6003F5B5195388D20070C39A /* Tests */, + 6003F58C195388D20070C39A /* Frameworks */, + 6003F58B195388D20070C39A /* Products */, + CCE77F10C6D41F74B075ECD0 /* Pods */, + ); + sourceTree = ""; + }; + 6003F58B195388D20070C39A /* Products */ = { + isa = PBXGroup; + children = ( + 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, + 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, + B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, + ); + name = Products; + sourceTree = ""; + }; + 6003F58C195388D20070C39A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6003F58D195388D20070C39A /* Foundation.framework */, + 6003F58F195388D20070C39A /* CoreGraphics.framework */, + 6003F591195388D20070C39A /* UIKit.framework */, + 6003F5AF195388D20070C39A /* XCTest.framework */, + 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */, + FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6003F593195388D20070C39A /* Example for SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6003F59C195388D20070C39A /* SWGAppDelegate.h */, + 6003F59D195388D20070C39A /* SWGAppDelegate.m */, + 6003F5A5195388D20070C39A /* SWGViewController.h */, + 6003F5A6195388D20070C39A /* SWGViewController.m */, + 6003F594195388D20070C39A /* Supporting Files */, + ); + name = "Example for SwaggerClient"; + path = SwaggerClient; + sourceTree = ""; + }; + 6003F594195388D20070C39A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6003F595195388D20070C39A /* SwaggerClient-Info.plist */, + 6003F596195388D20070C39A /* InfoPlist.strings */, + 6003F599195388D20070C39A /* main.m */, + 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 6003F5B5195388D20070C39A /* Tests */ = { + isa = PBXGroup; + children = ( + 6003F5B6195388D20070C39A /* Supporting Files */, + B2ADC838FCC22F4BC6C41106 /* BuildersTest.m */, + B2ADCA62DE4AC0F5BAB42208 /* Helpers */, + ); + path = Tests; + sourceTree = ""; + }; + 6003F5B6195388D20070C39A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6003F5B7195388D20070C39A /* Tests-Info.plist */, + 6003F5B8195388D20070C39A /* InfoPlist.strings */, + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { + isa = PBXGroup; + children = ( + E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, + 4CCE21315897B7D544C83242 /* README.md */, + B2ADC7027D4B025ABCA7999F /* Main.storyboard */, + B2ADC65E342ADA697322D68C /* Images.xcassets */, + ); + name = "Podspec Metadata"; + sourceTree = ""; + }; + B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { + isa = PBXGroup; + children = ( + B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, + B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, + ); + path = Helpers; + sourceTree = ""; + }; + CCE77F10C6D41F74B075ECD0 /* Pods */ = { + isa = PBXGroup; + children = ( + E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */, + BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */, + 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */, + 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6003F589195388D20070C39A /* SwaggerClient_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */; + buildPhases = ( + 841AD69C2F0A6609E3057F05 /* [CP] Check Pods Manifest.lock */, + 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */, + 6003F586195388D20070C39A /* Sources */, + 6003F587195388D20070C39A /* Frameworks */, + 6003F588195388D20070C39A /* Resources */, + 429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */, + FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */, + DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient_Example; + productName = SwaggerClient; + productReference = 6003F58A195388D20070C39A /* SwaggerClient_Example.app */; + productType = "com.apple.product-type.application"; + }; + 6003F5AD195388D20070C39A /* SwaggerClient_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */; + buildPhases = ( + E0F523B17966072A199F040E /* [CP] Check Pods Manifest.lock */, + 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */, + 6003F5AA195388D20070C39A /* Sources */, + 6003F5AB195388D20070C39A /* Frameworks */, + 6003F5AC195388D20070C39A /* Resources */, + E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */, + AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */, + E994E0232EFD15F8EE665A4D /* Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 6003F5B4195388D20070C39A /* PBXTargetDependency */, + ); + name = SwaggerClient_Tests; + productName = SwaggerClientTests; + productReference = 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6003F582195388D10070C39A /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = SWG; + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = geekerzp; + }; + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6003F581195388D10070C39A; + productRefGroup = 6003F58B195388D20070C39A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6003F589195388D20070C39A /* SwaggerClient_Example */, + 6003F5AD195388D20070C39A /* SwaggerClient_Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6003F588195388D20070C39A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, + B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, + B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, + B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AC195388D20070C39A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 429AF5C69E165ED75311B4B0 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh", + "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld", + "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.momd", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.mom", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 841AD69C2F0A6609E3057F05 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + AA7CAD658C61D6EBA222B5F8 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + DA89ADFB80DCCB6691DED12D /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E0F523B17966072A199F040E /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Tests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + E337D7E459CCFFDF27046FFC /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh", + "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld", + "${PODS_ROOT}/../../SwaggerClient/Model/SWGModel.xcdatamodeld/SWGModel.xcdatamodel", + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.momd", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SWGModel.mom", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + E994E0232EFD15F8EE665A4D /* Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + FF3F107CF27E0A54D86C49F5 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6003F586195388D20070C39A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */, + 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */, + 6003F59A195388D20070C39A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AA195388D20070C39A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + B2ADC3C7634D15595DD14814 /* BuildersTest.m in Sources */, + B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6003F589195388D20070C39A /* SwaggerClient_Example */; + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6003F596195388D20070C39A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 6003F597195388D20070C39A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 6003F5B9195388D20070C39A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6003F5BD195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6003F5BE195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 7.1; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6003F5C0195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; + INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 6003F5C1195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; + INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 6003F5C3195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 6003F5C4195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5BD195388D20070C39A /* Debug */, + 6003F5BE195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5C0195388D20070C39A /* Debug */, + 6003F5C1195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5C3195388D20070C39A /* Debug */, + 6003F5C4195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6003F582195388D10070C39A /* Project object */; +} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..13bdd8ab8b75 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme new file mode 100644 index 000000000000..24c1ef20c794 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme new file mode 100644 index 000000000000..29c43710dffc --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..f697f61f4aaf --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 000000000000..4458b40c0558 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,51 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard new file mode 100644 index 000000000000..36df4e16819b --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard new file mode 100644 index 000000000000..f204320d3339 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/Main.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h new file mode 100644 index 000000000000..eb867594fdee --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h @@ -0,0 +1,15 @@ +// +// SWGAppDelegate.h +// SwaggerClient +// +// Created by CocoaPods on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +@import UIKit; + +@interface SWGAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m new file mode 100644 index 000000000000..25ad44a411e3 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m @@ -0,0 +1,19 @@ +// +// SWGAppDelegate.m +// SwaggerClient +// +// Created by CocoaPods on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +#import "SWGAppDelegate.h" + +@implementation SWGAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + return YES; +} + + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h new file mode 100644 index 000000000000..7847f2d05b1d --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.h @@ -0,0 +1,13 @@ +// +// SWGViewController.h +// SwaggerClient +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +@import UIKit; + +@interface SWGViewController : UIViewController + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m new file mode 100644 index 000000000000..d1ee531e2f05 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SWGViewController.m @@ -0,0 +1,60 @@ +// +// SWGViewController.m +// SwaggerClient +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +#import "SWGViewController.h" +#import +#import +#import +#import + +@interface SWGViewController () + +@end + +@implementation SWGViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; + config.debug = YES; + + SWGPetApi *api = [[SWGPetApi alloc] init]; + NSURL *file = [NSURL fileURLWithPath:@"/Users/geekerzp/tmp/test.jpg"]; + [api uploadFileWithPetId:@2 additionalMetadata:@"2" file:file completionHandler:^(NSError *error) { + NSLog(@"*** error: %@", error); + }]; +} + +- (SWGPet*) createPet { + SWGPet * pet = [[SWGPet alloc] init]; + pet._id = @((long) [[NSDate date] timeIntervalSince1970]); + pet.name = @"monkey"; + + SWGCategory * category = [[SWGCategory alloc] init]; + category._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + category.name = @"super-happy"; + pet.category = category; + + SWGTag *tag1 = [[SWGTag alloc] init]; + tag1._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + tag1.name = @"test tag 1"; + SWGTag *tag2 = [[SWGTag alloc] init]; + tag2._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + tag2.name = @"test tag 2"; + pet.tags = (NSArray *) @[tag1, tag2]; + + pet.status = @"available"; + + NSArray * photos = @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]; + pet.photoUrls = photos; + return pet; +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist new file mode 100644 index 000000000000..0c641d12c147 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist @@ -0,0 +1,54 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UILaunchStoryboardName + Launch Screen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch new file mode 100644 index 000000000000..7825372cbdda --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + @import UIKit; + @import Foundation; +#endif diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings new file mode 100644 index 000000000000..477b28ff8f86 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m new file mode 100644 index 000000000000..4a47f1fd69e4 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient/main.m @@ -0,0 +1,17 @@ +// +// main.m +// SwaggerClient +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +@import UIKit; +#import "SWGAppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWGAppDelegate class])); + } +} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m new file mode 100644 index 000000000000..c822d59d7996 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/BuildersTest.m @@ -0,0 +1,117 @@ +// +// BuildersTest.m +// SwaggerClient +// +// Created by mmackowiak on 16.05.2016. +// Copyright (c) 2016 geekerzp. All rights reserved. +// + +#import +#import +#import "SWGPetManagedObject.h" +#import "SWGPetManagedObjectBuilder.h" +#import "DatabaseHelper.h" +#import "SWGUserManagedObject.h" +#import "SWGUserManagedObjectBuilder.h" +#import "SWGOrderManagedObjectBuilder.h" + +@interface BuildersTest : XCTestCase { + SWGPet *pet; + SWGUser* user; + SWGOrder *order; + NSManagedObjectContext *context; +} + +@end + +@implementation BuildersTest + +- (void)setUp { + [super setUp]; + + NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", + @"status": @"sold", + @"photoUrls": @[@"string"], + @"category": @{ @"id": @1, @"name": @"test category" }, + @"tags": @[ @{ @"id": @1, @"name": @"test tag" }], + }; + NSError * error; + pet = [[SWGPet alloc] initWithDictionary:petDict error:&error]; + XCTAssertNil(error); + + NSDictionary *userDict = @{ + @"id": @1, + @"email": @"test@test.com", + @"firstName": @"firstName", + @"lastName": @"lastName", + @"password": @"password", + @"username": @"username", + @"phone": @"57676767", + }; + error = nil; + user = [[SWGUser alloc] initWithDictionary:userDict error:&error]; + XCTAssertNil(error); + + NSDictionary *orderDict = @{ + @"id": @324, + @"petId": @234, + @"quantity": @12, + @"shipDate": @"1997-07-16T19:20:30+00:00", + @"status": @"status", + @"complete": @1, + }; + error = nil; + order = [[SWGOrder alloc] initWithDictionary:orderDict error:&error]; + XCTAssertNil(error); + + context = [DatabaseHelper createContextWithModelName:@"SWGModel"]; + + +} + +- (void)testSWGPetExample { + SWGPetManagedObjectBuilder* builder = [[SWGPetManagedObjectBuilder alloc] init]; + + SWGPetManagedObject * managedObject = [builder SWGPetManagedObjectFromSWGPet:pet context:context]; + SWGPet *pet2 = [builder SWGPetFromSWGPetManagedObject:managedObject]; + NSError * error; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + [context deleteObject:managedObject]; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(pet.description,pet2.description); + +} + + +- (void)testSWGUserExample { + SWGUserManagedObjectBuilder * builder = [[SWGUserManagedObjectBuilder alloc] init]; + SWGUserManagedObject * managedObject = [builder SWGUserManagedObjectFromSWGUser:user context:context]; + SWGUser *user2 = [builder SWGUserFromSWGUserManagedObject:managedObject]; + NSError * error; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + [context deleteObject:managedObject]; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + XCTAssertEqualObjects(user.description,user2.description); + +} + +- (void)testSWGOrderExample { + SWGOrderManagedObjectBuilder * builder = [[SWGOrderManagedObjectBuilder alloc] init]; + SWGOrderManagedObject * managedObject = [builder SWGOrderManagedObjectFromSWGOrder:order context:context]; + SWGOrder *order2 = [builder SWGOrderFromSWGOrderManagedObject:managedObject]; + NSError * error; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + [context deleteObject:managedObject]; + XCTAssertTrue([context save:&error]); + XCTAssertNil(error); + + XCTAssertEqualObjects(order.description,order2.description); + +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h new file mode 100644 index 000000000000..8216e012a32a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h @@ -0,0 +1,14 @@ +#import +#import + +@interface DatabaseHelper : NSObject + ++ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName; + ++ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName; + ++ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName; + ++ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model; + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m new file mode 100644 index 000000000000..3433ac19ddbf --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m @@ -0,0 +1,42 @@ +#import "DatabaseHelper.h" + +@implementation DatabaseHelper + + ++ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName { + NSManagedObjectModel *model = [self createModelWithModelName:mName]; + return [self createDatabaseWithModel:model]; +} + ++ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model { + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + [coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil]; + + NSManagedObjectContext *testingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + [testingContext setPersistentStoreCoordinator:coordinator]; + [testingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy]; + return testingContext; +} + ++ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName { + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + NSString *path = [bundle pathForResource:mName ofType:@"momd"]; + NSAssert(path, @"Missing Model for name: %@",mName); + NSURL *modURL = [NSURL fileURLWithPath:path]; + return [[NSManagedObjectModel alloc] initWithContentsOfURL:modURL]; +} + ++ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName { + NSFetchRequest *fetch = [[NSFetchRequest alloc] init]; + [fetch setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:ctx]]; + NSError *error = nil; + NSArray *result = [ctx executeFetchRequest:fetch error:&error]; + if (error) { + NSLog(@"Failed clearing context from entities with name [%@]", error); + } + for (id basket in result) { + [ctx deleteObject:basket]; + } +} + +@end diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist new file mode 100644 index 000000000000..169b6f710ecc --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch new file mode 100644 index 000000000000..6d08c288215a --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/Tests-Prefix.pch @@ -0,0 +1,8 @@ +// The contents of this file are implicitly included at the beginning of every test case source file. + +#ifdef __OBJC__ + + //@import Specta; + //@import Expecta; + +#endif diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings new file mode 100644 index 000000000000..477b28ff8f86 --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml b/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..d5cbe4b51d0d --- /dev/null +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + ObjcCoreDataPetstoreClientTests + pom + 1.0-SNAPSHOT + Objective-C Core Data Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh old mode 100644 new mode 100755 index c63c525fc247..5f88b8fcd74c --- a/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/objc/core-data/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -(cd $DIRECTORY/tests ; xcodebuild -scheme TestClientTests-Package test -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}) +pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/objc/core-data/docs/SWGCategory.md b/samples/client/petstore/objc/core-data/docs/SWGCategory.md new file mode 100644 index 000000000000..93a8d14ecb98 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGCategory.md @@ -0,0 +1,11 @@ +# SWGCategory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGInlineObject.md b/samples/client/petstore/objc/core-data/docs/SWGInlineObject.md new file mode 100644 index 000000000000..1d66818927f4 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGInlineObject.md @@ -0,0 +1,11 @@ +# SWGInlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **NSString*** | Updated name of the pet | [optional] +**status** | **NSString*** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md b/samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md new file mode 100644 index 000000000000..c59e84858851 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGInlineObject1.md @@ -0,0 +1,11 @@ +# SWGInlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional] +**file** | **NSURL*** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGOrder.md b/samples/client/petstore/objc/core-data/docs/SWGOrder.md new file mode 100644 index 000000000000..b2a9f25eae95 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGOrder.md @@ -0,0 +1,15 @@ +# SWGOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**petId** | **NSNumber*** | | [optional] +**quantity** | **NSNumber*** | | [optional] +**shipDate** | **NSDate*** | | [optional] +**status** | **NSString*** | Order Status | [optional] +**complete** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGPet.md b/samples/client/petstore/objc/core-data/docs/SWGPet.md new file mode 100644 index 000000000000..c8298c66bf14 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGPet.md @@ -0,0 +1,15 @@ +# SWGPet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**category** | [**SWGCategory***](SWGCategory.md) | | [optional] +**name** | **NSString*** | | +**photoUrls** | **NSArray<NSString*>*** | | +**tags** | [**NSArray<SWGTag>***](SWGTag.md) | | [optional] +**status** | **NSString*** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGPetApi.md b/samples/client/petstore/objc/core-data/docs/SWGPetApi.md new file mode 100644 index 000000000000..47b1b14d8d26 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGPetApi.md @@ -0,0 +1,466 @@ +# SWGPetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```objc +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; +``` + +Add a new pet to the store + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Add a new pet to the store +[apiInstance addPetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->addPet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +```objc +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; +``` + +Deletes a pet + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // Pet id to delete +NSString* apiKey = @"apiKey_example"; // (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Deletes a pet +[apiInstance deletePetWithPetId:petId + apiKey:apiKey + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->deletePet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| Pet id to delete | + **apiKey** | **NSString***| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +```objc +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* status = @[@"status_example"]; // Status values that need to be considered for filter (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Finds Pets by status +[apiInstance findPetsByStatusWithStatus:status + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGPetApi->findPetsByStatus: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | [optional] + +### Return type + +[**NSArray***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +```objc +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* tags = @[@"tags_example"]; // Tags to filter by (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Finds Pets by tags +[apiInstance findPetsByTagsWithTags:tags + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGPetApi->findPetsByTags: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | [optional] + +### Return type + +[**NSArray***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +```objc +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; +``` + +Find pet by ID + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + +// Configure API key authorization: (authentication scheme: api_key) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; + + +NSNumber* petId = @56; // ID of pet that needs to be fetched + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Find pet by ID +[apiInstance getPetByIdWithPetId:petId + completionHandler: ^(SWGPet* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGPetApi->getPetById: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet that needs to be fetched | + +### Return type + +[**SWGPet***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +```objc +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; +``` + +Update an existing pet + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Update an existing pet +[apiInstance updatePetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->updatePet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +```objc +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updates a pet in the store with form data + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSString* petId = @"petId_example"; // ID of pet that needs to be updated +NSString* name = @"name_example"; // Updated name of the pet (optional) +NSString* status = @"status_example"; // Updated status of the pet (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Updates a pet in the store with form data +[apiInstance updatePetWithFormWithPetId:petId + name:name + status:status + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->updatePetWithForm: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSString***| ID of pet that needs to be updated | + **name** | **NSString***| Updated name of the pet | [optional] + **status** | **NSString***| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +```objc +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; +``` + +uploads an image + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // ID of pet to update +NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional) +NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file to upload (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// uploads an image +[apiInstance uploadFileWithPetId:petId + additionalMetadata:additionalMetadata + file:file + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->uploadFile: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet to update | + **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] + **file** | **NSURL*****NSURL***| file to upload | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md b/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md new file mode 100644 index 000000000000..3c13b68eaff6 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGStoreApi.md @@ -0,0 +1,212 @@ +# SWGStoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```objc +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of the order that needs to be deleted + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Delete purchase order by ID +[apiInstance deleteOrderWithOrderId:orderId + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGStoreApi->deleteOrder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +```objc +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: api_key) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; + + + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Returns pet inventories by status +[apiInstance getInventoryWithCompletionHandler: + ^(NSDictionary* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGStoreApi->getInventory: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSDictionary*** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +```objc +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Find purchase order by ID +[apiInstance getOrderByIdWithOrderId:orderId + completionHandler: ^(SWGOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGStoreApi->getOrderById: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of pet that needs to be fetched | + +### Return type + +[**SWGOrder***](SWGOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +```objc +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; +``` + +Place an order for a pet + + + +### Example +```objc + +SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Place an order for a pet +[apiInstance placeOrderWithOrder:order + completionHandler: ^(SWGOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGStoreApi->placeOrder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] + +### Return type + +[**SWGOrder***](SWGOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/core-data/docs/SWGTag.md b/samples/client/petstore/objc/core-data/docs/SWGTag.md new file mode 100644 index 000000000000..5495d5c8a99f --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGTag.md @@ -0,0 +1,11 @@ +# SWGTag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGUser.md b/samples/client/petstore/objc/core-data/docs/SWGUser.md new file mode 100644 index 000000000000..35bf5540cad0 --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGUser.md @@ -0,0 +1,17 @@ +# SWGUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**username** | **NSString*** | | [optional] +**firstName** | **NSString*** | | [optional] +**lastName** | **NSString*** | | [optional] +**email** | **NSString*** | | [optional] +**password** | **NSString*** | | [optional] +**phone** | **NSString*** | | [optional] +**userStatus** | **NSNumber*** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/core-data/docs/SWGUserApi.md b/samples/client/petstore/objc/core-data/docs/SWGUserApi.md new file mode 100644 index 000000000000..51792caed6bd --- /dev/null +++ b/samples/client/petstore/objc/core-data/docs/SWGUserApi.md @@ -0,0 +1,402 @@ +# SWGUserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](SWGUserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```objc +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Create user + +This can only be done by the logged in user. + +### Example +```objc + +SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Create user +[apiInstance createUserWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->createUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +```objc +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + + + +### Example +```objc + +NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Creates list of users with given input array +[apiInstance createUsersWithArrayInputWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +```objc +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + + + +### Example +```objc + +NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Creates list of users with given input array +[apiInstance createUsersWithListInputWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +```objc +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be deleted + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Delete user +[apiInstance deleteUserWithUsername:username + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->deleteUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +```objc +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; +``` + +Get user by user name + + + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Get user by user name +[apiInstance getUserByNameWithUsername:username + completionHandler: ^(SWGUser* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGUserApi->getUserByName: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**SWGUser***](SWGUser.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +```objc +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; +``` + +Logs user into the system + + + +### Example +```objc + +NSString* username = @"username_example"; // The user name for login (optional) +NSString* password = @"password_example"; // The password for login in clear text (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Logs user into the system +[apiInstance loginUserWithUsername:username + password:password + completionHandler: ^(NSString* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGUserApi->loginUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The user name for login | [optional] + **password** | **NSString***| The password for login in clear text | [optional] + +### Return type + +**NSString*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +```objc +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + +Logs out current logged in user session + + + +### Example +```objc + + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Logs out current logged in user session +[apiInstance logoutUserWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->logoutUser: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +```objc +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updated user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // name that need to be deleted +SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Updated user +[apiInstance updateUserWithUsername:username + user:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->updateUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| name that need to be deleted | + **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/core-data/git_push.sh b/samples/client/petstore/objc/core-data/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/objc/core-data/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/objc/default/.gitignore b/samples/client/petstore/objc/default/.gitignore new file mode 100644 index 000000000000..01103f6f5ef6 --- /dev/null +++ b/samples/client/petstore/objc/default/.gitignore @@ -0,0 +1,53 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/samples/client/petstore/objc/default/.openapi-generator-ignore b/samples/client/petstore/objc/default/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/client/petstore/objc/default/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/client/petstore/objc/default/.openapi-generator/FILES b/samples/client/petstore/objc/default/.openapi-generator/FILES new file mode 100644 index 000000000000..02311083874d --- /dev/null +++ b/samples/client/petstore/objc/default/.openapi-generator/FILES @@ -0,0 +1,50 @@ +.gitignore +README.md +SwaggerClient.podspec +SwaggerClient/Api/SWGPetApi.h +SwaggerClient/Api/SWGPetApi.m +SwaggerClient/Api/SWGStoreApi.h +SwaggerClient/Api/SWGStoreApi.m +SwaggerClient/Api/SWGUserApi.h +SwaggerClient/Api/SWGUserApi.m +SwaggerClient/Core/JSONValueTransformer+ISO8601.h +SwaggerClient/Core/JSONValueTransformer+ISO8601.m +SwaggerClient/Core/SWGApi.h +SwaggerClient/Core/SWGApiClient.h +SwaggerClient/Core/SWGApiClient.m +SwaggerClient/Core/SWGBasicAuthTokenProvider.h +SwaggerClient/Core/SWGBasicAuthTokenProvider.m +SwaggerClient/Core/SWGConfiguration.h +SwaggerClient/Core/SWGDefaultConfiguration.h +SwaggerClient/Core/SWGDefaultConfiguration.m +SwaggerClient/Core/SWGJSONRequestSerializer.h +SwaggerClient/Core/SWGJSONRequestSerializer.m +SwaggerClient/Core/SWGLogger.h +SwaggerClient/Core/SWGLogger.m +SwaggerClient/Core/SWGObject.h +SwaggerClient/Core/SWGObject.m +SwaggerClient/Core/SWGQueryParamCollection.h +SwaggerClient/Core/SWGQueryParamCollection.m +SwaggerClient/Core/SWGResponseDeserializer.h +SwaggerClient/Core/SWGResponseDeserializer.m +SwaggerClient/Core/SWGSanitizer.h +SwaggerClient/Core/SWGSanitizer.m +SwaggerClient/Model/SWGCategory.h +SwaggerClient/Model/SWGCategory.m +SwaggerClient/Model/SWGOrder.h +SwaggerClient/Model/SWGOrder.m +SwaggerClient/Model/SWGPet.h +SwaggerClient/Model/SWGPet.m +SwaggerClient/Model/SWGTag.h +SwaggerClient/Model/SWGTag.m +SwaggerClient/Model/SWGUser.h +SwaggerClient/Model/SWGUser.m +docs/SWGCategory.md +docs/SWGOrder.md +docs/SWGPet.md +docs/SWGPetApi.md +docs/SWGStoreApi.md +docs/SWGTag.md +docs/SWGUser.md +docs/SWGUserApi.md +git_push.sh diff --git a/samples/client/petstore/objc/default/.openapi-generator/VERSION b/samples/client/petstore/objc/default/.openapi-generator/VERSION new file mode 100644 index 000000000000..909dcd0eca63 --- /dev/null +++ b/samples/client/petstore/objc/default/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.19.0-SNAPSHOT diff --git a/samples/client/petstore/objc/default/OpenAPIClient.podspec b/samples/client/petstore/objc/default/OpenAPIClient.podspec new file mode 100644 index 000000000000..36156fa1484d --- /dev/null +++ b/samples/client/petstore/objc/default/OpenAPIClient.podspec @@ -0,0 +1,37 @@ +# +# Be sure to run `pod lib lint OpenAPIClient.podspec' to ensure this is a +# valid spec and remove all comments before submitting the spec. +# +# Any lines starting with a # are optional, but encouraged +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = "OpenAPIClient" + s.version = "1.0.0" + + s.summary = "OpenAPI Petstore" + s.description = <<-DESC + This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + DESC + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.framework = 'SystemConfiguration' + + s.homepage = "https://github.com/openapitools/openapi-generator" + s.license = "Proprietary" + s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } + s.author = { "OpenAPI" => "team@openapitools.org" } + + s.source_files = 'OpenAPIClient/**/*.{m,h}' + s.public_header_files = 'OpenAPIClient/**/*.h' + + + s.dependency 'AFNetworking', '~> 3' + s.dependency 'JSONModel', '~> 1.2' + s.dependency 'ISO8601', '~> 0.6' +end + diff --git a/samples/client/petstore/objc/default/README.md b/samples/client/petstore/objc/default/README.md new file mode 100644 index 000000000000..1c81b8151b46 --- /dev/null +++ b/samples/client/petstore/objc/default/README.md @@ -0,0 +1,147 @@ +# SwaggerClient + +This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + +This ObjC package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 1.0.0 +- Package version: +- Generator version: 7.19.0-SNAPSHOT +- Build package: org.openapitools.codegen.languages.ObjcClientCodegen + +## Requirements + +The SDK requires [**ARC (Automatic Reference Counting)**](http://stackoverflow.com/questions/7778356/how-to-enable-disable-automatic-reference-counting) to be enabled in the Xcode project. + +## Installation & Usage +### Install from Github using [CocoaPods](https://cocoapods.org/) + +Add the following to the Podfile: + +```ruby +pod 'SwaggerClient', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git' +``` + +To specify a particular branch, append `, :branch => 'branch-name-here'` + +To specify a particular commit, append `, :commit => '11aa22'` + +### Install from local path using [CocoaPods](https://cocoapods.org/) + +Put the SDK under your project folder (e.g. /path/to/objc_project/Vendor/SwaggerClient) and then add the following to the Podfile: + +```ruby +pod 'SwaggerClient', :path => 'Vendor/SwaggerClient' +``` + +### Usage + +Import the following: + +```objc +#import +#import +// load models +#import +#import +#import +#import +#import +// load API classes for accessing endpoints +#import +#import +#import + +``` + +## Recommendation + +It's recommended to create an instance of ApiClient per thread in a multi-threaded environment to avoid any potential issues. + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```objc + +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* *pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +SWGPetApi *apiInstance = [[SWGPetApi alloc] init]; + +// Add a new pet to the store +[apiInstance addPetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error: %@", error); + } + }]; + +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*SWGPetApi* | [**addPet**](docs/SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +*SWGPetApi* | [**deletePet**](docs/SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +*SWGPetApi* | [**findPetsByStatus**](docs/SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +*SWGPetApi* | [**findPetsByTags**](docs/SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +*SWGPetApi* | [**getPetById**](docs/SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +*SWGPetApi* | [**updatePet**](docs/SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +*SWGPetApi* | [**updatePetWithForm**](docs/SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +*SWGPetApi* | [**uploadFile**](docs/SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image +*SWGStoreApi* | [**deleteOrder**](docs/SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*SWGStoreApi* | [**getInventory**](docs/SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +*SWGStoreApi* | [**getOrderById**](docs/SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +*SWGStoreApi* | [**placeOrder**](docs/SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet +*SWGUserApi* | [**createUser**](docs/SWGUserApi.md#createuser) | **POST** /user | Create user +*SWGUserApi* | [**createUsersWithArrayInput**](docs/SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +*SWGUserApi* | [**createUsersWithListInput**](docs/SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +*SWGUserApi* | [**deleteUser**](docs/SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +*SWGUserApi* | [**getUserByName**](docs/SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +*SWGUserApi* | [**loginUser**](docs/SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +*SWGUserApi* | [**logoutUser**](docs/SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +*SWGUserApi* | [**updateUser**](docs/SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +## Documentation For Models + + - [SWGCategory](docs/SWGCategory.md) + - [SWGOrder](docs/SWGOrder.md) + - [SWGPet](docs/SWGPet.md) + - [SWGTag](docs/SWGTag.md) + - [SWGUser](docs/SWGUser.md) + + +## Documentation For Authorization + + +Authentication schemes defined for the API: +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +### petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + + +## Author + + + diff --git a/samples/client/petstore/objc/default/SwaggerClient.podspec b/samples/client/petstore/objc/default/SwaggerClient.podspec new file mode 100644 index 000000000000..c58a3f751b16 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient.podspec @@ -0,0 +1,36 @@ +# +# Be sure to run `pod lib lint SwaggerClient.podspec' to ensure this is a +# valid spec and remove all comments before submitting the spec. +# +# Any lines starting with a # are optional, but encouraged +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html +# + +Pod::Spec.new do |s| + s.name = "SwaggerClient" + s.version = "1.0.0" + + s.summary = "OpenAPI Petstore" + s.description = <<-DESC + This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters + DESC + + s.platform = :ios, '7.0' + s.requires_arc = true + + s.framework = 'SystemConfiguration' + + s.homepage = "https://github.com/openapitools/openapi-generator" + s.license = "Proprietary" + s.source = { :git => "https://github.com/openapitools/openapi-generator.git", :tag => "#{s.version}" } + s.author = { "OpenAPI" => "team@openapitools.org" } + + s.source_files = 'SwaggerClient/**/*.{m,h}' + s.public_header_files = 'SwaggerClient/**/*.h' + + + s.dependency 'AFNetworking', '~> 3' + s.dependency 'JSONModel', '~> 1.2' + s.dependency 'ISO8601', '~> 0.6' +end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h new file mode 100644 index 000000000000..1b1309c48761 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.h @@ -0,0 +1,139 @@ +#import +#import "SWGPet.h" +#import "SWGApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface SWGPetApi: NSObject + +extern NSString* kSWGPetApiErrorDomain; +extern NSInteger kSWGPetApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Add a new pet to the store +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Deletes a pet +/// +/// +/// @param petId Pet id to delete +/// @param apiKey (optional) +/// +/// code:400 message:"Invalid pet value" +/// +/// @return void +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; + + +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// +/// @param status Status values that need to be considered for filter (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid status value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// +/// @param tags Tags to filter by (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid tag value" +/// +/// @return NSArray* +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; + + +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// +/// @param petId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found" +/// +/// @return SWGPet* +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; + + +/// Update an existing pet +/// +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Pet not found", +/// code:405 message:"Validation exception" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; + + +/// Updates a pet in the store with form data +/// +/// +/// @param petId ID of pet that needs to be updated +/// @param name Updated name of the pet (optional) +/// @param status Updated status of the pet (optional) +/// +/// code:405 message:"Invalid input" +/// +/// @return void +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; + + +/// uploads an image +/// +/// +/// @param petId ID of pet to update +/// @param additionalMetadata Additional data to pass to server (optional) +/// @param file file to upload (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m new file mode 100644 index 000000000000..9a774f3d9b7f --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGPetApi.m @@ -0,0 +1,578 @@ +#import "SWGPetApi.h" +#import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" +#import "SWGPet.h" + + +@interface SWGPetApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation SWGPetApi + +NSString* kSWGPetApiErrorDomain = @"SWGPetApiErrorDomain"; +NSInteger kSWGPetApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[SWGApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Add a new pet to the store +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Deletes a pet +/// +/// @param petId Pet id to delete +/// +/// @param apiKey (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + if (apiKey != nil) { + headerParams[@"api_key"] = apiKey; + } + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Finds Pets by status +/// Multiple status values can be provided with comma separated strings +/// @param status Status values that need to be considered for filter (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByStatus"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (status != nil) { + queryParams[@"status"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: status format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Finds Pets by tags +/// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +/// @param tags Tags to filter by (optional) +/// +/// @returns NSArray* +/// +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/findByTags"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (tags != nil) { + queryParams[@"tags"] = [[SWGQueryParamCollection alloc] initWithValuesAndFormat: tags format: @"multi"]; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSArray*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSArray*)data, error); + } + }]; +} + +/// +/// Find pet by ID +/// Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions +/// @param petId ID of pet that needs to be fetched +/// +/// @returns SWGPet* +/// +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth", @"api_key"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGPet*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGPet*)data, error); + } + }]; +} + +/// +/// Update an existing pet +/// +/// @param pet Pet object that needs to be added to the store (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json", @"application/xml"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = pet; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updates a pet in the store with form data +/// +/// @param petId ID of pet that needs to be updated +/// +/// @param name Updated name of the pet (optional) +/// +/// @param status Updated status of the pet (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/x-www-form-urlencoded"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (name) { + formParams[@"name"] = name; + } + if (status) { + formParams[@"status"] = status; + } + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// uploads an image +/// +/// @param petId ID of pet to update +/// +/// @param additionalMetadata Additional data to pass to server (optional) +/// +/// @param file file to upload (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'petId' is set + if (petId == nil) { + NSParameterAssert(petId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"petId"] }; + NSError* error = [NSError errorWithDomain:kSWGPetApiErrorDomain code:kSWGPetApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/pet/{petId}/uploadImage"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (petId != nil) { + pathParams[@"petId"] = petId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"multipart/form-data"]]; + + // Authentication setting + NSArray *authSettings = @[@"petstore_auth"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + if (additionalMetadata) { + formParams[@"additionalMetadata"] = additionalMetadata; + } + localVarFiles[@"file"] = file; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h new file mode 100644 index 000000000000..935845f72151 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.h @@ -0,0 +1,78 @@ +#import +#import "SWGOrder.h" +#import "SWGApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface SWGStoreApi: NSObject + +extern NSString* kSWGStoreApiErrorDomain; +extern NSInteger kSWGStoreApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// +/// @param orderId ID of the order that needs to be deleted +/// +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return void +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; + + +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// +/// +/// code:200 message:"successful operation" +/// +/// @return NSDictionary* +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; + + +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +/// +/// @param orderId ID of pet that needs to be fetched +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid ID supplied", +/// code:404 message:"Order not found" +/// +/// @return SWGOrder* +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; + + +/// Place an order for a pet +/// +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid Order" +/// +/// @return SWGOrder* +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m new file mode 100644 index 000000000000..14a5c4239217 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGStoreApi.m @@ -0,0 +1,297 @@ +#import "SWGStoreApi.h" +#import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" +#import "SWGOrder.h" + + +@interface SWGStoreApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation SWGStoreApi + +NSString* kSWGStoreApiErrorDomain = @"SWGStoreApiErrorDomain"; +NSInteger kSWGStoreApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[SWGApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Delete purchase order by ID +/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +/// @param orderId ID of the order that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Returns pet inventories by status +/// Returns a map of status codes to quantities +/// @returns NSDictionary* +/// +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/inventory"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[@"api_key"]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSDictionary*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSDictionary*)data, error); + } + }]; +} + +/// +/// Find purchase order by ID +/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions +/// @param orderId ID of pet that needs to be fetched +/// +/// @returns SWGOrder* +/// +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { + // verify the required parameter 'orderId' is set + if (orderId == nil) { + NSParameterAssert(orderId); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"orderId"] }; + NSError* error = [NSError errorWithDomain:kSWGStoreApiErrorDomain code:kSWGStoreApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order/{orderId}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (orderId != nil) { + pathParams[@"orderId"] = orderId; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGOrder*)data, error); + } + }]; +} + +/// +/// Place an order for a pet +/// +/// @param order order placed for purchasing the pet (optional) +/// +/// @returns SWGOrder* +/// +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/store/order"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = order; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGOrder*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGOrder*)data, error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h new file mode 100644 index 000000000000..98a3a1756d5d --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.h @@ -0,0 +1,131 @@ +#import +#import "SWGUser.h" +#import "SWGApi.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + +@interface SWGUserApi: NSObject + +extern NSString* kSWGUserApiErrorDomain; +extern NSInteger kSWGUserApiMissingParamErrorCode; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient NS_DESIGNATED_INITIALIZER; + +/// Create user +/// This can only be done by the logged in user. +/// +/// @param user Created user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Creates list of users with given input array +/// +/// +/// @param user List of user object (optional) +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; + + +/// Delete user +/// This can only be done by the logged in user. +/// +/// @param username The name that needs to be deleted +/// +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; + + +/// Get user by user name +/// +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username supplied", +/// code:404 message:"User not found" +/// +/// @return SWGUser* +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; + + +/// Logs user into the system +/// +/// +/// @param username The user name for login (optional) +/// @param password The password for login in clear text (optional) +/// +/// code:200 message:"successful operation", +/// code:400 message:"Invalid username/password supplied" +/// +/// @return NSString* +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; + + +/// Logs out current logged in user session +/// +/// +/// +/// code:0 message:"successful operation" +/// +/// @return void +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; + + +/// Updated user +/// This can only be done by the logged in user. +/// +/// @param username name that need to be deleted +/// @param user Updated user object (optional) +/// +/// code:400 message:"Invalid user supplied", +/// code:404 message:"User not found" +/// +/// @return void +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m new file mode 100644 index 000000000000..94651c70282f --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Api/SWGUserApi.m @@ -0,0 +1,542 @@ +#import "SWGUserApi.h" +#import "SWGQueryParamCollection.h" +#import "SWGApiClient.h" +#import "SWGUser.h" + + +@interface SWGUserApi () + +@property (nonatomic, strong, readwrite) NSMutableDictionary *mutableDefaultHeaders; + +@end + +@implementation SWGUserApi + +NSString* kSWGUserApiErrorDomain = @"SWGUserApiErrorDomain"; +NSInteger kSWGUserApiMissingParamErrorCode = 234513; + +@synthesize apiClient = _apiClient; + +#pragma mark - Initialize methods + +- (instancetype) init { + return [self initWithApiClient:[SWGApiClient sharedClient]]; +} + + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient { + self = [super init]; + if (self) { + _apiClient = apiClient; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + } + return self; +} + +#pragma mark - + +-(NSString*) defaultHeaderForKey:(NSString*)key { + return self.mutableDefaultHeaders[key]; +} + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key { + [self.mutableDefaultHeaders setValue:value forKey:key]; +} + +-(NSDictionary *)defaultHeaders { + return self.mutableDefaultHeaders; +} + +#pragma mark - Api Methods + +/// +/// Create user +/// This can only be done by the logged in user. +/// @param user Created user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithArray"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Creates list of users with given input array +/// +/// @param user List of user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/createWithList"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"POST" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Delete user +/// This can only be done by the logged in user. +/// @param username The name that needs to be deleted +/// +/// @returns void +/// +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"DELETE" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Get user by user name +/// +/// @param username The name that needs to be fetched. Use user1 for testing. +/// +/// @returns SWGUser* +/// +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(nil, error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"SWGUser*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((SWGUser*)data, error); + } + }]; +} + +/// +/// Logs user into the system +/// +/// @param username The user name for login (optional) +/// +/// @param password The password for login in clear text (optional) +/// +/// @returns NSString* +/// +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/login"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + queryParams[@"username"] = username; + } + if (password != nil) { + queryParams[@"password"] = password; + } + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[@"application/json", @"application/xml"]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: @"NSString*" + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler((NSString*)data, error); + } + }]; +} + +/// +/// Logs out current logged in user session +/// +/// @returns void +/// +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler { + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/logout"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + + return [self.apiClient requestWithPath: resourcePath + method: @"GET" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + +/// +/// Updated user +/// This can only be done by the logged in user. +/// @param username name that need to be deleted +/// +/// @param user Updated user object (optional) +/// +/// @returns void +/// +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler { + // verify the required parameter 'username' is set + if (username == nil) { + NSParameterAssert(username); + if(handler) { + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"Missing required parameter '%@'", nil),@"username"] }; + NSError* error = [NSError errorWithDomain:kSWGUserApiErrorDomain code:kSWGUserApiMissingParamErrorCode userInfo:userInfo]; + handler(error); + } + return nil; + } + + NSMutableString* resourcePath = [NSMutableString stringWithFormat:@"/user/{username}"]; + + NSMutableDictionary *pathParams = [[NSMutableDictionary alloc] init]; + if (username != nil) { + pathParams[@"username"] = username; + } + + NSMutableDictionary* queryParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary* headerParams = [NSMutableDictionary dictionaryWithDictionary:self.apiClient.configuration.defaultHeaders]; + [headerParams addEntriesFromDictionary:self.defaultHeaders]; + // HTTP header `Accept` + NSString *acceptHeader = [self.apiClient.sanitizer selectHeaderAccept:@[]]; + if(acceptHeader.length > 0) { + headerParams[@"Accept"] = acceptHeader; + } + + // response content type + NSString *responseContentType = [[acceptHeader componentsSeparatedByString:@", "] firstObject] ?: @""; + + // request content type + NSString *requestContentType = [self.apiClient.sanitizer selectHeaderContentType:@[@"application/json"]]; + + // Authentication setting + NSArray *authSettings = @[]; + + id bodyParam = nil; + NSMutableDictionary *formParams = [[NSMutableDictionary alloc] init]; + NSMutableDictionary *localVarFiles = [[NSMutableDictionary alloc] init]; + bodyParam = user; + + return [self.apiClient requestWithPath: resourcePath + method: @"PUT" + pathParams: pathParams + queryParams: queryParams + formParams: formParams + files: localVarFiles + body: bodyParam + headerParams: headerParams + authSettings: authSettings + requestContentType: requestContentType + responseContentType: responseContentType + responseType: nil + completionBlock: ^(id data, NSError *error) { + if(handler) { + handler(error); + } + }]; +} + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h new file mode 100644 index 000000000000..5179ca2e99b8 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface JSONValueTransformer (ISO8601) + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m new file mode 100644 index 000000000000..0f458f0af010 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/JSONValueTransformer+ISO8601.m @@ -0,0 +1,17 @@ +#import +#import "JSONValueTransformer+ISO8601.h" +#import "SWGSanitizer.h" + +@implementation JSONValueTransformer (ISO8601) + +- (NSDate *) NSDateFromNSString:(NSString *)string +{ + return [NSDate dateWithISO8601String:string]; +} + +- (NSString *)JSONObjectFromNSDate:(NSDate *)date +{ + return [SWGSanitizer dateToString:date]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h new file mode 100644 index 000000000000..6c0396f0cac5 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApi.h @@ -0,0 +1,29 @@ +#import + +@class SWGApiClient; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@protocol SWGApi + +@property(readonly, nonatomic, strong) SWGApiClient *apiClient; + +-(instancetype) initWithApiClient:(SWGApiClient *)apiClient; + +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; +-(NSString*) defaultHeaderForKey:(NSString*)key; + +-(NSDictionary *)defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h new file mode 100644 index 000000000000..761865f46933 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.h @@ -0,0 +1,121 @@ +#import +#import "SWGConfiguration.h" +#import "SWGResponseDeserializer.h" +#import "SWGSanitizer.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for `NSError` user info dictionaries. + * + * The corresponding value is the parsed response body for an HTTP error. + */ +extern NSString *const SWGResponseObjectErrorKey; + + +@interface SWGApiClient : AFHTTPSessionManager + +@property (nonatomic, strong, readonly) id configuration; + +@property(nonatomic, assign) NSTimeInterval timeoutInterval; + +@property(nonatomic, strong) id responseDeserializer; + +@property(nonatomic, strong) id sanitizer; + +/** + * Gets if the client is unreachable + * + * @return The client offline state + */ ++(BOOL) getOfflineState; + +/** + * Sets the client reachability, this may be overridden by the reachability manager if reachability changes + * + * @param status The client reachability status. + */ ++(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status; + +/** + * Gets the client reachability + * + * @return The client reachability. + */ ++(AFNetworkReachabilityStatus) getReachabilityStatus; + +@property (nonatomic, strong) NSDictionary< NSString *, AFHTTPRequestSerializer *>* requestSerializerForContentType; + +/** + * Gets client singleton instance + */ ++ (instancetype) sharedClient; + + +/** + * Updates header parameters and query parameters for authentication + * + * @param headers The header parameter will be updated, passed by pointer to pointer. + * @param queries The query parameters will be updated, passed by pointer to pointer. + * @param authSettings The authentication names NSArray. + */ +- (void) updateHeaderParams:(NSDictionary **)headers queryParams:(NSDictionary **)queries WithAuthSettings:(NSArray *)authSettings; + + +/** + * Initializes the session manager with a configuration. + * + * @param configuration The configuration implementation + */ +- (instancetype)initWithConfiguration:(id)configuration; + +/** +* Initializes the session manager with a configuration and url +* +* @param url The base url +* @param configuration The configuration implementation +*/ +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration; + +/** + * Performs request + * + * @param path Request url. + * @param method Request method. + * @param pathParams Request path parameters. + * @param queryParams Request query parameters. + * @param body Request body. + * @param headerParams Request header parameters. + * @param authSettings Request authentication names. + * @param requestContentType Request content-type. + * @param responseContentType Response content-type. + * @param completionBlock The block will be executed when the request completed. + * + * @return The created session task. + */ +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m new file mode 100644 index 000000000000..03f1cdda4e8a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGApiClient.m @@ -0,0 +1,376 @@ + +#import "SWGLogger.h" +#import "SWGApiClient.h" +#import "SWGJSONRequestSerializer.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" + +NSString *const SWGResponseObjectErrorKey = @"SWGResponseObject"; + +static NSString * const kSWGContentDispositionKey = @"Content-Disposition"; + +static NSDictionary * SWG__headerFieldsForResponse(NSURLResponse *response) { + if(![response isKindOfClass:[NSHTTPURLResponse class]]) { + return nil; + } + return ((NSHTTPURLResponse*)response).allHeaderFields; +} + +static NSString * SWG__fileNameForResponse(NSURLResponse *response) { + NSDictionary * headers = SWG__headerFieldsForResponse(response); + if(!headers[kSWGContentDispositionKey]) { + return [NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]; + } + NSString *pattern = @"filename=['\"]?([^'\"\\s]+)['\"]?"; + NSRegularExpression *regexp = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; + NSString *contentDispositionHeader = headers[kSWGContentDispositionKey]; + NSTextCheckingResult *match = [regexp firstMatchInString:contentDispositionHeader options:0 range:NSMakeRange(0, [contentDispositionHeader length])]; + return [contentDispositionHeader substringWithRange:[match rangeAtIndex:1]]; +} + + +@interface SWGApiClient () + +@property (nonatomic, strong, readwrite) id configuration; + +@property (nonatomic, strong) NSArray* downloadTaskResponseTypes; + +@end + +@implementation SWGApiClient + +#pragma mark - Singleton Methods + ++ (instancetype) sharedClient { + static SWGApiClient *sharedClient = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + sharedClient = [[self alloc] init]; + }); + return sharedClient; +} + +#pragma mark - Initialize Methods + +- (instancetype)init { + return [self initWithConfiguration:[SWGDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url { + return [self initWithBaseURL:url configuration:[SWGDefaultConfiguration sharedConfig]]; +} + +- (instancetype)initWithConfiguration:(id)configuration { + return [self initWithBaseURL:[NSURL URLWithString:configuration.host] configuration:configuration]; +} + +- (instancetype)initWithBaseURL:(NSURL *)url configuration:(id)configuration { + self = [super initWithBaseURL:url]; + if (self) { + _configuration = configuration; + _timeoutInterval = 60; + _responseDeserializer = [[SWGResponseDeserializer alloc] init]; + _sanitizer = [[SWGSanitizer alloc] init]; + + _downloadTaskResponseTypes = @[@"NSURL*", @"NSURL"]; + + AFHTTPRequestSerializer* afhttpRequestSerializer = [AFHTTPRequestSerializer serializer]; + SWGJSONRequestSerializer * swgjsonRequestSerializer = [SWGJSONRequestSerializer serializer]; + _requestSerializerForContentType = @{kSWGApplicationJSONType : swgjsonRequestSerializer, + @"application/x-www-form-urlencoded": afhttpRequestSerializer, + @"multipart/form-data": afhttpRequestSerializer + }; + self.securityPolicy = [self createSecurityPolicy]; + self.responseSerializer = [AFHTTPResponseSerializer serializer]; + } + return self; +} + +#pragma mark - Task Methods + +- (NSURLSessionDataTask*) taskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + NSURLSessionDataTask *task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) { + SWGDebugLogResponse(response, responseObject,request,error); + if(!error) { + completionBlock(responseObject, nil); + return; + } + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + // Add in the (parsed) response body. + userInfo[SWGResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + }]; + + return task; +} + +- (NSURLSessionDataTask*) downloadTaskWithCompletionBlock: (NSURLRequest *)request completionBlock: (void (^)(id, NSError *))completionBlock { + + __block NSString * tempFolderPath = [self.configuration.tempFolderPath copy]; + + NSURLSessionDataTask* task = [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) { + SWGDebugLogResponse(response, responseObject,request,error); + + if(error) { + NSMutableDictionary *userInfo = [error.userInfo mutableCopy]; + if (responseObject) { + userInfo[SWGResponseObjectErrorKey] = responseObject; + } + NSError *augmentedError = [error initWithDomain:error.domain code:error.code userInfo:userInfo]; + completionBlock(nil, augmentedError); + return; + } + + NSString *directory = tempFolderPath ?: NSTemporaryDirectory(); + NSString *filename = SWG__fileNameForResponse(response); + + NSString *filepath = [directory stringByAppendingPathComponent:filename]; + NSURL *file = [NSURL fileURLWithPath:filepath]; + + [responseObject writeToURL:file atomically:YES]; + + completionBlock(file, nil); + }]; + + return task; +} + +#pragma mark - Perform Request Methods + +- (NSURLSessionTask*) requestWithPath: (NSString*) path + method: (NSString*) method + pathParams: (NSDictionary *) pathParams + queryParams: (NSDictionary*) queryParams + formParams: (NSDictionary *) formParams + files: (NSDictionary *) files + body: (id) body + headerParams: (NSDictionary*) headerParams + authSettings: (NSArray *) authSettings + requestContentType: (NSString*) requestContentType + responseContentType: (NSString*) responseContentType + responseType: (NSString *) responseType + completionBlock: (void (^)(id, NSError *))completionBlock { + + AFHTTPRequestSerializer * requestSerializer = [self requestSerializerForRequestContentType:requestContentType]; + + __weak id sanitizer = self.sanitizer; + + // sanitize parameters + pathParams = [sanitizer sanitizeForSerialization:pathParams]; + queryParams = [sanitizer sanitizeForSerialization:queryParams]; + headerParams = [sanitizer sanitizeForSerialization:headerParams]; + formParams = [sanitizer sanitizeForSerialization:formParams]; + if(![body isKindOfClass:[NSData class]]) { + body = [sanitizer sanitizeForSerialization:body]; + } + + // auth setting + [self updateHeaderParams:&headerParams queryParams:&queryParams WithAuthSettings:authSettings]; + + NSMutableString *resourcePath = [NSMutableString stringWithString:path]; + [pathParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString * safeString = ([obj isKindOfClass:[NSString class]]) ? obj : [NSString stringWithFormat:@"%@", obj]; + safeString = SWGPercentEscapedStringFromString(safeString); + [resourcePath replaceCharactersInRange:[resourcePath rangeOfString:[NSString stringWithFormat:@"{%@}", key]] withString:safeString]; + }]; + + NSString* pathWithQueryParams = [self pathWithQueryParamsToString:resourcePath queryParams:queryParams]; + if ([pathWithQueryParams hasPrefix:@"/"]) { + pathWithQueryParams = [pathWithQueryParams substringFromIndex:1]; + } + + NSString* urlString = [[NSURL URLWithString:pathWithQueryParams relativeToURL:self.baseURL] absoluteString]; + + NSError *requestCreateError = nil; + NSMutableURLRequest * request = nil; + if (files.count > 0) { + request = [requestSerializer multipartFormRequestWithMethod:@"POST" URLString:urlString parameters:nil constructingBodyWithBlock:^(id formData) { + [formParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSString *objString = [sanitizer parameterToString:obj]; + NSData *data = [objString dataUsingEncoding:NSUTF8StringEncoding]; + [formData appendPartWithFormData:data name:key]; + }]; + [files enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + NSURL *filePath = (NSURL *)obj; + [formData appendPartWithFileURL:filePath name:key error:nil]; + }]; + } error:&requestCreateError]; + } + else { + if (formParams) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:formParams error:&requestCreateError]; + } + if (body) { + request = [requestSerializer requestWithMethod:method URLString:urlString parameters:body error:&requestCreateError]; + } + } + if(!request) { + completionBlock(nil, requestCreateError); + return nil; + } + + if ([headerParams count] > 0){ + for(NSString * key in [headerParams keyEnumerator]){ + [request setValue:[headerParams valueForKey:key] forHTTPHeaderField:key]; + } + } + [requestSerializer setValue:responseContentType forHTTPHeaderField:@"Accept"]; + + [self postProcessRequest:request]; + + + NSURLSessionTask *task = nil; + + if ([self.downloadTaskResponseTypes containsObject:responseType]) { + task = [self downloadTaskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + completionBlock(data, error); + }]; + } else { + __weak typeof(self) weakSelf = self; + task = [self taskWithCompletionBlock:request completionBlock:^(id data, NSError *error) { + NSError * serializationError; + id response = [weakSelf.responseDeserializer deserialize:data class:responseType error:&serializationError]; + + if(!response && !error){ + error = serializationError; + } + completionBlock(response, error); + }]; + } + + [task resume]; + + return task; +} + +-(AFHTTPRequestSerializer *)requestSerializerForRequestContentType:(NSString *)requestContentType { + AFHTTPRequestSerializer * serializer = self.requestSerializerForContentType[requestContentType]; + if(!serializer) { + NSAssert(NO, @"Unsupported request content type %@", requestContentType); + serializer = [AFHTTPRequestSerializer serializer]; + } + serializer.timeoutInterval = self.timeoutInterval; + return serializer; +} + +//Added for easier override to modify request +-(void)postProcessRequest:(NSMutableURLRequest *)request { + +} + +#pragma mark - + +- (NSString*) pathWithQueryParamsToString:(NSString*) path queryParams:(NSDictionary*) queryParams { + if(queryParams.count == 0) { + return path; + } + NSString * separator = nil; + NSUInteger counter = 0; + + NSMutableString * requestUrl = [NSMutableString stringWithFormat:@"%@", path]; + + NSDictionary *separatorStyles = @{@"csv" : @",", + @"tsv" : @"\t", + @"pipes": @"|" + }; + for(NSString * key in [queryParams keyEnumerator]){ + if (counter == 0) { + separator = @"?"; + } else { + separator = @"&"; + } + id queryParam = [queryParams valueForKey:key]; + if(!queryParam) { + continue; + } + NSString *safeKey = SWGPercentEscapedStringFromString(key); + if ([queryParam isKindOfClass:[NSString class]]){ + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, SWGPercentEscapedStringFromString(queryParam)]]; + + } else if ([queryParam isKindOfClass:[SWGQueryParamCollection class]]){ + SWGQueryParamCollection * coll = (SWGQueryParamCollection*) queryParam; + NSArray* values = [coll values]; + NSString* format = [coll format]; + + if([format isEqualToString:@"multi"]) { + for(id obj in values) { + if (counter > 0) { + separator = @"&"; + } + NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",obj]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + counter += 1; + } + continue; + } + NSString * separatorStyle = separatorStyles[format]; + NSString * safeValue = SWGPercentEscapedStringFromString([values componentsJoinedByString:separatorStyle]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } else { + NSString * safeValue = SWGPercentEscapedStringFromString([NSString stringWithFormat:@"%@",queryParam]); + [requestUrl appendString:[NSString stringWithFormat:@"%@%@=%@", separator, safeKey, safeValue]]; + } + counter += 1; + } + return requestUrl; +} + +/** + * Update header and query params based on authentication settings + */ +- (void) updateHeaderParams:(NSDictionary * *)headers queryParams:(NSDictionary * *)queries WithAuthSettings:(NSArray *)authSettings { + + if ([authSettings count] == 0) { + return; + } + + NSMutableDictionary *headersWithAuth = [NSMutableDictionary dictionaryWithDictionary:*headers]; + NSMutableDictionary *queriesWithAuth = [NSMutableDictionary dictionaryWithDictionary:*queries]; + + id config = self.configuration; + for (NSString *auth in authSettings) { + NSDictionary *authSetting = config.authSettings[auth]; + + if(!authSetting) { // auth setting is set only if the key is non-empty + continue; + } + NSString *type = authSetting[@"in"]; + NSString *key = authSetting[@"key"]; + NSString *value = authSetting[@"value"]; + if ([type isEqualToString:@"header"] && [key length] > 0 ) { + headersWithAuth[key] = value; + } else if ([type isEqualToString:@"query"] && [key length] != 0) { + queriesWithAuth[key] = value; + } + } + + *headers = [NSDictionary dictionaryWithDictionary:headersWithAuth]; + *queries = [NSDictionary dictionaryWithDictionary:queriesWithAuth]; +} + +- (AFSecurityPolicy *) createSecurityPolicy { + AFSecurityPolicy *securityPolicy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone]; + + id config = self.configuration; + + if (config.sslCaCert) { + NSData *certData = [NSData dataWithContentsOfFile:config.sslCaCert]; + [securityPolicy setPinnedCertificates:[NSSet setWithObject:certData]]; + } + + if (config.verifySSL) { + [securityPolicy setAllowInvalidCertificates:NO]; + } + else { + [securityPolicy setAllowInvalidCertificates:YES]; + [securityPolicy setValidatesDomainName:NO]; + } + + return securityPolicy; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h new file mode 100644 index 000000000000..bd10d59028b1 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.h @@ -0,0 +1,14 @@ +/** The `SWGBasicAuthTokenProvider` class creates a basic auth token from username and password. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +#import + +@interface SWGBasicAuthTokenProvider : NSObject + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password; + +@end \ No newline at end of file diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m new file mode 100644 index 000000000000..3788009ec587 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGBasicAuthTokenProvider.m @@ -0,0 +1,19 @@ +#import "SWGBasicAuthTokenProvider.h" + +@implementation SWGBasicAuthTokenProvider + ++ (NSString *)createBasicAuthTokenWithUsername:(NSString *)username password:(NSString *)password { + + // return empty string if username and password are empty + if (username.length == 0 && password.length == 0){ + return @""; + } + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", username, password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + return basicAuthCredentials; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h new file mode 100644 index 000000000000..f6b12de5c5c3 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGConfiguration.h @@ -0,0 +1,89 @@ +#import + +@class SWGLogger; + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +static NSString * const kSWGAPIVersion = @"1.0.0"; + +@protocol SWGConfiguration + +/** + * Api logger + */ +@property (readonly, nonatomic) SWGLogger *logger; + +/** + * Base url + */ +@property (readonly, nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + */ +@property (readonly, nonatomic) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + */ +@property (readonly, nonatomic) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (readonly, nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (readonly, nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (readonly, nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (readonly, nonatomic) BOOL debug; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (readonly, nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (readonly, nonatomic) NSString *sslCaCert; + +/** + * Authentication Settings + */ +@property (readonly, nonatomic) NSDictionary *authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h new file mode 100644 index 000000000000..e141e0d092d5 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.h @@ -0,0 +1,171 @@ +#import +#import "SWGConfiguration.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@class SWGApiClient; + +@interface SWGDefaultConfiguration : NSObject + + +/** + * Default api logger + */ +@property (nonatomic, strong) SWGLogger * logger; + +/** + * Default base url + */ +@property (nonatomic) NSString *host; + +/** + * Api key values for Api Key type Authentication + * + * To add or remove api key, use `setApiKey:forApiKeyIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKey; + +/** + * Api key prefix values to be prepend to the respective api key + * + * To add or remove prefix, use `setApiKeyPrefix:forApiKeyPrefixIdentifier:`. + */ +@property (readonly, nonatomic, strong) NSDictionary *apiKeyPrefix; + +/** + * Username for HTTP Basic Authentication + */ + @property (nonatomic) NSString *username; + +/** + * Password for HTTP Basic Authentication + */ +@property (nonatomic) NSString *password; + +/** + * Access token for OAuth + */ +@property (nonatomic) NSString *accessToken; + +/** + * Temp folder for file download + */ +@property (nonatomic) NSString *tempFolderPath; + +/** + * Debug switch, default false + */ +@property (nonatomic) BOOL debug; + +/** + * Gets configuration singleton instance + */ ++ (instancetype) sharedConfig; + +/** + * SSL/TLS verification + * Set this to NO to skip verifying SSL certificate when calling API from https server + */ +@property (nonatomic) BOOL verifySSL; + +/** + * SSL/TLS verification + * Set this to customize the certificate file to verify the peer + */ +@property (nonatomic) NSString *sslCaCert; + +/** + * The time zone to use for date serialization + */ +@property (nonatomic) NSTimeZone *serializationTimeZone; + +/** + * Sets API key + * + * To remove an apiKey for an identifier, just set the apiKey to nil. + * + * @param apiKey API key or token. + * @param identifier API key identifier (authentication schema). + * + */ +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString*)identifier; + +/** + * Removes api key + * + * @param identifier API key identifier. + */ +- (void) removeApiKey:(NSString *)identifier; + +/** + * Sets the prefix for API key + * + * @param prefix API key prefix. + * @param identifier API key identifier. + */ +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier; + +/** + * Removes api key prefix + * + * @param identifier API key identifier. + */ +- (void) removeApiKeyPrefix:(NSString *)identifier; + +/** + * Gets API key (with prefix if set) + */ +- (NSString *) getApiKeyWithPrefix:(NSString *) key; + +/** + * Gets Basic Auth token + */ +- (NSString *) getBasicAuthToken; + +/** + * Gets OAuth access token + */ +- (NSString *) getAccessToken; + +/** + * Gets Authentication Settings + */ +- (NSDictionary *) authSettings; + +/** +* Default headers for all services +*/ +@property (readonly, nonatomic, strong) NSDictionary *defaultHeaders; + +/** +* Removes header from defaultHeaders +* +* @param key Header name. +*/ +-(void) removeDefaultHeaderForKey:(NSString*)key; + +/** +* Sets the header for key +* +* @param value Value for header name +* @param key Header name +*/ +-(void) setDefaultHeaderValue:(NSString*) value forKey:(NSString*)key; + +/** +* @param key Header key name. +*/ +-(NSString*) defaultHeaderForKey:(NSString*)key; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m new file mode 100644 index 000000000000..4afe43359aaf --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGDefaultConfiguration.m @@ -0,0 +1,152 @@ +#import "SWGDefaultConfiguration.h" +#import "SWGBasicAuthTokenProvider.h" +#import "SWGLogger.h" + +@interface SWGDefaultConfiguration () + +@property (nonatomic, strong) NSMutableDictionary *mutableDefaultHeaders; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKey; +@property (nonatomic, strong) NSMutableDictionary *mutableApiKeyPrefix; + +@end + +@implementation SWGDefaultConfiguration + +#pragma mark - Singleton Methods + ++ (instancetype) sharedConfig { + static SWGDefaultConfiguration *shardConfig = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardConfig = [[self alloc] init]; + }); + return shardConfig; +} + +#pragma mark - Initialize Methods + +- (instancetype) init { + self = [super init]; + if (self) { + _host = @"http://petstore.swagger.io/v2"; + _username = @""; + _password = @""; + _accessToken= @""; + _verifySSL = YES; + _mutableApiKey = [NSMutableDictionary dictionary]; + _mutableApiKeyPrefix = [NSMutableDictionary dictionary]; + _mutableDefaultHeaders = [NSMutableDictionary dictionary]; + + _logger = [SWGLogger sharedLogger]; + } + return self; +} + +#pragma mark - Instance Methods + +- (NSString *) getApiKeyWithPrefix:(NSString *)key { + NSString *prefix = self.apiKeyPrefix[key]; + NSString *apiKey = self.apiKey[key]; + if (prefix && apiKey != (id)[NSNull null] && apiKey.length > 0) { // both api key prefix and api key are set + return [NSString stringWithFormat:@"%@ %@", prefix, apiKey]; + } + else if (apiKey != (id)[NSNull null] && apiKey.length > 0) { // only api key, no api key prefix + return [NSString stringWithFormat:@"%@", self.apiKey[key]]; + } + else { // return empty string if nothing is set + return @""; + } +} + +- (NSString *) getBasicAuthToken { + + NSString *basicAuthToken = [SWGBasicAuthTokenProvider createBasicAuthTokenWithUsername:self.username password:self.password]; + return basicAuthToken; +} + +- (NSString *) getAccessToken { + if (self.accessToken.length == 0) { // token not set, return empty string + return @""; + } else { + return [NSString stringWithFormat:@"Bearer %@", self.accessToken]; + } +} + +#pragma mark - Setter Methods + +- (void) setApiKey:(NSString *)apiKey forApiKeyIdentifier:(NSString *)identifier { + [self.mutableApiKey setValue:apiKey forKey:identifier]; +} + +- (void) removeApiKey:(NSString *)identifier { + [self.mutableApiKey removeObjectForKey:identifier]; +} + +- (void) setApiKeyPrefix:(NSString *)prefix forApiKeyPrefixIdentifier:(NSString *)identifier { + [self.mutableApiKeyPrefix setValue:prefix forKey:identifier]; +} + +- (void) removeApiKeyPrefix:(NSString *)identifier { + [self.mutableApiKeyPrefix removeObjectForKey:identifier]; +} + +#pragma mark - Getter Methods + +- (NSDictionary *) apiKey { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKey]; +} + +- (NSDictionary *) apiKeyPrefix { + return [NSDictionary dictionaryWithDictionary:self.mutableApiKeyPrefix]; +} + +#pragma mark - + +- (NSDictionary *) authSettings { + return @{ + @"api_key": + @{ + @"type": @"api_key", + @"in": @"header", + @"key": @"api_key", + @"value": [self getApiKeyWithPrefix:@"api_key"] + }, + @"petstore_auth": + @{ + @"type": @"oauth", + @"in": @"header", + @"key": @"Authorization", + @"value": [self getAccessToken] + }, + }; +} + +-(BOOL)debug { + return self.logger.isEnabled; +} + +-(void)setDebug:(BOOL)debug { + self.logger.enabled = debug; +} + +- (void)setDefaultHeaderValue:(NSString *)value forKey:(NSString *)key { + if(!value) { + [self.mutableDefaultHeaders removeObjectForKey:key]; + return; + } + self.mutableDefaultHeaders[key] = value; +} + +-(void) removeDefaultHeaderForKey:(NSString*)key { + [self.mutableDefaultHeaders removeObjectForKey:key]; +} + +- (NSString *)defaultHeaderForKey:(NSString *)key { + return self.mutableDefaultHeaders[key]; +} + +- (NSDictionary *)defaultHeaders { + return [self.mutableDefaultHeaders copy]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h new file mode 100644 index 000000000000..943ab1323133 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.h @@ -0,0 +1,18 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGJSONRequestSerializer : AFJSONRequestSerializer +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m new file mode 100644 index 000000000000..221765e48397 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGJSONRequestSerializer.m @@ -0,0 +1,37 @@ +#import "SWGJSONRequestSerializer.h" + +@implementation SWGJSONRequestSerializer + +/// +/// When customize a request serializer, +/// the serializer must conform the protocol `AFURLRequestSerialization` +/// and implements the protocol method `requestBySerializingRequest:withParameters:error:` +/// +/// @param request The original request. +/// @param parameters The parameters to be encoded. +/// @param error The error that occurred while attempting to encode the request parameters. +/// +/// @return A serialized request. +/// +- (NSURLRequest *)requestBySerializingRequest:(NSURLRequest *)request + withParameters:(id)parameters + error:(NSError *__autoreleasing *)error +{ + if (!parameters) { + return request; + } + // If the body data which will be serialized isn't NSArray or NSDictionary + // then put the data in the http request body directly. + if ([parameters isKindOfClass:[NSArray class]] || [parameters isKindOfClass:[NSDictionary class]]) { + return [super requestBySerializingRequest:request withParameters:parameters error:error]; + } + NSMutableURLRequest *mutableRequest = [request mutableCopy]; + if([parameters isKindOfClass:[NSData class]]) { + [mutableRequest setHTTPBody:parameters]; + } else { + [mutableRequest setHTTPBody:[parameters dataUsingEncoding:self.stringEncoding]]; + } + return mutableRequest; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h new file mode 100644 index 000000000000..23f57acd7b8a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.h @@ -0,0 +1,61 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#ifndef SWGDebugLogResponse +#define SWGDebugLogResponse(response, responseObject,request, error) [[SWGLogger sharedLogger] logResponse:response responseObject:responseObject request:request error:error]; +#endif + +/** + * Log debug message macro + */ +#ifndef SWGDebugLog +#define SWGDebugLog(format, ...) [[SWGLogger sharedLogger] debugLog:[NSString stringWithFormat:@"%s", __PRETTY_FUNCTION__] message: format, ##__VA_ARGS__]; +#endif + +@interface SWGLogger : NSObject + ++(instancetype)sharedLogger; + +/** + * Enabled switch, default NO - default set by SWGConfiguration debug property + */ +@property (nonatomic, assign, getter=isEnabled) BOOL enabled; + +/** + * Debug file location, default log in console + */ +@property (nonatomic, strong) NSString *loggingFile; + +/** + * Log file handler, this property is used by sdk internally. + */ +@property (nonatomic, strong, readonly) NSFileHandle *loggingFileHandler; + +/** + * Log debug message + */ +-(void)debugLog:(NSString *)method message:(NSString *)format, ...; + +/** + * Logs request and response + * + * @param response NSURLResponse for the HTTP request. + * @param responseObject response object of the HTTP request. + * @param request The HTTP request. + * @param error The error of the HTTP request. + */ +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m new file mode 100644 index 000000000000..2a96e5ec54d3 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGLogger.m @@ -0,0 +1,73 @@ +#import "SWGLogger.h" + +@interface SWGLogger () + +@end + +@implementation SWGLogger + ++ (instancetype) sharedLogger { + static SWGLogger *shardLogger = nil; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + shardLogger = [[self alloc] init]; + }); + return shardLogger; +} + +#pragma mark - Log Methods + +- (void)debugLog:(NSString *)method message:(NSString *)format, ... { + if (!self.isEnabled) { + return; + } + + NSMutableString *message = [NSMutableString stringWithCapacity:1]; + + if (method) { + [message appendFormat:@"%@: ", method]; + } + + va_list args; + va_start(args, format); + + [message appendString:[[NSString alloc] initWithFormat:format arguments:args]]; + + // If set logging file handler, log into file, + // otherwise log into console. + if (self.loggingFileHandler) { + [self.loggingFileHandler seekToEndOfFile]; + [self.loggingFileHandler writeData:[message dataUsingEncoding:NSUTF8StringEncoding]]; + } else { + NSLog(@"%@", message); + } + + va_end(args); +} + +- (void)logResponse:(NSURLResponse *)response responseObject:(id)responseObject request:(NSURLRequest *)request error:(NSError *)error { + NSString *message = [NSString stringWithFormat:@"\n[DEBUG] HTTP request body \n~BEGIN~\n %@\n~END~\n"\ + "[DEBUG] HTTP response body \n~BEGIN~\n %@\n~END~\n", + [[NSString alloc] initWithData:request.HTTPBody encoding:NSUTF8StringEncoding], + responseObject]; + + SWGDebugLog(message); +} + +- (void) setLoggingFile:(NSString *)loggingFile { + if(_loggingFile == loggingFile) { + return; + } + // close old file handler + if ([self.loggingFileHandler isKindOfClass:[NSFileHandle class]]) { + [self.loggingFileHandler closeFile]; + } + _loggingFile = loggingFile; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + if (_loggingFileHandler == nil) { + [[NSFileManager defaultManager] createFileAtPath:_loggingFile contents:nil attributes:nil]; + _loggingFileHandler = [NSFileHandle fileHandleForWritingAtPath:_loggingFile]; + } +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h new file mode 100644 index 000000000000..7d7112c5976a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.h @@ -0,0 +1,19 @@ +#import +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGObject : JSONModel + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m new file mode 100644 index 000000000000..f985195d4b12 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGObject.m @@ -0,0 +1,44 @@ +#import "SWGObject.h" + +@implementation SWGObject + +/** + * Workaround for JSONModel multithreading issues + * https://github.com/icanzilb/JSONModel/issues/441 + */ +- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError **)err { + static NSMutableSet *classNames; + static NSObject *lock; + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + classNames = [NSMutableSet new]; + lock = [NSObject new]; + }); + + BOOL initSync; + @synchronized(lock) + { + NSString *className = NSStringFromClass([self class]); + initSync = ![classNames containsObject:className]; + if(initSync) + { + [classNames addObject:className]; + self = [super initWithDictionary:dict error:err]; + } + } + if(!initSync) + { + self = [super initWithDictionary:dict error:err]; + } + return self; +} + +/** + * Gets the string presentation of the object. + * This method will be called when logging model object using `NSLog`. + */ +- (NSString *)description { + return [[self toDictionary] description]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h new file mode 100644 index 000000000000..4bd35d86f352 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.h @@ -0,0 +1,24 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +@interface SWGQueryParamCollection : NSObject + +@property(nonatomic, readonly) NSArray* values; +@property(nonatomic, readonly) NSString* format; + +- (id) initWithValuesAndFormat: (NSArray*) values + format: (NSString*) format; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m new file mode 100644 index 000000000000..5f9306219edd --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGQueryParamCollection.m @@ -0,0 +1,20 @@ +#import "SWGQueryParamCollection.h" + +@implementation SWGQueryParamCollection + +@synthesize values = _values; +@synthesize format = _format; + +- (id)initWithValuesAndFormat:(NSArray *)values + format:(NSString *)format { + + self = [super init]; + if (self) { + _values = values; + _format = format; + } + + return self; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h new file mode 100644 index 000000000000..68f83704f495 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.h @@ -0,0 +1,57 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +/** + * A key for deserialization ErrorDomain + */ +extern NSString *const SWGDeserializationErrorDomainKey; + +/** + * Code for deserialization type mismatch error + */ +extern NSInteger const SWGTypeMismatchErrorCode; + +/** + * Code for deserialization empty value error + */ +extern NSInteger const SWGEmptyValueOccurredErrorCode; + +/** + * Error code for unknown response + */ +extern NSInteger const SWGUnknownResponseObjectErrorCode; + +@protocol SWGResponseDeserializer + +/** + * Deserializes the given data to Objective-C object. + * + * @param data The data will be deserialized. + * @param className The type of objective-c object. + * @param error The error + */ +- (id) deserialize:(id) data class:(NSString *) className error:(NSError**)error; + +@end + +@interface SWGResponseDeserializer : NSObject + +/** + * If a null value occurs in dictionary or array if set to YES whole response will be invalid else will be ignored + * @default NO + */ +@property (nonatomic, assign) BOOL treatNullAsError; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m new file mode 100644 index 000000000000..46d4b460fc74 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGResponseDeserializer.m @@ -0,0 +1,247 @@ +#import "SWGResponseDeserializer.h" +#import +#import + +NSString *const SWGDeserializationErrorDomainKey = @"SWGDeserializationErrorDomainKey"; + +NSInteger const SWGTypeMismatchErrorCode = 143553; + +NSInteger const SWGEmptyValueOccurredErrorCode = 143509; + +NSInteger const SWGUnknownResponseObjectErrorCode = 143528; + + +@interface SWGResponseDeserializer () + +@property (nonatomic, strong) NSNumberFormatter* numberFormatter; +@property (nonatomic, strong) NSArray *primitiveTypes; +@property (nonatomic, strong) NSArray *basicReturnTypes; +@property (nonatomic, strong) NSArray *dataReturnTypes; + +@property (nonatomic, strong) NSRegularExpression* arrayOfModelsPatExpression; +@property (nonatomic, strong) NSRegularExpression* arrayOfPrimitivesPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictPatExpression; +@property (nonatomic, strong) NSRegularExpression* dictModelsPatExpression; + +@end + +@implementation SWGResponseDeserializer + +- (instancetype)init { + self = [super init]; + if (self) { + NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; + formatter.numberStyle = NSNumberFormatterDecimalStyle; + _numberFormatter = formatter; + _primitiveTypes = @[@"NSString", @"NSDate", @"NSNumber"]; + _basicReturnTypes = @[@"NSObject", @"id"]; + _dataReturnTypes = @[@"NSData"]; + + _arrayOfModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray<(.+)>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _arrayOfPrimitivesPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSArray\\* /\\* (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\* /\\* (.+?), (.+) \\*/" + options:NSRegularExpressionCaseInsensitive + error:nil]; + _dictModelsPatExpression = [NSRegularExpression regularExpressionWithPattern:@"NSDictionary\\<(.+?), (.+)*\\>" + options:NSRegularExpressionCaseInsensitive + error:nil]; + } + return self; +} + +#pragma mark - Deserialize methods + +- (id) deserialize:(id) data class:(NSString *) className error:(NSError **) error { + if (!data || !className) { + return nil; + } + + if ([className hasSuffix:@"*"]) { + className = [className substringToIndex:[className length] - 1]; + } + if([self.dataReturnTypes containsObject:className]) { + return data; + } + id jsonData = nil; + if([data isKindOfClass:[NSData class]]) { + jsonData = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:error]; + } else { + jsonData = data; + } + if(!jsonData) { + jsonData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + } else if([jsonData isKindOfClass:[NSNull class]]) { + return nil; + } + + // pure object + if ([self.basicReturnTypes containsObject:className]) { + return jsonData; + } + + // primitives + if ([self.primitiveTypes containsObject:className]) { + return [self deserializePrimitiveValue:jsonData class:className error:error]; + } + + NSTextCheckingResult *match = nil; + NSRange range = NSMakeRange(0, [className length]); + // list of models + match = [self.arrayOfModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // list of primitives + match = [self.arrayOfPrimitivesPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *innerType = [className substringWithRange:[match rangeAtIndex:1]]; + return [self deserializeArrayValue:jsonData innerType:innerType error:error]; + } + + // map + match = [self.dictPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + match = [self.dictModelsPatExpression firstMatchInString:className options:0 range:range]; + if (match) { + NSString *valueType = [className substringWithRange:[match rangeAtIndex:2]]; + return [self deserializeDictionaryValue:jsonData valueType:valueType error:error]; + } + + // model + Class ModelClass = NSClassFromString(className); + if ([ModelClass instancesRespondToSelector:@selector(initWithDictionary:error:)]) { + return [(JSONModel *) [ModelClass alloc] initWithDictionary:jsonData error:error]; + } + + if(error) { + *error = [self unknownResponseErrorWithExpectedType:className data:jsonData]; + } + return nil; +} + +- (id) deserializeDictionaryValue:(id) data valueType:(NSString *) valueType error:(NSError**)error { + if(![data isKindOfClass: [NSDictionary class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDictionary class]) data:data]; + } + return nil; + } + __block NSMutableDictionary *resultDict = [NSMutableDictionary dictionaryWithCapacity:[data count]]; + for (id key in [data allKeys]) { + id obj = [data valueForKey:key]; + id dicObj = [self deserialize:obj class:valueType error:error]; + if(dicObj) { + [resultDict setValue:dicObj forKey:key]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultDict = nil; + break; + } + } else { + resultDict = nil; + break; + } + } + return resultDict; +} + +- (id) deserializeArrayValue:(id) data innerType:(NSString *) innerType error:(NSError**)error { + if(![data isKindOfClass: [NSArray class]]) { + if(error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSArray class]) data:data]; + } + return nil; + } + NSMutableArray* resultArray = [NSMutableArray arrayWithCapacity:[data count]]; + for (id obj in data) { + id arrObj = [self deserialize:obj class:innerType error:error]; + if(arrObj) { + [resultArray addObject:arrObj]; + } else if([obj isKindOfClass:[NSNull class]]) { + if(self.treatNullAsError) { + if (error) { + *error = [self emptyValueOccurredError]; + } + resultArray = nil; + break; + } + } else { + resultArray = nil; + break; + } + } + return resultArray; +}; + +- (id) deserializePrimitiveValue:(id) data class:(NSString *) className error:(NSError**)error { + if ([className isEqualToString:@"NSString"]) { + return [NSString stringWithFormat:@"%@",data]; + } + else if ([className isEqualToString:@"NSDate"]) { + return [self deserializeDateValue:data error:error]; + } + else if ([className isEqualToString:@"NSNumber"]) { + // NSNumber from NSNumber + if ([data isKindOfClass:[NSNumber class]]) { + return data; + } + else if ([data isKindOfClass:[NSString class]]) { + // NSNumber (NSCFBoolean) from NSString + if ([[data lowercaseString] isEqualToString:@"true"] || [[data lowercaseString] isEqualToString:@"false"]) { + return @([data boolValue]); + // NSNumber from NSString + } else { + NSNumber* formattedValue = [self.numberFormatter numberFromString:data]; + if(!formattedValue && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return formattedValue; + } + } + } + if(error) { + *error = [self typeMismatchErrorWithExpectedType:className data:data]; + } + return nil; +} + +- (id) deserializeDateValue:(id) data error:(NSError**)error { + NSDate *date =[NSDate dateWithISO8601String:data]; + if(!date && [data length] > 0 && error) { + *error = [self typeMismatchErrorWithExpectedType:NSStringFromClass([NSDate class]) data:data]; + } + return date; +}; + +-(NSError *)typeMismatchErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Received response [%@] is not an object of type %@",nil),data, expected]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGTypeMismatchErrorCode userInfo:userInfo]; +} + +-(NSError *)emptyValueOccurredError { + NSString * message = NSLocalizedString(@"Received response contains null value in dictionary or array response",nil); + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGEmptyValueOccurredErrorCode userInfo:userInfo]; +} + +-(NSError *)unknownResponseErrorWithExpectedType:(NSString *)expected data:(id)data { + NSString * message = [NSString stringWithFormat:NSLocalizedString(@"Unknown response expected type %@ [response: %@]",nil),expected,data]; + NSDictionary * userInfo = @{NSLocalizedDescriptionKey : message}; + return [NSError errorWithDomain:SWGDeserializationErrorDomainKey code:SWGUnknownResponseObjectErrorCode userInfo:userInfo]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h new file mode 100644 index 000000000000..83853bec8cf0 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.h @@ -0,0 +1,63 @@ +#import + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +extern NSString * SWGPercentEscapedStringFromString(NSString *string); + +extern NSString * const kSWGApplicationJSONType; + +@protocol SWGSanitizer + +/** + * Sanitize object for request + * + * @param object The query/path/header/form/body param to be sanitized. + */ +- (id) sanitizeForSerialization:(id) object; + +/** + * Convert parameter to NSString + */ +- (NSString *) parameterToString: (id) param; + +/** + * Convert date to NSString + */ ++ (NSString *)dateToString:(id)date; + +/** + * Detects Accept header from accepts NSArray + * + * @param accepts NSArray of header + * + * @return The Accept header + */ +-(NSString *) selectHeaderAccept:(NSArray *)accepts; + +/** + * Detects Content-Type header from contentTypes NSArray + * + * @param contentTypes NSArray of header + * + * @return The Content-Type header + */ +-(NSString *) selectHeaderContentType:(NSArray *)contentTypes; + +@end + +@interface SWGSanitizer : NSObject + + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m new file mode 100644 index 000000000000..1b3e0e10b0d5 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Core/SWGSanitizer.m @@ -0,0 +1,170 @@ +#import "SWGSanitizer.h" +#import "SWGObject.h" +#import "SWGQueryParamCollection.h" +#import "SWGDefaultConfiguration.h" +#import + +NSString * const kSWGApplicationJSONType = @"application/json"; + +NSString * SWGPercentEscapedStringFromString(NSString *string) { + static NSString * const kSWGCharactersGeneralDelimitersToEncode = @":#[]@"; + static NSString * const kSWGCharactersSubDelimitersToEncode = @"!$&'()*+,;="; + + NSMutableCharacterSet * allowedCharacterSet = [[NSCharacterSet URLQueryAllowedCharacterSet] mutableCopy]; + [allowedCharacterSet removeCharactersInString:[kSWGCharactersGeneralDelimitersToEncode stringByAppendingString:kSWGCharactersSubDelimitersToEncode]]; + + static NSUInteger const batchSize = 50; + + NSUInteger index = 0; + NSMutableString *escaped = @"".mutableCopy; + + while (index < string.length) { + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wgnu" + NSUInteger length = MIN(string.length - index, batchSize); + #pragma GCC diagnostic pop + NSRange range = NSMakeRange(index, length); + + // To avoid breaking up character sequences such as 👴🏻👮🏽 + range = [string rangeOfComposedCharacterSequencesForRange:range]; + + NSString *substring = [string substringWithRange:range]; + NSString *encoded = [substring stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacterSet]; + [escaped appendString:encoded]; + + index += range.length; + } + + return escaped; +} + +@interface SWGSanitizer () + +@property (nonatomic, strong) NSRegularExpression* jsonHeaderTypeExpression; + +@end + +@implementation SWGSanitizer + +-(instancetype)init { + self = [super init]; + if ( !self ) { + return nil; + } + _jsonHeaderTypeExpression = [NSRegularExpression regularExpressionWithPattern:@"(.*)application(.*)json(.*)" options:NSRegularExpressionCaseInsensitive error:nil]; + return self; +} + + +- (id) sanitizeForSerialization:(id) object { + if (object == nil) { + return nil; + } + else if ([object isKindOfClass:[NSString class]] || [object isKindOfClass:[NSNumber class]] || [object isKindOfClass:[SWGQueryParamCollection class]]) { + return object; + } + else if ([object isKindOfClass:[NSDate class]]) { + return [SWGSanitizer dateToString:object]; + } + else if ([object isKindOfClass:[NSArray class]]) { + NSArray *objectArray = object; + NSMutableArray *sanitizedObjs = [NSMutableArray arrayWithCapacity:[objectArray count]]; + [object enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + [sanitizedObjs addObject:sanitizedObj]; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[NSDictionary class]]) { + NSDictionary *objectDict = object; + NSMutableDictionary *sanitizedObjs = [NSMutableDictionary dictionaryWithCapacity:[objectDict count]]; + [object enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { + id sanitizedObj = [self sanitizeForSerialization:obj]; + if (sanitizedObj) { + sanitizedObjs[key] = sanitizedObj; + } + }]; + return sanitizedObjs; + } + else if ([object isKindOfClass:[SWGObject class]]) { + return [object toDictionary]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", object] + userInfo:nil]; + @throw e; + } +} + +- (NSString *) parameterToString:(id)param { + if ([param isKindOfClass:[NSString class]]) { + return param; + } + else if ([param isKindOfClass:[NSNumber class]]) { + return [param stringValue]; + } + else if ([param isKindOfClass:[NSDate class]]) { + return [SWGSanitizer dateToString:param]; + } + else if ([param isKindOfClass:[NSArray class]]) { + NSMutableArray *mutableParam = [NSMutableArray array]; + [param enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + [mutableParam addObject:[self parameterToString:obj]]; + }]; + return [mutableParam componentsJoinedByString:@","]; + } + else { + NSException *e = [NSException + exceptionWithName:@"InvalidObjectArgumentException" + reason:[NSString stringWithFormat:@"*** The argument object: %@ is invalid", param] + userInfo:nil]; + @throw e; + } +} + ++ (NSString *)dateToString:(id)date { + NSTimeZone* timeZone = [SWGDefaultConfiguration sharedConfig].serializationTimeZone; + return [date ISO8601StringWithTimeZone:timeZone usingCalendar:nil]; +} + +#pragma mark - Utility Methods + +/* + * Detect `Accept` from accepts + */ +- (NSString *) selectHeaderAccept:(NSArray *)accepts { + if (accepts.count == 0) { + return @""; + } + NSMutableArray *lowerAccepts = [[NSMutableArray alloc] initWithCapacity:[accepts count]]; + for (NSString *string in accepts) { + if ([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0) { + return kSWGApplicationJSONType; + } + [lowerAccepts addObject:[string lowercaseString]]; + } + return [lowerAccepts componentsJoinedByString:@", "]; +} + +/* + * Detect `Content-Type` from contentTypes + */ +- (NSString *) selectHeaderContentType:(NSArray *)contentTypes { + if (contentTypes.count == 0) { + return kSWGApplicationJSONType; + } + NSMutableArray *lowerContentTypes = [[NSMutableArray alloc] initWithCapacity:[contentTypes count]]; + for (NSString *string in contentTypes) { + if([self.jsonHeaderTypeExpression matchesInString:string options:0 range:NSMakeRange(0, [string length])].count > 0){ + return kSWGApplicationJSONType; + } + [lowerContentTypes addObject:[string lowercaseString]]; + } + return [lowerContentTypes firstObject]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h new file mode 100644 index 000000000000..31eb9e6b31ca --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.h @@ -0,0 +1,30 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGCategory +@end + +@interface SWGCategory : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m new file mode 100644 index 000000000000..21e354b30e9e --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGCategory.m @@ -0,0 +1,34 @@ +#import "SWGCategory.h" + +@implementation SWGCategory + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h new file mode 100644 index 000000000000..1d3390dab8c4 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.h @@ -0,0 +1,32 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGInlineObject +@end + +@interface SWGInlineObject : SWGObject + +/* Updated name of the pet [optional] + */ +@property(nonatomic) NSString* name; +/* Updated status of the pet [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m new file mode 100644 index 000000000000..a10d7060973a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject.m @@ -0,0 +1,34 @@ +#import "SWGInlineObject.h" + +@implementation SWGInlineObject + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"name": @"name", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"name", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h new file mode 100644 index 000000000000..36d1a7194cdd --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.h @@ -0,0 +1,32 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGInlineObject1 +@end + +@interface SWGInlineObject1 : SWGObject + +/* Additional data to pass to server [optional] + */ +@property(nonatomic) NSString* additionalMetadata; +/* file to upload [optional] + */ +@property(nonatomic) NSURL* file; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m new file mode 100644 index 000000000000..825dbcc286ae --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGInlineObject1.m @@ -0,0 +1,34 @@ +#import "SWGInlineObject1.h" + +@implementation SWGInlineObject1 + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"additionalMetadata": @"additionalMetadata", @"file": @"file" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"additionalMetadata", @"file"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h new file mode 100644 index 000000000000..5ea7a94cfcbe --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.h @@ -0,0 +1,39 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGOrder +@end + +@interface SWGOrder : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSNumber* petId; + +@property(nonatomic) NSNumber* quantity; + +@property(nonatomic) NSDate* shipDate; +/* Order Status [optional] + */ +@property(nonatomic) NSString* status; + +@property(nonatomic) NSNumber* complete; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m new file mode 100644 index 000000000000..7f93b0212c48 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGOrder.m @@ -0,0 +1,34 @@ +#import "SWGOrder.h" + +@implementation SWGOrder + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"petId": @"petId", @"quantity": @"quantity", @"shipDate": @"shipDate", @"status": @"status", @"complete": @"complete" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"petId", @"quantity", @"shipDate", @"status", @"complete"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h new file mode 100644 index 000000000000..4b3729193265 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.h @@ -0,0 +1,45 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + +#import "SWGCategory.h" +#import "SWGTag.h" +@protocol SWGCategory; +@class SWGCategory; +@protocol SWGTag; +@class SWGTag; + + + +@protocol SWGPet +@end + +@interface SWGPet : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) SWGCategory* category; + +@property(nonatomic) NSString* name; + +@property(nonatomic) NSArray* photoUrls; + +@property(nonatomic) NSArray* tags; +/* pet status in the store [optional] + */ +@property(nonatomic) NSString* status; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m new file mode 100644 index 000000000000..8c958695c888 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGPet.m @@ -0,0 +1,34 @@ +#import "SWGPet.h" + +@implementation SWGPet + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"category": @"category", @"name": @"name", @"photoUrls": @"photoUrls", @"tags": @"tags", @"status": @"status" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"category", @"tags", @"status"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h new file mode 100644 index 000000000000..cdcedfd916bb --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.h @@ -0,0 +1,30 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGTag +@end + +@interface SWGTag : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* name; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m new file mode 100644 index 000000000000..3a62bcbb9a12 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGTag.m @@ -0,0 +1,34 @@ +#import "SWGTag.h" + +@implementation SWGTag + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"name": @"name" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"name"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h new file mode 100644 index 000000000000..7786883ed29c --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.h @@ -0,0 +1,43 @@ +#import +#import "SWGObject.h" + +/** +* OpenAPI Petstore +* This is a sample server Petstore server. For this sample, you can use the api key \"special-key\" to test the authorization filters +* +* The version of the OpenAPI document: 1.0.0 +* +* +* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). +* https://openapi-generator.tech +* Do not edit the class manually. +*/ + + + + + +@protocol SWGUser +@end + +@interface SWGUser : SWGObject + + +@property(nonatomic) NSNumber* _id; + +@property(nonatomic) NSString* username; + +@property(nonatomic) NSString* firstName; + +@property(nonatomic) NSString* lastName; + +@property(nonatomic) NSString* email; + +@property(nonatomic) NSString* password; + +@property(nonatomic) NSString* phone; +/* User Status [optional] + */ +@property(nonatomic) NSNumber* userStatus; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m new file mode 100644 index 000000000000..fd50c02e2c9c --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClient/Model/SWGUser.m @@ -0,0 +1,34 @@ +#import "SWGUser.h" + +@implementation SWGUser + +- (instancetype)init { + self = [super init]; + if (self) { + // initialize property's default value, if any + + } + return self; +} + + +/** + * Maps json key to property name. + * This method is used by `JSONModel`. + */ ++ (JSONKeyMapper *)keyMapper { + return [[JSONKeyMapper alloc] initWithModelToJSONDictionary:@{ @"_id": @"id", @"username": @"username", @"firstName": @"firstName", @"lastName": @"lastName", @"email": @"email", @"password": @"password", @"phone": @"phone", @"userStatus": @"userStatus" }]; +} + +/** + * Indicates whether the property with the given name is optional. + * If `propertyName` is optional, then return `YES`, otherwise return `NO`. + * This method is used by `JSONModel`. + */ ++ (BOOL)propertyIsOptional:(NSString *)propertyName { + + NSArray *optionalProperties = @[@"_id", @"username", @"firstName", @"lastName", @"email", @"password", @"phone", @"userStatus"]; + return [optionalProperties containsObject:propertyName]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Podfile b/samples/client/petstore/objc/default/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..22654e6adda3 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Podfile @@ -0,0 +1,12 @@ +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient_Example' do + pod "SwaggerClient", :path => "../" +end + +target 'SwaggerClient_Tests' do + pod "SwaggerClient", :path => "../" + + pod 'Specta' + pod 'Expecta' +end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..6407077fccd8 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,592 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */; }; + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; + 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; + 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* SWGAppDelegate.m */; }; + 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* SWGViewController.m */; }; + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; + 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; + 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */; }; + B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */; }; + B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC7027D4B025ABCA7999F /* Main.storyboard */; }; + B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC65E342ADA697322D68C /* Images.xcassets */; }; + B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */; }; + CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF0ADB471B5F95D6008A2729 /* PetTest.m */; }; + CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CF8F71381B5F73AC00162980 /* DeserializationTest.m */; }; + CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */; }; + CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */; }; + CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */; }; + CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */ = {isa = PBXBuildFile; fileRef = CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6003F582195388D10070C39A /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6003F589195388D20070C39A; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.release.xcconfig"; sourceTree = ""; }; + 4CCE21315897B7D544C83242 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; + 6003F58A195388D20070C39A /* SwaggerClient_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 6003F595195388D20070C39A /* SwaggerClient-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "SwaggerClient-Info.plist"; sourceTree = ""; }; + 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SwaggerClient-Prefix.pch"; sourceTree = ""; }; + 6003F59C195388D20070C39A /* SWGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGAppDelegate.h; sourceTree = ""; }; + 6003F59D195388D20070C39A /* SWGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGAppDelegate.m; sourceTree = ""; }; + 6003F5A5195388D20070C39A /* SWGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SWGViewController.h; sourceTree = ""; }; + 6003F5A6195388D20070C39A /* SWGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SWGViewController.m; sourceTree = ""; }; + 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClient_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; + 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; + 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; + 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Tests/Pods-SwaggerClient_Tests.debug.xcconfig"; sourceTree = ""; }; + 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = "Launch Screen.storyboard"; path = "SwaggerClient/Launch Screen.storyboard"; sourceTree = ""; }; + B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseHelper.h; sourceTree = ""; }; + B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DatabaseHelper.m; sourceTree = ""; }; + B2ADC65E342ADA697322D68C /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SwaggerClient/Images.xcassets; sourceTree = ""; }; + B2ADC7027D4B025ABCA7999F /* Main.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Main.storyboard; path = SwaggerClient/Main.storyboard; sourceTree = ""; }; + BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.release.xcconfig"; sourceTree = ""; }; + CF0ADB471B5F95D6008A2729 /* PetTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetTest.m; sourceTree = ""; }; + CF8F71381B5F73AC00162980 /* DeserializationTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DeserializationTest.m; sourceTree = ""; }; + CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PetApiTest.m; sourceTree = ""; }; + CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = StoreApiTest.m; sourceTree = ""; }; + CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWGApiClientTest.m; sourceTree = ""; }; + CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UserApiTest.m; sourceTree = ""; }; + E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient_Example/Pods-SwaggerClient_Example.debug.xcconfig"; sourceTree = ""; }; + E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = SwaggerClient.podspec; path = ../SwaggerClient.podspec; sourceTree = ""; }; + FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SwaggerClient_Tests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6003F587195388D20070C39A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, + 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, + 94BE6BE84795B5034A811E61 /* libPods-SwaggerClient_Example.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AB195388D20070C39A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, + 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, + 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, + 158CE3AA214CB1B31C7ADC48 /* libPods-SwaggerClient_Tests.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 6003F581195388D10070C39A = { + isa = PBXGroup; + children = ( + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, + 6003F593195388D20070C39A /* Example for SwaggerClient */, + 6003F5B5195388D20070C39A /* Tests */, + 6003F58C195388D20070C39A /* Frameworks */, + 6003F58B195388D20070C39A /* Products */, + CCE77F10C6D41F74B075ECD0 /* Pods */, + ); + sourceTree = ""; + }; + 6003F58B195388D20070C39A /* Products */ = { + isa = PBXGroup; + children = ( + 6003F58A195388D20070C39A /* SwaggerClient_Example.app */, + 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */, + B2ADC084A2C0BDF217832B03 /* Launch Screen.storyboard */, + ); + name = Products; + sourceTree = ""; + }; + 6003F58C195388D20070C39A /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6003F58D195388D20070C39A /* Foundation.framework */, + 6003F58F195388D20070C39A /* CoreGraphics.framework */, + 6003F591195388D20070C39A /* UIKit.framework */, + 6003F5AF195388D20070C39A /* XCTest.framework */, + 8D46325ECAD48245C07F6733 /* libPods-SwaggerClient_Example.a */, + FDEF5BA3CF9CFFDEB5A47DB4 /* libPods-SwaggerClient_Tests.a */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6003F593195388D20070C39A /* Example for SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6003F59C195388D20070C39A /* SWGAppDelegate.h */, + 6003F59D195388D20070C39A /* SWGAppDelegate.m */, + 6003F5A5195388D20070C39A /* SWGViewController.h */, + 6003F5A6195388D20070C39A /* SWGViewController.m */, + 6003F594195388D20070C39A /* Supporting Files */, + ); + name = "Example for SwaggerClient"; + path = SwaggerClient; + sourceTree = ""; + }; + 6003F594195388D20070C39A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6003F595195388D20070C39A /* SwaggerClient-Info.plist */, + 6003F596195388D20070C39A /* InfoPlist.strings */, + 6003F599195388D20070C39A /* main.m */, + 6003F59B195388D20070C39A /* SwaggerClient-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 6003F5B5195388D20070C39A /* Tests */ = { + isa = PBXGroup; + children = ( + CFDFB40A1B3CFEC3009739C5 /* PetApiTest.m */, + CFDFB40B1B3CFEC3009739C5 /* StoreApiTest.m */, + CFDFB40C1B3CFEC3009739C5 /* SWGApiClientTest.m */, + CF0ADB471B5F95D6008A2729 /* PetTest.m */, + CF8F71381B5F73AC00162980 /* DeserializationTest.m */, + CFDFB40D1B3CFEC3009739C5 /* UserApiTest.m */, + 6003F5BB195388D20070C39A /* Tests.m */, + 6003F5B6195388D20070C39A /* Supporting Files */, + B2ADCA62DE4AC0F5BAB42208 /* Helpers */, + ); + path = Tests; + sourceTree = ""; + }; + 6003F5B6195388D20070C39A /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 6003F5B7195388D20070C39A /* Tests-Info.plist */, + 6003F5B8195388D20070C39A /* InfoPlist.strings */, + 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; + 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { + isa = PBXGroup; + children = ( + E9675D953C6DCDE71A1BDFD4 /* SwaggerClient.podspec */, + 4CCE21315897B7D544C83242 /* README.md */, + B2ADC7027D4B025ABCA7999F /* Main.storyboard */, + B2ADC65E342ADA697322D68C /* Images.xcassets */, + ); + name = "Podspec Metadata"; + sourceTree = ""; + }; + B2ADCA62DE4AC0F5BAB42208 /* Helpers */ = { + isa = PBXGroup; + children = ( + B2ADC2F3483B3117A00FA91C /* DatabaseHelper.h */, + B2ADC55130D5E329ED945E8F /* DatabaseHelper.m */, + ); + path = Helpers; + sourceTree = ""; + }; + CCE77F10C6D41F74B075ECD0 /* Pods */ = { + isa = PBXGroup; + children = ( + E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */, + BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */, + 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */, + 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6003F589195388D20070C39A /* SwaggerClient_Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */; + buildPhases = ( + 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */, + 6003F586195388D20070C39A /* Sources */, + 6003F587195388D20070C39A /* Frameworks */, + 6003F588195388D20070C39A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient_Example; + productName = SwaggerClient; + productReference = 6003F58A195388D20070C39A /* SwaggerClient_Example.app */; + productType = "com.apple.product-type.application"; + }; + 6003F5AD195388D20070C39A /* SwaggerClient_Tests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */; + buildPhases = ( + 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */, + 6003F5AA195388D20070C39A /* Sources */, + 6003F5AB195388D20070C39A /* Frameworks */, + 6003F5AC195388D20070C39A /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6003F5B4195388D20070C39A /* PBXTargetDependency */, + ); + name = SwaggerClient_Tests; + productName = SwaggerClientTests; + productReference = 6003F5AE195388D20070C39A /* SwaggerClient_Tests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6003F582195388D10070C39A /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = SWG; + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = geekerzp; + }; + buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6003F581195388D10070C39A; + productRefGroup = 6003F58B195388D20070C39A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6003F589195388D20070C39A /* SwaggerClient_Example */, + 6003F5AD195388D20070C39A /* SwaggerClient_Tests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6003F588195388D20070C39A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, + B2ADC17C287DCABF329BA8AC /* Main.storyboard in Resources */, + B2ADC2D632658A5F73C6CE66 /* Images.xcassets in Resources */, + B2ADC56977372855A63F4E4D /* Launch Screen.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AC195388D20070C39A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 799E7E29D924C30424DFBA28 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Example-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 7B069562A9F91E498732474F /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient_Tests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6003F586195388D20070C39A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6003F59E195388D20070C39A /* SWGAppDelegate.m in Sources */, + 6003F5A7195388D20070C39A /* SWGViewController.m in Sources */, + 6003F59A195388D20070C39A /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6003F5AA195388D20070C39A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + CFDFB4141B3CFFF6009739C5 /* StoreApiTest.m in Sources */, + CF0ADB481B5F95D6008A2729 /* PetTest.m in Sources */, + CFDFB4131B3CFFDD009739C5 /* PetApiTest.m in Sources */, + 6003F5BC195388D20070C39A /* Tests.m in Sources */, + CFDFB4151B3D000B009739C5 /* SWGApiClientTest.m in Sources */, + CFDFB4121B3CFFA8009739C5 /* UserApiTest.m in Sources */, + CF8F71391B5F73AC00162980 /* DeserializationTest.m in Sources */, + B2ADC0B1C8A60A05C48B4DF7 /* DatabaseHelper.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6003F589195388D20070C39A /* SwaggerClient_Example */; + targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6003F596195388D20070C39A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 6003F597195388D20070C39A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; + 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 6003F5B9195388D20070C39A /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6003F5BD195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6003F5BE195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6003F5C0195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E445A633FA767F207D7EE6CE /* Pods-SwaggerClient_Example.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; + INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Debug; + }; + 6003F5C1195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BFB4BE760737508B3CFC23B2 /* Pods-SwaggerClient_Example.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "SwaggerClient/SwaggerClient-Prefix.pch"; + INFOPLIST_FILE = "SwaggerClient/SwaggerClient-Info.plist"; + MODULE_NAME = ExampleApp; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = app; + }; + name = Release; + }; + 6003F5C3195388D20070C39A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 73CCD82196AABD64F2807C7B /* Pods-SwaggerClient_Tests.debug.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = xctest; + }; + name = Debug; + }; + 6003F5C4195388D20070C39A /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 1A81C3BE3E54961CD827EAE3 /* Pods-SwaggerClient_Tests.release.xcconfig */; + buildSettings = { + FRAMEWORK_SEARCH_PATHS = ( + "$(SDKROOT)/Developer/Library/Frameworks", + "$(inherited)", + "$(DEVELOPER_FRAMEWORKS_DIR)", + ); + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; + INFOPLIST_FILE = "Tests/Tests-Info.plist"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME)"; + WRAPPER_EXTENSION = xctest; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6003F585195388D10070C39A /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5BD195388D20070C39A /* Debug */, + 6003F5BE195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5C0195388D20070C39A /* Debug */, + 6003F5C1195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "SwaggerClient_Tests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6003F5C3195388D20070C39A /* Debug */, + 6003F5C4195388D20070C39A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6003F582195388D10070C39A /* Project object */; +} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..13bdd8ab8b75 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme new file mode 100644 index 000000000000..24c1ef20c794 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/All Tests.xcscheme @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme new file mode 100644 index 000000000000..29c43710dffc --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient-Example.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..f697f61f4aaf --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,53 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json new file mode 100644 index 000000000000..4458b40c0558 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Images.xcassets/LaunchImage.launchimage/Contents.json @@ -0,0 +1,51 @@ +{ + "images" : [ + { + "orientation" : "portrait", + "idiom" : "iphone", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "iphone", + "subtype" : "retina4", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "1x" + }, + { + "orientation" : "portrait", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + }, + { + "orientation" : "landscape", + "idiom" : "ipad", + "extent" : "full-screen", + "minimum-system-version" : "7.0", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard new file mode 100644 index 000000000000..36df4e16819b --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Launch Screen.storyboard @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard new file mode 100644 index 000000000000..f204320d3339 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/Main.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h new file mode 100644 index 000000000000..eb867594fdee --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.h @@ -0,0 +1,15 @@ +// +// SWGAppDelegate.h +// SwaggerClient +// +// Created by CocoaPods on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +@import UIKit; + +@interface SWGAppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m new file mode 100644 index 000000000000..492c6026d6bc --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGAppDelegate.m @@ -0,0 +1,46 @@ +// +// SWGAppDelegate.m +// SwaggerClient +// +// Created by CocoaPods on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +#import "SWGAppDelegate.h" + +@implementation SWGAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + // Override point for customization after application launch. + return YES; +} + +- (void)applicationWillResignActive:(UIApplication *)application +{ + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. +} + +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + +- (void)applicationWillEnterForeground:(UIApplication *)application +{ + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. +} + +- (void)applicationDidBecomeActive:(UIApplication *)application +{ + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + +- (void)applicationWillTerminate:(UIApplication *)application +{ + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h new file mode 100644 index 000000000000..7847f2d05b1d --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.h @@ -0,0 +1,13 @@ +// +// SWGViewController.h +// SwaggerClient +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +@import UIKit; + +@interface SWGViewController : UIViewController + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m new file mode 100644 index 000000000000..d1ee531e2f05 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SWGViewController.m @@ -0,0 +1,60 @@ +// +// SWGViewController.m +// SwaggerClient +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +#import "SWGViewController.h" +#import +#import +#import +#import + +@interface SWGViewController () + +@end + +@implementation SWGViewController + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; + config.debug = YES; + + SWGPetApi *api = [[SWGPetApi alloc] init]; + NSURL *file = [NSURL fileURLWithPath:@"/Users/geekerzp/tmp/test.jpg"]; + [api uploadFileWithPetId:@2 additionalMetadata:@"2" file:file completionHandler:^(NSError *error) { + NSLog(@"*** error: %@", error); + }]; +} + +- (SWGPet*) createPet { + SWGPet * pet = [[SWGPet alloc] init]; + pet._id = @((long) [[NSDate date] timeIntervalSince1970]); + pet.name = @"monkey"; + + SWGCategory * category = [[SWGCategory alloc] init]; + category._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + category.name = @"super-happy"; + pet.category = category; + + SWGTag *tag1 = [[SWGTag alloc] init]; + tag1._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + tag1.name = @"test tag 1"; + SWGTag *tag2 = [[SWGTag alloc] init]; + tag2._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + tag2.name = @"test tag 2"; + pet.tags = (NSArray *) @[tag1, tag2]; + + pet.status = @"available"; + + NSArray * photos = @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]; + pet.photoUrls = photos; + return pet; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist new file mode 100644 index 000000000000..0c641d12c147 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Info.plist @@ -0,0 +1,54 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UILaunchStoryboardName + Launch Screen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch new file mode 100644 index 000000000000..7825372cbdda --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/SwaggerClient-Prefix.pch @@ -0,0 +1,16 @@ +// +// Prefix header +// +// The contents of this file are implicitly included at the beginning of every source file. +// + +#import + +#ifndef __IPHONE_5_0 +#warning "This project uses features only available in iOS SDK 5.0 and later." +#endif + +#ifdef __OBJC__ + @import UIKit; + @import Foundation; +#endif diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings new file mode 100644 index 000000000000..477b28ff8f86 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m new file mode 100644 index 000000000000..4a47f1fd69e4 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient/main.m @@ -0,0 +1,17 @@ +// +// main.m +// SwaggerClient +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2014 geekerzp. All rights reserved. +// + +@import UIKit; +#import "SWGAppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([SWGAppDelegate class])); + } +} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m new file mode 100644 index 000000000000..d24f349419cd --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/DeserializationTest.m @@ -0,0 +1,265 @@ +#import +#import +#import +#import + +@interface DeserializationTest : XCTestCase { + +@private SWGApiClient *apiClient; + +} + +@end + +@implementation DeserializationTest + +- (void)setUp { + [super setUp]; + apiClient = [[SWGApiClient alloc] init]; +} + +- (void)testDeserializeDate { + NSString *dateStr = @"2012-09-27"; + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + NSTimeZone *timezone = [NSTimeZone timeZoneWithName:@"UTC"]; + [formatter setTimeZone:timezone]; + [formatter setDateFormat:@"yyyy-MM-dd"]; + NSDate *date = [formatter dateFromString:dateStr]; + NSError* error; + NSDate *deserializedDate = [apiClient.responseDeserializer deserialize:dateStr class:@"NSDate*" error:&error]; + XCTAssertNil(error); + XCTAssertEqualWithAccuracy([date timeIntervalSinceReferenceDate], [deserializedDate timeIntervalSinceReferenceDate], 0.001); +} + +- (void)testDeserializeInvalidDate { + NSString *dateStr = @"random string"; + + NSError* error; + NSDate *deserializedDate = [apiClient.responseDeserializer deserialize:dateStr class:@"NSDate*" error:&error]; + XCTAssertNotNil(error); + XCTAssertNil(deserializedDate); +} + +- (void)testDeserializeEmptyDate { + NSString *dateStr = @""; + NSError* error; + NSDate *deserializedDate = [apiClient.responseDeserializer deserialize:dateStr class:@"NSDate*" error:&error]; + XCTAssertNil(error); + XCTAssertNil(deserializedDate); +} + +- (void)testDeserializeDateTime { + NSString *dateTimeStr = @"1997-07-16T19:20:30+00:00"; + + NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; + [formatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ssZ"]; + NSDate *dateTime = [formatter dateFromString:dateTimeStr]; + NSError* error; + NSDate *deserializedDateTime = [apiClient.responseDeserializer deserialize:dateTimeStr class:@"NSDate*" error:&error]; + XCTAssertNil(error); + XCTAssertEqualWithAccuracy([dateTime timeIntervalSinceReferenceDate], [deserializedDateTime timeIntervalSinceReferenceDate], 0.001); +} + +- (void)testDeserializeUnknownObject { + NSString *data = @"random string"; + NSError* error; + NSNumber *result = [apiClient.responseDeserializer deserialize:data class:@"DeserializationTest*" error:&error]; + XCTAssertNotNil(error); + XCTAssertNil(result); +} + +- (void)testDeserializeObject { + NSNumber *data = @1; + NSError* error; + NSNumber *result = [apiClient.responseDeserializer deserialize:data class:@"NSObject*" error:&error]; + XCTAssertNil(error); + XCTAssertEqualObjects(data, result); +} + +- (void)testDeserializeString { + NSString *data = @"test string"; + NSError* error; + NSString *result = [apiClient.responseDeserializer deserialize:data class:@"NSString*" error:&error]; + XCTAssertNil(error); + XCTAssertTrue([result isEqualToString:data]); +} + +- (void)testDeserializeListOfString { + NSArray *data = @[@"test string"]; + NSError* error; + NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; + XCTAssertNil(error); + XCTAssertTrue([result isKindOfClass:[NSArray class]]); + XCTAssertTrue([result[0] isKindOfClass:[NSString class]]); +} + +- (void)testDeserializeInvalidListOfNumbers { + NSArray *data = @[@"test string"]; + NSError* error; + NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; + XCTAssertNotNil(error); + XCTAssertNil(result); +} + +- (void)testDeserializeListOfNumbers { + NSArray *data = @[@"1.0"]; + NSError* error; + NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; + XCTAssertNil(error); + XCTAssertTrue([result isKindOfClass:[NSArray class]]); + XCTAssertTrue([result[0] isKindOfClass:[NSNumber class]]); +} + +- (void)testDeserializeListOfModels { + NSArray *data = + @[ + @{ + @"id": @119, + @"category": @{ + @"id": @0, + @"name": @"string" + }, + @"name": @"doggie", + @"photoUrls": @[ + @"string" + ], + @"tags": @[ + @{ + @"id": @0, + @"name": @"string" + } + ], + @"status": @"available" + + }]; + NSError* error; + NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray*" error:&error]; + + XCTAssertTrue([result isKindOfClass:[NSArray class]]); + XCTAssertTrue([[result firstObject] isKindOfClass:[SWGPet class]]); + SWGPet*pet = [result firstObject]; + XCTAssertEqualObjects([pet.photoUrls firstObject],@"string"); + XCTAssertTrue([[pet.tags firstObject] isKindOfClass:[SWGTag class]]); + SWGTag* tag = [pet.tags firstObject]; + XCTAssertEqualObjects(tag._id, @0); + XCTAssertEqualObjects(tag.name, @"string"); + XCTAssertEqualObjects(pet._id, @119); +} + +- (void)testDeserializeMapOfModels { + NSDictionary *data = + @{ + @"pet": @{ + @"id": @119, + @"category": @{ + @"id": @0, + @"name": @"string" + }, + @"name": @"doggie", + @"photoUrls": @[ + @"string" + ], + @"tags": @[ + @{ + @"id": @0, + @"name": @"string" + } + ], + @"status": @"available" + + } + }; + NSError* error; + NSDictionary *result = [apiClient.responseDeserializer deserialize:data class:@"NSDictionary* /* NSString, SWGPet */" error:&error]; + + XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"pet"] isKindOfClass:[SWGPet class]]); + XCTAssertEqualObjects([result[@"pet"] _id], @119); +} + +- (void)testDeserializeNestedMap { + NSDictionary *data = + @{ + @"foo": @{ + @"bar": @1, + @"bar2": [NSNull null] + } + }; + SWGResponseDeserializer* responseDeserializer = [[SWGResponseDeserializer alloc] init]; + NSError* error; + NSDictionary *result = [responseDeserializer deserialize:data class:@"NSDictionary* /* NSString, NSDictionary* /* NSString, NSNumber */ */" error:&error]; + + XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"foo"] isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"foo"][@"bar"] isKindOfClass:[NSNumber class]]); +} + + +- (void)testDeserializeNestedMapWithNullValue { + NSDictionary *data = + @{ + @"foo": @{ + @"bar": @1, + @"bar2": [NSNull null] + } + }; + SWGResponseDeserializer* responseDeserializer = [[SWGResponseDeserializer alloc] init]; + responseDeserializer.treatNullAsError = YES; + NSError* error; + NSDictionary *result = [responseDeserializer deserialize:data class:@"NSDictionary* /* NSString, NSDictionary* /* NSString, NSNumber */ */" error:&error]; + XCTAssertNil(result); + XCTAssertNotNil(error); +} + +- (void)testDeserializeNestedMap2 { + NSDictionary *data = @{ + @"foo": @{ + @"bar": @1 + } + }; + NSError* error; + NSDictionary *result = [apiClient.responseDeserializer deserialize:data class:@"NSDictionary*>*" error:&error]; + + XCTAssertTrue([result isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"foo"] isKindOfClass:[NSDictionary class]]); + XCTAssertTrue([result[@"foo"][@"bar"] isKindOfClass:[NSNumber class]]); +} + +- (void)testDeserializeNestedList { + NSArray *data = @[@[@"foo"]]; + NSError* error; + NSArray *result = [apiClient.responseDeserializer deserialize:data class:@"NSArray* /* NSArray* /* NSString */ */" error:&error]; + + XCTAssertTrue([result isKindOfClass:[NSArray class]]); + XCTAssertTrue([result[0] isKindOfClass:[NSArray class]]); + XCTAssertTrue([result[0][0] isKindOfClass:[NSString class]]); +} + +- (void)testDeserializeBool { + NSString *data; + NSNumber *result; + + data = @"true"; + NSError* error; + result = [apiClient.responseDeserializer deserialize:data class:@"NSNumber*" error:&error]; + XCTAssertTrue([result isEqual:@YES]); + + data = @"false"; + result = [apiClient.responseDeserializer deserialize:data class:@"NSNumber*" error:&error]; + XCTAssertTrue([result isEqual:@NO]); +} + +- (void)testDeserializeStringData { + NSString *data = @"1233"; + + NSError* error; + NSString * returnValue = [apiClient.responseDeserializer deserialize:[data dataUsingEncoding:NSUTF8StringEncoding] class:@"NSString*" error:&error]; + XCTAssertTrue([returnValue isEqual:data]); + + NSNumber *returnNumber = [apiClient.responseDeserializer deserialize:[data dataUsingEncoding:NSUTF8StringEncoding] class:@"NSNumber*" error:&error]; + XCTAssertTrue([returnNumber isEqual:@1233]); +} + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h new file mode 100644 index 000000000000..8216e012a32a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.h @@ -0,0 +1,14 @@ +#import +#import + +@interface DatabaseHelper : NSObject + ++ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName; + ++ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName; + ++ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName; + ++ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model; + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m new file mode 100644 index 000000000000..3433ac19ddbf --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Helpers/DatabaseHelper.m @@ -0,0 +1,42 @@ +#import "DatabaseHelper.h" + +@implementation DatabaseHelper + + ++ (NSManagedObjectContext *)createContextWithModelName:(NSString *)mName { + NSManagedObjectModel *model = [self createModelWithModelName:mName]; + return [self createDatabaseWithModel:model]; +} + ++ (NSManagedObjectContext *)createDatabaseWithModel:(NSManagedObjectModel*)model { + NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model]; + [coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:nil]; + + NSManagedObjectContext *testingContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + [testingContext setPersistentStoreCoordinator:coordinator]; + [testingContext setMergePolicy:NSMergeByPropertyObjectTrumpMergePolicy]; + return testingContext; +} + ++ (NSManagedObjectModel *)createModelWithModelName:(NSString *)mName { + NSBundle *bundle = [NSBundle bundleForClass:[self class]]; + NSString *path = [bundle pathForResource:mName ofType:@"momd"]; + NSAssert(path, @"Missing Model for name: %@",mName); + NSURL *modURL = [NSURL fileURLWithPath:path]; + return [[NSManagedObjectModel alloc] initWithContentsOfURL:modURL]; +} + ++ (void)clearContext:(NSManagedObjectContext *)ctx fromEntitiesWithName:(NSString *)entityName { + NSFetchRequest *fetch = [[NSFetchRequest alloc] init]; + [fetch setEntity:[NSEntityDescription entityForName:entityName inManagedObjectContext:ctx]]; + NSError *error = nil; + NSArray *result = [ctx executeFetchRequest:fetch error:&error]; + if (error) { + NSLog(@"Failed clearing context from entities with name [%@]", error); + } + for (id basket in result) { + [ctx deleteObject:basket]; + } +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m new file mode 100644 index 000000000000..52c3213c37f5 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetApiTest.m @@ -0,0 +1,307 @@ +#import +#import +#import + +@interface PetApiTest : XCTestCase { +@private + SWGPetApi * api; +} + +@end + +@implementation PetApiTest + +- (void)setUp { + [super setUp]; + api = [[SWGPetApi alloc ]init]; +} + +- (void)tearDown { + [super tearDown]; +} + +- (void)testCreatePetApi { + SWGPetApi *api1 = [[SWGPetApi alloc] init]; + SWGPetApi *api2 = [[SWGPetApi alloc] init]; + XCTAssertEqual(api1.apiClient, api2.apiClient); + + SWGApiClient *client = [[SWGApiClient alloc] init]; + SWGPetApi *api3 = [[SWGPetApi alloc] initWithApiClient:client]; + XCTAssertNotEqual(api1.apiClient, api3.apiClient); +} + +- (void)testCreateAndGetPet { + XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetById"]; + SWGPet* pet = [self createPet]; + + [api addPetWithPet:pet completionHandler:^(NSError *error) { + if(error){ + XCTFail(@"got error %@", error); + } + NSLog(@"%@", [pet _id]); + [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { + if(error){ + XCTFail(@"got error %@", error); + } + if(output){ + XCTAssertNotNil([output _id], @"token was nil"); + + // test category of pet is correct + XCTAssertEqualObjects(output.category._id, pet.category._id); + XCTAssertEqualObjects(output.category.name, pet.category.name); + + // test tags of pet is correct + XCTAssertTrue([output.tags isKindOfClass:[NSArray class]]); + [pet.tags enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { + SWGTag *foundTag = [[SWGTag alloc] init]; + for (SWGTag *tag in output.tags) { + if ([tag _id] == [obj _id]) { + foundTag = tag; + } + } + XCTAssertNotNil(foundTag); + XCTAssertEqualObjects([foundTag _id], [obj _id]); + XCTAssertEqualObjects([foundTag name], [obj name]); + }]; + } + [expectation fulfill]; + }]; + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +- (void) testUpdatePet { + XCTestExpectation *expectation = [self expectationWithDescription:@"testUpdatePet"]; + SWGPet* pet = [self createPet]; + + [api addPetWithPet:pet completionHandler:^(NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + else { + [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + if(output == nil){ + NSLog(@"failed to fetch pet"); + } + else { + SWGPet* pet = [[SWGPet alloc] initWithDictionary:[output toDictionary] error:nil]; + NSLog(@"got the pet"); + + [pet setName:@"programmer"]; + [pet setStatus:@"confused"]; + + [api updatePetWithPet:pet + completionHandler:^(NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + if(output == nil){ + NSLog(@"failed to fetch pet"); + } + else { + SWGPet* pet = [[SWGPet alloc] initWithDictionary:[output toDictionary] error:nil]; + XCTAssertNotNil([pet _id], @"pet was nil"); + XCTAssertEqualObjects([pet name], @"programmer", @"pet name was not updated"); + XCTAssertEqualObjects([pet status], @"confused", @"pet status was not updated"); + } + [expectation fulfill]; + + }]; + }]; + } + }]; + } + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +/* +wing328@20151130: comment out the test case below as some data do not contain the 'name' attribute, +which causes an exception when deserializing the data + +- (void)testGetPetByStatus { + XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByStatus"]; + SWGPet* pet = [self createPet]; + + [api addPetWithCompletionBlock:pet completionHandler:^(NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + NSArray* status = [[NSArray alloc] initWithObjects:@"available", nil]; + [api findPetsByStatusWithCompletionBlock:status completionHandler:^(NSArray *output, NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + if(output == nil){ + XCTFail(@"failed to fetch pets"); + } + else { + bool found = false; + for(SWGPet* fetched in output) { + if([pet _id] == [fetched _id]) { + found = true; + } + } + if(found) + [expectation fulfill]; + } + }]; + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} +*/ + +- (void)testGetPetByTags { + XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByTags"]; + SWGPet* pet = [self createPet]; + SWGTag* tag = [[SWGTag alloc] init]; + tag.name = @"tony"; + NSLog(@"%@", pet._id); + pet.tags = (id) @[tag]; + + [api addPetWithPet:pet completionHandler:^(NSError *error) { + if(error) { + XCTFail(@"got error %@", error); + } + NSArray* tags = @[@"tony",@"tony2"]; + + [api findPetsByTagsWithTags:tags completionHandler:^(NSArray *output, NSError *error) { + if(error){ + XCTFail(@"got error %@", error); + } + if(output){ + bool hasTag = false; + for(SWGPet * fetched in output) { + for(SWGTag * tag in [fetched tags]){ + if(fetched._id == pet._id && [[tag name] isEqualToString:@"tony"]) + hasTag = true; + } + } + if(!hasTag) + XCTFail(@"failed to find tag in pet"); + if(hasTag) + [expectation fulfill]; + } + }]; + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +- (void)testDeletePet { + XCTestExpectation *expectation = [self expectationWithDescription:@"testDeletePet"]; + + SWGPet* pet = [self createPet]; + + [api addPetWithPet:pet completionHandler:^(NSError *error) { + if(error){ + XCTFail(@"got error %@", error); + } + [api deletePetWithPetId:pet._id apiKey:@"" completionHandler:^(NSError *error) { + if(error){ + XCTFail(@"got error %@", error); + } + [api getPetByIdWithPetId:[pet _id] completionHandler:^(SWGPet *output, NSError *error) { + if(error) { + // good + [expectation fulfill]; + + } + else { + XCTFail(@"expected a failure"); + } + }]; + }]; + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +- (void)testUploadFileWithFormParameter { + XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithFileWithFormParameter"]; + + NSURL *fileURL = [self createTempFile]; + + [api uploadFileWithPetId:@1 additionalMetadata:@"special-metadata" file:fileURL completionHandler:^(NSError *error) { + if(error) { + // good + XCTFail(@"expected a failure"); + + } + else { + [expectation fulfill]; + } + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +- (void)testUploadFile { + XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadFile"]; + + NSURL *fileURL = [self createTempFile]; + + [api uploadFileWithPetId:@1 additionalMetadata:nil file:fileURL completionHandler:^(NSError *error) { + if (error) { + XCTFail(@"expected a failure"); + } + else { + [expectation fulfill]; + } + }]; + + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +- (void)TestUploadWithoutFile { + XCTestExpectation *expectation = [self expectationWithDescription:@"testUploadWithoutFile"]; + + [api uploadFileWithPetId:@1 additionalMetadata:@"special-metadata" file:nil completionHandler:^(NSError *error) { + if(error) { + XCTFail(@"failed to upload"); + + } + else { + [expectation fulfill]; + } + }]; + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +- (SWGPet*) createPet { + SWGPet * pet = [[SWGPet alloc] init]; + pet._id = @((long) [[NSDate date] timeIntervalSince1970]); + pet.name = @"monkey"; + + SWGCategory * category = [[SWGCategory alloc] init]; + category._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + category.name = @"super-happy"; + pet.category = category; + + SWGTag *tag1 = [[SWGTag alloc] init]; + tag1._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + tag1.name = @"test tag 1"; + SWGTag *tag2 = [[SWGTag alloc] init]; + tag2._id = [[NSNumber alloc] initWithInteger:arc4random_uniform(100000)]; + tag2.name = @"test tag 2"; + pet.tags = (NSArray *) @[tag1, tag2]; + + pet.status = @"available"; + + NSArray * photos = @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]; + pet.photoUrls = photos; + return pet; +} + +- (NSURL *) createTempFile { + NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:[NSString stringWithFormat:@"%@", [[NSProcessInfo processInfo] globallyUniqueString]]]; + NSData *data = [@"test string" dataUsingEncoding:NSUTF8StringEncoding]; + [data writeToFile:filePath atomically:YES]; + + return [NSURL fileURLWithPath:filePath]; +} +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m new file mode 100644 index 000000000000..9dbde13310b5 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/PetTest.m @@ -0,0 +1,37 @@ +#import +#import +#import + +@interface PetTest : XCTestCase { + +@private SWGPet *pet; + +} + +@end + +@implementation PetTest + +- (void)setUp { + [super setUp]; + + NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", + @"status": @"sold", + @"photoUrls": @[@"string"], + @"category": @{ @"id": @1, @"name": @"test category" }, + @"tags": @[ @{ @"id": @1, @"name": @"test tag" } ]}; + pet = [[SWGPet alloc] initWithDictionary:petDict error:nil]; +} + +- (void)testDescription { + NSDictionary *petDict = @{ @"id": @1, @"name": @"test pet", + @"status": @"sold", + @"photoUrls": @[@"string"], + @"category": @{ @"id": @1, @"name": @"test category" }, + @"tags": @[ @{ @"id": @1, @"name": @"test tag" } ]}; + NSString *petStr = [petDict description]; + + XCTAssertTrue([[pet description] isEqualToString:petStr]); +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m new file mode 100644 index 000000000000..b6bee5a719a9 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/SWGApiClientTest.m @@ -0,0 +1,191 @@ +#import +#import +#import +#import +#import +#import +#import + +@interface SWGApiClientTest : XCTestCase + +@property (nonatomic) SWGApiClient *apiClient; + +@end + +@implementation SWGApiClientTest + +- (void)setUp { + [super setUp]; + self.apiClient = [[SWGApiClient alloc] init]; +} + +- (void)tearDown { + // Put teardown code here. This method is called after the invocation of each test method in the class. + [super tearDown]; +} + +- (void)testSelectHeaderAccept { + NSArray *accepts = nil; + + accepts = @[@"APPLICATION/JSON", @"APPLICATION/XML"]; + SWGSanitizer * sanitizer = [[SWGSanitizer alloc] init]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"application/json", @"application/xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"APPLICATION/xml", @"APPLICATION/json"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"application/vnd.github+json", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"application/json;charset=utf-8", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"application/vnd.github.v3.html+json", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"application/vnd.github.v3.html+json"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"application/json"); + + accepts = @[@"text/plain", @"application/xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @"text/plain, application/xml"); + + accepts = @[]; + XCTAssertEqualObjects([sanitizer selectHeaderAccept:accepts], @""); +} + +- (void)testSelectHeaderContentType { + NSArray *contentTypes = nil; + SWGSanitizer * sanitizer = [[SWGSanitizer alloc] init]; + + contentTypes = @[@"APPLICATION/JSON", @"APPLICATION/XML"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"application/json", @"application/xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"APPLICATION/xml", @"APPLICATION/json"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"application/vnd.github+json", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"application/json;charset=utf-8", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"application/json;charset=utf-8", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"application/vnd.github.v3.html+json", @"application/vnd.github+xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); + + contentTypes = @[@"text/plain", @"application/xml"]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"text/plain"); + + contentTypes = @[]; + XCTAssertEqualObjects([sanitizer selectHeaderContentType:contentTypes], @"application/json"); +} + +- (void)testConfiguration { + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; + [config setApiKey:@"123456" forApiKeyIdentifier:@"api_key"]; + [config setApiKeyPrefix:@"PREFIX" forApiKeyPrefixIdentifier:@"api_key"]; + config.username = @"test_username"; + config.password = @"test_password"; + + NSDictionary *headerParams = @{@"test1": @"value1"}; + NSDictionary *queryParams = @{@"test2": @"value2"}; + NSArray *authSettings = @[@"api_key", @"unknown"]; + + // test prefix + XCTAssertEqualObjects(@"PREFIX", config.apiKeyPrefix[@"api_key"]); + [self.apiClient updateHeaderParams:&headerParams + queryParams:&queryParams + WithAuthSettings:authSettings]; + + // test api key auth + XCTAssertEqualObjects(headerParams[@"test1"], @"value1"); + XCTAssertEqualObjects(headerParams[@"api_key"], @"PREFIX 123456"); + XCTAssertEqualObjects(queryParams[@"test2"], @"value2"); + + // test basic auth + XCTAssertEqualObjects(@"test_username", config.username); + XCTAssertEqualObjects(@"test_password", config.password); +} + +- (void)testGetBasicAuthToken { + SWGDefaultConfiguration *config = [SWGDefaultConfiguration sharedConfig]; + config.username = @"test_username"; + config.password = @"test_password"; + + NSString *basicAuthCredentials = [NSString stringWithFormat:@"%@:%@", config.username, config.password]; + NSData *data = [basicAuthCredentials dataUsingEncoding:NSUTF8StringEncoding]; + basicAuthCredentials = [NSString stringWithFormat:@"Basic %@", [data base64EncodedStringWithOptions:0]]; + + XCTAssertEqualObjects(basicAuthCredentials, [config getBasicAuthToken]); +} + +- (void)testSanitizeForSerialization { + id result; + id data; + + // nil + data = nil; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, data); + + // NSString + data = @"test string"; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, data); + + // NSNumber + data = @1; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, data); + + // SWGQueryParamCollection + data = [[SWGQueryParamCollection alloc] init]; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, data); + + // NSDate + data = [NSDate dateWithISO8601String:@"1997-07-16T19:20:30.45+01:00"]; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, [data ISO8601StringWithTimeZone:nil usingCalendar:nil]); + + data = [NSDate dateWithISO8601String:@"1997-07-16"]; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, [data ISO8601StringWithTimeZone:nil usingCalendar:nil]); + + // model + NSDictionary *petDict = @{@"id": @1, @"name": @"monkey", + @"category": @{@"id": @1, @"name": @"test category"}, + @"tags": @[@{@"id": @1, @"name": @"test tag1"}, + @{@"id": @2, @"name": @"test tag2"}], + @"status": @"available", + @"photoUrls": @[@"http://foo.bar.com/3", @"http://foo.bar.com/4"]}; + data = [[SWGPet alloc] initWithDictionary:petDict error:nil]; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, petDict); + + // NSArray + data = @[@1]; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, data); + + // NSArray of models + NSArray *arrayOfPetDict = @[petDict]; + data = @[[[SWGPet alloc] initWithDictionary:petDict error:nil]]; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, arrayOfPetDict); + + // NSDictionary + data = @{@"test key": @"test value"}; + result = [self.apiClient.sanitizer sanitizeForSerialization:data]; + XCTAssertEqualObjects(result, data); +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m new file mode 100644 index 000000000000..334258fdaf13 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/StoreApiTest.m @@ -0,0 +1,44 @@ +#import +#import +#import + +@interface StoreApiTest : XCTestCase + +@property (nonatomic) SWGStoreApi *api; + +@end + +@implementation StoreApiTest + +- (void)setUp { + [super setUp]; + self.api = [[SWGStoreApi alloc] init]; +} + +- (void)tearDown { + [super tearDown]; +} + +- (void)testGetInventory { + XCTestExpectation *expectation = [self expectationWithDescription:@"testGetPetByStatus"]; + + [self.api getInventoryWithCompletionHandler:^(NSDictionary *output, NSError *error) { + + if (error) { + XCTFail(@"got error %@", error); + } + + if (!output) { + XCTFail(@"failed to fetch inventory"); + } + + XCTAssertNotNil(output.allKeys); + + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist new file mode 100644 index 000000000000..169b6f710ecc --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch new file mode 100644 index 000000000000..6d08c288215a --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests-Prefix.pch @@ -0,0 +1,8 @@ +// The contents of this file are implicitly included at the beginning of every test case source file. + +#ifdef __OBJC__ + + //@import Specta; + //@import Expecta; + +#endif diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m new file mode 100644 index 000000000000..527c8abd3481 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/Tests.m @@ -0,0 +1,52 @@ +// +// SwaggerClientTests.m +// SwaggerClientTests +// +// Created by geekerzp on 06/26/2015. +// Copyright (c) 2015 geekerzp. All rights reserved. +// + +// https://github.com/Specta/Specta + +/** + * show cases for Specta + ** + +SpecBegin(InitialSpecs) + +describe(@"these will fail", ^{ + + it(@"can do maths", ^{ + expect(1).to.equal(2); + }); + + it(@"can read", ^{ + expect(@"number").to.equal(@"string"); + }); + + it(@"will wait for 10 seconds and fail", ^{ + waitUntil(^(DoneCallback done) { + + }); + }); +}); + +describe(@"these will pass", ^{ + + it(@"can do maths", ^{ + expect(1).beLessThan(23); + }); + + it(@"can read", ^{ + expect(@"team").toNot.contain(@"I"); + }); + + it(@"will wait and succeed", ^{ + waitUntil(^(DoneCallback done) { + done(); + }); + }); +}); + +SpecEnd +*/ diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m new file mode 100644 index 000000000000..dd895d705aa0 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/UserApiTest.m @@ -0,0 +1,40 @@ +#import +#import +#import + +@interface UserApiTest : XCTestCase + +@property (nonatomic) SWGUserApi *api; + +@end + +@implementation UserApiTest + +- (void)setUp { + [super setUp]; + self.api = [[SWGUserApi alloc] init]; +} + +- (void)tearDown { + [super tearDown]; +} + +- (void)testLoginUser { + XCTestExpectation *expectation = [self expectationWithDescription:@"test login user"]; + + [self.api loginUserWithUsername:@"test username" password:@"test password" completionHandler:^(NSString *output, NSError *error) { + if (error) { + XCTFail(@"got error %@", error); + } + + if (!output) { + XCTFail(@"response can't be nil"); + } + XCTAssertTrue([output rangeOfString:@"logged in user"].location != NSNotFound); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:10.0 handler:nil]; +} + +@end diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings new file mode 100644 index 000000000000..477b28ff8f86 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/Tests/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/pom.xml b/samples/client/petstore/objc/default/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..a2f239310a27 --- /dev/null +++ b/samples/client/petstore/objc/default/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + ObjcPetstoreClientTests + pom + 1.0-SNAPSHOT + Objective-C Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh b/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh old mode 100644 new mode 100755 index c63c525fc247..5f88b8fcd74c --- a/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh +++ b/samples/client/petstore/objc/default/SwaggerClientTests/run_xcodebuild.sh @@ -1,3 +1,3 @@ #!/bin/sh -(cd $DIRECTORY/tests ; xcodebuild -scheme TestClientTests-Package test -destination "platform=iOS Simulator,name=iPhone 17,OS=latest" | xcpretty && exit ${PIPESTATUS[0]}) +pod install && xcodebuild test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient-Example" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.1" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/objc/default/docs/SWGApiResponse.md b/samples/client/petstore/objc/default/docs/SWGApiResponse.md new file mode 100644 index 000000000000..88ff755faf74 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGApiResponse.md @@ -0,0 +1,12 @@ +# SWGApiResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **NSNumber*** | | [optional] +**type** | **NSString*** | | [optional] +**message** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGCategory.md b/samples/client/petstore/objc/default/docs/SWGCategory.md new file mode 100644 index 000000000000..93a8d14ecb98 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGCategory.md @@ -0,0 +1,11 @@ +# SWGCategory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGInlineObject.md b/samples/client/petstore/objc/default/docs/SWGInlineObject.md new file mode 100644 index 000000000000..1d66818927f4 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGInlineObject.md @@ -0,0 +1,11 @@ +# SWGInlineObject + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **NSString*** | Updated name of the pet | [optional] +**status** | **NSString*** | Updated status of the pet | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGInlineObject1.md b/samples/client/petstore/objc/default/docs/SWGInlineObject1.md new file mode 100644 index 000000000000..c59e84858851 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGInlineObject1.md @@ -0,0 +1,11 @@ +# SWGInlineObject1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**additionalMetadata** | **NSString*** | Additional data to pass to server | [optional] +**file** | **NSURL*** | file to upload | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGOrder.md b/samples/client/petstore/objc/default/docs/SWGOrder.md new file mode 100644 index 000000000000..b2a9f25eae95 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGOrder.md @@ -0,0 +1,15 @@ +# SWGOrder + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**petId** | **NSNumber*** | | [optional] +**quantity** | **NSNumber*** | | [optional] +**shipDate** | **NSDate*** | | [optional] +**status** | **NSString*** | Order Status | [optional] +**complete** | **NSNumber*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGPet.md b/samples/client/petstore/objc/default/docs/SWGPet.md new file mode 100644 index 000000000000..c8298c66bf14 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGPet.md @@ -0,0 +1,15 @@ +# SWGPet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**category** | [**SWGCategory***](SWGCategory.md) | | [optional] +**name** | **NSString*** | | +**photoUrls** | **NSArray<NSString*>*** | | +**tags** | [**NSArray<SWGTag>***](SWGTag.md) | | [optional] +**status** | **NSString*** | pet status in the store | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGPetApi.md b/samples/client/petstore/objc/default/docs/SWGPetApi.md new file mode 100644 index 000000000000..47b1b14d8d26 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGPetApi.md @@ -0,0 +1,466 @@ +# SWGPetApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addPet**](SWGPetApi.md#addpet) | **POST** /pet | Add a new pet to the store +[**deletePet**](SWGPetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet +[**findPetsByStatus**](SWGPetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status +[**findPetsByTags**](SWGPetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags +[**getPetById**](SWGPetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID +[**updatePet**](SWGPetApi.md#updatepet) | **PUT** /pet | Update an existing pet +[**updatePetWithForm**](SWGPetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data +[**uploadFile**](SWGPetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image + + +# **addPet** +```objc +-(NSURLSessionTask*) addPetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; +``` + +Add a new pet to the store + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Add a new pet to the store +[apiInstance addPetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->addPet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deletePet** +```objc +-(NSURLSessionTask*) deletePetWithPetId: (NSNumber*) petId + apiKey: (NSString*) apiKey + completionHandler: (void (^)(NSError* error)) handler; +``` + +Deletes a pet + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // Pet id to delete +NSString* apiKey = @"apiKey_example"; // (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Deletes a pet +[apiInstance deletePetWithPetId:petId + apiKey:apiKey + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->deletePet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| Pet id to delete | + **apiKey** | **NSString***| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByStatus** +```objc +-(NSURLSessionTask*) findPetsByStatusWithStatus: (NSArray*) status + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* status = @[@"status_example"]; // Status values that need to be considered for filter (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Finds Pets by status +[apiInstance findPetsByStatusWithStatus:status + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGPetApi->findPetsByStatus: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**NSArray<NSString*>***](NSString*.md)| Status values that need to be considered for filter | [optional] + +### Return type + +[**NSArray***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **findPetsByTags** +```objc +-(NSURLSessionTask*) findPetsByTagsWithTags: (NSArray*) tags + completionHandler: (void (^)(NSArray* output, NSError* error)) handler; +``` + +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSArray* tags = @[@"tags_example"]; // Tags to filter by (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Finds Pets by tags +[apiInstance findPetsByTagsWithTags:tags + completionHandler: ^(NSArray* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGPetApi->findPetsByTags: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **tags** | [**NSArray<NSString*>***](NSString*.md)| Tags to filter by | [optional] + +### Return type + +[**NSArray***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getPetById** +```objc +-(NSURLSessionTask*) getPetByIdWithPetId: (NSNumber*) petId + completionHandler: (void (^)(SWGPet* output, NSError* error)) handler; +``` + +Find pet by ID + +Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + +// Configure API key authorization: (authentication scheme: api_key) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; + + +NSNumber* petId = @56; // ID of pet that needs to be fetched + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Find pet by ID +[apiInstance getPetByIdWithPetId:petId + completionHandler: ^(SWGPet* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGPetApi->getPetById: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet that needs to be fetched | + +### Return type + +[**SWGPet***](SWGPet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth), [api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePet** +```objc +-(NSURLSessionTask*) updatePetWithPet: (SWGPet*) pet + completionHandler: (void (^)(NSError* error)) handler; +``` + +Update an existing pet + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +SWGPet* pet = [[SWGPet alloc] init]; // Pet object that needs to be added to the store (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Update an existing pet +[apiInstance updatePetWithPet:pet + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->updatePet: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet** | [**SWGPet***](SWGPet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/json, application/xml + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updatePetWithForm** +```objc +-(NSURLSessionTask*) updatePetWithFormWithPetId: (NSString*) petId + name: (NSString*) name + status: (NSString*) status + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updates a pet in the store with form data + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSString* petId = @"petId_example"; // ID of pet that needs to be updated +NSString* name = @"name_example"; // Updated name of the pet (optional) +NSString* status = @"status_example"; // Updated status of the pet (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// Updates a pet in the store with form data +[apiInstance updatePetWithFormWithPetId:petId + name:name + status:status + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->updatePetWithForm: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSString***| ID of pet that needs to be updated | + **name** | **NSString***| Updated name of the pet | [optional] + **status** | **NSString***| Updated status of the pet | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: application/x-www-form-urlencoded + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **uploadFile** +```objc +-(NSURLSessionTask*) uploadFileWithPetId: (NSNumber*) petId + additionalMetadata: (NSString*) additionalMetadata + file: (NSURL*) file + completionHandler: (void (^)(NSError* error)) handler; +``` + +uploads an image + + + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure OAuth2 access token for authorization: (authentication scheme: petstore_auth) +[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"]; + + +NSNumber* petId = @56; // ID of pet to update +NSString* additionalMetadata = @"additionalMetadata_example"; // Additional data to pass to server (optional) +NSURL* file = [NSURL fileURLWithPath:@"/path/to/file"]; // file to upload (optional) + +SWGPetApi*apiInstance = [[SWGPetApi alloc] init]; + +// uploads an image +[apiInstance uploadFileWithPetId:petId + additionalMetadata:additionalMetadata + file:file + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGPetApi->uploadFile: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **petId** | **NSNumber***| ID of pet to update | + **additionalMetadata** | **NSString***| Additional data to pass to server | [optional] + **file** | **NSURL*****NSURL***| file to upload | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/default/docs/SWGStoreApi.md b/samples/client/petstore/objc/default/docs/SWGStoreApi.md new file mode 100644 index 000000000000..3c13b68eaff6 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGStoreApi.md @@ -0,0 +1,212 @@ +# SWGStoreApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**deleteOrder**](SWGStoreApi.md#deleteorder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**getInventory**](SWGStoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status +[**getOrderById**](SWGStoreApi.md#getorderbyid) | **GET** /store/order/{orderId} | Find purchase order by ID +[**placeOrder**](SWGStoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet + + +# **deleteOrder** +```objc +-(NSURLSessionTask*) deleteOrderWithOrderId: (NSString*) orderId + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of the order that needs to be deleted + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Delete purchase order by ID +[apiInstance deleteOrderWithOrderId:orderId + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGStoreApi->deleteOrder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getInventory** +```objc +-(NSURLSessionTask*) getInventoryWithCompletionHandler: + (void (^)(NSDictionary* output, NSError* error)) handler; +``` + +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Example +```objc +SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig]; + +// Configure API key authorization: (authentication scheme: api_key) +[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api_key"]; +// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api_key"]; + + + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Returns pet inventories by status +[apiInstance getInventoryWithCompletionHandler: + ^(NSDictionary* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGStoreApi->getInventory: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**NSDictionary*** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getOrderById** +```objc +-(NSURLSessionTask*) getOrderByIdWithOrderId: (NSString*) orderId + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; +``` + +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + +### Example +```objc + +NSString* orderId = @"orderId_example"; // ID of pet that needs to be fetched + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Find purchase order by ID +[apiInstance getOrderByIdWithOrderId:orderId + completionHandler: ^(SWGOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGStoreApi->getOrderById: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **orderId** | **NSString***| ID of pet that needs to be fetched | + +### Return type + +[**SWGOrder***](SWGOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **placeOrder** +```objc +-(NSURLSessionTask*) placeOrderWithOrder: (SWGOrder*) order + completionHandler: (void (^)(SWGOrder* output, NSError* error)) handler; +``` + +Place an order for a pet + + + +### Example +```objc + +SWGOrder* order = [[SWGOrder alloc] init]; // order placed for purchasing the pet (optional) + +SWGStoreApi*apiInstance = [[SWGStoreApi alloc] init]; + +// Place an order for a pet +[apiInstance placeOrderWithOrder:order + completionHandler: ^(SWGOrder* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGStoreApi->placeOrder: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order** | [**SWGOrder***](SWGOrder.md)| order placed for purchasing the pet | [optional] + +### Return type + +[**SWGOrder***](SWGOrder.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/default/docs/SWGTag.md b/samples/client/petstore/objc/default/docs/SWGTag.md new file mode 100644 index 000000000000..5495d5c8a99f --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGTag.md @@ -0,0 +1,11 @@ +# SWGTag + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**name** | **NSString*** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGUser.md b/samples/client/petstore/objc/default/docs/SWGUser.md new file mode 100644 index 000000000000..35bf5540cad0 --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGUser.md @@ -0,0 +1,17 @@ +# SWGUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_id** | **NSNumber*** | | [optional] +**username** | **NSString*** | | [optional] +**firstName** | **NSString*** | | [optional] +**lastName** | **NSString*** | | [optional] +**email** | **NSString*** | | [optional] +**password** | **NSString*** | | [optional] +**phone** | **NSString*** | | [optional] +**userStatus** | **NSNumber*** | User Status | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/client/petstore/objc/default/docs/SWGUserApi.md b/samples/client/petstore/objc/default/docs/SWGUserApi.md new file mode 100644 index 000000000000..51792caed6bd --- /dev/null +++ b/samples/client/petstore/objc/default/docs/SWGUserApi.md @@ -0,0 +1,402 @@ +# SWGUserApi + +All URIs are relative to *http://petstore.swagger.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**createUser**](SWGUserApi.md#createuser) | **POST** /user | Create user +[**createUsersWithArrayInput**](SWGUserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array +[**createUsersWithListInput**](SWGUserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array +[**deleteUser**](SWGUserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user +[**getUserByName**](SWGUserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name +[**loginUser**](SWGUserApi.md#loginuser) | **GET** /user/login | Logs user into the system +[**logoutUser**](SWGUserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session +[**updateUser**](SWGUserApi.md#updateuser) | **PUT** /user/{username} | Updated user + + +# **createUser** +```objc +-(NSURLSessionTask*) createUserWithUser: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Create user + +This can only be done by the logged in user. + +### Example +```objc + +SWGUser* user = [[SWGUser alloc] init]; // Created user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Create user +[apiInstance createUserWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->createUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**SWGUser***](SWGUser.md)| Created user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithArrayInput** +```objc +-(NSURLSessionTask*) createUsersWithArrayInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + + + +### Example +```objc + +NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Creates list of users with given input array +[apiInstance createUsersWithArrayInputWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->createUsersWithArrayInput: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **createUsersWithListInput** +```objc +-(NSURLSessionTask*) createUsersWithListInputWithUser: (NSArray*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Creates list of users with given input array + + + +### Example +```objc + +NSArray* user = @[[[SWGUser alloc] init]]; // List of user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Creates list of users with given input array +[apiInstance createUsersWithListInputWithUser:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->createUsersWithListInput: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user** | [**NSArray<SWGUser>***](SWGUser.md)| List of user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **deleteUser** +```objc +-(NSURLSessionTask*) deleteUserWithUsername: (NSString*) username + completionHandler: (void (^)(NSError* error)) handler; +``` + +Delete user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be deleted + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Delete user +[apiInstance deleteUserWithUsername:username + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->deleteUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **getUserByName** +```objc +-(NSURLSessionTask*) getUserByNameWithUsername: (NSString*) username + completionHandler: (void (^)(SWGUser* output, NSError* error)) handler; +``` + +Get user by user name + + + +### Example +```objc + +NSString* username = @"username_example"; // The name that needs to be fetched. Use user1 for testing. + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Get user by user name +[apiInstance getUserByNameWithUsername:username + completionHandler: ^(SWGUser* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGUserApi->getUserByName: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**SWGUser***](SWGUser.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **loginUser** +```objc +-(NSURLSessionTask*) loginUserWithUsername: (NSString*) username + password: (NSString*) password + completionHandler: (void (^)(NSString* output, NSError* error)) handler; +``` + +Logs user into the system + + + +### Example +```objc + +NSString* username = @"username_example"; // The user name for login (optional) +NSString* password = @"password_example"; // The password for login in clear text (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Logs user into the system +[apiInstance loginUserWithUsername:username + password:password + completionHandler: ^(NSString* output, NSError* error) { + if (output) { + NSLog(@"%@", output); + } + if (error) { + NSLog(@"Error calling SWGUserApi->loginUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| The user name for login | [optional] + **password** | **NSString***| The password for login in clear text | [optional] + +### Return type + +**NSString*** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **logoutUser** +```objc +-(NSURLSessionTask*) logoutUserWithCompletionHandler: + (void (^)(NSError* error)) handler; +``` + +Logs out current logged in user session + + + +### Example +```objc + + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Logs out current logged in user session +[apiInstance logoutUserWithCompletionHandler: + ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->logoutUser: %@", error); + } + }]; +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **updateUser** +```objc +-(NSURLSessionTask*) updateUserWithUsername: (NSString*) username + user: (SWGUser*) user + completionHandler: (void (^)(NSError* error)) handler; +``` + +Updated user + +This can only be done by the logged in user. + +### Example +```objc + +NSString* username = @"username_example"; // name that need to be deleted +SWGUser* user = [[SWGUser alloc] init]; // Updated user object (optional) + +SWGUserApi*apiInstance = [[SWGUserApi alloc] init]; + +// Updated user +[apiInstance updateUserWithUsername:username + user:user + completionHandler: ^(NSError* error) { + if (error) { + NSLog(@"Error calling SWGUserApi->updateUser: %@", error); + } + }]; +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **NSString***| name that need to be deleted | + **user** | [**SWGUser***](SWGUser.md)| Updated user object | [optional] + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/samples/client/petstore/objc/default/git_push.sh b/samples/client/petstore/objc/default/git_push.sh new file mode 100644 index 000000000000..f53a75d4fabe --- /dev/null +++ b/samples/client/petstore/objc/default/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https'