├── .gitignore ├── .swiftpm └── xcode │ └── package.xcworkspace │ └── contents.xcworkspacedata ├── APIClient.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── APIClient.xcscheme ├── APIClient.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Configurations ├── APIClient-Debug.xcconfig ├── APIClient-Release.xcconfig ├── APIClient-Shared.xcconfig ├── Project-Debug.xcconfig ├── Project-Release.xcconfig └── Project-Shared.xcconfig ├── Examples ├── Petstore │ ├── .gitignore │ ├── .openapi-generator-ignore │ ├── .openapi-generator │ │ └── VERSION │ ├── Cartfile │ ├── Petstore.podspec │ ├── Petstore │ │ └── Classes │ │ │ └── OpenAPIs │ │ │ ├── APIHelper.swift │ │ │ ├── APIs.swift │ │ │ ├── APIs │ │ │ ├── PetAPI.swift │ │ │ ├── StoreAPI.swift │ │ │ └── UserAPI.swift │ │ │ ├── AlamofireImplementations.swift │ │ │ ├── CodableHelper.swift │ │ │ ├── Configuration.swift │ │ │ ├── Extensions.swift │ │ │ ├── JSONEncodableEncoding.swift │ │ │ ├── JSONEncodingHelper.swift │ │ │ ├── Models.swift │ │ │ └── Models │ │ │ ├── ApiResponse.swift │ │ │ ├── Category.swift │ │ │ ├── Order.swift │ │ │ ├── Pet.swift │ │ │ ├── Tag.swift │ │ │ └── User.swift │ └── git_push.sh ├── generate.sh └── swift4 │ ├── APIHelper.mustache │ ├── APIs.mustache │ ├── AlamofireImplementations.mustache │ ├── Cartfile.mustache │ ├── CodableHelper.mustache │ ├── Configuration.mustache │ ├── Extensions.mustache │ ├── JSONEncodableEncoding.mustache │ ├── JSONEncodingHelper.mustache │ ├── Models.mustache │ ├── Podspec.mustache │ ├── README.mustache │ ├── _param.mustache │ ├── api.mustache │ ├── git_push.sh.mustache │ ├── gitignore.mustache │ ├── model.mustache │ ├── modelArray.mustache │ ├── modelEnum.mustache │ ├── modelInlineEnumDeclaration.mustache │ └── modelObject.mustache ├── LICENSE ├── Package.swift ├── Podfile ├── Podfile.lock ├── Pods ├── Local Podspecs │ └── Petstore.podspec.json ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj └── Target Support Files │ ├── Petstore │ ├── Petstore-Info.plist │ ├── Petstore-dummy.m │ ├── Petstore-prefix.pch │ ├── Petstore-umbrella.h │ ├── Petstore.modulemap │ └── Petstore.xcconfig │ ├── Pods-APIClient │ ├── Pods-APIClient-Info.plist │ ├── Pods-APIClient-acknowledgements.markdown │ ├── Pods-APIClient-acknowledgements.plist │ ├── Pods-APIClient-dummy.m │ ├── Pods-APIClient-umbrella.h │ ├── Pods-APIClient.debug.xcconfig │ ├── Pods-APIClient.modulemap │ └── Pods-APIClient.release.xcconfig │ └── Pods-APIClientTests │ ├── Pods-APIClientTests-Info.plist │ ├── Pods-APIClientTests-acknowledgements.markdown │ ├── Pods-APIClientTests-acknowledgements.plist │ ├── Pods-APIClientTests-dummy.m │ ├── Pods-APIClientTests-frameworks-Debug-input-files.xcfilelist │ ├── Pods-APIClientTests-frameworks-Debug-output-files.xcfilelist │ ├── Pods-APIClientTests-frameworks-Release-input-files.xcfilelist │ ├── Pods-APIClientTests-frameworks-Release-output-files.xcfilelist │ ├── Pods-APIClientTests-frameworks.sh │ ├── Pods-APIClientTests-umbrella.h │ ├── Pods-APIClientTests.debug.xcconfig │ ├── Pods-APIClientTests.modulemap │ └── Pods-APIClientTests.release.xcconfig ├── README.md ├── Sources ├── APIClient │ ├── APIClient.h │ ├── Authenticator.swift │ ├── Client.swift │ ├── Configuration.swift │ ├── Interceptor.swift │ ├── Request.swift │ └── Response.swift └── Info.plist └── Tests ├── APIClientTests ├── APIClientTests.swift ├── Logger.swift └── RequestProvider.swift └── Info.plist /.gitignore: -------------------------------------------------------------------------------- 1 | ### https://raw.github.com/github/gitignore/f908e51bcf38ae5ede449c55189a7b25d8c507cc/Global/macOS.gitignore 2 | 3 | # General 4 | .DS_Store 5 | .AppleDouble 6 | .LSOverride 7 | 8 | # Icon must end with two \r 9 | Icon 10 | 11 | # Thumbnails 12 | ._* 13 | 14 | # Files that might appear in the root of a volume 15 | .DocumentRevisions-V100 16 | .fseventsd 17 | .Spotlight-V100 18 | .TemporaryItems 19 | .Trashes 20 | .VolumeIcon.icns 21 | .com.apple.timemachine.donotpresent 22 | 23 | # Directories potentially created on remote AFP share 24 | .AppleDB 25 | .AppleDesktop 26 | Network Trash Folder 27 | Temporary Items 28 | .apdisk 29 | 30 | 31 | ### https://raw.github.com/github/gitignore/f908e51bcf38ae5ede449c55189a7b25d8c507cc/Swift.gitignore 32 | 33 | # Xcode 34 | # 35 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 36 | 37 | ## Build generated 38 | build/ 39 | DerivedData/ 40 | 41 | ## Various settings 42 | *.pbxuser 43 | !default.pbxuser 44 | *.mode1v3 45 | !default.mode1v3 46 | *.mode2v3 47 | !default.mode2v3 48 | *.perspectivev3 49 | !default.perspectivev3 50 | xcuserdata/ 51 | 52 | ## Other 53 | *.moved-aside 54 | *.xccheckout 55 | *.xcscmblueprint 56 | 57 | ## Obj-C/Swift specific 58 | *.hmap 59 | *.ipa 60 | *.dSYM.zip 61 | *.dSYM 62 | 63 | ## Playgrounds 64 | timeline.xctimeline 65 | playground.xcworkspace 66 | 67 | # Swift Package Manager 68 | # 69 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 70 | # Packages/ 71 | # Package.pins 72 | # Package.resolved 73 | .build/ 74 | 75 | # CocoaPods 76 | # 77 | # We recommend against adding the Pods directory to your .gitignore. However 78 | # you should judge for yourself, the pros and cons are mentioned at: 79 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 80 | # 81 | # Pods/ 82 | # 83 | # Add this line if you want to avoid checking in source code from the Xcode workspace 84 | # *.xcworkspace 85 | 86 | # Carthage 87 | # 88 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 89 | # Carthage/Checkouts 90 | 91 | Carthage/Build 92 | 93 | # fastlane 94 | # 95 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 96 | # screenshots whenever they are needed. 97 | # For more information about the recommended setup visit: 98 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 99 | 100 | fastlane/report.xml 101 | fastlane/Preview.html 102 | fastlane/screenshots/**/*.png 103 | fastlane/test_output 104 | 105 | # Code Injection 106 | # 107 | # After new code Injection tools there's a generated folder /iOSInjectionProject 108 | # https://github.com/johnno1962/injectionforxcode 109 | 110 | iOSInjectionProject/ 111 | 112 | 113 | -------------------------------------------------------------------------------- /.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /APIClient.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 51; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1463BA90223E23F800570758 /* RequestProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1463BA8F223E23F800570758 /* RequestProvider.swift */; }; 11 | 1463BA94223E262C00570758 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1463BA93223E262C00570758 /* Logger.swift */; }; 12 | 14847E602212054200478D45 /* Authenticator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14847E5F2212054200478D45 /* Authenticator.swift */; }; 13 | 14DDC19F21F4B5DD006E01E8 /* APIClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14DDC19521F4B5DD006E01E8 /* APIClient.framework */; }; 14 | 14DDC1A421F4B5DD006E01E8 /* APIClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14DDC1A321F4B5DD006E01E8 /* APIClientTests.swift */; }; 15 | 14DDC1A621F4B5DD006E01E8 /* APIClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 14DDC19821F4B5DD006E01E8 /* APIClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; 16 | 14DDC1B021F4B711006E01E8 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14DDC1AF21F4B711006E01E8 /* Client.swift */; }; 17 | 14DDC1B221F4B735006E01E8 /* Interceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14DDC1B121F4B735006E01E8 /* Interceptor.swift */; }; 18 | 14DDC1B421F4B769006E01E8 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14DDC1B321F4B769006E01E8 /* Request.swift */; }; 19 | 14DDC1B621F4B795006E01E8 /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14DDC1B521F4B795006E01E8 /* Response.swift */; }; 20 | 14E0CC8F2236C607004B1407 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14E0CC8E2236C607004B1407 /* Configuration.swift */; }; 21 | 54849B4974998EC222D926EE /* Pods_APIClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6C213BABCC3B2BE09FFECFD /* Pods_APIClientTests.framework */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXContainerItemProxy section */ 25 | 14DDC1A021F4B5DD006E01E8 /* PBXContainerItemProxy */ = { 26 | isa = PBXContainerItemProxy; 27 | containerPortal = 14DDC18C21F4B5DD006E01E8 /* Project object */; 28 | proxyType = 1; 29 | remoteGlobalIDString = 14DDC19421F4B5DD006E01E8; 30 | remoteInfo = APIClient; 31 | }; 32 | /* End PBXContainerItemProxy section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 14153249225A2AB500C74C18 /* APIClient-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "APIClient-Debug.xcconfig"; sourceTree = ""; }; 36 | 1415324A225A2AB500C74C18 /* Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Debug.xcconfig"; sourceTree = ""; }; 37 | 1415324B225A2AB500C74C18 /* APIClient-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "APIClient-Release.xcconfig"; sourceTree = ""; }; 38 | 1415324C225A2AB500C74C18 /* Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Release.xcconfig"; sourceTree = ""; }; 39 | 1415324E225A2AB500C74C18 /* Project-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Shared.xcconfig"; sourceTree = ""; }; 40 | 14153251225A2AB500C74C18 /* APIClient-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "APIClient-Shared.xcconfig"; sourceTree = ""; }; 41 | 1463BA8F223E23F800570758 /* RequestProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestProvider.swift; sourceTree = ""; }; 42 | 1463BA93223E262C00570758 /* Logger.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; }; 43 | 14847E5F2212054200478D45 /* Authenticator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Authenticator.swift; sourceTree = ""; }; 44 | 14DDC19521F4B5DD006E01E8 /* APIClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = APIClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 45 | 14DDC19821F4B5DD006E01E8 /* APIClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = APIClient.h; sourceTree = ""; }; 46 | 14DDC19921F4B5DD006E01E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 47 | 14DDC19E21F4B5DD006E01E8 /* APIClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = APIClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 48 | 14DDC1A321F4B5DD006E01E8 /* APIClientTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIClientTests.swift; sourceTree = ""; }; 49 | 14DDC1A521F4B5DD006E01E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 50 | 14DDC1AF21F4B711006E01E8 /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; 51 | 14DDC1B121F4B735006E01E8 /* Interceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Interceptor.swift; sourceTree = ""; }; 52 | 14DDC1B321F4B769006E01E8 /* Request.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = ""; }; 53 | 14DDC1B521F4B795006E01E8 /* Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Response.swift; sourceTree = ""; }; 54 | 14E0CC8E2236C607004B1407 /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; 55 | 302E53B0AF86FC2C69D769FE /* Pods-APIClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClientTests.debug.xcconfig"; path = "Target Support Files/Pods-APIClientTests/Pods-APIClientTests.debug.xcconfig"; sourceTree = ""; }; 56 | 6A9D066F7BC17CEE256AA3D8 /* Pods-APIClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClient.release.xcconfig"; path = "Target Support Files/Pods-APIClient/Pods-APIClient.release.xcconfig"; sourceTree = ""; }; 57 | AFD47B4D9F068747B95003C9 /* Pods-APIClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClient.debug.xcconfig"; path = "Target Support Files/Pods-APIClient/Pods-APIClient.debug.xcconfig"; sourceTree = ""; }; 58 | BDE650F9478F1706A1049F6D /* Pods_APIClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | C6C213BABCC3B2BE09FFECFD /* Pods_APIClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_APIClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | C95844A3A6872810B3BD654F /* Pods-APIClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-APIClientTests.release.xcconfig"; path = "Target Support Files/Pods-APIClientTests/Pods-APIClientTests.release.xcconfig"; sourceTree = ""; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 14DDC19221F4B5DD006E01E8 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | ); 69 | runOnlyForDeploymentPostprocessing = 0; 70 | }; 71 | 14DDC19B21F4B5DD006E01E8 /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 14DDC19F21F4B5DD006E01E8 /* APIClient.framework in Frameworks */, 76 | 54849B4974998EC222D926EE /* Pods_APIClientTests.framework in Frameworks */, 77 | ); 78 | runOnlyForDeploymentPostprocessing = 0; 79 | }; 80 | /* End PBXFrameworksBuildPhase section */ 81 | 82 | /* Begin PBXGroup section */ 83 | 14153248225A2A8B00C74C18 /* Configurations */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 1415324E225A2AB500C74C18 /* Project-Shared.xcconfig */, 87 | 1415324A225A2AB500C74C18 /* Project-Debug.xcconfig */, 88 | 1415324C225A2AB500C74C18 /* Project-Release.xcconfig */, 89 | 14153251225A2AB500C74C18 /* APIClient-Shared.xcconfig */, 90 | 14153249225A2AB500C74C18 /* APIClient-Debug.xcconfig */, 91 | 1415324B225A2AB500C74C18 /* APIClient-Release.xcconfig */, 92 | ); 93 | path = Configurations; 94 | sourceTree = ""; 95 | }; 96 | 14509D06239FB8B600AB69C0 /* Sources */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 14DDC19721F4B5DD006E01E8 /* APIClient */, 100 | 14DDC19921F4B5DD006E01E8 /* Info.plist */, 101 | ); 102 | path = Sources; 103 | sourceTree = ""; 104 | }; 105 | 14509D07239FB8D200AB69C0 /* Tests */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 14DDC1A221F4B5DD006E01E8 /* APIClientTests */, 109 | 14DDC1A521F4B5DD006E01E8 /* Info.plist */, 110 | ); 111 | path = Tests; 112 | sourceTree = ""; 113 | }; 114 | 14DDC18B21F4B5DD006E01E8 = { 115 | isa = PBXGroup; 116 | children = ( 117 | 14509D06239FB8B600AB69C0 /* Sources */, 118 | 14509D07239FB8D200AB69C0 /* Tests */, 119 | 14153248225A2A8B00C74C18 /* Configurations */, 120 | 14DDC19621F4B5DD006E01E8 /* Products */, 121 | 55041E2D4F9F37E8E5658B10 /* Pods */, 122 | 6F4C15C00721136277021A84 /* Frameworks */, 123 | ); 124 | sourceTree = ""; 125 | }; 126 | 14DDC19621F4B5DD006E01E8 /* Products */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 14DDC19521F4B5DD006E01E8 /* APIClient.framework */, 130 | 14DDC19E21F4B5DD006E01E8 /* APIClientTests.xctest */, 131 | ); 132 | name = Products; 133 | sourceTree = ""; 134 | }; 135 | 14DDC19721F4B5DD006E01E8 /* APIClient */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 14DDC19821F4B5DD006E01E8 /* APIClient.h */, 139 | 14DDC1AF21F4B711006E01E8 /* Client.swift */, 140 | 14E0CC8E2236C607004B1407 /* Configuration.swift */, 141 | 14DDC1B121F4B735006E01E8 /* Interceptor.swift */, 142 | 14847E5F2212054200478D45 /* Authenticator.swift */, 143 | 14DDC1B321F4B769006E01E8 /* Request.swift */, 144 | 14DDC1B521F4B795006E01E8 /* Response.swift */, 145 | ); 146 | path = APIClient; 147 | sourceTree = ""; 148 | }; 149 | 14DDC1A221F4B5DD006E01E8 /* APIClientTests */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | 14DDC1A321F4B5DD006E01E8 /* APIClientTests.swift */, 153 | 1463BA8F223E23F800570758 /* RequestProvider.swift */, 154 | 1463BA93223E262C00570758 /* Logger.swift */, 155 | ); 156 | path = APIClientTests; 157 | sourceTree = ""; 158 | }; 159 | 55041E2D4F9F37E8E5658B10 /* Pods */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | AFD47B4D9F068747B95003C9 /* Pods-APIClient.debug.xcconfig */, 163 | 6A9D066F7BC17CEE256AA3D8 /* Pods-APIClient.release.xcconfig */, 164 | 302E53B0AF86FC2C69D769FE /* Pods-APIClientTests.debug.xcconfig */, 165 | C95844A3A6872810B3BD654F /* Pods-APIClientTests.release.xcconfig */, 166 | ); 167 | path = Pods; 168 | sourceTree = ""; 169 | }; 170 | 6F4C15C00721136277021A84 /* Frameworks */ = { 171 | isa = PBXGroup; 172 | children = ( 173 | BDE650F9478F1706A1049F6D /* Pods_APIClient.framework */, 174 | C6C213BABCC3B2BE09FFECFD /* Pods_APIClientTests.framework */, 175 | ); 176 | name = Frameworks; 177 | sourceTree = ""; 178 | }; 179 | /* End PBXGroup section */ 180 | 181 | /* Begin PBXHeadersBuildPhase section */ 182 | 14DDC19021F4B5DD006E01E8 /* Headers */ = { 183 | isa = PBXHeadersBuildPhase; 184 | buildActionMask = 2147483647; 185 | files = ( 186 | 14DDC1A621F4B5DD006E01E8 /* APIClient.h in Headers */, 187 | ); 188 | runOnlyForDeploymentPostprocessing = 0; 189 | }; 190 | /* End PBXHeadersBuildPhase section */ 191 | 192 | /* Begin PBXNativeTarget section */ 193 | 14DDC19421F4B5DD006E01E8 /* APIClient */ = { 194 | isa = PBXNativeTarget; 195 | buildConfigurationList = 14DDC1A921F4B5DD006E01E8 /* Build configuration list for PBXNativeTarget "APIClient" */; 196 | buildPhases = ( 197 | 14DDC19021F4B5DD006E01E8 /* Headers */, 198 | 14DDC19121F4B5DD006E01E8 /* Sources */, 199 | 14DDC19221F4B5DD006E01E8 /* Frameworks */, 200 | 14DDC19321F4B5DD006E01E8 /* Resources */, 201 | ); 202 | buildRules = ( 203 | ); 204 | dependencies = ( 205 | ); 206 | name = APIClient; 207 | productName = APIClient; 208 | productReference = 14DDC19521F4B5DD006E01E8 /* APIClient.framework */; 209 | productType = "com.apple.product-type.framework"; 210 | }; 211 | 14DDC19D21F4B5DD006E01E8 /* APIClientTests */ = { 212 | isa = PBXNativeTarget; 213 | buildConfigurationList = 14DDC1AC21F4B5DD006E01E8 /* Build configuration list for PBXNativeTarget "APIClientTests" */; 214 | buildPhases = ( 215 | B38F147A9731AAD7E4F59CF7 /* [CP] Check Pods Manifest.lock */, 216 | 14DDC19A21F4B5DD006E01E8 /* Sources */, 217 | 14DDC19B21F4B5DD006E01E8 /* Frameworks */, 218 | 14DDC19C21F4B5DD006E01E8 /* Resources */, 219 | 5FA9B360CA638513CE483A55 /* [CP] Embed Pods Frameworks */, 220 | ); 221 | buildRules = ( 222 | ); 223 | dependencies = ( 224 | 14DDC1A121F4B5DD006E01E8 /* PBXTargetDependency */, 225 | ); 226 | name = APIClientTests; 227 | productName = APIClientTests; 228 | productReference = 14DDC19E21F4B5DD006E01E8 /* APIClientTests.xctest */; 229 | productType = "com.apple.product-type.bundle.unit-test"; 230 | }; 231 | /* End PBXNativeTarget section */ 232 | 233 | /* Begin PBXProject section */ 234 | 14DDC18C21F4B5DD006E01E8 /* Project object */ = { 235 | isa = PBXProject; 236 | attributes = { 237 | LastSwiftUpdateCheck = 1010; 238 | LastUpgradeCheck = 1010; 239 | ORGANIZATIONNAME = "Kishikawa Katsumi"; 240 | TargetAttributes = { 241 | 14DDC19421F4B5DD006E01E8 = { 242 | CreatedOnToolsVersion = 10.1; 243 | LastSwiftMigration = 1020; 244 | }; 245 | 14DDC19D21F4B5DD006E01E8 = { 246 | CreatedOnToolsVersion = 10.1; 247 | LastSwiftMigration = 1020; 248 | }; 249 | }; 250 | }; 251 | buildConfigurationList = 14DDC18F21F4B5DD006E01E8 /* Build configuration list for PBXProject "APIClient" */; 252 | compatibilityVersion = "Xcode 9.3"; 253 | developmentRegion = en; 254 | hasScannedForEncodings = 0; 255 | knownRegions = ( 256 | en, 257 | Base, 258 | ); 259 | mainGroup = 14DDC18B21F4B5DD006E01E8; 260 | productRefGroup = 14DDC19621F4B5DD006E01E8 /* Products */; 261 | projectDirPath = ""; 262 | projectRoot = ""; 263 | targets = ( 264 | 14DDC19421F4B5DD006E01E8 /* APIClient */, 265 | 14DDC19D21F4B5DD006E01E8 /* APIClientTests */, 266 | ); 267 | }; 268 | /* End PBXProject section */ 269 | 270 | /* Begin PBXResourcesBuildPhase section */ 271 | 14DDC19321F4B5DD006E01E8 /* Resources */ = { 272 | isa = PBXResourcesBuildPhase; 273 | buildActionMask = 2147483647; 274 | files = ( 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | 14DDC19C21F4B5DD006E01E8 /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | ); 283 | runOnlyForDeploymentPostprocessing = 0; 284 | }; 285 | /* End PBXResourcesBuildPhase section */ 286 | 287 | /* Begin PBXShellScriptBuildPhase section */ 288 | 5FA9B360CA638513CE483A55 /* [CP] Embed Pods Frameworks */ = { 289 | isa = PBXShellScriptBuildPhase; 290 | buildActionMask = 2147483647; 291 | files = ( 292 | ); 293 | inputFileListPaths = ( 294 | "${PODS_ROOT}/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks-${CONFIGURATION}-input-files.xcfilelist", 295 | ); 296 | name = "[CP] Embed Pods Frameworks"; 297 | outputFileListPaths = ( 298 | "${PODS_ROOT}/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks-${CONFIGURATION}-output-files.xcfilelist", 299 | ); 300 | runOnlyForDeploymentPostprocessing = 0; 301 | shellPath = /bin/sh; 302 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks.sh\"\n"; 303 | showEnvVarsInLog = 0; 304 | }; 305 | B38F147A9731AAD7E4F59CF7 /* [CP] Check Pods Manifest.lock */ = { 306 | isa = PBXShellScriptBuildPhase; 307 | buildActionMask = 2147483647; 308 | files = ( 309 | ); 310 | inputFileListPaths = ( 311 | ); 312 | inputPaths = ( 313 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 314 | "${PODS_ROOT}/Manifest.lock", 315 | ); 316 | name = "[CP] Check Pods Manifest.lock"; 317 | outputFileListPaths = ( 318 | ); 319 | outputPaths = ( 320 | "$(DERIVED_FILE_DIR)/Pods-APIClientTests-checkManifestLockResult.txt", 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | shellPath = /bin/sh; 324 | 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"; 325 | showEnvVarsInLog = 0; 326 | }; 327 | /* End PBXShellScriptBuildPhase section */ 328 | 329 | /* Begin PBXSourcesBuildPhase section */ 330 | 14DDC19121F4B5DD006E01E8 /* Sources */ = { 331 | isa = PBXSourcesBuildPhase; 332 | buildActionMask = 2147483647; 333 | files = ( 334 | 14DDC1B621F4B795006E01E8 /* Response.swift in Sources */, 335 | 14E0CC8F2236C607004B1407 /* Configuration.swift in Sources */, 336 | 14DDC1B021F4B711006E01E8 /* Client.swift in Sources */, 337 | 14DDC1B421F4B769006E01E8 /* Request.swift in Sources */, 338 | 14DDC1B221F4B735006E01E8 /* Interceptor.swift in Sources */, 339 | 14847E602212054200478D45 /* Authenticator.swift in Sources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | 14DDC19A21F4B5DD006E01E8 /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | 1463BA90223E23F800570758 /* RequestProvider.swift in Sources */, 348 | 1463BA94223E262C00570758 /* Logger.swift in Sources */, 349 | 14DDC1A421F4B5DD006E01E8 /* APIClientTests.swift in Sources */, 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | }; 353 | /* End PBXSourcesBuildPhase section */ 354 | 355 | /* Begin PBXTargetDependency section */ 356 | 14DDC1A121F4B5DD006E01E8 /* PBXTargetDependency */ = { 357 | isa = PBXTargetDependency; 358 | target = 14DDC19421F4B5DD006E01E8 /* APIClient */; 359 | targetProxy = 14DDC1A021F4B5DD006E01E8 /* PBXContainerItemProxy */; 360 | }; 361 | /* End PBXTargetDependency section */ 362 | 363 | /* Begin XCBuildConfiguration section */ 364 | 14DDC1A721F4B5DD006E01E8 /* Debug */ = { 365 | isa = XCBuildConfiguration; 366 | baseConfigurationReference = 1415324A225A2AB500C74C18 /* Project-Debug.xcconfig */; 367 | buildSettings = { 368 | }; 369 | name = Debug; 370 | }; 371 | 14DDC1A821F4B5DD006E01E8 /* Release */ = { 372 | isa = XCBuildConfiguration; 373 | baseConfigurationReference = 1415324C225A2AB500C74C18 /* Project-Release.xcconfig */; 374 | buildSettings = { 375 | }; 376 | name = Release; 377 | }; 378 | 14DDC1AA21F4B5DD006E01E8 /* Debug */ = { 379 | isa = XCBuildConfiguration; 380 | baseConfigurationReference = 14153249225A2AB500C74C18 /* APIClient-Debug.xcconfig */; 381 | buildSettings = { 382 | }; 383 | name = Debug; 384 | }; 385 | 14DDC1AB21F4B5DD006E01E8 /* Release */ = { 386 | isa = XCBuildConfiguration; 387 | baseConfigurationReference = 1415324B225A2AB500C74C18 /* APIClient-Release.xcconfig */; 388 | buildSettings = { 389 | }; 390 | name = Release; 391 | }; 392 | 14DDC1AD21F4B5DD006E01E8 /* Debug */ = { 393 | isa = XCBuildConfiguration; 394 | baseConfigurationReference = 302E53B0AF86FC2C69D769FE /* Pods-APIClientTests.debug.xcconfig */; 395 | buildSettings = { 396 | CODE_SIGN_STYLE = Automatic; 397 | DEVELOPMENT_TEAM = 27AEDK3C9F; 398 | INFOPLIST_FILE = Tests/Info.plist; 399 | LD_RUNPATH_SEARCH_PATHS = ( 400 | "$(inherited)", 401 | "@executable_path/Frameworks", 402 | "@loader_path/Frameworks", 403 | ); 404 | PRODUCT_BUNDLE_IDENTIFIER = "com.folio-sec.APIClientTests"; 405 | PRODUCT_NAME = "$(TARGET_NAME)"; 406 | SDKROOT = iphoneos; 407 | SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; 408 | SWIFT_VERSION = 5.0; 409 | TARGETED_DEVICE_FAMILY = "1,2"; 410 | }; 411 | name = Debug; 412 | }; 413 | 14DDC1AE21F4B5DD006E01E8 /* Release */ = { 414 | isa = XCBuildConfiguration; 415 | baseConfigurationReference = C95844A3A6872810B3BD654F /* Pods-APIClientTests.release.xcconfig */; 416 | buildSettings = { 417 | CODE_SIGN_STYLE = Automatic; 418 | DEVELOPMENT_TEAM = 27AEDK3C9F; 419 | INFOPLIST_FILE = Tests/Info.plist; 420 | LD_RUNPATH_SEARCH_PATHS = ( 421 | "$(inherited)", 422 | "@executable_path/Frameworks", 423 | "@loader_path/Frameworks", 424 | ); 425 | PRODUCT_BUNDLE_IDENTIFIER = "com.folio-sec.APIClientTests"; 426 | PRODUCT_NAME = "$(TARGET_NAME)"; 427 | SDKROOT = iphoneos; 428 | SUPPORTED_PLATFORMS = "iphonesimulator iphoneos"; 429 | SWIFT_VERSION = 5.0; 430 | TARGETED_DEVICE_FAMILY = "1,2"; 431 | }; 432 | name = Release; 433 | }; 434 | /* End XCBuildConfiguration section */ 435 | 436 | /* Begin XCConfigurationList section */ 437 | 14DDC18F21F4B5DD006E01E8 /* Build configuration list for PBXProject "APIClient" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | 14DDC1A721F4B5DD006E01E8 /* Debug */, 441 | 14DDC1A821F4B5DD006E01E8 /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | 14DDC1A921F4B5DD006E01E8 /* Build configuration list for PBXNativeTarget "APIClient" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | 14DDC1AA21F4B5DD006E01E8 /* Debug */, 450 | 14DDC1AB21F4B5DD006E01E8 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | 14DDC1AC21F4B5DD006E01E8 /* Build configuration list for PBXNativeTarget "APIClientTests" */ = { 456 | isa = XCConfigurationList; 457 | buildConfigurations = ( 458 | 14DDC1AD21F4B5DD006E01E8 /* Debug */, 459 | 14DDC1AE21F4B5DD006E01E8 /* Release */, 460 | ); 461 | defaultConfigurationIsVisible = 0; 462 | defaultConfigurationName = Release; 463 | }; 464 | /* End XCConfigurationList section */ 465 | }; 466 | rootObject = 14DDC18C21F4B5DD006E01E8 /* Project object */; 467 | } 468 | -------------------------------------------------------------------------------- /APIClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /APIClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /APIClient.xcodeproj/xcshareddata/xcschemes/APIClient.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 72 | 73 | 74 | 75 | 76 | 82 | 83 | 89 | 90 | 91 | 92 | 94 | 95 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /APIClient.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /APIClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Configurations/APIClient-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "APIClient-Shared.xcconfig" 2 | 3 | SWIFT_OPTIMIZATION_LEVEL = -Onone 4 | -------------------------------------------------------------------------------- /Configurations/APIClient-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "APIClient-Shared.xcconfig" 2 | -------------------------------------------------------------------------------- /Configurations/APIClient-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | APPLICATION_EXTENSION_API_ONLY = YES 2 | CLANG_ENABLE_MODULES = YES 3 | CODE_SIGN_IDENTITY = 4 | CODE_SIGN_STYLE = Automatic 5 | DEFINES_MODULE = YES 6 | DEVELOPMENT_TEAM = 27AEDK3C9F 7 | DYLIB_COMPATIBILITY_VERSION = 1 8 | DYLIB_CURRENT_VERSION = 1 9 | DYLIB_INSTALL_NAME_BASE = @rpath 10 | INFOPLIST_FILE = Sources/Info.plist 11 | INSTALL_PATH = $(LOCAL_LIBRARY_DIR)/Frameworks 12 | LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path/Frameworks @loader_path/Frameworks 13 | PRODUCT_BUNDLE_IDENTIFIER = com.folio-sec.APIClient 14 | PRODUCT_NAME = $(TARGET_NAME:c99extidentifier) 15 | SKIP_INSTALL = YES 16 | SWIFT_VERSION = 5.0 17 | 18 | SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator; 19 | TARGETED_DEVICE_FAMILY = 1,2,3,4; 20 | 21 | ENABLE_BITCODE[sdk=iphone*] = YES; 22 | ENABLE_BITCODE[sdk=watch*] = YES; 23 | ENABLE_BITCODE[sdk=appletv*] = YES; 24 | 25 | LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks; 26 | LD_RUNPATH_SEARCH_PATHS[sdk=watch*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks; 27 | LD_RUNPATH_SEARCH_PATHS[sdk=appletv*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks; 28 | LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks; 29 | -------------------------------------------------------------------------------- /Configurations/Project-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Project-Shared.xcconfig" 2 | 3 | DEBUG_INFORMATION_FORMAT = dwarf 4 | ENABLE_TESTABILITY = YES 5 | GCC_DYNAMIC_NO_PIC = NO 6 | GCC_OPTIMIZATION_LEVEL = 0 7 | GCC_PREPROCESSOR_DEFINITIONS = DEBUG=1 $(inherited) 8 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE 9 | ONLY_ACTIVE_ARCH = YES 10 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG 11 | SWIFT_OPTIMIZATION_LEVEL = -Onone 12 | -------------------------------------------------------------------------------- /Configurations/Project-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Project-Shared.xcconfig" 2 | 3 | DEBUG_INFORMATION_FORMAT = dwarf-with-dsym 4 | ENABLE_NS_ASSERTIONS = NO 5 | MTL_ENABLE_DEBUG_INFO = NO 6 | SWIFT_COMPILATION_MODE = wholemodule 7 | SWIFT_OPTIMIZATION_LEVEL = -O 8 | VALIDATE_PRODUCT = YES 9 | -------------------------------------------------------------------------------- /Configurations/Project-Shared.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_SEARCH_USER_PATHS = NO 2 | CLANG_ANALYZER_NONNULL = YES 3 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE 4 | CLANG_CXX_LANGUAGE_STANDARD = gnu++14 5 | CLANG_CXX_LIBRARY = libc++ 6 | CLANG_ENABLE_MODULES = YES 7 | CLANG_ENABLE_OBJC_ARC = YES 8 | CLANG_ENABLE_OBJC_WEAK = YES 9 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 10 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES 11 | CLANG_WARN_BOOL_CONVERSION = YES 12 | CLANG_WARN_COMMA = YES 13 | CLANG_WARN_CONSTANT_CONVERSION = YES 14 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES 15 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR 16 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES 17 | CLANG_WARN_EMPTY_BODY = YES 18 | CLANG_WARN_ENUM_CONVERSION = YES 19 | CLANG_WARN_INFINITE_RECURSION = YES 20 | CLANG_WARN_INT_CONVERSION = YES 21 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES 22 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 23 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES 24 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR 25 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES 26 | CLANG_WARN_STRICT_PROTOTYPES = YES 27 | CLANG_WARN_SUSPICIOUS_MOVE = YES 28 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 29 | CLANG_WARN_UNREACHABLE_CODE = YES 30 | CODE_SIGN_IDENTITY = iPhone Developer 31 | COPY_PHASE_STRIP = NO 32 | CURRENT_PROJECT_VERSION = 1 33 | ENABLE_STRICT_OBJC_MSGSEND = YES 34 | GCC_C_LANGUAGE_STANDARD = gnu11 35 | GCC_NO_COMMON_BLOCKS = YES 36 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES 37 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR 38 | GCC_WARN_UNDECLARED_SELECTOR = YES 39 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE 40 | GCC_WARN_UNUSED_FUNCTION = YES 41 | GCC_WARN_UNUSED_VARIABLE = YES 42 | 43 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 44 | WATCHOS_DEPLOYMENT_TARGET = 3.0; 45 | TVOS_DEPLOYMENT_TARGET = 10.0; 46 | MACOSX_DEPLOYMENT_TARGET = 10.13; 47 | 48 | MTL_FAST_MATH = YES 49 | VERSION_INFO_PREFIX = 50 | VERSIONING_SYSTEM = apple-generic 51 | -------------------------------------------------------------------------------- /Examples/Petstore/.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | -------------------------------------------------------------------------------- /Examples/Petstore/.openapi-generator-ignore: -------------------------------------------------------------------------------- 1 | # OpenAPI Generator Ignore 2 | # Generated by openapi-generator https://github.com/openapitools/openapi-generator 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /Examples/Petstore/.openapi-generator/VERSION: -------------------------------------------------------------------------------- 1 | 3.3.4 -------------------------------------------------------------------------------- /Examples/Petstore/Cartfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Cartfile -------------------------------------------------------------------------------- /Examples/Petstore/Petstore.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'Petstore' 3 | s.ios.deployment_target = '9.0' 4 | s.osx.deployment_target = '10.11' 5 | s.tvos.deployment_target = '9.0' 6 | s.version = '0.0.1' 7 | s.source = { :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' } 8 | s.authors = 'OpenAPI Generator' 9 | s.license = 'Proprietary' 10 | s.homepage = 'https://github.com/folio-sec/APIClient' 11 | s.summary = 'Swagger Petstore' 12 | s.source_files = ['Petstore/Classes/**/APIs.swift', 'Petstore/Classes/**/APIs/*.swift', 'Petstore/Classes/**/Models/*.swift'] 13 | end 14 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/APIHelper.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/APIHelper.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/APIs.swift: -------------------------------------------------------------------------------- 1 | // APIs.swift 2 | // 3 | // Generated by swagger-codegen 4 | // https://github.com/swagger-api/swagger-codegen 5 | // 6 | 7 | import Foundation 8 | 9 | public struct RequestProvider { 10 | public let endpoint: String 11 | public let method: String 12 | public let parameters: Parameters? 13 | public let headers: [String : String] 14 | 15 | public init(endpoint: String, method: String, parameters: Parameters? = nil, headers: [String : String] = [:]) { 16 | self.endpoint = endpoint 17 | self.method = method 18 | self.parameters = parameters 19 | self.headers = headers 20 | } 21 | 22 | public enum Parameters { 23 | case query([String: Any?]) 24 | case form([String: String?]) 25 | case json(AnyEncodable) 26 | 27 | public init(_ raw: [String: Any?]) { 28 | self = .query(raw) 29 | } 30 | 31 | public init(_ raw: [String: String?]) { 32 | self = .form(raw) 33 | } 34 | 35 | public init(_ raw: T) { 36 | self = .json(AnyEncodable(raw)) 37 | } 38 | } 39 | 40 | public struct AnyEncodable: Encodable { 41 | var encode: (Encoder) throws -> Void 42 | 43 | init(_ encodable: Encodable) { 44 | func encode(to encoder: Encoder) throws { 45 | try encodable.encode(to: encoder) 46 | } 47 | self.encode = encode 48 | } 49 | 50 | public func encode(to encoder: Encoder) throws { 51 | try encode(encoder) 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/APIs/PetAPI.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PetAPI.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | open class PetAPI { 12 | /** 13 | Add a new pet to the store 14 | - POST /pet 15 | - OAuth: 16 | - type: oauth2 17 | - name: petstore_auth 18 | - parameter pet: (body) Pet object that needs to be added to the store 19 | - returns: RequestProvider 20 | */ 21 | open class func addPet(pet: Pet) -> RequestProvider { 22 | let path = "/pet" 23 | let parameters = pet 24 | 25 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 26 | } 27 | 28 | /** 29 | Deletes a pet 30 | - DELETE /pet/{petId} 31 | - OAuth: 32 | - type: oauth2 33 | - name: petstore_auth 34 | - parameter petId: (path) Pet id to delete 35 | - parameter apiKey: (header) (optional) 36 | - returns: RequestProvider 37 | */ 38 | open class func deletePet(petId: Int64, apiKey: String? = nil) -> RequestProvider { 39 | var path = "/pet/{petId}" 40 | let petIdPreEscape = "\(petId)" 41 | let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 42 | path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) 43 | 44 | return RequestProvider(endpoint: path, method: "DELETE") 45 | } 46 | 47 | /** 48 | Finds Pets by status 49 | - GET /pet/findByStatus 50 | - Multiple status values can be provided with comma separated strings 51 | - OAuth: 52 | - type: oauth2 53 | - name: petstore_auth 54 | - parameter status: (query) Status values that need to be considered for filter 55 | - returns: RequestProvider<[Pet]> 56 | */ 57 | open class func findPetsByStatus(status: [String]) -> RequestProvider<[Pet]> { 58 | let path = "/pet/findByStatus" 59 | 60 | let parameters: [String: Any?] = [ 61 | "status": status 62 | ] 63 | return RequestProvider<[Pet]>(endpoint: path, method: "GET", parameters: RequestProvider.Parameters(parameters)) 64 | } 65 | 66 | /** 67 | Finds Pets by tags 68 | - GET /pet/findByTags 69 | - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. 70 | - OAuth: 71 | - type: oauth2 72 | - name: petstore_auth 73 | - parameter tags: (query) Tags to filter by 74 | - returns: RequestProvider<[Pet]> 75 | */ 76 | open class func findPetsByTags(tags: [String]) -> RequestProvider<[Pet]> { 77 | let path = "/pet/findByTags" 78 | 79 | let parameters: [String: Any?] = [ 80 | "tags": tags 81 | ] 82 | return RequestProvider<[Pet]>(endpoint: path, method: "GET", parameters: RequestProvider.Parameters(parameters)) 83 | } 84 | 85 | /** 86 | Find pet by ID 87 | - GET /pet/{petId} 88 | - Returns a single pet 89 | - API Key: 90 | - type: apiKey api_key 91 | - name: api_key 92 | - parameter petId: (path) ID of pet to return 93 | - returns: RequestProvider 94 | */ 95 | open class func getPetById(petId: Int64) -> RequestProvider { 96 | var path = "/pet/{petId}" 97 | let petIdPreEscape = "\(petId)" 98 | let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 99 | path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) 100 | 101 | return RequestProvider(endpoint: path, method: "GET") 102 | } 103 | 104 | /** 105 | Update an existing pet 106 | - PUT /pet 107 | - OAuth: 108 | - type: oauth2 109 | - name: petstore_auth 110 | - parameter pet: (body) Pet object that needs to be added to the store 111 | - returns: RequestProvider 112 | */ 113 | open class func updatePet(pet: Pet) -> RequestProvider { 114 | let path = "/pet" 115 | let parameters = pet 116 | 117 | return RequestProvider(endpoint: path, method: "PUT", parameters: RequestProvider.Parameters(parameters)) 118 | } 119 | 120 | /** 121 | Updates a pet in the store with form data 122 | - POST /pet/{petId} 123 | - OAuth: 124 | - type: oauth2 125 | - name: petstore_auth 126 | - parameter petId: (path) ID of pet that needs to be updated 127 | - parameter name: (form) Updated name of the pet (optional) 128 | - parameter status: (form) Updated status of the pet (optional) 129 | - returns: RequestProvider 130 | */ 131 | open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> RequestProvider { 132 | var path = "/pet/{petId}" 133 | let petIdPreEscape = "\(petId)" 134 | let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 135 | path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) 136 | let parameters: [String: String?] = [ 137 | "name": name?.description, 138 | "status": status?.description 139 | ] 140 | 141 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 142 | } 143 | 144 | /** 145 | uploads an image 146 | - POST /pet/{petId}/uploadImage 147 | - OAuth: 148 | - type: oauth2 149 | - name: petstore_auth 150 | - parameter petId: (path) ID of pet to update 151 | - parameter additionalMetadata: (form) Additional data to pass to server (optional) 152 | - parameter file: (form) file to upload (optional) 153 | - returns: RequestProvider 154 | */ 155 | open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestProvider { 156 | var path = "/pet/{petId}/uploadImage" 157 | let petIdPreEscape = "\(petId)" 158 | let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 159 | path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) 160 | let parameters: [String: String?] = [ 161 | "additionalMetadata": additionalMetadata?.description, 162 | "file": file?.description 163 | ] 164 | 165 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/APIs/StoreAPI.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StoreAPI.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | open class StoreAPI { 12 | /** 13 | Delete purchase order by ID 14 | - DELETE /store/order/{orderId} 15 | - For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors 16 | - parameter orderId: (path) ID of the order that needs to be deleted 17 | - returns: RequestProvider 18 | */ 19 | open class func deleteOrder(orderId: Int64) -> RequestProvider { 20 | var path = "/store/order/{orderId}" 21 | let orderIdPreEscape = "\(orderId)" 22 | let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 23 | path = path.replacingOccurrences(of: "{orderId}", with: orderIdPostEscape, options: .literal, range: nil) 24 | 25 | return RequestProvider(endpoint: path, method: "DELETE") 26 | } 27 | 28 | /** 29 | Returns pet inventories by status 30 | - GET /store/inventory 31 | - Returns a map of status codes to quantities 32 | - API Key: 33 | - type: apiKey api_key 34 | - name: api_key 35 | - returns: RequestProvider<[String:Int]> 36 | */ 37 | open class func getInventory() -> RequestProvider<[String:Int]> { 38 | let path = "/store/inventory" 39 | 40 | return RequestProvider<[String:Int]>(endpoint: path, method: "GET") 41 | } 42 | 43 | /** 44 | Find purchase order by ID 45 | - GET /store/order/{orderId} 46 | - For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions 47 | - parameter orderId: (path) ID of pet that needs to be fetched 48 | - returns: RequestProvider 49 | */ 50 | open class func getOrderById(orderId: Int64) -> RequestProvider { 51 | var path = "/store/order/{orderId}" 52 | let orderIdPreEscape = "\(orderId)" 53 | let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 54 | path = path.replacingOccurrences(of: "{orderId}", with: orderIdPostEscape, options: .literal, range: nil) 55 | 56 | return RequestProvider(endpoint: path, method: "GET") 57 | } 58 | 59 | /** 60 | Place an order for a pet 61 | - POST /store/order 62 | - parameter order: (body) order placed for purchasing the pet 63 | - returns: RequestProvider 64 | */ 65 | open class func placeOrder(order: Order) -> RequestProvider { 66 | let path = "/store/order" 67 | let parameters = order 68 | 69 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/APIs/UserAPI.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UserAPI.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | open class UserAPI { 12 | /** 13 | Create user 14 | - POST /user 15 | - This can only be done by the logged in user. 16 | - parameter user: (body) Created user object 17 | - returns: RequestProvider 18 | */ 19 | open class func createUser(user: User) -> RequestProvider { 20 | let path = "/user" 21 | let parameters = user 22 | 23 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 24 | } 25 | 26 | /** 27 | Creates list of users with given input array 28 | - POST /user/createWithArray 29 | - parameter user: (body) List of user object 30 | - returns: RequestProvider 31 | */ 32 | open class func createUsersWithArrayInput(user: [User]) -> RequestProvider { 33 | let path = "/user/createWithArray" 34 | let parameters = user 35 | 36 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 37 | } 38 | 39 | /** 40 | Creates list of users with given input array 41 | - POST /user/createWithList 42 | - parameter user: (body) List of user object 43 | - returns: RequestProvider 44 | */ 45 | open class func createUsersWithListInput(user: [User]) -> RequestProvider { 46 | let path = "/user/createWithList" 47 | let parameters = user 48 | 49 | return RequestProvider(endpoint: path, method: "POST", parameters: RequestProvider.Parameters(parameters)) 50 | } 51 | 52 | /** 53 | Delete user 54 | - DELETE /user/{username} 55 | - This can only be done by the logged in user. 56 | - parameter username: (path) The name that needs to be deleted 57 | - returns: RequestProvider 58 | */ 59 | open class func deleteUser(username: String) -> RequestProvider { 60 | var path = "/user/{username}" 61 | let usernamePreEscape = "\(username)" 62 | let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 63 | path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) 64 | 65 | return RequestProvider(endpoint: path, method: "DELETE") 66 | } 67 | 68 | /** 69 | Get user by user name 70 | - GET /user/{username} 71 | - parameter username: (path) The name that needs to be fetched. Use user1 for testing. 72 | - returns: RequestProvider 73 | */ 74 | open class func getUserByName(username: String) -> RequestProvider { 75 | var path = "/user/{username}" 76 | let usernamePreEscape = "\(username)" 77 | let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 78 | path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) 79 | 80 | return RequestProvider(endpoint: path, method: "GET") 81 | } 82 | 83 | /** 84 | Logs user into the system 85 | - GET /user/login 86 | - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] 87 | - parameter username: (query) The user name for login 88 | - parameter password: (query) The password for login in clear text 89 | - returns: RequestProvider 90 | */ 91 | open class func loginUser(username: String, password: String) -> RequestProvider { 92 | let path = "/user/login" 93 | 94 | let parameters: [String: Any?] = [ 95 | "username": username, 96 | "password": password 97 | ] 98 | return RequestProvider(endpoint: path, method: "GET", parameters: RequestProvider.Parameters(parameters)) 99 | } 100 | 101 | /** 102 | Logs out current logged in user session 103 | - GET /user/logout 104 | - returns: RequestProvider 105 | */ 106 | open class func logoutUser() -> RequestProvider { 107 | let path = "/user/logout" 108 | 109 | return RequestProvider(endpoint: path, method: "GET") 110 | } 111 | 112 | /** 113 | Updated user 114 | - PUT /user/{username} 115 | - This can only be done by the logged in user. 116 | - parameter username: (path) name that need to be updated 117 | - parameter user: (body) Updated user object 118 | - returns: RequestProvider 119 | */ 120 | open class func updateUser(username: String, user: User) -> RequestProvider { 121 | var path = "/user/{username}" 122 | let usernamePreEscape = "\(username)" 123 | let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 124 | path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) 125 | let parameters = user 126 | 127 | return RequestProvider(endpoint: path, method: "PUT", parameters: RequestProvider.Parameters(parameters)) 128 | } 129 | 130 | } 131 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/AlamofireImplementations.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/AlamofireImplementations.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/CodableHelper.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/CodableHelper.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Configuration.swift: -------------------------------------------------------------------------------- 1 | // Configuration.swift 2 | // 3 | // Generated by openapi-generator 4 | // https://openapi-generator.tech 5 | // 6 | 7 | import Foundation 8 | 9 | open class Configuration { 10 | 11 | // This value is used to configure the date formatter that is used to serialize dates into JSON format. 12 | // You must set it prior to encoding any dates, and it will only be read once. 13 | public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" 14 | 15 | } -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Extensions.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/Extensions.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/JSONEncodableEncoding.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/JSONEncodableEncoding.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/JSONEncodingHelper.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/JSONEncodingHelper.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models.swift: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/Petstore/Petstore/Classes/OpenAPIs/Models.swift -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models/ApiResponse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ApiResponse.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public struct ApiResponse: Codable, Hashable { 13 | 14 | public var code: Int? 15 | public var type: String? 16 | public var message: String? 17 | 18 | public init(code: Int?, type: String?, message: String?) { 19 | self.code = code 20 | self.type = type 21 | self.message = message 22 | } 23 | 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models/Category.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Category.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public struct Category: Codable, Hashable { 13 | 14 | public var _id: Int64? 15 | public var name: String? 16 | 17 | public init(_id: Int64?, name: String?) { 18 | self._id = _id 19 | self.name = name 20 | } 21 | 22 | public enum CodingKeys: String, CodingKey { 23 | case _id = "id" 24 | case name 25 | } 26 | 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models/Order.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Order.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public struct Order: Codable, Hashable { 13 | 14 | public enum Status: String, Codable { 15 | case placed = "placed" 16 | case approved = "approved" 17 | case delivered = "delivered" 18 | } 19 | public var _id: Int64? 20 | public var petId: Int64? 21 | public var quantity: Int? 22 | public var shipDate: Date? 23 | /** Order Status */ 24 | public var status: Status? 25 | public var complete: Bool? = false 26 | 27 | public init(_id: Int64?, petId: Int64?, quantity: Int?, shipDate: Date?, status: Status?, complete: Bool?) { 28 | self._id = _id 29 | self.petId = petId 30 | self.quantity = quantity 31 | self.shipDate = shipDate 32 | self.status = status 33 | self.complete = complete 34 | } 35 | 36 | public enum CodingKeys: String, CodingKey { 37 | case _id = "id" 38 | case petId 39 | case quantity 40 | case shipDate 41 | case status 42 | case complete 43 | } 44 | 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models/Pet.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Pet.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public struct Pet: Codable, Hashable { 13 | 14 | public enum Status: String, Codable { 15 | case available = "available" 16 | case pending = "pending" 17 | case sold = "sold" 18 | } 19 | public var _id: Int64? 20 | public var category: Category? 21 | public var name: String 22 | public var photoUrls: [String] 23 | public var tags: [Tag]? 24 | /** pet status in the store */ 25 | public var status: Status? 26 | 27 | public init(_id: Int64?, category: Category?, name: String, photoUrls: [String], tags: [Tag]?, status: Status?) { 28 | self._id = _id 29 | self.category = category 30 | self.name = name 31 | self.photoUrls = photoUrls 32 | self.tags = tags 33 | self.status = status 34 | } 35 | 36 | public enum CodingKeys: String, CodingKey { 37 | case _id = "id" 38 | case category 39 | case name 40 | case photoUrls 41 | case tags 42 | case status 43 | } 44 | 45 | 46 | } 47 | 48 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models/Tag.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tag.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public struct Tag: Codable, Hashable { 13 | 14 | public var _id: Int64? 15 | public var name: String? 16 | 17 | public init(_id: Int64?, name: String?) { 18 | self._id = _id 19 | self.name = name 20 | } 21 | 22 | public enum CodingKeys: String, CodingKey { 23 | case _id = "id" 24 | case name 25 | } 26 | 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Examples/Petstore/Petstore/Classes/OpenAPIs/Models/User.swift: -------------------------------------------------------------------------------- 1 | // 2 | // User.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | 11 | 12 | public struct User: Codable, Hashable { 13 | 14 | public var _id: Int64? 15 | public var username: String? 16 | public var firstName: String? 17 | public var lastName: String? 18 | public var email: String? 19 | public var password: String? 20 | public var phone: String? 21 | /** User Status */ 22 | public var userStatus: Int? 23 | 24 | public init(_id: Int64?, username: String?, firstName: String?, lastName: String?, email: String?, password: String?, phone: String?, userStatus: Int?) { 25 | self._id = _id 26 | self.username = username 27 | self.firstName = firstName 28 | self.lastName = lastName 29 | self.email = email 30 | self.password = password 31 | self.phone = phone 32 | self.userStatus = userStatus 33 | } 34 | 35 | public enum CodingKeys: String, CodingKey { 36 | case _id = "id" 37 | case username 38 | case firstName 39 | case lastName 40 | case email 41 | case password 42 | case phone 43 | case userStatus 44 | } 45 | 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /Examples/Petstore/git_push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | 10 | if [ "$git_user_id" = "" ]; then 11 | git_user_id="GIT_USER_ID" 12 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 13 | fi 14 | 15 | if [ "$git_repo_id" = "" ]; then 16 | git_repo_id="GIT_REPO_ID" 17 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 18 | fi 19 | 20 | if [ "$release_note" = "" ]; then 21 | release_note="Minor update" 22 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 23 | fi 24 | 25 | # Initialize the local directory as a Git repository 26 | git init 27 | 28 | # Adds the files in the local repository and stages them for commit. 29 | git add . 30 | 31 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 32 | git commit -m "$release_note" 33 | 34 | # Sets the new remote 35 | git_remote=`git remote` 36 | if [ "$git_remote" = "" ]; then # git remote not defined 37 | 38 | if [ "$GIT_TOKEN" = "" ]; then 39 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 40 | git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git 41 | else 42 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 43 | fi 44 | 45 | fi 46 | 47 | git pull origin master 48 | 49 | # Pushes (Forces) the changes in the local repository up to the remote repository 50 | echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" 51 | git push origin master 2>&1 | grep -v 'To https' 52 | 53 | -------------------------------------------------------------------------------- /Examples/generate.sh: -------------------------------------------------------------------------------- 1 | openapi-generator generate \ 2 | -i https://petstore.swagger.io/v2/swagger.json \ 3 | -g swift4 --additional-properties projectName=Petstore \ 4 | --additional-properties podSummary='Swagger Petstore' \ 5 | --additional-properties podHomepage=https://github.com/folio-sec/APIClient \ 6 | -o ./Petstore \ 7 | -t ./swift4 8 | -------------------------------------------------------------------------------- /Examples/swift4/APIHelper.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/APIHelper.mustache -------------------------------------------------------------------------------- /Examples/swift4/APIs.mustache: -------------------------------------------------------------------------------- 1 | // APIs.swift 2 | // 3 | // Generated by swagger-codegen 4 | // https://github.com/swagger-api/swagger-codegen 5 | // 6 | 7 | import Foundation 8 | 9 | public struct RequestProvider { 10 | public let endpoint: String 11 | public let method: String 12 | public let parameters: Parameters? 13 | public let headers: [String : String] 14 | 15 | public init(endpoint: String, method: String, parameters: Parameters? = nil, headers: [String : String] = [:]) { 16 | self.endpoint = endpoint 17 | self.method = method 18 | self.parameters = parameters 19 | self.headers = headers 20 | } 21 | 22 | public enum Parameters { 23 | case query([String: Any?]) 24 | case form([String: String?]) 25 | case multipart([String: Any?]) 26 | case json(AnyEncodable) 27 | 28 | public init(_ raw: [String: Any?]) { 29 | self = .query(raw) 30 | } 31 | 32 | public init(_ raw: [String: String?]) { 33 | self = .form(raw) 34 | } 35 | 36 | public init(_ raw: T) { 37 | self = .json(AnyEncodable(raw)) 38 | } 39 | } 40 | 41 | public struct AnyEncodable: Encodable { 42 | var encode: (Encoder) throws -> Void 43 | 44 | init(_ encodable: Encodable) { 45 | func encode(to encoder: Encoder) throws { 46 | try encodable.encode(to: encoder) 47 | } 48 | self.encode = encode 49 | } 50 | 51 | public func encode(to encoder: Encoder) throws { 52 | try encode(encoder) 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Examples/swift4/AlamofireImplementations.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/AlamofireImplementations.mustache -------------------------------------------------------------------------------- /Examples/swift4/Cartfile.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/Cartfile.mustache -------------------------------------------------------------------------------- /Examples/swift4/CodableHelper.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/CodableHelper.mustache -------------------------------------------------------------------------------- /Examples/swift4/Configuration.mustache: -------------------------------------------------------------------------------- 1 | // Configuration.swift 2 | // 3 | // Generated by openapi-generator 4 | // https://openapi-generator.tech 5 | // 6 | 7 | import Foundation 8 | 9 | open class Configuration { 10 | 11 | // This value is used to configure the date formatter that is used to serialize dates into JSON format. 12 | // You must set it prior to encoding any dates, and it will only be read once. 13 | public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" 14 | 15 | } -------------------------------------------------------------------------------- /Examples/swift4/Extensions.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/Extensions.mustache -------------------------------------------------------------------------------- /Examples/swift4/JSONEncodableEncoding.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/JSONEncodableEncoding.mustache -------------------------------------------------------------------------------- /Examples/swift4/JSONEncodingHelper.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/JSONEncodingHelper.mustache -------------------------------------------------------------------------------- /Examples/swift4/Models.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/Models.mustache -------------------------------------------------------------------------------- /Examples/swift4/Podspec.mustache: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = '{{projectName}}'{{#projectDescription}} 3 | s.summary = '{{projectDescription}}'{{/projectDescription}} 4 | s.ios.deployment_target = '9.0' 5 | s.osx.deployment_target = '10.11' 6 | s.tvos.deployment_target = '9.0' 7 | s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' 8 | s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:openapitools/openapi-generator.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}} 9 | s.authors = '{{podAuthors}}'{{/podAuthors}}{{#podSocialMediaURL}} 10 | s.social_media_url = '{{podSocialMediaURL}}'{{/podSocialMediaURL}}{{#podDocsetURL}} 11 | s.docset_url = '{{podDocsetURL}}'{{/podDocsetURL}} 12 | s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}}{{#podHomepage}} 13 | s.homepage = '{{podHomepage}}'{{/podHomepage}}{{#podSummary}} 14 | s.summary = '{{podSummary}}'{{/podSummary}}{{#podDescription}} 15 | s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}} 16 | s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}} 17 | s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}} 18 | s.source_files = ['{{projectName}}/Classes/**/APIs.swift', '{{projectName}}/Classes/**/APIs/*.swift', '{{projectName}}/Classes/**/Models/*.swift'] 19 | end 20 | -------------------------------------------------------------------------------- /Examples/swift4/README.mustache: -------------------------------------------------------------------------------- 1 | # Swift4 API client for {{packageName}} 2 | 3 | {{#appDescription}} 4 | {{{appDescription}}} 5 | {{/appDescription}} 6 | 7 | ## Overview 8 | This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec from a remote server, you can easily generate an API client. 9 | 10 | - API version: {{appVersion}} 11 | - Package version: {{packageVersion}} 12 | {{^hideGenerationTimestamp}} 13 | - Build date: {{generatedDate}} 14 | {{/hideGenerationTimestamp}} 15 | - Build package: {{generatorClass}} 16 | {{#infoUrl}} 17 | For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) 18 | {{/infoUrl}} 19 | 20 | ## Installation 21 | Put the package under your project folder and add the following in import: 22 | ``` 23 | "./{{packageName}}" 24 | ``` 25 | 26 | ## Documentation for API Endpoints 27 | 28 | All URIs are relative to *{{basePath}}* 29 | 30 | Class | Method | HTTP request | Description 31 | ------------ | ------------- | ------------- | ------------- 32 | {{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} 33 | {{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} 34 | 35 | ## Documentation For Models 36 | 37 | {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) 38 | {{/model}}{{/models}} 39 | 40 | ## Documentation For Authorization 41 | 42 | {{^authMethods}} All endpoints do not require authorization. 43 | {{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} 44 | {{#authMethods}}## {{{name}}} 45 | 46 | {{#isApiKey}}- **Type**: API key 47 | - **API key parameter name**: {{{keyParamName}}} 48 | - **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} 49 | {{/isApiKey}} 50 | {{#isBasic}}- **Type**: HTTP basic authentication 51 | {{/isBasic}} 52 | {{#isOAuth}}- **Type**: OAuth 53 | - **Flow**: {{{flow}}} 54 | - **Authorization URL**: {{{authorizationUrl}}} 55 | - **Scopes**: {{^scopes}}N/A{{/scopes}} 56 | {{#scopes}} - **{{{scope}}}**: {{{description}}} 57 | {{/scopes}} 58 | {{/isOAuth}} 59 | 60 | {{/authMethods}} 61 | 62 | ## Author 63 | 64 | {{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} 65 | {{/hasMore}}{{/apis}}{{/apiInfo}} 66 | -------------------------------------------------------------------------------- /Examples/swift4/_param.mustache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/folio-sec/APIClient/16100d01eda0b16ff953e84d01d693b308906fbb/Examples/swift4/_param.mustache -------------------------------------------------------------------------------- /Examples/swift4/api.mustache: -------------------------------------------------------------------------------- 1 | {{#operations}}// 2 | // {{classname}}.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | {{#swiftUseApiNamespace}} 10 | extension {{projectName}}API { 11 | {{/swiftUseApiNamespace}} 12 | 13 | {{#description}} 14 | /** {{description}} */{{/description}} 15 | open class {{classname}} { 16 | {{#operation}} 17 | /** 18 | {{#summary}} 19 | {{{summary}}} 20 | {{/summary}} 21 | - {{httpMethod}} {{{path}}}{{#notes}} 22 | - {{{notes}}}{{/notes}}{{#subresourceOperation}} 23 | - subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}} 24 | - defaultResponse: {{defaultResponse}}{{/defaultResponse}} 25 | {{#authMethods}} 26 | - {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}: 27 | - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}} 28 | - name: {{name}} 29 | {{/authMethods}} 30 | {{#hasResponseHeaders}} 31 | - responseHeaders: [{{#responseHeaders}}{{{baseName}}}({{{dataType}}}){{^-last}}, {{/-last}}{{/responseHeaders}}] 32 | {{/hasResponseHeaders}} 33 | {{#externalDocs}} 34 | - externalDocs: {{externalDocs}} 35 | {{/externalDocs}} 36 | {{#allParams}} 37 | - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}} 38 | {{/allParams}} 39 | - returns: RequestProvider<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} 40 | */ 41 | open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestProvider<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { 42 | {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} 43 | let {{paramName}}PreEscape = "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})" 44 | let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 45 | path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}} 46 | {{#bodyParam}} 47 | let parameters = {{paramName}} 48 | {{/bodyParam}} 49 | {{^bodyParam}} 50 | {{#hasFormParams}} 51 | let parameters: [String: {{#isMultipart}}Any?{{/isMultipart}}{{^isMultipart}}String?{{/isMultipart}}] = [ 52 | {{#formParams}} 53 | "{{baseName}}": {{paramName}}{{^required}}?{{/required}}{{^isMultipart}}.description{{/isMultipart}}{{#hasMore}},{{/hasMore}} 54 | {{/formParams}} 55 | ] 56 | {{/hasFormParams}} 57 | {{/bodyParam}}{{#hasQueryParams}} 58 | let parameters: [String: Any?] = [ 59 | {{#queryParams}} 60 | "{{baseName}}": {{paramName}}{{#hasMore}}, {{/hasMore}} 61 | {{/queryParams}} 62 | ]{{/hasQueryParams}} 63 | return RequestProvider<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>(endpoint: path, method: "{{httpMethod}}"{{#bodyParam}}, parameters: RequestProvider.Parameters(parameters){{/bodyParam}}{{^bodyParam}}{{#hasFormParams}}, parameters: {{#isMultipart}}RequestProvider.Parameters.multipart(parameters){{/isMultipart}}{{^isMultipart}}RequestProvider.Parameters(parameters){{/isMultipart}}{{/hasFormParams}}{{/bodyParam}}{{#hasQueryParams}}, parameters: RequestProvider.Parameters(parameters){{/hasQueryParams}}) 64 | } 65 | 66 | {{/operation}} 67 | } 68 | {{#swiftUseApiNamespace}} 69 | } 70 | {{/swiftUseApiNamespace}} 71 | {{/operations}} 72 | -------------------------------------------------------------------------------- /Examples/swift4/git_push.sh.mustache: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ 3 | # 4 | # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" 5 | 6 | git_user_id=$1 7 | git_repo_id=$2 8 | release_note=$3 9 | 10 | if [ "$git_user_id" = "" ]; then 11 | git_user_id="{{{gitUserId}}}" 12 | echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" 13 | fi 14 | 15 | if [ "$git_repo_id" = "" ]; then 16 | git_repo_id="{{{gitRepoId}}}" 17 | echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" 18 | fi 19 | 20 | if [ "$release_note" = "" ]; then 21 | release_note="{{{releaseNote}}}" 22 | echo "[INFO] No command line input provided. Set \$release_note to $release_note" 23 | fi 24 | 25 | # Initialize the local directory as a Git repository 26 | git init 27 | 28 | # Adds the files in the local repository and stages them for commit. 29 | git add . 30 | 31 | # Commits the tracked changes and prepares them to be pushed to a remote repository. 32 | git commit -m "$release_note" 33 | 34 | # Sets the new remote 35 | git_remote=`git remote` 36 | if [ "$git_remote" = "" ]; then # git remote not defined 37 | 38 | if [ "$GIT_TOKEN" = "" ]; then 39 | echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." 40 | git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git 41 | else 42 | git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git 43 | fi 44 | 45 | fi 46 | 47 | git pull origin master 48 | 49 | # Pushes (Forces) the changes in the local repository up to the remote repository 50 | echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" 51 | git push origin master 2>&1 | grep -v 'To https' 52 | 53 | -------------------------------------------------------------------------------- /Examples/swift4/gitignore.mustache: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | ## Playgrounds 31 | timeline.xctimeline 32 | playground.xcworkspace 33 | 34 | # Swift Package Manager 35 | # 36 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 37 | # Packages/ 38 | .build/ 39 | 40 | # CocoaPods 41 | # 42 | # We recommend against adding the Pods directory to your .gitignore. However 43 | # you should judge for yourself, the pros and cons are mentioned at: 44 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 45 | # 46 | # Pods/ 47 | 48 | # Carthage 49 | # 50 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 51 | # Carthage/Checkouts 52 | 53 | Carthage/Build 54 | 55 | # fastlane 56 | # 57 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 58 | # screenshots whenever they are needed. 59 | # For more information about the recommended setup visit: 60 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 61 | 62 | fastlane/report.xml 63 | fastlane/screenshots 64 | -------------------------------------------------------------------------------- /Examples/swift4/model.mustache: -------------------------------------------------------------------------------- 1 | {{#models}}{{#model}}// 2 | // {{classname}}.swift 3 | // 4 | // Generated by openapi-generator 5 | // https://openapi-generator.tech 6 | // 7 | 8 | import Foundation 9 | 10 | {{#description}} 11 | 12 | /** {{description}} */{{/description}} 13 | {{#isArrayModel}} 14 | {{> modelArray}} 15 | {{/isArrayModel}} 16 | {{^isArrayModel}} 17 | {{#isEnum}} 18 | {{> modelEnum}} 19 | {{/isEnum}} 20 | {{^isEnum}} 21 | {{> modelObject}} 22 | {{/isEnum}} 23 | {{/isArrayModel}} 24 | {{/model}} 25 | {{/models}} 26 | -------------------------------------------------------------------------------- /Examples/swift4/modelArray.mustache: -------------------------------------------------------------------------------- 1 | public typealias {{classname}} = {{parent}} -------------------------------------------------------------------------------- /Examples/swift4/modelEnum.mustache: -------------------------------------------------------------------------------- 1 | public enum {{classname}}: {{dataType}}, Codable, Hashable { 2 | {{#allowableValues}} 3 | {{#enumVars}} 4 | case {{name}} = {{{value}}} 5 | {{/enumVars}} 6 | {{/allowableValues}} 7 | } -------------------------------------------------------------------------------- /Examples/swift4/modelInlineEnumDeclaration.mustache: -------------------------------------------------------------------------------- 1 | public enum {{enumName}}: {{^isContainer}}{{dataType}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { 2 | {{#allowableValues}} 3 | {{#enumVars}} 4 | case {{name}} = {{{value}}} 5 | {{/enumVars}} 6 | {{/allowableValues}} 7 | } -------------------------------------------------------------------------------- /Examples/swift4/modelObject.mustache: -------------------------------------------------------------------------------- 1 | 2 | public struct {{classname}}: Codable, Hashable { 3 | 4 | {{#allVars}} 5 | {{#isEnum}} 6 | {{> modelInlineEnumDeclaration}} 7 | {{/isEnum}} 8 | {{/allVars}} 9 | {{#allVars}} 10 | {{#isEnum}} 11 | {{#description}}/** {{description}} */ 12 | {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} 13 | {{/isEnum}} 14 | {{^isEnum}} 15 | {{#description}}/** {{description}} */ 16 | {{/description}}public var {{name}}: {{{datatype}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} 17 | public var {{name}}Num: NSNumber? { 18 | get { 19 | return {{name}}.map({ return NSNumber(value: $0) }) 20 | } 21 | }{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}} 22 | {{/isEnum}} 23 | {{/allVars}} 24 | 25 | {{#hasVars}} 26 | public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{#unwrapRequired}}?{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}?{{/required}}{{/unwrapRequired}}{{#hasMore}}, {{/hasMore}}{{/allVars}}) { 27 | {{#allVars}} 28 | self.{{name}} = {{name}} 29 | {{/allVars}} 30 | } 31 | {{/hasVars}} 32 | {{#additionalPropertiesType}} 33 | public var additionalProperties: [String:{{{additionalPropertiesType}}}] = [:] 34 | 35 | public subscript(key: String) -> {{{additionalPropertiesType}}}? { 36 | get { 37 | if let value = additionalProperties[key] { 38 | return value 39 | } 40 | return nil 41 | } 42 | 43 | set { 44 | additionalProperties[key] = newValue 45 | } 46 | } 47 | 48 | // Encodable protocol methods 49 | 50 | public func encode(to encoder: Encoder) throws { 51 | 52 | var container = encoder.container(keyedBy: String.self) 53 | 54 | {{#allVars}} 55 | try container.encode{{#unwrapRequired}}IfPresent{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}IfPresent{{/required}}{{/unwrapRequired}}({{{name}}}, forKey: "{{{baseName}}}") 56 | {{/allVars}} 57 | try container.encodeMap(additionalProperties) 58 | } 59 | 60 | // Decodable protocol methods 61 | 62 | public init(from decoder: Decoder) throws { 63 | let container = try decoder.container(keyedBy: String.self) 64 | 65 | {{#allVars}} 66 | {{name}} = try container.decode{{#unwrapRequired}}IfPresent{{/unwrapRequired}}{{^unwrapRequired}}{{^required}}IfPresent{{/required}}{{/unwrapRequired}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") 67 | {{/allVars}} 68 | var nonAdditionalPropertyKeys = Set() 69 | {{#allVars}} 70 | nonAdditionalPropertyKeys.insert("{{{baseName}}}") 71 | {{/allVars}} 72 | additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) 73 | } 74 | 75 | {{/additionalPropertiesType}} 76 | {{^additionalPropertiesType}}{{#vendorExtensions.x-codegen-has-escaped-property-names}} 77 | public enum CodingKeys: String, CodingKey { {{#allVars}} 78 | case {{name}}{{#vendorExtensions.x-codegen-escaped-property-name}} = "{{{baseName}}}"{{/vendorExtensions.x-codegen-escaped-property-name}}{{/allVars}} 79 | } 80 | {{/vendorExtensions.x-codegen-has-escaped-property-names}}{{/additionalPropertiesType}} 81 | 82 | } 83 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 FOLIO Co., Ltd. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:5.1 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "APIClient", 8 | platforms: [ 9 | .macOS(.v10_13), .iOS(.v10), .watchOS(.v3), .tvOS(.v10), 10 | ], 11 | products: [ 12 | .library( 13 | name: "APIClient", 14 | targets: ["APIClient"]), 15 | ], 16 | targets: [ 17 | .target( 18 | name: "APIClient", 19 | dependencies: []), 20 | ] 21 | ) 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | 3 | target 'APIClient' do 4 | use_frameworks! 5 | 6 | target 'APIClientTests' do 7 | inherit! :search_paths 8 | pod 'Petstore', path: './Examples/Petstore/Petstore.podspec' 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Petstore (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - Petstore (from `./Examples/Petstore/Petstore.podspec`) 6 | 7 | EXTERNAL SOURCES: 8 | Petstore: 9 | :path: "./Examples/Petstore/Petstore.podspec" 10 | 11 | SPEC CHECKSUMS: 12 | Petstore: ec706bff33363b3c258b0876db2af164d2b0ff8d 13 | 14 | PODFILE CHECKSUM: 6b84d074caed2adcec012db690d8a04e8e833c39 15 | 16 | COCOAPODS: 1.7.0.beta.3 17 | -------------------------------------------------------------------------------- /Pods/Local Podspecs/Petstore.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Petstore", 3 | "platforms": { 4 | "ios": "9.0", 5 | "osx": "10.11", 6 | "tvos": "9.0" 7 | }, 8 | "version": "0.0.1", 9 | "source": { 10 | "git": "git@github.com:openapitools/openapi-generator.git", 11 | "tag": "v1.0.0" 12 | }, 13 | "authors": "OpenAPI Generator", 14 | "license": "Proprietary", 15 | "homepage": "https://github.com/folio-sec/APIClient", 16 | "summary": "Swagger Petstore", 17 | "source_files": [ 18 | "Petstore/Classes/**/APIs.swift", 19 | "Petstore/Classes/**/APIs/*.swift", 20 | "Petstore/Classes/**/Models/*.swift" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Petstore (0.0.1) 3 | 4 | DEPENDENCIES: 5 | - Petstore (from `./Examples/Petstore/Petstore.podspec`) 6 | 7 | EXTERNAL SOURCES: 8 | Petstore: 9 | :path: "./Examples/Petstore/Petstore.podspec" 10 | 11 | SPEC CHECKSUMS: 12 | Petstore: ec706bff33363b3c258b0876db2af164d2b0ff8d 13 | 14 | PODFILE CHECKSUM: 6b84d074caed2adcec012db690d8a04e8e833c39 15 | 16 | COCOAPODS: 1.7.0.beta.3 17 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 04F7CAB778E621DAEA99584D2BC9AFDD /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9B354306E092E5D8B30B6F08C29E5E9 /* Category.swift */; }; 11 | 2362A229F8B383CA98AEFEBC4CD79721 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75867A692D4D299D2E312E6B77BBD14B /* UserAPI.swift */; }; 12 | 328D02080E3DEF65D9080EE145ECC9B7 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D46E0A23E5812D05CDF92FB05719782 /* Order.swift */; }; 13 | 42AB636F5610BDAE760BDB1B1B206A4D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; 14 | 55C6867487178C15183A4DBEABDD269D /* Petstore-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EFC22306511E85FC72386D57EBC9720 /* Petstore-dummy.m */; }; 15 | 5685938FCAAFFA8D3929161428D086DA /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A9CF5064C47A780EAF881D98FFAB35F /* ApiResponse.swift */; }; 16 | 6FE7C1E8241D93A4944A95864034F4F8 /* Petstore-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 408A8D162AB8854D8AF91D657CD1E44F /* Petstore-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 17 | 8B88CE809253A68DB4922499F41DC2C0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; 18 | 94F909662284FBE81538A7B91E519C3A /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F09D48B4F99A2CD1B75A4525A48622D /* PetAPI.swift */; }; 19 | A49EFE3F9F69BA5BF52D69E78D59E23F /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0EC916EA4B80EAE9DDEA997E43301E98 /* APIs.swift */; }; 20 | B4286065BBDB0B4D39AD05C2A96875C1 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A308F3196B7C1DF79965800730299E6 /* User.swift */; }; 21 | BAF5D26DFC3169B605E093A61DFC81C3 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECBA766E8234030508A926DFA6E458D6 /* StoreAPI.swift */; }; 22 | BC08FBA71E9C68AEAE42119EB6F4F1A7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */; }; 23 | C8012BAEDB5744C9D2CE72DE98B7A73E /* Pods-APIClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = A1F0823FD80C1332AB3458C0001D9BD4 /* Pods-APIClient-dummy.m */; }; 24 | D7C9EA9595E69C574752320C0CBA7A98 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = C434688340088B4265D40AE849D96000 /* Pet.swift */; }; 25 | E47F445D20F005E3139D9ED1E7802967 /* Pods-APIClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 1D5A25ABE21A417DE58ABAC38F09BA74 /* Pods-APIClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 26 | E632387ED05F086A4FE6600A8E77F04D /* Pods-APIClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CC00ECD8FCC10E3B3642E6CE7A86BB9 /* Pods-APIClientTests-dummy.m */; }; 27 | EFE615DF97CCE77126BFB40EA0E57498 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 646DC29B84E007EEB1E8E06AE032B2C1 /* Tag.swift */; }; 28 | F8A400D0C80205C6DB9314775D66177D /* Pods-APIClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 3FBB78C64312DCADED2B85ABE9C45DE3 /* Pods-APIClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; 29 | /* End PBXBuildFile section */ 30 | 31 | /* Begin PBXContainerItemProxy section */ 32 | B35C145B200054F46B2DEDF20E592143 /* PBXContainerItemProxy */ = { 33 | isa = PBXContainerItemProxy; 34 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 35 | proxyType = 1; 36 | remoteGlobalIDString = 6929B5C594C8E9A920C6F7BF2B5BC486; 37 | remoteInfo = "Pods-APIClient"; 38 | }; 39 | D7D3C5D935620C5439370AE4EB34FBB5 /* PBXContainerItemProxy */ = { 40 | isa = PBXContainerItemProxy; 41 | containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; 42 | proxyType = 1; 43 | remoteGlobalIDString = 41F259BB3F3A6C9B1DB522A8435F782D; 44 | remoteInfo = Petstore; 45 | }; 46 | /* End PBXContainerItemProxy section */ 47 | 48 | /* Begin PBXFileReference section */ 49 | 0B0727CD74C3806406E2DF637AC060B1 /* Pods-APIClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-APIClient-Info.plist"; sourceTree = ""; }; 50 | 0E68FC2F2E1029CFCF8957E3A2B4F192 /* Pods-APIClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-APIClientTests.modulemap"; sourceTree = ""; }; 51 | 0EC916EA4B80EAE9DDEA997E43301E98 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = Petstore/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; 52 | 12702C4DAFADC381CB75F06850D2BCDF /* Petstore.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Petstore.xcconfig; sourceTree = ""; }; 53 | 1A308F3196B7C1DF79965800730299E6 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; 54 | 1CC00ECD8FCC10E3B3642E6CE7A86BB9 /* Pods-APIClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-APIClientTests-dummy.m"; sourceTree = ""; }; 55 | 1D5A25ABE21A417DE58ABAC38F09BA74 /* Pods-APIClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-APIClient-umbrella.h"; sourceTree = ""; }; 56 | 3FBB78C64312DCADED2B85ABE9C45DE3 /* Pods-APIClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-APIClientTests-umbrella.h"; sourceTree = ""; }; 57 | 408A8D162AB8854D8AF91D657CD1E44F /* Petstore-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Petstore-umbrella.h"; sourceTree = ""; }; 58 | 4EFC22306511E85FC72386D57EBC9720 /* Petstore-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Petstore-dummy.m"; sourceTree = ""; }; 59 | 4F09D48B4F99A2CD1B75A4525A48622D /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; 60 | 4F91E6ECD6A861535ACD84E23645DBAC /* Pods-APIClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-APIClient-acknowledgements.markdown"; sourceTree = ""; }; 61 | 528D5C93CCD731489767D5BD51EB43BC /* Pods-APIClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-APIClientTests-acknowledgements.plist"; sourceTree = ""; }; 62 | 629A9159ADCB9D604BEF5188B85B829A /* Pods-APIClientTests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-APIClientTests-Info.plist"; sourceTree = ""; }; 63 | 646DC29B84E007EEB1E8E06AE032B2C1 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; 64 | 6A9CF5064C47A780EAF881D98FFAB35F /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; 65 | 6D46E0A23E5812D05CDF92FB05719782 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; 66 | 75867A692D4D299D2E312E6B77BBD14B /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; 67 | 842D0C2BBF6558F444912BED089531FB /* Pods_APIClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_APIClient.framework; path = "Pods-APIClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 863B7C6E06738F51E583446D20EDB4D0 /* Pods-APIClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-APIClientTests.release.xcconfig"; sourceTree = ""; }; 69 | 900BF8DFAA482BB39AC1AAFD983AC24E /* Pods-APIClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-APIClient-acknowledgements.plist"; sourceTree = ""; }; 70 | 9754F223C71AA9958AF90C4F37C597F3 /* Pods-APIClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-APIClientTests-acknowledgements.markdown"; sourceTree = ""; }; 71 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; name = Podfile; path = ../Podfile; sourceTree = SOURCE_ROOT; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 72 | A1F0823FD80C1332AB3458C0001D9BD4 /* Pods-APIClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-APIClient-dummy.m"; sourceTree = ""; }; 73 | A2BFC794A52C7A07E81C8964E83DA824 /* Petstore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Petstore.framework; path = Petstore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74 | B44A7AA8844F242A9ABB2A77BC72EC56 /* Petstore.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Petstore.modulemap; sourceTree = ""; }; 75 | BC4D194D6A6EDF49F3CB2248B4B44678 /* Pods-APIClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-APIClient.modulemap"; sourceTree = ""; }; 76 | C434688340088B4265D40AE849D96000 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; 77 | C9A4CDA89328A71204AE3D40BB8683B3 /* Pods-APIClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-APIClient.release.xcconfig"; sourceTree = ""; }; 78 | CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; 79 | D245C081213E88AD038A58F90CB489EE /* Petstore-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Petstore-Info.plist"; sourceTree = ""; }; 80 | D6DE2DE38B72A86E77C56D43A05E716E /* Petstore.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = Petstore.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 81 | D7E5CFAF6FBB971723E2441FA7496C12 /* Pods-APIClientTests-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-APIClientTests-frameworks.sh"; sourceTree = ""; }; 82 | E6C9C46E652E192A77EAD6EC77F6B161 /* Petstore-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Petstore-prefix.pch"; sourceTree = ""; }; 83 | E800DC8E30482E04A48FDCBC3F3F75E6 /* Pods_APIClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_APIClientTests.framework; path = "Pods-APIClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; 84 | E9B354306E092E5D8B30B6F08C29E5E9 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; 85 | ECBA766E8234030508A926DFA6E458D6 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; 86 | F1B07AED8BAE369C37DD1EC8C7963F41 /* Pods-APIClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-APIClientTests.debug.xcconfig"; sourceTree = ""; }; 87 | FB10997E11116564DD78CC41AFACBAC3 /* Pods-APIClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-APIClient.debug.xcconfig"; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 628C892E94E88F062B5BE5C7EE2F8FAB /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | 8B88CE809253A68DB4922499F41DC2C0 /* Foundation.framework in Frameworks */, 96 | ); 97 | runOnlyForDeploymentPostprocessing = 0; 98 | }; 99 | 700E5B5B085138928839F0F80575D490 /* Frameworks */ = { 100 | isa = PBXFrameworksBuildPhase; 101 | buildActionMask = 2147483647; 102 | files = ( 103 | BC08FBA71E9C68AEAE42119EB6F4F1A7 /* Foundation.framework in Frameworks */, 104 | ); 105 | runOnlyForDeploymentPostprocessing = 0; 106 | }; 107 | F4A03BBF12ABF86971159AC771D1537F /* Frameworks */ = { 108 | isa = PBXFrameworksBuildPhase; 109 | buildActionMask = 2147483647; 110 | files = ( 111 | 42AB636F5610BDAE760BDB1B1B206A4D /* Foundation.framework in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | /* End PBXFrameworksBuildPhase section */ 116 | 117 | /* Begin PBXGroup section */ 118 | 351CE069CCC6B2FB7879CAFAE14FCE49 /* Models */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 6A9CF5064C47A780EAF881D98FFAB35F /* ApiResponse.swift */, 122 | E9B354306E092E5D8B30B6F08C29E5E9 /* Category.swift */, 123 | 6D46E0A23E5812D05CDF92FB05719782 /* Order.swift */, 124 | C434688340088B4265D40AE849D96000 /* Pet.swift */, 125 | 646DC29B84E007EEB1E8E06AE032B2C1 /* Tag.swift */, 126 | 1A308F3196B7C1DF79965800730299E6 /* User.swift */, 127 | ); 128 | name = Models; 129 | path = Petstore/Classes/OpenAPIs/Models; 130 | sourceTree = ""; 131 | }; 132 | 35E20A5B3AB962BF8768725C9061AA20 /* Pods-APIClientTests */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 0E68FC2F2E1029CFCF8957E3A2B4F192 /* Pods-APIClientTests.modulemap */, 136 | 9754F223C71AA9958AF90C4F37C597F3 /* Pods-APIClientTests-acknowledgements.markdown */, 137 | 528D5C93CCD731489767D5BD51EB43BC /* Pods-APIClientTests-acknowledgements.plist */, 138 | 1CC00ECD8FCC10E3B3642E6CE7A86BB9 /* Pods-APIClientTests-dummy.m */, 139 | D7E5CFAF6FBB971723E2441FA7496C12 /* Pods-APIClientTests-frameworks.sh */, 140 | 629A9159ADCB9D604BEF5188B85B829A /* Pods-APIClientTests-Info.plist */, 141 | 3FBB78C64312DCADED2B85ABE9C45DE3 /* Pods-APIClientTests-umbrella.h */, 142 | F1B07AED8BAE369C37DD1EC8C7963F41 /* Pods-APIClientTests.debug.xcconfig */, 143 | 863B7C6E06738F51E583446D20EDB4D0 /* Pods-APIClientTests.release.xcconfig */, 144 | ); 145 | name = "Pods-APIClientTests"; 146 | path = "Target Support Files/Pods-APIClientTests"; 147 | sourceTree = ""; 148 | }; 149 | 375A55C5734458E467E617E9138C1EAB /* Development Pods */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | F595145D71E2097046730BA599C19D0A /* Petstore */, 153 | ); 154 | name = "Development Pods"; 155 | sourceTree = ""; 156 | }; 157 | 41CAB0FE646B70829F93D489E82237AF /* Pod */ = { 158 | isa = PBXGroup; 159 | children = ( 160 | D6DE2DE38B72A86E77C56D43A05E716E /* Petstore.podspec */, 161 | ); 162 | name = Pod; 163 | sourceTree = ""; 164 | }; 165 | 5E14E08278DC0FD407F621BE01465044 /* Support Files */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | B44A7AA8844F242A9ABB2A77BC72EC56 /* Petstore.modulemap */, 169 | 12702C4DAFADC381CB75F06850D2BCDF /* Petstore.xcconfig */, 170 | 4EFC22306511E85FC72386D57EBC9720 /* Petstore-dummy.m */, 171 | D245C081213E88AD038A58F90CB489EE /* Petstore-Info.plist */, 172 | E6C9C46E652E192A77EAD6EC77F6B161 /* Petstore-prefix.pch */, 173 | 408A8D162AB8854D8AF91D657CD1E44F /* Petstore-umbrella.h */, 174 | ); 175 | name = "Support Files"; 176 | path = "../../Pods/Target Support Files/Petstore"; 177 | sourceTree = ""; 178 | }; 179 | 9B055D0CFEA43187E72B03DED11F5662 /* iOS */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | CB4607EFCA7C5F75397649E792E2AFCB /* Foundation.framework */, 183 | ); 184 | name = iOS; 185 | sourceTree = ""; 186 | }; 187 | 9EC7B69DFAC6514B4D1B2F53535522A8 /* APIs */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 4F09D48B4F99A2CD1B75A4525A48622D /* PetAPI.swift */, 191 | ECBA766E8234030508A926DFA6E458D6 /* StoreAPI.swift */, 192 | 75867A692D4D299D2E312E6B77BBD14B /* UserAPI.swift */, 193 | ); 194 | name = APIs; 195 | path = Petstore/Classes/OpenAPIs/APIs; 196 | sourceTree = ""; 197 | }; 198 | A98EC38DC81B55266BD600F93EC5D8E7 /* Targets Support Files */ = { 199 | isa = PBXGroup; 200 | children = ( 201 | E27D2E9D6660578D01333B158DC8BFED /* Pods-APIClient */, 202 | 35E20A5B3AB962BF8768725C9061AA20 /* Pods-APIClientTests */, 203 | ); 204 | name = "Targets Support Files"; 205 | sourceTree = ""; 206 | }; 207 | CDCA2EA873E07B287C85A12CE317970F /* Products */ = { 208 | isa = PBXGroup; 209 | children = ( 210 | A2BFC794A52C7A07E81C8964E83DA824 /* Petstore.framework */, 211 | 842D0C2BBF6558F444912BED089531FB /* Pods_APIClient.framework */, 212 | E800DC8E30482E04A48FDCBC3F3F75E6 /* Pods_APIClientTests.framework */, 213 | ); 214 | name = Products; 215 | sourceTree = ""; 216 | }; 217 | CF1408CF629C7361332E53B88F7BD30C = { 218 | isa = PBXGroup; 219 | children = ( 220 | 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, 221 | 375A55C5734458E467E617E9138C1EAB /* Development Pods */, 222 | D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */, 223 | CDCA2EA873E07B287C85A12CE317970F /* Products */, 224 | A98EC38DC81B55266BD600F93EC5D8E7 /* Targets Support Files */, 225 | ); 226 | sourceTree = ""; 227 | }; 228 | D210D550F4EA176C3123ED886F8F87F5 /* Frameworks */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | 9B055D0CFEA43187E72B03DED11F5662 /* iOS */, 232 | ); 233 | name = Frameworks; 234 | sourceTree = ""; 235 | }; 236 | E27D2E9D6660578D01333B158DC8BFED /* Pods-APIClient */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | BC4D194D6A6EDF49F3CB2248B4B44678 /* Pods-APIClient.modulemap */, 240 | 4F91E6ECD6A861535ACD84E23645DBAC /* Pods-APIClient-acknowledgements.markdown */, 241 | 900BF8DFAA482BB39AC1AAFD983AC24E /* Pods-APIClient-acknowledgements.plist */, 242 | A1F0823FD80C1332AB3458C0001D9BD4 /* Pods-APIClient-dummy.m */, 243 | 0B0727CD74C3806406E2DF637AC060B1 /* Pods-APIClient-Info.plist */, 244 | 1D5A25ABE21A417DE58ABAC38F09BA74 /* Pods-APIClient-umbrella.h */, 245 | FB10997E11116564DD78CC41AFACBAC3 /* Pods-APIClient.debug.xcconfig */, 246 | C9A4CDA89328A71204AE3D40BB8683B3 /* Pods-APIClient.release.xcconfig */, 247 | ); 248 | name = "Pods-APIClient"; 249 | path = "Target Support Files/Pods-APIClient"; 250 | sourceTree = ""; 251 | }; 252 | F595145D71E2097046730BA599C19D0A /* Petstore */ = { 253 | isa = PBXGroup; 254 | children = ( 255 | 0EC916EA4B80EAE9DDEA997E43301E98 /* APIs.swift */, 256 | 9EC7B69DFAC6514B4D1B2F53535522A8 /* APIs */, 257 | 351CE069CCC6B2FB7879CAFAE14FCE49 /* Models */, 258 | 41CAB0FE646B70829F93D489E82237AF /* Pod */, 259 | 5E14E08278DC0FD407F621BE01465044 /* Support Files */, 260 | ); 261 | name = Petstore; 262 | path = ../Examples/Petstore; 263 | sourceTree = ""; 264 | }; 265 | /* End PBXGroup section */ 266 | 267 | /* Begin PBXHeadersBuildPhase section */ 268 | 18ED630CCD254AF4480C60603C4CC87E /* Headers */ = { 269 | isa = PBXHeadersBuildPhase; 270 | buildActionMask = 2147483647; 271 | files = ( 272 | F8A400D0C80205C6DB9314775D66177D /* Pods-APIClientTests-umbrella.h in Headers */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | 25FC13A406229068BF61ECF367636E61 /* Headers */ = { 277 | isa = PBXHeadersBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | E47F445D20F005E3139D9ED1E7802967 /* Pods-APIClient-umbrella.h in Headers */, 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | }; 284 | D76498297E4755E7E7E7E215816A576B /* Headers */ = { 285 | isa = PBXHeadersBuildPhase; 286 | buildActionMask = 2147483647; 287 | files = ( 288 | 6FE7C1E8241D93A4944A95864034F4F8 /* Petstore-umbrella.h in Headers */, 289 | ); 290 | runOnlyForDeploymentPostprocessing = 0; 291 | }; 292 | /* End PBXHeadersBuildPhase section */ 293 | 294 | /* Begin PBXNativeTarget section */ 295 | 41F259BB3F3A6C9B1DB522A8435F782D /* Petstore */ = { 296 | isa = PBXNativeTarget; 297 | buildConfigurationList = 5D609BC352BE529DDF52F91D41A950F4 /* Build configuration list for PBXNativeTarget "Petstore" */; 298 | buildPhases = ( 299 | D76498297E4755E7E7E7E215816A576B /* Headers */, 300 | F104212274D2DCC6CE12A0937BD0557B /* Sources */, 301 | 628C892E94E88F062B5BE5C7EE2F8FAB /* Frameworks */, 302 | 822B3B8F752B63A4126DC4B0BCD2669B /* Resources */, 303 | ); 304 | buildRules = ( 305 | ); 306 | dependencies = ( 307 | ); 308 | name = Petstore; 309 | productName = Petstore; 310 | productReference = A2BFC794A52C7A07E81C8964E83DA824 /* Petstore.framework */; 311 | productType = "com.apple.product-type.framework"; 312 | }; 313 | 6929B5C594C8E9A920C6F7BF2B5BC486 /* Pods-APIClient */ = { 314 | isa = PBXNativeTarget; 315 | buildConfigurationList = 7EF0ACF3014FFFA832D8F9B958563227 /* Build configuration list for PBXNativeTarget "Pods-APIClient" */; 316 | buildPhases = ( 317 | 25FC13A406229068BF61ECF367636E61 /* Headers */, 318 | C6F9BC1679073557413C0687F1D20690 /* Sources */, 319 | F4A03BBF12ABF86971159AC771D1537F /* Frameworks */, 320 | 1B449AC2F927EE4F036749D39AE95FE7 /* Resources */, 321 | ); 322 | buildRules = ( 323 | ); 324 | dependencies = ( 325 | ); 326 | name = "Pods-APIClient"; 327 | productName = "Pods-APIClient"; 328 | productReference = 842D0C2BBF6558F444912BED089531FB /* Pods_APIClient.framework */; 329 | productType = "com.apple.product-type.framework"; 330 | }; 331 | F16193CDBAB477E83E559997FC5A37B9 /* Pods-APIClientTests */ = { 332 | isa = PBXNativeTarget; 333 | buildConfigurationList = 01ED2BBD7EB9D6903FB3BF4E2C3232B0 /* Build configuration list for PBXNativeTarget "Pods-APIClientTests" */; 334 | buildPhases = ( 335 | 18ED630CCD254AF4480C60603C4CC87E /* Headers */, 336 | 80AD96DD02FB86341F1462E34F695B76 /* Sources */, 337 | 700E5B5B085138928839F0F80575D490 /* Frameworks */, 338 | 01136BBAC4A11634A8C86C99231CCC66 /* Resources */, 339 | ); 340 | buildRules = ( 341 | ); 342 | dependencies = ( 343 | 0B97E12CB5AB666B9065E4B877DB62CF /* PBXTargetDependency */, 344 | 58B6A2C1298A4A091575C903E168AC1D /* PBXTargetDependency */, 345 | ); 346 | name = "Pods-APIClientTests"; 347 | productName = "Pods-APIClientTests"; 348 | productReference = E800DC8E30482E04A48FDCBC3F3F75E6 /* Pods_APIClientTests.framework */; 349 | productType = "com.apple.product-type.framework"; 350 | }; 351 | /* End PBXNativeTarget section */ 352 | 353 | /* Begin PBXProject section */ 354 | BFDFE7DC352907FC980B868725387E98 /* Project object */ = { 355 | isa = PBXProject; 356 | attributes = { 357 | LastSwiftUpdateCheck = 0930; 358 | LastUpgradeCheck = 0930; 359 | }; 360 | buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; 361 | compatibilityVersion = "Xcode 3.2"; 362 | developmentRegion = English; 363 | hasScannedForEncodings = 0; 364 | knownRegions = ( 365 | en, 366 | ); 367 | mainGroup = CF1408CF629C7361332E53B88F7BD30C; 368 | productRefGroup = CDCA2EA873E07B287C85A12CE317970F /* Products */; 369 | projectDirPath = ""; 370 | projectRoot = ""; 371 | targets = ( 372 | 41F259BB3F3A6C9B1DB522A8435F782D /* Petstore */, 373 | 6929B5C594C8E9A920C6F7BF2B5BC486 /* Pods-APIClient */, 374 | F16193CDBAB477E83E559997FC5A37B9 /* Pods-APIClientTests */, 375 | ); 376 | }; 377 | /* End PBXProject section */ 378 | 379 | /* Begin PBXResourcesBuildPhase section */ 380 | 01136BBAC4A11634A8C86C99231CCC66 /* Resources */ = { 381 | isa = PBXResourcesBuildPhase; 382 | buildActionMask = 2147483647; 383 | files = ( 384 | ); 385 | runOnlyForDeploymentPostprocessing = 0; 386 | }; 387 | 1B449AC2F927EE4F036749D39AE95FE7 /* Resources */ = { 388 | isa = PBXResourcesBuildPhase; 389 | buildActionMask = 2147483647; 390 | files = ( 391 | ); 392 | runOnlyForDeploymentPostprocessing = 0; 393 | }; 394 | 822B3B8F752B63A4126DC4B0BCD2669B /* Resources */ = { 395 | isa = PBXResourcesBuildPhase; 396 | buildActionMask = 2147483647; 397 | files = ( 398 | ); 399 | runOnlyForDeploymentPostprocessing = 0; 400 | }; 401 | /* End PBXResourcesBuildPhase section */ 402 | 403 | /* Begin PBXSourcesBuildPhase section */ 404 | 80AD96DD02FB86341F1462E34F695B76 /* Sources */ = { 405 | isa = PBXSourcesBuildPhase; 406 | buildActionMask = 2147483647; 407 | files = ( 408 | E632387ED05F086A4FE6600A8E77F04D /* Pods-APIClientTests-dummy.m in Sources */, 409 | ); 410 | runOnlyForDeploymentPostprocessing = 0; 411 | }; 412 | C6F9BC1679073557413C0687F1D20690 /* Sources */ = { 413 | isa = PBXSourcesBuildPhase; 414 | buildActionMask = 2147483647; 415 | files = ( 416 | C8012BAEDB5744C9D2CE72DE98B7A73E /* Pods-APIClient-dummy.m in Sources */, 417 | ); 418 | runOnlyForDeploymentPostprocessing = 0; 419 | }; 420 | F104212274D2DCC6CE12A0937BD0557B /* Sources */ = { 421 | isa = PBXSourcesBuildPhase; 422 | buildActionMask = 2147483647; 423 | files = ( 424 | 5685938FCAAFFA8D3929161428D086DA /* ApiResponse.swift in Sources */, 425 | A49EFE3F9F69BA5BF52D69E78D59E23F /* APIs.swift in Sources */, 426 | 04F7CAB778E621DAEA99584D2BC9AFDD /* Category.swift in Sources */, 427 | 328D02080E3DEF65D9080EE145ECC9B7 /* Order.swift in Sources */, 428 | D7C9EA9595E69C574752320C0CBA7A98 /* Pet.swift in Sources */, 429 | 94F909662284FBE81538A7B91E519C3A /* PetAPI.swift in Sources */, 430 | 55C6867487178C15183A4DBEABDD269D /* Petstore-dummy.m in Sources */, 431 | BAF5D26DFC3169B605E093A61DFC81C3 /* StoreAPI.swift in Sources */, 432 | EFE615DF97CCE77126BFB40EA0E57498 /* Tag.swift in Sources */, 433 | B4286065BBDB0B4D39AD05C2A96875C1 /* User.swift in Sources */, 434 | 2362A229F8B383CA98AEFEBC4CD79721 /* UserAPI.swift in Sources */, 435 | ); 436 | runOnlyForDeploymentPostprocessing = 0; 437 | }; 438 | /* End PBXSourcesBuildPhase section */ 439 | 440 | /* Begin PBXTargetDependency section */ 441 | 0B97E12CB5AB666B9065E4B877DB62CF /* PBXTargetDependency */ = { 442 | isa = PBXTargetDependency; 443 | name = Petstore; 444 | target = 41F259BB3F3A6C9B1DB522A8435F782D /* Petstore */; 445 | targetProxy = D7D3C5D935620C5439370AE4EB34FBB5 /* PBXContainerItemProxy */; 446 | }; 447 | 58B6A2C1298A4A091575C903E168AC1D /* PBXTargetDependency */ = { 448 | isa = PBXTargetDependency; 449 | name = "Pods-APIClient"; 450 | target = 6929B5C594C8E9A920C6F7BF2B5BC486 /* Pods-APIClient */; 451 | targetProxy = B35C145B200054F46B2DEDF20E592143 /* PBXContainerItemProxy */; 452 | }; 453 | /* End PBXTargetDependency section */ 454 | 455 | /* Begin XCBuildConfiguration section */ 456 | 07488D4657FB0A78086563621D425F8A /* Debug */ = { 457 | isa = XCBuildConfiguration; 458 | buildSettings = { 459 | ALWAYS_SEARCH_USER_PATHS = NO; 460 | CLANG_ANALYZER_NONNULL = YES; 461 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 462 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 463 | CLANG_CXX_LIBRARY = "libc++"; 464 | CLANG_ENABLE_MODULES = YES; 465 | CLANG_ENABLE_OBJC_ARC = YES; 466 | CLANG_ENABLE_OBJC_WEAK = YES; 467 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 468 | CLANG_WARN_BOOL_CONVERSION = YES; 469 | CLANG_WARN_COMMA = YES; 470 | CLANG_WARN_CONSTANT_CONVERSION = YES; 471 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 472 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 473 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 474 | CLANG_WARN_EMPTY_BODY = YES; 475 | CLANG_WARN_ENUM_CONVERSION = YES; 476 | CLANG_WARN_INFINITE_RECURSION = YES; 477 | CLANG_WARN_INT_CONVERSION = YES; 478 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 479 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 480 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 481 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 482 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 483 | CLANG_WARN_STRICT_PROTOTYPES = YES; 484 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 485 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 486 | CLANG_WARN_UNREACHABLE_CODE = YES; 487 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 488 | COPY_PHASE_STRIP = NO; 489 | DEBUG_INFORMATION_FORMAT = dwarf; 490 | ENABLE_STRICT_OBJC_MSGSEND = YES; 491 | ENABLE_TESTABILITY = YES; 492 | GCC_C_LANGUAGE_STANDARD = gnu11; 493 | GCC_DYNAMIC_NO_PIC = NO; 494 | GCC_NO_COMMON_BLOCKS = YES; 495 | GCC_OPTIMIZATION_LEVEL = 0; 496 | GCC_PREPROCESSOR_DEFINITIONS = ( 497 | "POD_CONFIGURATION_DEBUG=1", 498 | "DEBUG=1", 499 | "$(inherited)", 500 | ); 501 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 502 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 503 | GCC_WARN_UNDECLARED_SELECTOR = YES; 504 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 505 | GCC_WARN_UNUSED_FUNCTION = YES; 506 | GCC_WARN_UNUSED_VARIABLE = YES; 507 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 508 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 509 | MTL_FAST_MATH = YES; 510 | ONLY_ACTIVE_ARCH = YES; 511 | PRODUCT_NAME = "$(TARGET_NAME)"; 512 | STRIP_INSTALLED_PRODUCT = NO; 513 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 514 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 515 | SWIFT_VERSION = 4.2; 516 | SYMROOT = "${SRCROOT}/../build"; 517 | }; 518 | name = Debug; 519 | }; 520 | 3FBBDF7ABB3496CD10AEC5ED16034A66 /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | baseConfigurationReference = 12702C4DAFADC381CB75F06850D2BCDF /* Petstore.xcconfig */; 523 | buildSettings = { 524 | CODE_SIGN_IDENTITY = ""; 525 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 526 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 527 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 528 | CURRENT_PROJECT_VERSION = 1; 529 | DEFINES_MODULE = YES; 530 | DYLIB_COMPATIBILITY_VERSION = 1; 531 | DYLIB_CURRENT_VERSION = 1; 532 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 533 | GCC_PREFIX_HEADER = "Target Support Files/Petstore/Petstore-prefix.pch"; 534 | INFOPLIST_FILE = "Target Support Files/Petstore/Petstore-Info.plist"; 535 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 536 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 537 | LD_RUNPATH_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "@executable_path/Frameworks", 540 | "@loader_path/Frameworks", 541 | ); 542 | MODULEMAP_FILE = "Target Support Files/Petstore/Petstore.modulemap"; 543 | PRODUCT_MODULE_NAME = Petstore; 544 | PRODUCT_NAME = Petstore; 545 | SDKROOT = iphoneos; 546 | SKIP_INSTALL = YES; 547 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 548 | SWIFT_VERSION = 4.2; 549 | TARGETED_DEVICE_FAMILY = "1,2"; 550 | VERSIONING_SYSTEM = "apple-generic"; 551 | VERSION_INFO_PREFIX = ""; 552 | }; 553 | name = Debug; 554 | }; 555 | 7D7D025EEFBD601180B4AB21D6EFF0CF /* Debug */ = { 556 | isa = XCBuildConfiguration; 557 | baseConfigurationReference = FB10997E11116564DD78CC41AFACBAC3 /* Pods-APIClient.debug.xcconfig */; 558 | buildSettings = { 559 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 560 | APPLICATION_EXTENSION_API_ONLY = YES; 561 | CODE_SIGN_IDENTITY = ""; 562 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 564 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 565 | CURRENT_PROJECT_VERSION = 1; 566 | DEFINES_MODULE = YES; 567 | DYLIB_COMPATIBILITY_VERSION = 1; 568 | DYLIB_CURRENT_VERSION = 1; 569 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 570 | INFOPLIST_FILE = "Target Support Files/Pods-APIClient/Pods-APIClient-Info.plist"; 571 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 572 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 573 | LD_RUNPATH_SEARCH_PATHS = ( 574 | "$(inherited)", 575 | "@executable_path/Frameworks", 576 | "@loader_path/Frameworks", 577 | ); 578 | MACH_O_TYPE = staticlib; 579 | MODULEMAP_FILE = "Target Support Files/Pods-APIClient/Pods-APIClient.modulemap"; 580 | OTHER_LDFLAGS = ""; 581 | OTHER_LIBTOOLFLAGS = ""; 582 | PODS_ROOT = "$(SRCROOT)"; 583 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 584 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 585 | SDKROOT = iphoneos; 586 | SKIP_INSTALL = YES; 587 | TARGETED_DEVICE_FAMILY = "1,2"; 588 | VERSIONING_SYSTEM = "apple-generic"; 589 | VERSION_INFO_PREFIX = ""; 590 | }; 591 | name = Debug; 592 | }; 593 | 937F767FEF9880A33BC08107C97FCBB9 /* Release */ = { 594 | isa = XCBuildConfiguration; 595 | baseConfigurationReference = 863B7C6E06738F51E583446D20EDB4D0 /* Pods-APIClientTests.release.xcconfig */; 596 | buildSettings = { 597 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 598 | CODE_SIGN_IDENTITY = ""; 599 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 600 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 601 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 602 | CURRENT_PROJECT_VERSION = 1; 603 | DEFINES_MODULE = YES; 604 | DYLIB_COMPATIBILITY_VERSION = 1; 605 | DYLIB_CURRENT_VERSION = 1; 606 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 607 | INFOPLIST_FILE = "Target Support Files/Pods-APIClientTests/Pods-APIClientTests-Info.plist"; 608 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 609 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 610 | LD_RUNPATH_SEARCH_PATHS = ( 611 | "$(inherited)", 612 | "@executable_path/Frameworks", 613 | "@loader_path/Frameworks", 614 | ); 615 | MACH_O_TYPE = staticlib; 616 | MODULEMAP_FILE = "Target Support Files/Pods-APIClientTests/Pods-APIClientTests.modulemap"; 617 | OTHER_LDFLAGS = ""; 618 | OTHER_LIBTOOLFLAGS = ""; 619 | PODS_ROOT = "$(SRCROOT)"; 620 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 621 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 622 | SDKROOT = iphoneos; 623 | SKIP_INSTALL = YES; 624 | TARGETED_DEVICE_FAMILY = "1,2"; 625 | VALIDATE_PRODUCT = YES; 626 | VERSIONING_SYSTEM = "apple-generic"; 627 | VERSION_INFO_PREFIX = ""; 628 | }; 629 | name = Release; 630 | }; 631 | A1962E6FF39BBAC201A2E5DDF99557DF /* Release */ = { 632 | isa = XCBuildConfiguration; 633 | buildSettings = { 634 | ALWAYS_SEARCH_USER_PATHS = NO; 635 | CLANG_ANALYZER_NONNULL = YES; 636 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 637 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 638 | CLANG_CXX_LIBRARY = "libc++"; 639 | CLANG_ENABLE_MODULES = YES; 640 | CLANG_ENABLE_OBJC_ARC = YES; 641 | CLANG_ENABLE_OBJC_WEAK = YES; 642 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 643 | CLANG_WARN_BOOL_CONVERSION = YES; 644 | CLANG_WARN_COMMA = YES; 645 | CLANG_WARN_CONSTANT_CONVERSION = YES; 646 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 647 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 648 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 649 | CLANG_WARN_EMPTY_BODY = YES; 650 | CLANG_WARN_ENUM_CONVERSION = YES; 651 | CLANG_WARN_INFINITE_RECURSION = YES; 652 | CLANG_WARN_INT_CONVERSION = YES; 653 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 654 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 655 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 656 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 657 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 658 | CLANG_WARN_STRICT_PROTOTYPES = YES; 659 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 660 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 661 | CLANG_WARN_UNREACHABLE_CODE = YES; 662 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 663 | COPY_PHASE_STRIP = NO; 664 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 665 | ENABLE_NS_ASSERTIONS = NO; 666 | ENABLE_STRICT_OBJC_MSGSEND = YES; 667 | GCC_C_LANGUAGE_STANDARD = gnu11; 668 | GCC_NO_COMMON_BLOCKS = YES; 669 | GCC_PREPROCESSOR_DEFINITIONS = ( 670 | "POD_CONFIGURATION_RELEASE=1", 671 | "$(inherited)", 672 | ); 673 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 674 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 675 | GCC_WARN_UNDECLARED_SELECTOR = YES; 676 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 677 | GCC_WARN_UNUSED_FUNCTION = YES; 678 | GCC_WARN_UNUSED_VARIABLE = YES; 679 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 680 | MTL_ENABLE_DEBUG_INFO = NO; 681 | MTL_FAST_MATH = YES; 682 | PRODUCT_NAME = "$(TARGET_NAME)"; 683 | STRIP_INSTALLED_PRODUCT = NO; 684 | SWIFT_COMPILATION_MODE = wholemodule; 685 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 686 | SWIFT_VERSION = 4.2; 687 | SYMROOT = "${SRCROOT}/../build"; 688 | }; 689 | name = Release; 690 | }; 691 | B07801CE663D4E53234550D7771E9CC9 /* Release */ = { 692 | isa = XCBuildConfiguration; 693 | baseConfigurationReference = C9A4CDA89328A71204AE3D40BB8683B3 /* Pods-APIClient.release.xcconfig */; 694 | buildSettings = { 695 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 696 | APPLICATION_EXTENSION_API_ONLY = YES; 697 | CODE_SIGN_IDENTITY = ""; 698 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 699 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 700 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 701 | CURRENT_PROJECT_VERSION = 1; 702 | DEFINES_MODULE = YES; 703 | DYLIB_COMPATIBILITY_VERSION = 1; 704 | DYLIB_CURRENT_VERSION = 1; 705 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 706 | INFOPLIST_FILE = "Target Support Files/Pods-APIClient/Pods-APIClient-Info.plist"; 707 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 708 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 709 | LD_RUNPATH_SEARCH_PATHS = ( 710 | "$(inherited)", 711 | "@executable_path/Frameworks", 712 | "@loader_path/Frameworks", 713 | ); 714 | MACH_O_TYPE = staticlib; 715 | MODULEMAP_FILE = "Target Support Files/Pods-APIClient/Pods-APIClient.modulemap"; 716 | OTHER_LDFLAGS = ""; 717 | OTHER_LIBTOOLFLAGS = ""; 718 | PODS_ROOT = "$(SRCROOT)"; 719 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 720 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 721 | SDKROOT = iphoneos; 722 | SKIP_INSTALL = YES; 723 | TARGETED_DEVICE_FAMILY = "1,2"; 724 | VALIDATE_PRODUCT = YES; 725 | VERSIONING_SYSTEM = "apple-generic"; 726 | VERSION_INFO_PREFIX = ""; 727 | }; 728 | name = Release; 729 | }; 730 | EF4FEF24036E5DD24D7442B5561FE7B5 /* Debug */ = { 731 | isa = XCBuildConfiguration; 732 | baseConfigurationReference = F1B07AED8BAE369C37DD1EC8C7963F41 /* Pods-APIClientTests.debug.xcconfig */; 733 | buildSettings = { 734 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; 735 | CODE_SIGN_IDENTITY = ""; 736 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 737 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 738 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 739 | CURRENT_PROJECT_VERSION = 1; 740 | DEFINES_MODULE = YES; 741 | DYLIB_COMPATIBILITY_VERSION = 1; 742 | DYLIB_CURRENT_VERSION = 1; 743 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 744 | INFOPLIST_FILE = "Target Support Files/Pods-APIClientTests/Pods-APIClientTests-Info.plist"; 745 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 746 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 747 | LD_RUNPATH_SEARCH_PATHS = ( 748 | "$(inherited)", 749 | "@executable_path/Frameworks", 750 | "@loader_path/Frameworks", 751 | ); 752 | MACH_O_TYPE = staticlib; 753 | MODULEMAP_FILE = "Target Support Files/Pods-APIClientTests/Pods-APIClientTests.modulemap"; 754 | OTHER_LDFLAGS = ""; 755 | OTHER_LIBTOOLFLAGS = ""; 756 | PODS_ROOT = "$(SRCROOT)"; 757 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; 758 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 759 | SDKROOT = iphoneos; 760 | SKIP_INSTALL = YES; 761 | TARGETED_DEVICE_FAMILY = "1,2"; 762 | VERSIONING_SYSTEM = "apple-generic"; 763 | VERSION_INFO_PREFIX = ""; 764 | }; 765 | name = Debug; 766 | }; 767 | F34344081E82A724A99838947AF3B76D /* Release */ = { 768 | isa = XCBuildConfiguration; 769 | baseConfigurationReference = 12702C4DAFADC381CB75F06850D2BCDF /* Petstore.xcconfig */; 770 | buildSettings = { 771 | CODE_SIGN_IDENTITY = ""; 772 | "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; 773 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 774 | "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; 775 | CURRENT_PROJECT_VERSION = 1; 776 | DEFINES_MODULE = YES; 777 | DYLIB_COMPATIBILITY_VERSION = 1; 778 | DYLIB_CURRENT_VERSION = 1; 779 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 780 | GCC_PREFIX_HEADER = "Target Support Files/Petstore/Petstore-prefix.pch"; 781 | INFOPLIST_FILE = "Target Support Files/Petstore/Petstore-Info.plist"; 782 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 783 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 784 | LD_RUNPATH_SEARCH_PATHS = ( 785 | "$(inherited)", 786 | "@executable_path/Frameworks", 787 | "@loader_path/Frameworks", 788 | ); 789 | MODULEMAP_FILE = "Target Support Files/Petstore/Petstore.modulemap"; 790 | PRODUCT_MODULE_NAME = Petstore; 791 | PRODUCT_NAME = Petstore; 792 | SDKROOT = iphoneos; 793 | SKIP_INSTALL = YES; 794 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; 795 | SWIFT_VERSION = 4.2; 796 | TARGETED_DEVICE_FAMILY = "1,2"; 797 | VALIDATE_PRODUCT = YES; 798 | VERSIONING_SYSTEM = "apple-generic"; 799 | VERSION_INFO_PREFIX = ""; 800 | }; 801 | name = Release; 802 | }; 803 | /* End XCBuildConfiguration section */ 804 | 805 | /* Begin XCConfigurationList section */ 806 | 01ED2BBD7EB9D6903FB3BF4E2C3232B0 /* Build configuration list for PBXNativeTarget "Pods-APIClientTests" */ = { 807 | isa = XCConfigurationList; 808 | buildConfigurations = ( 809 | EF4FEF24036E5DD24D7442B5561FE7B5 /* Debug */, 810 | 937F767FEF9880A33BC08107C97FCBB9 /* Release */, 811 | ); 812 | defaultConfigurationIsVisible = 0; 813 | defaultConfigurationName = Release; 814 | }; 815 | 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { 816 | isa = XCConfigurationList; 817 | buildConfigurations = ( 818 | 07488D4657FB0A78086563621D425F8A /* Debug */, 819 | A1962E6FF39BBAC201A2E5DDF99557DF /* Release */, 820 | ); 821 | defaultConfigurationIsVisible = 0; 822 | defaultConfigurationName = Release; 823 | }; 824 | 5D609BC352BE529DDF52F91D41A950F4 /* Build configuration list for PBXNativeTarget "Petstore" */ = { 825 | isa = XCConfigurationList; 826 | buildConfigurations = ( 827 | 3FBBDF7ABB3496CD10AEC5ED16034A66 /* Debug */, 828 | F34344081E82A724A99838947AF3B76D /* Release */, 829 | ); 830 | defaultConfigurationIsVisible = 0; 831 | defaultConfigurationName = Release; 832 | }; 833 | 7EF0ACF3014FFFA832D8F9B958563227 /* Build configuration list for PBXNativeTarget "Pods-APIClient" */ = { 834 | isa = XCConfigurationList; 835 | buildConfigurations = ( 836 | 7D7D025EEFBD601180B4AB21D6EFF0CF /* Debug */, 837 | B07801CE663D4E53234550D7771E9CC9 /* Release */, 838 | ); 839 | defaultConfigurationIsVisible = 0; 840 | defaultConfigurationName = Release; 841 | }; 842 | /* End XCConfigurationList section */ 843 | }; 844 | rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; 845 | } 846 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Petstore/Petstore-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Petstore/Petstore-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Petstore : NSObject 3 | @end 4 | @implementation PodsDummy_Petstore 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Petstore/Petstore-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Petstore/Petstore-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double PetstoreVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char PetstoreVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Petstore/Petstore.modulemap: -------------------------------------------------------------------------------- 1 | framework module Petstore { 2 | umbrella header "Petstore-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Petstore/Petstore.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Petstore 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../Examples/Petstore 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_APIClient : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_APIClient 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_APIClientVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_APIClientVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | PODS_BUILD_DIR = ${BUILD_DIR} 3 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 4 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 5 | PODS_ROOT = ${SRCROOT}/Pods 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_APIClient { 2 | umbrella header "Pods-APIClient-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClient/Pods-APIClient.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | PODS_BUILD_DIR = ${BUILD_DIR} 3 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 4 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 5 | PODS_ROOT = ${SRCROOT}/Pods 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | ${PRODUCT_BUNDLE_IDENTIFIER} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ${PRODUCT_NAME} 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_APIClientTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_APIClientTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Petstore/Petstore.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Petstore.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Petstore/Petstore.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Petstore.framework -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | if [ -r "$source" ]; then 88 | # Copy the dSYM into a the targets temp dir. 89 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 90 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 91 | 92 | local basename 93 | basename="$(basename -s .framework.dSYM "$source")" 94 | binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" 95 | 96 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 97 | if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then 98 | strip_invalid_archs "$binary" 99 | fi 100 | 101 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 102 | # Move the stripped file into its final destination. 103 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 104 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 105 | else 106 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 107 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" 108 | fi 109 | fi 110 | } 111 | 112 | # Copies the bcsymbolmap files of a vendored framework 113 | install_bcsymbolmap() { 114 | local bcsymbolmap_path="$1" 115 | local destination="${BUILT_PRODUCTS_DIR}" 116 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 117 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 118 | } 119 | 120 | # Signs a framework with the provided identity 121 | code_sign_if_enabled() { 122 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 123 | # Use the current code_sign_identity 124 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 125 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 126 | 127 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 128 | code_sign_cmd="$code_sign_cmd &" 129 | fi 130 | echo "$code_sign_cmd" 131 | eval "$code_sign_cmd" 132 | fi 133 | } 134 | 135 | # Strip invalid architectures 136 | strip_invalid_archs() { 137 | binary="$1" 138 | # Get architectures for current target binary 139 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 140 | # Intersect them with the architectures we are building for 141 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 142 | # If there are no archs supported by this binary then warn the user 143 | if [[ -z "$intersected_archs" ]]; then 144 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 145 | STRIP_BINARY_RETVAL=0 146 | return 147 | fi 148 | stripped="" 149 | for arch in $binary_archs; do 150 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 151 | # Strip non-valid architectures in-place 152 | lipo -remove "$arch" -output "$binary" "$binary" 153 | stripped="$stripped $arch" 154 | fi 155 | done 156 | if [[ "$stripped" ]]; then 157 | echo "Stripped $binary of architectures:$stripped" 158 | fi 159 | STRIP_BINARY_RETVAL=1 160 | } 161 | 162 | 163 | if [[ "$CONFIGURATION" == "Debug" ]]; then 164 | install_framework "${BUILT_PRODUCTS_DIR}/Petstore/Petstore.framework" 165 | fi 166 | if [[ "$CONFIGURATION" == "Release" ]]; then 167 | install_framework "${BUILT_PRODUCTS_DIR}/Petstore/Petstore.framework" 168 | fi 169 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 170 | wait 171 | fi 172 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_APIClientTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_APIClientTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Petstore" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Petstore/Petstore.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Petstore" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_APIClientTests { 2 | umbrella header "Pods-APIClientTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-APIClientTests/Pods-APIClientTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Petstore" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Petstore/Petstore.framework/Headers" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 6 | OTHER_LDFLAGS = $(inherited) -framework "Petstore" 7 | OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS 8 | PODS_BUILD_DIR = ${BUILD_DIR} 9 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://app.bitrise.io/app/fb217dd8dc7e8002/status.svg?token=zgTIlwz2Qz-YPsOK6rQxUQ)](https://app.bitrise.io/app/fb217dd8dc7e8002) 2 | [![codecov](https://codecov.io/gh/folio-sec/APIClient/branch/master/graph/badge.svg)](https://codecov.io/gh/folio-sec/APIClient) 3 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 4 | 5 | # APIClient 6 | 7 | APIClient is a client library for OpenAPI. It makes OpenAPI generated code remarkably more straightforward than the default one. 8 | 9 | The generated code by Open API is a strongly tied scheme definition and networking code. It makes debugging and logging difficult. This library separates networking code from OpenAPI generated code, and you can depend on only schema and model definitions. 10 | 11 | 12 | #### BEFORE 13 | 14 | ```swift 15 | import Foundation 16 | import Alamofire 17 | 18 | open class PetAPI { 19 | open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?,_ error: Error?) -> Void)) { 20 | getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in 21 | completion(response?.body, error) 22 | } 23 | } 24 | 25 | open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { 26 | var path = "/pet/{petId}" 27 | let petIdPreEscape = "\(petId)" 28 | let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 29 | path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) 30 | let URLString = PetstoreAPI.basePath + path 31 | let parameters: [String:Any]? = nil 32 | 33 | let url = URLComponents(string: URLString) 34 | 35 | let requestBuilder: RequestBuilder.Type = PetstoreAPI.requestBuilderFactory.getBuilder() 36 | 37 | return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) 38 | } 39 | ... 40 | ``` 41 | 42 | #### AFTER 43 | 44 | ```swift 45 | import Foundation 46 | 47 | open class PetAPI { 48 | open class func getPetById(petId: Int64) -> RequestProvider { 49 | var path = "/pet/{petId}" 50 | let petIdPreEscape = "\(petId)" 51 | let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" 52 | path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) 53 | 54 | return RequestProvider(endpoint: path, method: "GET") 55 | } 56 | ... 57 | ``` 58 | 59 | `RequestProvider` just encodes an endpoint (path), parameters (query, form or JSON), an HTTP method and a response type. 60 | 61 | 62 | ## Usage 63 | 64 | Add an extension to convert OpenAPI's `RequestProvider` to APIClient's `Request`. 65 | 66 | ```swift 67 | import Foundation 68 | import APIClient 69 | import Petstore 70 | 71 | extension RequestProvider { 72 | func request() -> Request { 73 | if let parameters = parameters { 74 | switch parameters { 75 | case .query(let raw): 76 | return Request(endpoint: endpoint, method: method, parameters: Request.Parameters(raw)) 77 | case .form(let raw): 78 | return Request(endpoint: endpoint, method: method, parameters: Request.Parameters(raw)) 79 | case .json(let raw): 80 | return Request(endpoint: endpoint, method: method, parameters: Request.Parameters(raw)) 81 | } 82 | } 83 | return Request(endpoint: endpoint, method: method) 84 | } 85 | } 86 | ``` 87 | 88 | Initialize `Client` instance. 89 | 90 | ```swift 91 | let client = Client(baseURL: URL(string: "https://petstore.swagger.io/v2")!) 92 | ... 93 | ``` 94 | 95 | Then you can call `Client.perform` with `Request` object. 96 | 97 | ```swift 98 | client.perform(request: PetAPI.getPetById(petId: 1000).request()) { 99 | switch $0 { 100 | case .success(let response): 101 | let pet = response.body 102 | ... 103 | case .failure(let error): 104 | ... 105 | } 106 | } 107 | ``` 108 | 109 | ## Installation ## 110 | 111 | ### [Carthage] ### 112 | 113 | [Carthage]: https://github.com/Carthage/Carthage 114 | 115 | ``` 116 | github "folio-sec/APIClient" 117 | ``` 118 | 119 | Then run `carthage update`. 120 | 121 | Follow the current instructions in [Carthage's README][carthage-installation] 122 | for up to date installation instructions. 123 | 124 | [carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application 125 | 126 | ## Advanced 127 | 128 | ### Interceptor 129 | 130 | APIClient supports request and response interceptors. 131 | 132 | The following example is a logger interceptor. 133 | 134 | ```swift 135 | import Foundation 136 | import APIClient 137 | 138 | public struct Logger: Intercepting { 139 | public init() {} 140 | 141 | public func intercept(client: Client, request: URLRequest) -> URLRequest { 142 | print("\(requestToCurl(client: client, request: request))") 143 | return request 144 | } 145 | 146 | // swiftlint:disable large_tuple 147 | public func intercept(client: Client, request: URLRequest, response: URLResponse?, data: Data?, error: Error?) -> (URLResponse?, Data?, Error?) { 148 | if let response = response as? HTTPURLResponse { 149 | let path = request.url?.path ?? "" 150 | print("\(request.httpMethod?.uppercased() ?? "") \(path) \(response.statusCode)") 151 | } else if let error = error { 152 | print("\(error)") 153 | } 154 | return (response, data, error) 155 | } 156 | 157 | private func requestToCurl(client: Client, request: URLRequest) -> String { 158 | ... 159 | } 160 | } 161 | ``` 162 | 163 | ```swift 164 | client.interceptors = [Logger()] 165 | ... 166 | ``` 167 | 168 | ### Authenticator 169 | 170 | The Authenticator has an opportunity to retry when it receives a 401 response. It will be used to seamlessly refresh access tokens. 171 | 172 | ```swift 173 | import Foundation 174 | import APIClient 175 | 176 | struct Authenticator: Intercepting, Authenticating { 177 | private let credentials: Credentials 178 | 179 | init(credentials: Credentials) { 180 | self.credentials = credentials 181 | } 182 | 183 | func intercept(client: Client, request: URLRequest) -> URLRequest { 184 | return sign(request: request) 185 | } 186 | 187 | func authenticate(client: Client, request: URLRequest, response: HTTPURLResponse, data: Data?, completion: @escaping (AuthenticationResult) -> Void) { 188 | switch response.statusCode { 189 | case 401: 190 | if let url = request.url, !url.path.hasSuffix("/login"), let refreshToken = credentials.fetch()?.refreshToken { 191 | client.perform(request: AuthenticationAPI.authorize(refreshToken: refreshToken).request()) { 192 | switch $0 { 193 | case .success(let response): 194 | let body = response.body 195 | self.credentials.update(token: Token(accessToken: body.accessToken, refreshToken: body.refreshToken, expiry: Date().addingTimeInterval(TimeInterval(body.expiresIn)))) 196 | completion(.success(self.sign(request: request))) 197 | return 198 | case .failure(let error): 199 | switch error { 200 | case .networkError, .decodingError: 201 | completion(.failure(error)) 202 | return 203 | case .responseError(let code, _, _): 204 | switch code { 205 | case 400...499: 206 | self.credentials.update(token: nil) 207 | completion(.failure(error)) 208 | return 209 | case 500...499: 210 | completion(.failure(error)) 211 | return 212 | default: 213 | break 214 | } 215 | } 216 | completion(.failure(error)) 217 | return 218 | } 219 | } 220 | } else { 221 | completion(.cancel) 222 | return 223 | } 224 | default: 225 | completion(.cancel) 226 | return 227 | } 228 | } 229 | 230 | private func sign(request: URLRequest) -> URLRequest { 231 | var request = request 232 | if let url = request.url, !url.path.hasSuffix("/login") { 233 | if let accessToken = credentials.fetch()?.accessToken { 234 | request.setValue("Bearer \(accessToken)", forHTTPHeaderField: "Authorization") 235 | } 236 | } 237 | return request 238 | } 239 | } 240 | ``` 241 | 242 | ```swift 243 | let authenticator = Authenticator(credentials: credentials) 244 | client.authenticator = authenticator 245 | client.interceptors = [authenticator] + client.interceptors // for signing all requests 246 | ... 247 | ``` 248 | -------------------------------------------------------------------------------- /Sources/APIClient/APIClient.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | FOUNDATION_EXPORT double APIClientVersionNumber; 4 | FOUNDATION_EXPORT const unsigned char APIClientVersionString[]; 5 | -------------------------------------------------------------------------------- /Sources/APIClient/Authenticator.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol Authenticating { 4 | func shouldRetry(client: Client, request: URLRequest, response: HTTPURLResponse, data: Data?) -> Bool 5 | func authenticate(client: Client, request: URLRequest, response: HTTPURLResponse, data: Data?, completion: @escaping (AuthenticationResult) -> Void) 6 | } 7 | 8 | public enum AuthenticationResult { 9 | case success(URLRequest) 10 | case failure(Failure) 11 | case cancel 12 | } 13 | -------------------------------------------------------------------------------- /Sources/APIClient/Client.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public class Client { 4 | public let baseURL: URL 5 | public let headers: [AnyHashable: Any] 6 | public let configuration: Configuration 7 | 8 | public var authenticator: Authenticating? 9 | public var interceptors = [Intercepting]() 10 | 11 | private let session: URLSession 12 | private let queue = DispatchQueue.init(label: "com.folio-sec.api-client", qos: .userInitiated) 13 | private let taskExecutor = TaskExecutor() 14 | 15 | private var pendingRequests = [PendingRequest]() 16 | private var isRetrying = false 17 | 18 | private lazy var decoder: JSONDecoder = { 19 | let decoder = JSONDecoder() 20 | decoder.dateDecodingStrategy = configuration.dateDecodingStrategy 21 | decoder.dataDecodingStrategy = configuration.dataDecodingStrategy 22 | return decoder 23 | }() 24 | 25 | public init(baseURL: URL, headers: [AnyHashable: Any] = [:], configuration: Configuration = Configuration()) { 26 | self.baseURL = baseURL 27 | self.headers = headers 28 | self.configuration = configuration 29 | 30 | let config = URLSessionConfiguration.ephemeral 31 | config.httpAdditionalHeaders = headers 32 | config.timeoutIntervalForRequest = configuration.timeoutIntervalForRequest 33 | config.timeoutIntervalForResource = configuration.timeoutIntervalForResource 34 | 35 | session = URLSession(configuration: config) 36 | } 37 | 38 | public func cancel(taskIdentifier: Int) { 39 | taskExecutor.cancel(taskIdentifier: taskIdentifier) 40 | } 41 | 42 | public func cancelAll() { 43 | taskExecutor.cancelAll() 44 | } 45 | 46 | public func perform(request: Request, completion: @escaping (Result, Failure>) -> Void) { 47 | queue.async { [weak self] in 48 | guard let self = self else { return } 49 | self.perform(request: request.makeURLRequest(baseURL: self.baseURL), completion: completion) 50 | } 51 | } 52 | 53 | private func perform(request: URLRequest, completion: @escaping (Result, Failure>) -> Void) { 54 | interceptRequest(interceptors: self.interceptors, request: request) { [weak self] (request) in 55 | guard let self = self else { return } 56 | 57 | let task = self.session.dataTask(with: request) { [weak self] (data, response, error) in 58 | guard let self = self else { return } 59 | 60 | self.queue.async { [weak self] in 61 | guard let self = self else { return } 62 | 63 | self.interceptResponse(interceptors: self.interceptors, request: request, response: response, data: data, error: error) { [weak self] (response, data, error) in 64 | guard let self = self else { return } 65 | 66 | self.queue.async { [weak self] in 67 | guard let self = self else { return } 68 | self.handleResponse(request: request, response: response, data: data, error: error, completion: completion) 69 | } 70 | } 71 | self.taskExecutor.startPendingTasks() 72 | } 73 | } 74 | self.taskExecutor.push(Task(sessionTask: task)) 75 | } 76 | } 77 | 78 | private func handleResponse(request: URLRequest, response: URLResponse?, data: Data?, error: Error?, completion: @escaping (Result, Failure>) -> Void) { 79 | let q = configuration.queue 80 | 81 | if let error = error { 82 | q.async { 83 | completion(.failure(.networkError(error))) 84 | } 85 | return 86 | } 87 | if let response = response as? HTTPURLResponse, let data = data { 88 | let statusCode = response.statusCode 89 | switch statusCode { 90 | case 100...199: // Informational 91 | break 92 | case 200...299: // Success 93 | switch ResponseBody.self { 94 | case is String.Type: 95 | q.async { 96 | completion(.success(Response(statusCode: response.statusCode, headers: response.allHeaderFields, body: (String(data: data, encoding: .utf8) ?? "") as! ResponseBody))) 97 | } 98 | case is Void.Type: 99 | q.async { 100 | completion(.success(Response(statusCode: response.statusCode, headers: response.allHeaderFields, body: () as! ResponseBody))) 101 | } 102 | case let decodableType as Decodable.Type: 103 | do { 104 | let responseBody = try decodableType.init(decoder: decoder, data: data) as! ResponseBody 105 | q.async { 106 | completion(.success(Response(statusCode: response.statusCode, headers: response.allHeaderFields, body: responseBody))) 107 | } 108 | } catch { 109 | q.async { 110 | completion(.failure(.decodingError(error, response.statusCode, response.allHeaderFields, data))) 111 | } 112 | } 113 | default: 114 | fatalError("unexpected response type: \(ResponseBody.self)") 115 | } 116 | case 300...399: // Redirection 117 | break 118 | case 400...499: // Client Error 119 | if let authenticator = self.authenticator, authenticator.shouldRetry(client: self, request: request, response: response, data: data) { 120 | if !isRetrying { 121 | isRetrying = true 122 | 123 | self.authenticate(authenticator: authenticator, request: request, response: response, data: data) { [weak self] (result) in 124 | guard let self = self else { return } 125 | 126 | self.queue.async { [weak self] in 127 | guard let self = self else { return } 128 | 129 | switch result { 130 | case .success(let request): 131 | self.perform(request: request, completion: completion) 132 | self.retryPendingRequests() 133 | case .failure(let error): 134 | q.async { 135 | completion(.failure(error)) 136 | } 137 | self.failPendingRequests(error) 138 | case .cancel: 139 | let error = Failure.responseError(statusCode, response.allHeaderFields, data) 140 | q.async { 141 | completion(.failure(error)) 142 | } 143 | self.cancelPendingRequests(error) 144 | } 145 | 146 | self.isRetrying = false 147 | } 148 | } 149 | } else { 150 | let pendingRequest = PendingRequest(request: request, 151 | retry: { self.perform(request: request, completion: completion) }, 152 | fail: { (error) in q.async { completion(.failure(error)) } }, 153 | cancel: { _ in q.async { completion(.failure(.responseError(statusCode, response.allHeaderFields, data))) } }) 154 | pendingRequests.append(pendingRequest) 155 | } 156 | } else { 157 | q.async { 158 | completion(.failure(.responseError(statusCode, response.allHeaderFields, data))) 159 | } 160 | } 161 | case 500...599: // Server Error 162 | q.async { 163 | completion(.failure(.responseError(statusCode, response.allHeaderFields, data))) 164 | } 165 | default: 166 | break 167 | } 168 | } 169 | } 170 | 171 | private func retryPendingRequests() { 172 | for request in pendingRequests { 173 | request.retry() 174 | } 175 | pendingRequests.removeAll() 176 | } 177 | 178 | private func failPendingRequests(_ error: Failure) { 179 | for request in pendingRequests { 180 | request.fail(error) 181 | } 182 | pendingRequests.removeAll() 183 | } 184 | 185 | private func cancelPendingRequests(_ error: Failure) { 186 | for request in pendingRequests { 187 | request.cancel(error) 188 | } 189 | pendingRequests.removeAll() 190 | } 191 | 192 | private func interceptRequest(interceptors: [Intercepting], request: URLRequest, completion: @escaping (URLRequest) -> Void) { 193 | completion(interceptors.reduce(request) { $1.intercept(client: self, request: $0) }) 194 | } 195 | 196 | private func interceptResponse(interceptors: [Intercepting], request: URLRequest, response: URLResponse?, data: Data?, error: Error?, completion: @escaping (URLResponse?, Data?, Error?) -> Void) { 197 | let (response, data, error) = interceptors.reduce((response, data, error)) { $1.intercept(client: self, request: request, response: $0.0, data: $0.1, error: $0.2) } 198 | completion(response, data, error) 199 | } 200 | 201 | private func authenticate(authenticator: Authenticating, request: URLRequest, response: HTTPURLResponse, data: Data?, completion: @escaping (AuthenticationResult) -> Void) { 202 | let client = Client(baseURL: baseURL, headers: headers, configuration: configuration) 203 | client.interceptors = interceptors 204 | authenticator.authenticate(client: client, request: request, response: response, data: data) { 205 | completion($0) 206 | withExtendedLifetime(client) {} 207 | } 208 | } 209 | } 210 | 211 | private struct PendingRequest { 212 | let request: URLRequest 213 | let retry: () -> Void 214 | let fail: (Failure) -> Void 215 | let cancel: (Failure) -> Void 216 | } 217 | 218 | private class TaskExecutor { 219 | private var tasks = [Task]() 220 | private var runningTasks = [Int: Task]() 221 | private let maxConcurrentTasks = 4 222 | 223 | func push(_ task: Task) { 224 | if let index = tasks.firstIndex(of: task) { 225 | tasks.remove(at: index) 226 | } 227 | tasks.append(task) 228 | startPendingTasks() 229 | } 230 | 231 | func cancel(taskIdentifier: Int) { 232 | if let task = runningTasks[taskIdentifier] { 233 | task.sessionTask.cancel() 234 | runningTasks[taskIdentifier] = nil 235 | } 236 | } 237 | 238 | func cancelAll() { 239 | (tasks + runningTasks.values).forEach { $0.sessionTask.cancel() } 240 | tasks.removeAll() 241 | runningTasks.removeAll() 242 | } 243 | 244 | func startPendingTasks() { 245 | for runningTask in runningTasks { 246 | switch runningTask.value.sessionTask.state { 247 | case .running, .suspended, .canceling: 248 | break 249 | case .completed: 250 | runningTasks[runningTask.key] = nil 251 | @unknown default: 252 | break 253 | } 254 | } 255 | while tasks.count > 0 && runningTasks.count <= maxConcurrentTasks { 256 | let task = tasks.removeLast() 257 | task.sessionTask.resume() 258 | runningTasks[task.taskIdentifier] = task 259 | } 260 | } 261 | } 262 | 263 | private class Task: Hashable { 264 | let sessionTask: URLSessionTask 265 | let taskIdentifier: Int 266 | 267 | init(sessionTask: URLSessionTask) { 268 | self.sessionTask = sessionTask 269 | self.taskIdentifier = sessionTask.taskIdentifier 270 | } 271 | 272 | func hash(into hasher: inout Hasher) { 273 | hasher.combine(taskIdentifier) 274 | } 275 | 276 | static func == (lhs: Task, rhs: Task) -> Bool { 277 | return lhs.taskIdentifier == rhs.taskIdentifier 278 | } 279 | } 280 | 281 | private extension Decodable { 282 | init(decoder: JSONDecoder, data: Data) throws { 283 | self = try decoder.decode(Self.self, from: data) 284 | } 285 | } 286 | -------------------------------------------------------------------------------- /Sources/APIClient/Configuration.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct Configuration { 4 | public let dateDecodingStrategy: JSONDecoder.DateDecodingStrategy 5 | public let dataDecodingStrategy: JSONDecoder.DataDecodingStrategy 6 | 7 | public let timeoutIntervalForRequest: TimeInterval 8 | public let timeoutIntervalForResource: TimeInterval 9 | 10 | public let queue: DispatchQueue 11 | 12 | public init(dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .iso8601, 13 | dataDecodingStrategy: JSONDecoder.DataDecodingStrategy = .base64, 14 | timeoutIntervalForRequest: TimeInterval = 60, 15 | timeoutIntervalForResource: TimeInterval = 604800, 16 | queue: DispatchQueue = DispatchQueue.main) { 17 | self.dateDecodingStrategy = dateDecodingStrategy 18 | self.dataDecodingStrategy = dataDecodingStrategy 19 | self.timeoutIntervalForRequest = timeoutIntervalForRequest 20 | self.timeoutIntervalForResource = timeoutIntervalForResource 21 | self.queue = queue 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Sources/APIClient/Interceptor.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public protocol Intercepting { 4 | func intercept(client: Client, request: URLRequest) -> URLRequest 5 | func intercept(client: Client, request: URLRequest, response: URLResponse?, data: Data?, error: Error?) -> (URLResponse?, Data?, Error?) 6 | } 7 | 8 | public extension Intercepting { 9 | func intercept(client: Client, request: URLRequest) -> URLRequest { 10 | return request 11 | } 12 | 13 | func intercept(client: Client, request: URLRequest, response: URLResponse?, data: Data?, error: Error?) -> (URLResponse?, Data?, Error?) { 14 | return (response, data, error) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Sources/APIClient/Request.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct Request { 4 | public let endpoint: String 5 | public let method: String 6 | public let parameters: Parameters? 7 | 8 | public init(endpoint: String, method: String, parameters: Parameters? = nil) { 9 | self.endpoint = endpoint 10 | self.method = method 11 | self.parameters = parameters 12 | } 13 | 14 | public enum Parameters { 15 | case query([String: Any?]) 16 | case form([String: String?]) 17 | case multipart([String: Any?]) 18 | case json(Data?) 19 | 20 | public init(_ raw: [String: Any?]) { 21 | self = .query(raw) 22 | } 23 | 24 | public init(_ raw: [String: String?]) { 25 | self = .form(raw) 26 | } 27 | 28 | public init(_ raw: T, dateEncodingStrategy: JSONEncoder.DateEncodingStrategy = .iso8601, dataEncodingStrategy: JSONEncoder.DataEncodingStrategy = .base64) { 29 | let encoder = JSONEncoder() 30 | encoder.dateEncodingStrategy = dateEncodingStrategy 31 | encoder.dataEncodingStrategy = dataEncodingStrategy 32 | if let data = try? encoder.encode(raw) { 33 | self = .json(data) 34 | } else { 35 | self = .json(nil) 36 | } 37 | } 38 | } 39 | 40 | func makeURLRequest(baseURL: URL) -> URLRequest { 41 | let url = baseURL.appendingPathComponent(endpoint) 42 | 43 | var request = URLRequest(url: url) 44 | request.httpMethod = method.description 45 | 46 | if let parameters = parameters { 47 | switch parameters { 48 | case .query(let raw): 49 | if var components = URLComponents(url: url, resolvingAgainstBaseURL: false) { 50 | var queryItems = [URLQueryItem]() 51 | for (key, value) in raw { 52 | switch value { 53 | case let values as [Any?]: 54 | queryItems.append(contentsOf: values.compactMap { 55 | if let value = $0 { 56 | return URLQueryItem(name: key, value: "\(value)".addingPercentEncoding(withAllowedCharacters: .alphanumerics)) 57 | } 58 | return nil 59 | }) 60 | case let value?: 61 | queryItems.append(URLQueryItem(name: key, value: "\(value)".addingPercentEncoding(withAllowedCharacters: .alphanumerics))) 62 | default: 63 | break 64 | } 65 | } 66 | if #available(iOS 11.0, *) { 67 | components.percentEncodedQueryItems = queryItems 68 | } else { 69 | components.queryItems = queryItems 70 | } 71 | request.url = components.url 72 | } 73 | case .form(let raw): 74 | var components = URLComponents() 75 | components.queryItems = raw.compactMap { 76 | if let value = $0.value { 77 | return URLQueryItem(name: $0.key, value: value.addingPercentEncoding(withAllowedCharacters: .alphanumerics)) 78 | } 79 | return nil 80 | } 81 | 82 | if let query = components.query { 83 | request.addValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") 84 | request.httpBody = query.data(using: .utf8) 85 | } 86 | case .multipart(let raw): 87 | let boundaryIdentifier = UUID().uuidString 88 | 89 | let boundary = "--\(boundaryIdentifier)\r\n".data(using: .utf8)! 90 | var body = Data() 91 | 92 | for multipartFormData in raw.compactMap({ data in data.value.map { MultipartFormData(name: data.key, data: $0) } }) { 93 | body.append(boundary) 94 | body.append(multipartFormData.encode()) 95 | } 96 | body.append("--\(boundaryIdentifier)--\r\n".data(using: .utf8)!) 97 | 98 | request.addValue("multipart/form-data; boundary=\(boundaryIdentifier)", forHTTPHeaderField: "Content-Type") 99 | request.httpBody = body 100 | case .json(let data): 101 | request.addValue("application/json; charset=utf-8", forHTTPHeaderField: "Content-Type") 102 | request.httpBody = data 103 | } 104 | } 105 | 106 | return request 107 | } 108 | 109 | struct MultipartFormData { 110 | let name: String 111 | let data: Any 112 | 113 | func encode() -> Data { 114 | var encoded = Data() 115 | 116 | encoded.append(#"Content-Disposition: form-data; name="\#(name)""#.data(using: .utf8)!) 117 | if let url = data as? URL { 118 | encoded.append(#"; filename="\#(url.lastPathComponent)""#.data(using: .utf8)!) 119 | } 120 | encoded.append("\r\n".data(using: .utf8)!) 121 | 122 | let body = encodeBody() 123 | encoded.append("Content-Length: \(body.count)\r\n\r\n".data(using: .utf8)!) 124 | 125 | encoded.append(body) 126 | encoded.append("\r\n".data(using: .utf8)!) 127 | return encoded 128 | } 129 | 130 | func encodeBody() -> Data { 131 | switch data { 132 | case let number as Int: 133 | if let body = "\(number)".data(using: .utf8) { 134 | return body 135 | } 136 | case let string as String: 137 | if let body = string.data(using: .utf8) { 138 | return body 139 | } 140 | case let url as URL: 141 | if let body = try? Data(contentsOf: url) { 142 | return body 143 | } 144 | case let data as Data: 145 | return data 146 | default: 147 | if let body = "\(data)".data(using: .utf8) { 148 | return body 149 | } 150 | } 151 | 152 | return Data() 153 | } 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /Sources/APIClient/Response.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public struct Response { 4 | public let statusCode: Int 5 | public let headers: [AnyHashable: Any] 6 | public let body: ResponseBody 7 | 8 | public init(statusCode: Int, headers: [AnyHashable: Any], body: ResponseBody) { 9 | self.statusCode = statusCode 10 | self.headers = headers 11 | self.body = body 12 | } 13 | } 14 | 15 | public enum Failure: Error { 16 | case networkError(Error) 17 | case decodingError(Error, Int, [AnyHashable: Any], Data) 18 | case responseError(Int, [AnyHashable: Any], Data) 19 | } 20 | -------------------------------------------------------------------------------- /Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 0.6.2 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Tests/APIClientTests/APIClientTests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import APIClient 3 | import Petstore 4 | 5 | class APIClientTests: XCTestCase { 6 | lazy var client: Client = { 7 | let dateFormatter = DateFormatter() 8 | dateFormatter.calendar = Calendar(identifier: .gregorian) 9 | dateFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZ" 10 | 11 | let configuration = Configuration(dateDecodingStrategy: .formatted(dateFormatter)) 12 | let client = Client(baseURL: URL(string: "https://petstore.swagger.io/v2")!, 13 | configuration: configuration) 14 | return client 15 | }() 16 | 17 | override func setUp() { 18 | super.setUp() 19 | client.interceptors = [Logger()] 20 | 21 | let ex = expectation(description: "testAddPet") 22 | 23 | let category = Category(_id: 1234, name: "eyeColor") 24 | let tags = [Tag(_id: 1234, name: "New York"), Tag(_id: 124321, name: "Jose")] 25 | let newPet = Pet(_id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) 26 | 27 | client.perform(request: PetAPI.addPet(pet: newPet).request()) { 28 | switch $0 { 29 | case .success(let response): 30 | XCTAssertEqual(response.statusCode, 200) 31 | case .failure(let error): 32 | XCTFail("request failed: \(error)") 33 | } 34 | ex.fulfill() 35 | } 36 | 37 | waitForExpectations(timeout: 10) 38 | } 39 | 40 | func testQueryParameter1() { 41 | struct Interceptor: Intercepting { 42 | func intercept(client: Client, request: URLRequest) -> URLRequest { 43 | XCTAssertEqual(request.url?.query?.removingPercentEncoding, "tags=kishikawakatsumi+test@gmail.com") 44 | return request 45 | } 46 | } 47 | 48 | client.interceptors = client.interceptors + [Interceptor()] 49 | 50 | let ex = expectation(description: "testQueryParameter1") 51 | client.perform(request: PetAPI.findPetsByTags(tags: ["kishikawakatsumi+test@gmail.com"]).request()) { _ in 52 | ex.fulfill() 53 | } 54 | 55 | waitForExpectations(timeout: 10) 56 | } 57 | 58 | func testQueryParameter2() { 59 | struct Interceptor: Intercepting { 60 | func intercept(client: Client, request: URLRequest) -> URLRequest { 61 | XCTAssertEqual(request.url?.query?.removingPercentEncoding, "tags=a b+c") 62 | return request 63 | } 64 | } 65 | 66 | client.interceptors = client.interceptors + [Interceptor()] 67 | 68 | let ex = expectation(description: "testQueryParameter2") 69 | client.perform(request: PetAPI.findPetsByTags(tags: ["a b+c"]).request()) { _ in 70 | ex.fulfill() 71 | } 72 | 73 | waitForExpectations(timeout: 10) 74 | } 75 | 76 | func testFormParameter1() { 77 | struct Interceptor: Intercepting { 78 | func intercept(client: Client, request: URLRequest) -> URLRequest { 79 | if let httpBody = request.httpBody { 80 | XCTAssertEqual(String(data: httpBody, encoding: .utf8)?.removingPercentEncoding, "name=kishikawakatsumi+test@gmail.com") 81 | } 82 | return request 83 | } 84 | } 85 | 86 | client.interceptors = client.interceptors + [Interceptor()] 87 | 88 | let ex = expectation(description: "testFormParameter1") 89 | client.perform(request: PetAPI.updatePetWithForm(petId: 0, name: "kishikawakatsumi+test@gmail.com", status: nil).request()) { _ in 90 | ex.fulfill() 91 | } 92 | 93 | waitForExpectations(timeout: 10) 94 | } 95 | 96 | func testAddPet() { 97 | let ex = expectation(description: "testAddPet") 98 | 99 | let category = Category(_id: 1234, name: "eyeColor") 100 | let tags = [Tag(_id: 1234, name: "New York"), Tag(_id: 124321, name: "Jose")] 101 | let newPet = Pet(_id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) 102 | 103 | client.perform(request: PetAPI.addPet(pet: newPet).request()) { 104 | switch $0 { 105 | case .success(let response): 106 | XCTAssertEqual(response.statusCode, 200) 107 | case .failure(let error): 108 | XCTFail("request failed: \(error)") 109 | } 110 | ex.fulfill() 111 | } 112 | 113 | waitForExpectations(timeout: 10) 114 | } 115 | 116 | func testUpdatePet() { 117 | let ex = expectation(description: "testUpdatePet") 118 | 119 | let category = Category(_id: 1234, name: "eyeColor") 120 | let tags = [Tag(_id: 1234, name: "New York"), Tag(_id: 124321, name: "Jose")] 121 | let newPet = Pet(_id: 1000, category: category, name: "Fluffy", photoUrls: ["https://petstore.com/sample/photo1.jpg", "https://petstore.com/sample/photo2.jpg"], tags: tags, status: .available) 122 | 123 | client.perform(request: PetAPI.updatePet(pet: newPet).request()) { 124 | switch $0 { 125 | case .success(let response): 126 | XCTAssertEqual(response.statusCode, 200) 127 | case .failure(let error): 128 | XCTFail("request failed: \(error)") 129 | } 130 | ex.fulfill() 131 | } 132 | 133 | waitForExpectations(timeout: 10) 134 | } 135 | 136 | func testGetPetById() { 137 | let ex = expectation(description: "testGetPetById") 138 | 139 | self.client.perform(request: PetAPI.getPetById(petId: 1000).request()) { 140 | switch $0 { 141 | case .success(let response): 142 | XCTAssertEqual(response.statusCode, 200) 143 | let pet = response.body 144 | XCTAssertEqual(pet._id, 1000, "invalid id") 145 | XCTAssertEqual(pet.name, "Fluffy", "invalid name") 146 | case .failure(let error): 147 | XCTFail("request failed: \(error)") 148 | } 149 | ex.fulfill() 150 | } 151 | 152 | waitForExpectations(timeout: 10) 153 | } 154 | 155 | func testUpdatePetWithForm() { 156 | let ex = expectation(description: "") 157 | 158 | self.client.perform(request: PetAPI.updatePetWithForm(petId: 1000, name: "Fluffy", status: Pet.Status.available.rawValue).request()) { 159 | switch $0 { 160 | case .success(let response): 161 | XCTAssertEqual(response.statusCode, 200) 162 | case .failure(let error): 163 | XCTFail("request failed: \(error)") 164 | } 165 | ex.fulfill() 166 | } 167 | waitForExpectations(timeout: 10) 168 | } 169 | 170 | func testDeletePet() { 171 | let ex = expectation(description: "testDeletePet") 172 | 173 | client.perform(request: PetAPI.deletePet(petId: 1000).request()) { 174 | switch $0 { 175 | case .success(let response): 176 | XCTAssertEqual(response.statusCode, 200) 177 | case .failure(let error): 178 | XCTFail("request failed: \(error)") 179 | } 180 | ex.fulfill() 181 | } 182 | 183 | waitForExpectations(timeout: 10) 184 | } 185 | 186 | func testGetInventory() { 187 | let ex = expectation(description: "") 188 | 189 | client.perform(request: StoreAPI.getInventory().request()) { 190 | switch $0 { 191 | case .success(let response): 192 | XCTAssertEqual(response.statusCode, 200) 193 | case .failure(let error): 194 | XCTFail("request failed: \(error)") 195 | } 196 | ex.fulfill() 197 | } 198 | 199 | waitForExpectations(timeout: 10) 200 | } 201 | 202 | func testPlaceOrder() { 203 | let ex = expectation(description: "testPlaceOrder") 204 | 205 | let shipDate = Date() 206 | let order = Order(_id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) 207 | client.perform(request: StoreAPI.placeOrder(order: order).request()) { 208 | switch $0 { 209 | case .success(let response): 210 | XCTAssertEqual(response.statusCode, 200) 211 | 212 | XCTAssert(response.body._id == 1000, "invalid id") 213 | XCTAssert(response.body.quantity == 10, "invalid quantity") 214 | XCTAssert(response.body.status == .placed, "invalid status") 215 | case .failure(let error): 216 | XCTFail("request failed: \(error)") 217 | } 218 | ex.fulfill() 219 | } 220 | 221 | waitForExpectations(timeout: 10) 222 | } 223 | 224 | func testGetOrderById() { 225 | var ex = expectation(description: "testPlaceOrder") 226 | 227 | let shipDate = Date() 228 | let order = Order(_id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) 229 | client.perform(request: StoreAPI.placeOrder(order: order).request()) { 230 | switch $0 { 231 | case .success(let response): 232 | XCTAssertEqual(response.statusCode, 200) 233 | 234 | XCTAssert(response.body._id == 1000, "invalid id") 235 | XCTAssert(response.body.quantity == 10, "invalid quantity") 236 | XCTAssert(response.body.status == .placed, "invalid status") 237 | case .failure(let error): 238 | XCTFail("request failed: \(error)") 239 | } 240 | ex.fulfill() 241 | } 242 | 243 | waitForExpectations(timeout: 10) 244 | 245 | ex = expectation(description: "testGetOrderById") 246 | 247 | client.perform(request: StoreAPI.getOrderById(orderId: 1000).request()) { 248 | switch $0 { 249 | case .success(let response): 250 | XCTAssertEqual(response.statusCode, 200) 251 | 252 | XCTAssert(response.body._id == 1000, "invalid id") 253 | XCTAssert(response.body.quantity == 10, "invalid quantity") 254 | XCTAssert(response.body.status == .placed, "invalid status") 255 | case .failure(let error): 256 | XCTFail("request failed: \(error)") 257 | } 258 | ex.fulfill() 259 | } 260 | 261 | waitForExpectations(timeout: 10) 262 | } 263 | 264 | func testLoginUser() { 265 | let ex = expectation(description: "testLoginUser") 266 | 267 | client.perform(request: UserAPI.loginUser(username: "swiftTester", password: "swift").request()) { 268 | switch $0 { 269 | case .success(let response): 270 | XCTAssertEqual(response.statusCode, 200) 271 | case .failure(let error): 272 | XCTFail("request failed: \(error)") 273 | } 274 | ex.fulfill() 275 | } 276 | 277 | waitForExpectations(timeout: 10) 278 | } 279 | 280 | func testLogoutUser() { 281 | let ex = expectation(description: "testLogoutUser") 282 | 283 | client.perform(request: UserAPI.logoutUser().request()) { 284 | switch $0 { 285 | case .success(let response): 286 | XCTAssertEqual(response.statusCode, 200) 287 | case .failure(let error): 288 | XCTFail("request failed: \(error)") 289 | } 290 | ex.fulfill() 291 | } 292 | 293 | waitForExpectations(timeout: 10) 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /Tests/APIClientTests/Logger.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import APIClient 3 | 4 | public struct Logger: Intercepting { 5 | public init() {} 6 | 7 | public func intercept(client: Client, request: URLRequest) -> URLRequest { 8 | print("\(requestToCurl(client: client, request: request))") 9 | return request 10 | } 11 | 12 | // swiftlint:disable large_tuple 13 | public func intercept(client: Client, request: URLRequest, response: URLResponse?, data: Data?, error: Error?) -> (URLResponse?, Data?, Error?) { 14 | if let response = response as? HTTPURLResponse { 15 | let path = request.url?.path ?? "" 16 | print("\(request.httpMethod?.uppercased() ?? "") \(path) \(response.statusCode)") 17 | } else if let error = error { 18 | print("\(error)") 19 | } 20 | return (response, data, error) 21 | } 22 | 23 | private func requestToCurl(client: Client, request: URLRequest) -> String { 24 | guard let url = request.url else { return "" } 25 | 26 | var baseCommand = "curl \(url.absoluteString)" 27 | if request.httpMethod == "HEAD" { 28 | baseCommand += " --head" 29 | } 30 | var command = [baseCommand] 31 | if let method = request.httpMethod, method != "GET" && method != "HEAD" { 32 | command.append("-X \(method)") 33 | } 34 | if let headers = request.allHTTPHeaderFields { 35 | for (key, value) in client.headers { 36 | if let key = key as? String, key != "Cookie" { 37 | command.append("-H '\(key): \(value)'") 38 | } 39 | } 40 | for (key, value) in headers where key != "Cookie" { 41 | command.append("-H '\(key): \(value)'") 42 | } 43 | } 44 | if let data = request.httpBody, let body = String(data: data, encoding: .utf8) { 45 | command.append("-d '\(body)'") 46 | } 47 | 48 | return command.joined(separator: " \\\n\t") 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Tests/APIClientTests/RequestProvider.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | import APIClient 3 | import Petstore 4 | 5 | extension RequestProvider { 6 | func request() -> Request { 7 | if let parameters = parameters { 8 | switch parameters { 9 | case .query(let raw): 10 | return Request(endpoint: endpoint, method: method, parameters: Request.Parameters(raw)) 11 | case .form(let raw): 12 | return Request(endpoint: endpoint, method: method, parameters: Request.Parameters(raw)) 13 | case .json(let raw): 14 | return Request(endpoint: endpoint, method: method, parameters: Request.Parameters(raw)) 15 | } 16 | } 17 | return Request(endpoint: endpoint, method: method) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | --------------------------------------------------------------------------------