diff --git a/CI/samples.ci/client/petstore/R/pom.xml b/CI/samples.ci/client/petstore/R/pom.xml new file mode 100644 index 000000000000..949b3cd6bc4c --- /dev/null +++ b/CI/samples.ci/client/petstore/R/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + RPetstoreClientTests + pom + 1.0-SNAPSHOT + R OpenAPI Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + nose-test + integration-test + + exec + + + bash + + test_petstore.bash + + + + + + + + diff --git a/CI/samples.ci/client/petstore/R/test_petstore.bash b/CI/samples.ci/client/petstore/R/test_petstore.bash new file mode 100644 index 000000000000..ad0b3a6aa19c --- /dev/null +++ b/CI/samples.ci/client/petstore/R/test_petstore.bash @@ -0,0 +1,22 @@ +#!/bin/bash + +set -e + +REPO=http://cran.revolutionanalytics.com + +export R_LIBS_USER=$HOME/R + +echo "R lib directory: $R_LIBS_USER" + +mkdir $R_LIBS_USER || true + +Rscript -e "install.packages('jsonlite', repos='$REPO', lib='$R_LIBS_USER')" +Rscript -e "install.packages('httr', repos='$REPO', lib='$R_LIBS_USER')" +Rscript -e "install.packages('testthat', repos='$REPO', lib='$R_LIBS_USER')" +Rscript -e "install.packages('R6', repos='$REPO', lib='$R_LIBS_USER')" +Rscript -e "install.packages('caTools', repos='$REPO', lib='$R_LIBS_USER')" +Rscript -e "install.packages('rlang', repos='$REPO', lib='$R_LIBS_USER')" + +R CMD build . +R CMD check *tar.gz --no-manual +R CMD INSTALL *tar.gz diff --git a/CI/samples.ci/client/petstore/R/testthat.R b/CI/samples.ci/client/petstore/R/testthat.R new file mode 100644 index 000000000000..d67bd9cf2380 --- /dev/null +++ b/CI/samples.ci/client/petstore/R/testthat.R @@ -0,0 +1,4 @@ +library(testthat) +library(petstore) + +test_check("petstore") diff --git a/CI/samples.ci/client/petstore/bash/pom.xml b/CI/samples.ci/client/petstore/bash/pom.xml new file mode 100644 index 000000000000..fc8237d186c1 --- /dev/null +++ b/CI/samples.ci/client/petstore/bash/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + io.swagger + BashPetstoreClientTests + pom + 1.0-SNAPSHOT + Bash Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bats-test + integration-test + + exec + + + bats + + --tap + tests/petstore_test.sh + + + + + + + + diff --git a/CI/samples.ci/client/petstore/bash/tests/petstore_test.sh b/CI/samples.ci/client/petstore/bash/tests/petstore_test.sh new file mode 100644 index 000000000000..38c9456af86f --- /dev/null +++ b/CI/samples.ci/client/petstore/bash/tests/petstore_test.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bats + + +export PETSTORE_CLI="petstore-cli" + +export PETSTORE_HOST="http://petstore.swagger.io" + +# +# Bash syntax check +# +@test "Generated script should pass Bash syntax check" { + result="$(bash -n $PETSTORE_CLI)" + [ "$result" -eq 0 ] +} + +# +# Tests for parameter handling and validation +# +@test "addPet without host" { + unset PETSTORE_HOST + run bash $PETSTORE_CLI -ac xml -ct json \ + addPet id:=123321 name==lucky status==available + [[ "$output" =~ "Error: No hostname provided!!!" ]] +} + +@test "addPet without content type" { + run bash $PETSTORE_CLI -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available + [[ "$output" =~ "Error: Request's content-type not specified!" ]] +} + +@test "addPet abbreviated content type" { + run bash $PETSTORE_CLI -ct json -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available --dry-run + [[ "$output" =~ "Content-type: application/json" ]] +} + +@test "addPet unabbreviated content type" { + run bash $PETSTORE_CLI -ct userdefined/custom -ac xml --host $PETSTORE_HOST \ + addPet id:=123321 name==lucky status==available --dry-run + [[ "$output" =~ "Content-type: userdefined/custom" ]] +} + +@test "fakeOperation invalid operation name" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io fakeOperation" + [[ "$output" =~ "Error: No operation specified!" ]] +} + +@test "findPetsByStatus basic auth" { + run bash \ + -c "bash $PETSTORE_CLI -u alice:secret --host http://petstore.swagger.io findPetsByStatus status=s1 --dry-run" + [[ "$output" =~ "-u alice:secret" ]] +} + +@test "findPetsByStatus api key" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus status=s1 api_key:1234 --dry-run" + [[ "$output" =~ "-H \"api_key: 1234\"" ]] +} + +@test "findPetsByStatus empty api key" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus status=s1 --dry-run" + [[ ! "$output" =~ "-H \"api_key:" ]] +} + +@test "findPetsByStatus has default cURL parameters" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus status=s1 --dry-run" + [[ ! "$output" =~ " -Ss " ]] +} + +@test "findPetsByStatus too few values" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus" + [[ "$output" =~ "Error: Too few values" ]] +} + +@test "findPetsByTags too few values" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags" + [[ "$output" =~ "Error: Too few values" ]] +} + +@test "findPetsByStatus status with space" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus \ + status=available status=\"gone test\" --dry-run" + [[ "$output" =~ "status=available,gone%20test" ]] +} + +@test "findPetsByStatus collection csv" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags \ + tags=TAG1 tags=TAG2 --dry-run" + [[ "$output" =~ "tags=TAG1,TAG2" ]] +} + +@test "findPetsByStatus collection csv with space and question mark" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags \ + tags=TAG1 tags=\"TAG2 TEST\" tags=TAG3?TEST --dry-run" + [[ "$output" =~ "tags=TAG1,TAG2%20TEST,TAG3%3FTEST" ]] +} + +# +# Operations calling the service and checking result +# +@test "addPet from parameters" { + run bash $PETSTORE_CLI -ct json -ac xml \ + addPet id:=123321 name==lucky status==available + [[ "$output" =~ "123321" ]] +} + +@test "addPet from pipe" { + run bash \ + -c "echo '{\"id\": 37567, \"name\": \"lucky\", \"status\": \"available\"}' | \ + bash $PETSTORE_CLI -ct json -ac xml addPet -" + [[ "$output" =~ "37567" ]] +} diff --git a/CI/samples.ci/client/petstore/c/build-and-test.bash b/CI/samples.ci/client/petstore/c/build-and-test.bash new file mode 100755 index 000000000000..28256027f84d --- /dev/null +++ b/CI/samples.ci/client/petstore/c/build-and-test.bash @@ -0,0 +1,21 @@ +#!/bin/bash + +set -e + +#install latest curl +wget https://curl.haxx.se/download/curl-7.61.1.zip +unzip curl-7.61.1.zip +cd curl-7.61.1 +./configure +make +sudo make install +cd .. + +# project +cmake . + +make + +./unit-manual-PetAPI +./unit-manual-UserAPI +./unit-manual-StoreAPI diff --git a/CI/samples.ci/client/petstore/c/pom.xml b/CI/samples.ci/client/petstore/c/pom.xml new file mode 100644 index 000000000000..50246fbbe61c --- /dev/null +++ b/CI/samples.ci/client/petstore/c/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + CPetstoreClientTests + pom + 1.0-SNAPSHOT + C OpenAPI Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pet-test + integration-test + + exec + + + ./build-and-test.bash + + + + + + + diff --git a/CI/samples.ci/client/petstore/c/unit-tests/manual-PetAPI.c b/CI/samples.ci/client/petstore/c/unit-tests/manual-PetAPI.c new file mode 100644 index 000000000000..657a4fe38794 --- /dev/null +++ b/CI/samples.ci/client/petstore/c/unit-tests/manual-PetAPI.c @@ -0,0 +1,142 @@ +#include + #include + #include + #include + #include "../api/PetAPI.h" + + + #define EXAMPLE_CATEGORY_NAME "Example Category" + #define EXAMPLE_CATEGORY_ID 5 + #define EXAMPLE_PET_NAME "Example Pet" + #define EXAMPLE_URL_1 "http://www.github.com" + #define EXAMPLE_URL_2 "http://www.gitter.im" + #define EXAMPLE_TAG_1_NAME "beautiful code" + #define EXAMPLE_TAG_2_NAME "at least I tried" + #define EXAMPLE_TAG_1_ID 1 + #define EXAMPLE_TAG_2_ID 542353 + #define EXAMPLE_PET_ID 1234 // Set to 0 to generate a new pet + + +int main() { +// Add pet test + apiClient_t *apiClient = apiClient_create(); + + char *categoryName = malloc(strlen(EXAMPLE_CATEGORY_NAME) + 1); + strcpy(categoryName, EXAMPLE_CATEGORY_NAME); + + category_t *category = + category_create(EXAMPLE_CATEGORY_ID, categoryName); + + char *petName = malloc(strlen(EXAMPLE_PET_NAME) + 1); + strcpy(petName, EXAMPLE_PET_NAME); + + char *exampleUrl1 = malloc(strlen(EXAMPLE_URL_1) + 1); + strcpy(exampleUrl1, EXAMPLE_URL_1); + + char *exampleUrl2 = malloc(strlen(EXAMPLE_URL_2) + 1); + strcpy(exampleUrl2, EXAMPLE_URL_2); + + list_t *photoUrls = list_create(); + + list_addElement(photoUrls, exampleUrl1); + list_addElement(photoUrls, exampleUrl2); + + char *exampleTag1Name = malloc(strlen(EXAMPLE_TAG_1_NAME) + 1); + strcpy(exampleTag1Name, EXAMPLE_TAG_1_NAME); + tag_t *exampleTag1 = tag_create(EXAMPLE_TAG_1_ID, exampleTag1Name); + + char *exampleTag2Name = malloc(strlen(EXAMPLE_TAG_2_NAME) + 1); + strcpy(exampleTag2Name, EXAMPLE_TAG_2_NAME); + tag_t *exampleTag2 = tag_create(EXAMPLE_TAG_2_ID, exampleTag2Name); + + list_t *tags = list_create(); + + list_addElement(tags, exampleTag1); + list_addElement(tags, exampleTag2); + + + status_e status = available; + pet_t *pet = + pet_create(EXAMPLE_PET_ID, + category, + petName, + photoUrls, + tags, + status); + + PetAPI_addPet(apiClient, pet); + cJSON *JSONR_local = pet_convertToJSON(pet); + char *toPrint = cJSON_Print(JSONR_local); + printf("Data is:%s\n", toPrint); + free(toPrint); + pet_free(pet); + cJSON_Delete(JSONR_local); + apiClient_free(apiClient); + +// Pet update with form test + char *petName1 = "Rocky Handsome"; + + char *petName2 = "sold"; + + apiClient_t *apiClient1 = apiClient_create(); + PetAPI_updatePetWithForm(apiClient1, EXAMPLE_PET_ID, petName1, + petName2); + apiClient_free(apiClient1); + +// Get pet by id test + apiClient_t *apiClient2 = apiClient_create(); + pet_t *mypet = PetAPI_getPetById(apiClient2, EXAMPLE_PET_ID); + + cJSON *JSONR = pet_convertToJSON(mypet); + char *petJson = cJSON_Print(JSONR); + printf("Data is:%s\n", petJson); + + assert(strcmp(mypet->name, "Rocky Handsome") == 0); + assert(mypet->id == EXAMPLE_PET_ID); + assert(strcmp(mypet->category->name, EXAMPLE_CATEGORY_NAME) == 0); + assert(mypet->category->id == EXAMPLE_CATEGORY_ID); + assert(strcmp(list_getElementAt(mypet->photoUrls, + 0)->data, EXAMPLE_URL_1) == 0); + assert(strcmp(list_getElementAt(mypet->photoUrls, + 1)->data, EXAMPLE_URL_2) == 0); + assert(((tag_t *) list_getElementAt(mypet->tags, + 0)->data)->id == EXAMPLE_TAG_1_ID); + assert(((tag_t *) list_getElementAt(mypet->tags, + 1)->data)->id == EXAMPLE_TAG_2_ID); + assert(strcmp(((tag_t *) list_getElementAt(mypet->tags, 0)->data)->name, + EXAMPLE_TAG_1_NAME) == 0); + assert(strcmp(((tag_t *) list_getElementAt(mypet->tags, 1)->data)->name, + EXAMPLE_TAG_2_NAME) == 0); + + free(petJson); + cJSON_Delete(JSONR); + pet_free(mypet); + apiClient_free(apiClient2); + +// Pet upload file Test + apiClient_t *apiClient3 = apiClient_create(); + FILE *file = fopen("/opt/image.png", "r"); + char *buff; + int read_size, len; + binary_t *data = malloc(sizeof(binary_t)); + if(file) { + fseek(file, 0, SEEK_END); + read_size = 2 * ftell(file); + rewind(file); + data->data = (char *) malloc(read_size + 1); + data->len = fread((void *) data->data, 1, read_size, file); + data->data[read_size] = '\0'; + } + if(file != NULL) { + api_response_t *respo = PetAPI_uploadFile(apiClient3, + EXAMPLE_PET_ID, + "dec", + data); + + api_response_free(respo); + free(data->data); + free(data); + fclose(file); + } + apiClient_free(apiClient3); +} diff --git a/CI/samples.ci/client/petstore/c/unit-tests/manual-StoreAPI.c b/CI/samples.ci/client/petstore/c/unit-tests/manual-StoreAPI.c new file mode 100644 index 000000000000..485cf384bbd1 --- /dev/null +++ b/CI/samples.ci/client/petstore/c/unit-tests/manual-StoreAPI.c @@ -0,0 +1,103 @@ +#include + #include + #include + #include + #include "../api/StoreAPI.h" + + + #define ORDER_ID 1234 + #define PET_ID 12345 + #define QUANTITY 50 + #define SHIP_DATE "2018-09-24T10:19:09.592Z" + #define STATUS placed + #define COMPLETE true + +/* + Creates one pet and adds it. Then gets the pet with the just added ID and compare if the values are equal. + Could fail if someone else makes changes to the added pet, before it can be fetched again. + */ +int main() { +// place order test + apiClient_t *apiClient = apiClient_create(); + + char *shipdate = malloc(strlen(SHIP_DATE) + 1); + strcpy(shipdate, SHIP_DATE); + + order_t *neworder = order_create(ORDER_ID, + PET_ID, + QUANTITY, + shipdate, + STATUS, + COMPLETE); + + order_t *returnorder = StoreAPI_placeOrder(apiClient, neworder); + + cJSON *JSONNODE = order_convertToJSON(returnorder); + + char *dataToPrint = cJSON_Print(JSONNODE); + + printf("Placed order: \n%s\n", dataToPrint); + order_free(neworder); + order_free(returnorder); + cJSON_Delete(JSONNODE); + free(dataToPrint); + apiClient_free(apiClient); + +// order get by id test + apiClient_t *apiClient2 = apiClient_create(); + + neworder = StoreAPI_getOrderById(apiClient2, 1234); + + JSONNODE = order_convertToJSON(neworder); + + char *dataToPrint1 = cJSON_Print(JSONNODE); + + printf("Order received: \n%s\n", dataToPrint1); + + order_free(neworder); + cJSON_Delete(JSONNODE); + free(dataToPrint1); + apiClient_free(apiClient2); + +// delete order test + apiClient_t *apiClient3 = apiClient_create(); + + char *orderid = malloc(strlen("1234") + 1); + strcpy(orderid, "1234"); + + StoreAPI_deleteOrder(apiClient3, orderid); + + printf("Order Deleted \n"); + free(orderid); + apiClient_free(apiClient3); + + +// get order by id test + apiClient_t *apiClient4 = apiClient_create(); + + neworder = StoreAPI_getOrderById(apiClient4, 1234); + + if(neworder == NULL) { + printf("Order Not present \n"); + } + order_free(neworder); + apiClient_free(apiClient4); + +// get inventory test + apiClient_t *apiClient5 = apiClient_create(); + list_t *elementToReturn; + elementToReturn = StoreAPI_getInventory(apiClient5); + listEntry_t *listEntry; + list_ForEach(listEntry, elementToReturn) { + keyValuePair_t *pair = (keyValuePair_t *) listEntry->data; + printf("%s - %s\n", pair->key, (char *) pair->value); + } + list_ForEach(listEntry, elementToReturn) { + keyValuePair_t *pair = (keyValuePair_t *) listEntry->data; + free(pair->key); + free(pair->value); + keyValuePair_free(pair); + } + list_free(elementToReturn); + apiClient_free(apiClient5); +} diff --git a/CI/samples.ci/client/petstore/c/unit-tests/manual-UserAPI.c b/CI/samples.ci/client/petstore/c/unit-tests/manual-UserAPI.c new file mode 100644 index 000000000000..56c7eac5ee1a --- /dev/null +++ b/CI/samples.ci/client/petstore/c/unit-tests/manual-UserAPI.c @@ -0,0 +1,123 @@ +#include + #include + #include + #include + #include "../api/UserAPI.h" + + #define USER_ID 1234 + #define USER_NAME "example123" + #define FIRST_NAME "Example1" + #define LAST_NAME "Example2Last" + #define LAST_NAME1 "LastName" + #define EMAIL "example@example.com" + #define PASSWORD "thisisexample!123" + #define PHONE "+123456789" + #define USER_STATUS 4 + + +int main() { +// create user test + apiClient_t *apiClient = apiClient_create(); + + char *username = malloc(strlen(USER_NAME) + 1); + strcpy(username, USER_NAME); + char *firstname = malloc(strlen(FIRST_NAME) + 1); + strcpy(firstname, FIRST_NAME); + char *lastname = malloc(strlen(LAST_NAME) + 1); + strcpy(lastname, LAST_NAME); + char *email = malloc(strlen(EMAIL) + 1); + strcpy(email, EMAIL); + char *password = malloc(strlen(PASSWORD) + 1); + strcpy(password, PASSWORD); + char *phone = malloc(strlen(PHONE) + 1); + strcpy(phone, PHONE); + + user_t *newuser = user_create(USER_ID, + username, + firstname, + lastname, + email, + password, + phone, + USER_STATUS); + + UserAPI_createUser(apiClient, newuser); + user_free(newuser); + apiClient_free(apiClient); + +// get user by name test + apiClient_t *apiClient1 = apiClient_create(); + user_t *returnUser = UserAPI_getUserByName(apiClient1, USER_NAME); + + cJSON *JSONNODE = user_convertToJSON(returnUser); + + char *dataToPrint = cJSON_Print(JSONNODE); + + printf("User is: \n%s\n", dataToPrint); + user_free(returnUser); + cJSON_Delete(JSONNODE); + free(dataToPrint); + apiClient_free(apiClient1); + +// update user test + { + apiClient_t *apiClient2 = apiClient_create(); + char *username1 = malloc(strlen(USER_NAME) + 1); + strcpy(username1, USER_NAME); + char *firstname = malloc(strlen(FIRST_NAME) + 1); + strcpy(firstname, FIRST_NAME); + char *lastname = malloc(strlen(LAST_NAME) + 1); + strcpy(lastname, LAST_NAME); + char *email = malloc(strlen(EMAIL) + 1); + strcpy(email, EMAIL); + char *password = malloc(strlen(PASSWORD) + 1); + strcpy(password, PASSWORD); + char *phone = malloc(strlen(PHONE) + 1); + strcpy(phone, PHONE); + + user_t *newuser1 = user_create(USER_ID, + username1, + firstname, + lastname, + email, + password, + phone, + USER_STATUS); + + UserAPI_updateUser(apiClient2, username1, newuser1); + user_free(newuser1); + apiClient_free(apiClient2); + } + +// login user test + { + char *username1 = malloc(strlen(USER_NAME) + 1); + strcpy(username1, USER_NAME); + char *password = malloc(strlen(PASSWORD) + 1); + strcpy(password, PASSWORD); + apiClient_t *apiClient3 = apiClient_create(); + + char *loginuserreturn = UserAPI_loginUser(apiClient3, + username1, + password); + + printf("Login User: %s\n", loginuserreturn); + free(loginuserreturn); + free(username1); + free(password); + apiClient_free(apiClient3); + } + +// logout user test + apiClient_t *apiClient4 = apiClient_create(); + + UserAPI_logoutUser(apiClient4); + apiClient_free(apiClient4); + + +// delete user test + apiClient_t *apiClient5 = apiClient_create(); + + UserAPI_deleteUser(apiClient5, "example123"); + apiClient_free(apiClient5); +} diff --git a/CI/samples.ci/client/petstore/c/unit-tests/manual-order.c b/CI/samples.ci/client/petstore/c/unit-tests/manual-order.c new file mode 100644 index 000000000000..b1475bda6ae3 --- /dev/null +++ b/CI/samples.ci/client/petstore/c/unit-tests/manual-order.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include "../model/order.h" + + +#define ORDER_ID 1234 +#define PET_ID 12345 +#define QUANTITY 50 +#define SHIP_DATE "13/10/2018" + +#define COMPLETE 1 + +int main() { + status_e STATUS = placed; + + order_t *neworder = order_create(ORDER_ID, PET_ID, QUANTITY, SHIP_DATE, + STATUS, + COMPLETE); + + cJSON *JSONNODE = order_convertToJSON(neworder); + + char *dataToPrint = cJSON_Print(JSONNODE); + + printf("Created Order is: \n%s\n", dataToPrint); + + order_t *parsedOrder = order_parseFromJSON(JSONNODE); + + cJSON *fromJSON = order_convertToJSON(parsedOrder); + + char *dataToPrintFromJSON = cJSON_Print(fromJSON); + + printf("Parsed Order From JSON is: \n%s\n", dataToPrintFromJSON); + + order_free(neworder); + order_free(parsedOrder); + cJSON_Delete(JSONNODE); + cJSON_Delete(fromJSON); +} diff --git a/CI/samples.ci/client/petstore/c/unit-tests/manual-user.c b/CI/samples.ci/client/petstore/c/unit-tests/manual-user.c new file mode 100644 index 000000000000..738b21e22b2a --- /dev/null +++ b/CI/samples.ci/client/petstore/c/unit-tests/manual-user.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include "../model/user.h" + + +#define USER_ID 1234 +#define USER_NAME "example123" +#define FIRST_NAME "Example1" +#define LAST_NAME "Example2" +#define EMAIL "example@example.com" +#define PASSWORD "thisisexample!123" +#define PHONE "+123456789" +#define USER_STATUS 4 + +int main() { + user_t *newuser = user_create(USER_ID, USER_NAME, FIRST_NAME, LAST_NAME, + EMAIL, + PASSWORD, PHONE, USER_STATUS); + + cJSON *JSONNODE = user_convertToJSON(newuser); + + char *dataToPrint = cJSON_Print(JSONNODE); + + printf("Created User is: \n%s\n", dataToPrint); + + user_t *pasrsedUser = user_parseFromJSON(JSONNODE); + + cJSON *fromJSON = user_convertToJSON(pasrsedUser); + + char *dataToPrintFromJSON = cJSON_Print(fromJSON); + + printf("Parsed User From JSON is: \n%s\n", dataToPrintFromJSON); + + user_free(newuser); + user_free(pasrsedUser); + cJSON_Delete(JSONNODE); + cJSON_Delete(fromJSON); +} diff --git a/CI/samples.ci/client/petstore/clojure/.gitignore b/CI/samples.ci/client/petstore/clojure/.gitignore new file mode 100644 index 000000000000..e3388bed39e4 --- /dev/null +++ b/CI/samples.ci/client/petstore/clojure/.gitignore @@ -0,0 +1,11 @@ +pom.xml.asc +*jar +/lib/ +/classes/ +/target/ +/checkouts/ +.lein-deps-sum +.lein-repl-history +.lein-plugins/ +.lein-failures +.nrepl-port diff --git a/CI/samples.ci/client/petstore/clojure/pom.xml b/CI/samples.ci/client/petstore/clojure/pom.xml new file mode 100644 index 000000000000..99466e226910 --- /dev/null +++ b/CI/samples.ci/client/petstore/clojure/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + org.openapitools + openapi-petstore-clojure + pom + 1.0-SNAPSHOT + OpenAPI Clogure Petstore Client + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + lein-test + integration-test + + exec + + + lein + + test + + + + + + + + diff --git a/samples/openapi3/client/petstore/ruby-faraday/hello.txt b/CI/samples.ci/client/petstore/clojure/resources/hello.txt similarity index 100% rename from samples/openapi3/client/petstore/ruby-faraday/hello.txt rename to CI/samples.ci/client/petstore/clojure/resources/hello.txt diff --git a/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/pet_test.clj b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/pet_test.clj new file mode 100644 index 000000000000..77d2b0088b92 --- /dev/null +++ b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/pet_test.clj @@ -0,0 +1,104 @@ +(ns open-api-petstore.api.pet-test + (:require [clojure.test :refer :all] + [clojure.java.io :as io] + [open-api-petstore.core :refer [with-api-context]] + [open-api-petstore.api.pet :refer :all])) + +(defn credentials-fixture [f] + (with-api-context {:auths {"api_key" "special-key"}} + (f))) + +(use-fixtures :once credentials-fixture) + +(defn- make-random-pet + ([] (make-random-pet nil)) + ([{:keys [id] :as attrs :or {id (System/currentTimeMillis)}}] + (merge {:id id + :name (str "pet-" id) + :status "available" + :photoUrls ["http://foo.bar.com/1" "http://foo.bar.com/2"] + :category {:name "really-happy"}} + attrs))) + +(deftest test-create-and-get-pet + (let [{:keys [id] :as pet} (make-random-pet) + _ (add-pet {:pet pet}) + fetched (get-pet-by-id id)] + (is (identity fetched)) + (is (= id (:id fetched))) + (is (identity (:category fetched))) + (is (= (get-in pet [:category :name]) (get-in fetched [:category :name]))) + (delete-pet id))) + +(deftest test-create-and-get-pet-with-http-info + (let [{:keys [id] :as pet} (make-random-pet) + _ (add-pet-with-http-info {:pet pet}) + {:keys [status headers data]} (get-pet-by-id-with-http-info id)] + (is (= 200 status)) + (is (= "application/json" (:content-type headers))) + (is (identity data)) + (is (= id (:id data))) + (is (identity (:category data))) + (is (= (get-in pet [:category :name]) (get-in data [:category :name]))) + (delete-pet id))) + +(deftest test-find-pets-by-status + (let [status "pending" + {:keys [id] :as pet} (make-random-pet {:status status}) + _ (add-pet {:pet pet}) + pets (find-pets-by-status {:status [status]})] + (is (seq pets)) + (is (some #{id} (map :id pets))) + (delete-pet id))) + +(deftest test-find-pets-by-tags + (let [tag-name (str "tag-" (rand-int 1000)) + tag {:name tag-name} + {:keys [id] :as pet} (make-random-pet {:tags [tag]}) + _ (add-pet {:pet pet}) + pets (find-pets-by-tags {:tags [tag-name]})] + (is (seq pets)) + (is (some #{id} (map :id pets))) + (delete-pet id))) + +(deftest test-update-pet-with-form + (let [{pet-id :id :as pet} (make-random-pet {:name "new name" :status "available"}) + _ (add-pet {:pet pet}) + {:keys [id name status]} (get-pet-by-id pet-id)] + (is (= pet-id id)) + (is (= "new name" name)) + (is (= "available" status)) + ;; update "name" only + (update-pet-with-form pet-id {:name "updated name 1"}) + (let [{:keys [id name status]} (get-pet-by-id pet-id)] + (is (= pet-id id)) + (is (= "updated name 1" name)) + (is (= "available" status))) + ;; update "status" only + (update-pet-with-form pet-id {:status "pending"}) + (let [{:keys [id name status]} (get-pet-by-id pet-id)] + (is (= pet-id id)) + (is (= "updated name 1" name)) + (is (= "pending" status))) + ;; update both "name" and "status" + (update-pet-with-form pet-id {:name "updated name 2" :status "sold"}) + (let [{:keys [id name status]} (get-pet-by-id pet-id)] + (is (= pet-id id)) + (is (= "updated name 2" name)) + (is (= "sold" status))) + (delete-pet pet-id))) + +(deftest test-delete-pet + (let [{:keys [id] :as pet} (make-random-pet) + _ (add-pet {:pet pet}) + fetched (get-pet-by-id id)] + (is (= id (:id fetched))) + (delete-pet id) + (is (thrown? RuntimeException (get-pet-by-id id))))) + +(deftest test-upload-file + (let [{:keys [id] :as pet} (make-random-pet) + _ (add-pet {:pet pet}) + file (io/file (io/resource "hello.txt"))] + ;; no errors with upload-file + (upload-file id {:file file :additional-metadata "uploading file with clojure client"}))) diff --git a/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/store_test.clj b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/store_test.clj new file mode 100644 index 000000000000..b7f3edc31c2d --- /dev/null +++ b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/store_test.clj @@ -0,0 +1,42 @@ +(ns open-api-petstore.api.store-test + (:require [clojure.test :refer :all] + [open-api-petstore.core :refer [with-api-context]] + [open-api-petstore.api.store :refer :all]) + (:import (java.util Date))) + +(defn credentials-fixture [f] + (with-api-context {:auths {"api_key" "special-key"}} + (f))) + +(use-fixtures :once credentials-fixture) + +(defn- make-random-order [] + {:id (+ 90000 (rand-int 10000)) + :petId 200 + :quantity 13 + :shipDate (Date.) + :status "placed" + :complete true}) + +(deftest test-get-inventory + (let [inventory (get-inventory)] + (is (pos? (count inventory))))) + +(deftest test-place-and-delete-order + (let [order (make-random-order) + order-id (:id order) + _ (place-order {:order order}) + fetched (get-order-by-id order-id)] + (doseq [attr [:id :petId :quantity]] + (is (= (attr order) (attr fetched)))) + (delete-order order-id) + (comment "it seems that delete-order does not really delete the order" + (is (thrown? RuntimeException (get-order-by-id order-id)))))) + +(deftest test-order-spec-conforming + (with-api-context {:decode-models true} + (let [order (make-random-order) + order-id (:id order) + _ (place-order {:order order}) + fetched (get-order-by-id order-id)] + (is (= order fetched))))) \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/user_test.clj b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/user_test.clj new file mode 100644 index 000000000000..a64bd570c972 --- /dev/null +++ b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/api/user_test.clj @@ -0,0 +1,64 @@ +(ns open-api-petstore.api.user-test + (:require [clojure.test :refer :all] + [open-api-petstore.core :refer [with-api-context]] + [open-api-petstore.api.user :refer :all])) + +(defn credentials-fixture [f] + (with-api-context {:auths {"api_key" "special-key"}} + (f))) + +(use-fixtures :once credentials-fixture) + +(defn- make-random-user + ([] (make-random-user nil)) + ([{:keys [id] :as attrs :or {id (System/currentTimeMillis)}}] + (merge {:id id + :username (str "user-" id) + :password "my-password" + :userStatus 0} + attrs))) + +(deftest test-create-and-delete-user + (let [user (make-random-user) + username (:username user) + _ (create-user {:user user}) + fetched (get-user-by-name username)] + (doseq [attr [:id :username :password :userStatus]] + (is (= (attr user) (attr fetched)))) + (delete-user username) + (is (thrown? RuntimeException (get-user-by-name username))))) + +(deftest test-create-users-with-array-input + (let [id1 (System/currentTimeMillis) + id2 (inc id1) + user1 (make-random-user {:id id1}) + user2 (make-random-user {:id id2})] + (create-users-with-array-input {:user [user1 user2]}) + (let [fetched (get-user-by-name (:username user1))] + (is (= id1 (:id fetched)))) + (let [fetched (get-user-by-name (:username user2))] + (is (= id2 (:id fetched)))) + (delete-user (:username user1)) + (delete-user (:username user2)))) + +(deftest test-create-users-with-list-input + (let [id1 (System/currentTimeMillis) + id2 (inc id1) + user1 (make-random-user {:id id1}) + user2 (make-random-user {:id id2})] + (create-users-with-list-input {:user [user1 user2]}) + (let [fetched (get-user-by-name (:username user1))] + (is (= id1 (:id fetched)))) + (let [fetched (get-user-by-name (:username user2))] + (is (= id2 (:id fetched)))) + (delete-user (:username user1)) + (delete-user (:username user2)))) + +(deftest test-login-and-lougout-user + (let [{:keys [username password] :as user} (make-random-user) + _ (create-user {:user user}) + result (login-user {:username username :password password})] + (is (re-matches #"logged in user session:.+" result)) + ;; no error with logout-user + (logout-user) + (delete-user username))) diff --git a/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/core_test.clj b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/core_test.clj new file mode 100644 index 000000000000..d3cfcdfdb8b7 --- /dev/null +++ b/CI/samples.ci/client/petstore/clojure/test/open_api_petstore/core_test.clj @@ -0,0 +1,188 @@ +(ns open-api-petstore.core-test + (:require [clojure.java.io :as io] + [clojure.test :refer :all] + [open-api-petstore.core :refer :all]) + (:import (java.text ParseException))) + +(deftest test-api-context + (testing "default" + (is (= {:base-url "http://petstore.swagger.io/v2" + :date-format "yyyy-MM-dd" + :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" + :decode-models false + :debug false + :auths {"api_key" nil + "petstore_auth" nil}} + default-api-context + *api-context* + (with-api-context {} + *api-context*)))) + (testing "customize via with-api-context" + (with-api-context {:base-url "http://localhost" + :debug true + :auths {"api_key" "key1" + "petstore_auth" "token1"}} + (is (= {:base-url "http://localhost" + :date-format "yyyy-MM-dd" + :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" + :decode-models false + :debug true + :auths (merge (:auths default-api-context) + {"api_key" "key1" + "petstore_auth" "token1"})} + *api-context*)) + ;; nested with-api-context inherits values from the outer api context + (with-api-context {:datetime-format "yyyy-MM-dd HH:mm:ss" + :auths {"api_key" "key2"}} + (is (= {:base-url "http://localhost" + :date-format "yyyy-MM-dd" + :datetime-format "yyyy-MM-dd HH:mm:ss" + :decode-models false + :debug true + :auths (merge (:auths default-api-context) + {"api_key" "key2" + "petstore_auth" "token1"})} + *api-context*)))) + ;; back to default api context + (is (= {:base-url "http://petstore.swagger.io/v2" + :date-format "yyyy-MM-dd" + :datetime-format "yyyy-MM-dd'T'HH:mm:ss.SSSXXX" + :decode-models false + :debug false + :auths {"api_key" nil + "petstore_auth" nil}} + default-api-context + *api-context*)))) + +(deftest test-check-required-params + (let [a nil b :not-nil] + (is (thrown? IllegalArgumentException (check-required-params a))) + (is (nil? (check-required-params b))))) + +(deftest test-parse-and-format-date + (testing "default date format" + (is (= "2015-11-07" (-> "2015-11-07T03:49:09.356+00:00" parse-datetime format-date))) + (is (= "2015-11-07" (-> "2015-11-07" parse-date format-date))) + (is (thrown? ParseException (parse-date "2015-11")))) + (testing "custom date format: without day" + (with-api-context {:date-format "yyyy-MM"} + (is (= "2015-11" (-> "2015-11-07T03:49:09.123Z" parse-datetime format-date))) + (is (= "2015-11" (-> "2015-11" parse-date format-date))) + (is (thrown? ParseException (parse-date "2015")))))) + +(deftest test-parse-and-format-datetime + (testing "default datetime format" + (are [s] + (is (= "2015-11-07T03:49:09.356Z" (-> s parse-datetime (format-datetime "UTC")))) + "2015-11-07T03:49:09.356+00:00" + "2015-11-07T05:49:09.356+02:00" + "2015-11-07T02:49:09.356-01:00" + "2015-11-07T03:49:09.356Z") + (is (thrown? ParseException (parse-datetime "2015-11-07 03:49:09")))) + (testing "custom datetime format: without milliseconds" + (with-api-context {:datetime-format "yyyy-MM-dd'T'HH:mm:ssXXX"} + (are [s] + (is (= "2015-11-07T13:49:09+10:00" (-> s parse-datetime (format-datetime "GMT+10")))) + "2015-11-07T03:49:09+00:00" + "2015-11-07T03:49:09Z" + "2015-11-07T00:49:09-03:00") + (is (thrown? ParseException (parse-datetime "2015-11-07T03:49:09.123Z")))))) + +(deftest test-param->str + (let [date (parse-datetime "2015-11-07T03:49:09.123Z")] + (are [param expected] + (is (= expected (param->str param))) + nil "" + "abc" "abc" + 123 "123" + 1.0 "1.0" + [12 "34"] "12,34" + date (format-datetime date)))) + +(deftest test-auths->opts + (testing "auth values not set by default" + (is (= {} (auths->opts ["api_key" "petstore_auth"]))) + (is (= {} (auths->opts [])))) + (testing "set api_key" + (with-api-context {:auths {"api_key" "my key"}} + (is (= {:header-params {"api_key" "my key"}} (auths->opts ["api_key" "petstore_auth"]))) + (is (= {:header-params {"api_key" "my key"}} (auths->opts ["api_key"]))) + (is (= {} (auths->opts ["petstore_auth"]))) + (is (= {} (auths->opts []))))) + (testing "set both api_key and petstore_auth" + (with-api-context {:auths {"api_key" "my key" "petstore_auth" "my token"}} + (is (= {:req-opts {:oauth-token "my token"} + :header-params {"api_key" "my key"}} + (auths->opts ["api_key" "petstore_auth"]))) + (is (= {:req-opts {:oauth-token "my token"}} (auths->opts ["petstore_auth"]))) + (is (= {:header-params {"api_key" "my key"}} (auths->opts ["api_key"]))) + (is (= {} (auths->opts [])))))) + +(deftest test-make-url + (are [path path-params url] + (is (= url (make-url path path-params))) + "/pet/{petId}" {"petId" 123} "http://petstore.swagger.io/v2/pet/123" + "/" nil "http://petstore.swagger.io/v2/" + "/pet" {"id" 1} "http://petstore.swagger.io/v2/pet" + "/pet/{id}" nil "http://petstore.swagger.io/v2/pet/{id}")) + +(deftest test-normalize-param + (let [file (-> "hello.txt" io/resource io/file)] + (are [param expected] + (is (= expected (normalize-param param))) + file file + "abc" "abc" + [12 "34"] "12,34" + ^{:collection-format :csv} [12 "34"] "12,34" + ^{:collection-format :ssv} [12 "34"] "12 34" + ^{:collection-format :tsv} [12 "34"] "12\t34" + (with-collection-format [12 "34"] :pipes) "12|34" + (with-collection-format [12 "34"] :multi) ["12" "34"] + [[12 "34"] file "abc"] ["12,34" file "abc"]))) + +(deftest test-normalize-params + (is (= {:a "123" :b "4,5,6"} + (normalize-params {:a 123 :b [4 [5 "6"]] :c nil}))) + (is (= {:a "123" :b ["4" "5,6"]} + (normalize-params {:a 123 + :b ^{:collection-format :multi} [4 [5 "6"]] + :c nil}))) + (is (= {:a "123" :b "4 5|6"} + (normalize-params {:a 123 + :b (with-collection-format [4 (with-collection-format [5 "6"] :pipes)] :ssv) + :c nil})))) + +(deftest test-json-mime? + (are [mime expected] + (is (= expected (boolean (json-mime? mime)))) + :json true + "application/json" true + "APPLICATION/JSON" true + "application/json; charset=utf8" true + nil false + :xml false + "application/pdf" false + "application/jsonp" false)) + +(deftest test-json-preferred-mime + (are [mimes expected] + (is (= expected (json-preferred-mime mimes))) + ["application/xml" "application/json"] "application/json" + [:json] :json + [] nil + nil nil + ["application/xml"] "application/xml")) + +(deftest test-serialize + (is (= "{\"aa\":1,\"bb\":\"2\"}" (serialize {:aa 1 :bb "2"} :json))) + (is (= "{}" (serialize {} "application/json"))) + (is (= "[1,\"2\"]" (serialize [1 "2"] "application/json; charset=UTF8"))) + (is (thrown? IllegalArgumentException (serialize {} "application/xml")))) + +(deftest test-deserialize + (are [body content-type expected] + (is (= expected (deserialize {:body body :headers {:content-type content-type}}))) + "{\"aa\": 1, \"bb\": \"2\"}" "application/json" {:aa 1 :bb "2"} + "[1, \"2\"]" "application/json; charset=UTF8" [1 "2"] + "{invalid json}" "application/json" "{invalid json}" + "plain text" "text/plain" "plain text")) diff --git a/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Client/ApiClientTests.cs b/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Client/ApiClientTests.cs new file mode 100644 index 000000000000..d9637bd92e4f --- /dev/null +++ b/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Client/ApiClientTests.cs @@ -0,0 +1,139 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test +{ + public class ApiClientTests + { + public ApiClientTests() + { + } + + [TearDown()] + public void TearDown() + { + // Reset to default, just in case + Configuration.Default.DateTimeFormat = "o"; + } + + /// + /// Test SelectHeaderContentType + /// + [Test()] + public void TestSelectHeaderContentType() + { + ApiClient api = new ApiClient(); + String[] contentTypes = new String[] { "application/json", "application/xml" }; + Assert.AreEqual("application/json", api.SelectHeaderContentType(contentTypes)); + + contentTypes = new String[] { "application/xml" }; + Assert.AreEqual("application/xml", api.SelectHeaderContentType(contentTypes)); + + contentTypes = new String[] { }; + Assert.AreEqual("application/json", api.SelectHeaderContentType(contentTypes)); + } + + /// + /// Test ParameterToString + /// + [Test()] + public void TestParameterToString() + { + ApiClient api = new ApiClient(); + + // test array of string + List statusList = new List(new String[] { "available", "sold" }); + Assert.AreEqual("available,sold", api.ParameterToString(statusList)); + + // test array of int + List numList = new List(new int[] { 1, 37 }); + Assert.AreEqual("1,37", api.ParameterToString(numList)); + } + + [Test()] + public void TestParameterToStringForDateTime() + { + ApiClient api = new ApiClient(); + + // test datetime + DateTime dateUtc = DateTime.Parse("2008-04-10T13:30:00.0000000z", null, System.Globalization.DateTimeStyles.RoundtripKind); + Assert.AreEqual("2008-04-10T13:30:00.0000000Z", api.ParameterToString(dateUtc)); + + // test datetime with no timezone + DateTime dateWithNoTz = DateTime.Parse("2008-04-10T13:30:00.000", null, System.Globalization.DateTimeStyles.RoundtripKind); + Assert.AreEqual("2008-04-10T13:30:00.0000000", api.ParameterToString(dateWithNoTz)); + } + + // The test below only passes when running at -04:00 timezone + [Ignore("The test below only passes when running at -04:00 timezone")] + public void TestParameterToStringWithTimeZoneForDateTime() + { + ApiClient api = new ApiClient(); + // test datetime with a time zone + DateTimeOffset dateWithTz = DateTimeOffset.Parse("2008-04-10T13:30:00.0000000-04:00", null, System.Globalization.DateTimeStyles.RoundtripKind); + Assert.AreEqual("2008-04-10T13:30:00.0000000-04:00", api.ParameterToString(dateWithTz)); + } + + [Test()] + public void TestParameterToStringForDateTimeWithUFormat() + { + // Setup the DateTimeFormat across all of the calls + Configuration.Default.DateTimeFormat = "u"; + ApiClient api = new ApiClient(); + + // test datetime + DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind); + Assert.AreEqual("2009-06-15 20:45:30Z", api.ParameterToString(dateUtc)); + } + + [Test()] + public void TestParameterToStringForDateTimeWithCustomFormat() + { + // Setup the DateTimeFormat across all of the calls + Configuration.Default.DateTimeFormat = "dd/MM/yy HH:mm:ss"; + ApiClient api = new ApiClient(); + + // test datetime + DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind); + Assert.AreEqual("15/06/09 20:45:30", api.ParameterToString(dateUtc)); + } + + [Test()] + public void TestSanitizeFilename() + { + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("sun.gif")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("../sun.gif")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("/var/tmp/sun.gif")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("./sun.gif")); + + Assert.AreEqual("sun", ApiClient.SanitizeFilename("sun")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("..\\sun.gif")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("\\var\\tmp\\sun.gif")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("c:\\var\\tmp\\sun.gif")); + Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename(".\\sun.gif")); + + } + + [Test()] + public void TestApiClientInstance() + { + PetApi p1 = new PetApi(); + PetApi p2 = new PetApi(); + + Configuration c1 = new Configuration(); // using default ApiClient + PetApi p3 = new PetApi(c1); + + // ensure both using the same default ApiClient + Assert.AreSame(p1.Configuration.ApiClient, p2.Configuration.ApiClient); + Assert.AreSame(p1.Configuration.ApiClient, Configuration.Default.ApiClient); + + // ensure both using the same default ApiClient + Assert.AreSame(p3.Configuration.ApiClient, c1.ApiClient); + + } + } +} diff --git a/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Client/ConfigurationTests.cs b/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Client/ConfigurationTests.cs new file mode 100644 index 000000000000..53d15e3a6057 --- /dev/null +++ b/CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Client/ConfigurationTests.cs @@ -0,0 +1,111 @@ +using NUnit.Framework; +using System; +using System.Collections.Generic; +using Org.OpenAPITools.Client; +using Org.OpenAPITools.Api; +using Org.OpenAPITools.Model; + +namespace Org.OpenAPITools.Test +{ + public class ConfigurationTests + { + public ConfigurationTests() + { + } + + [TearDown()] + public void TearDown() + { + // Reset to default, just in case + Configuration.Default.DateTimeFormat = "o"; + } + + [Test()] + public void TestAuthentication() + { + Configuration c = new Configuration(); + c.Username = "test_username"; + c.Password = "test_password"; + + c.ApiKey["api_key_identifier"] = "1233456778889900"; + c.ApiKeyPrefix["api_key_identifier"] = "PREFIX"; + Assert.AreEqual(c.GetApiKeyWithPrefix("api_key_identifier"), "PREFIX 1233456778889900"); + + } + + [Test()] + public void TestBasePath() + { + PetApi p = new PetApi("http://new-basepath.com"); + Assert.AreEqual(p.Configuration.ApiClient.RestClient.BaseUrl, "http://new-basepath.com"); + // Given that PetApi is initailized with a base path, a new configuration (with a new ApiClient) + // is created by default + Assert.AreNotSame(p.Configuration, Configuration.Default); + } + + [Test()] + public void TestDateTimeFormat_Default() + { + // Should default to the Round-trip Format Specifier - "o" + // https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 + Assert.AreEqual("o", Configuration.Default.DateTimeFormat); + } + + [Test()] + public void TestDateTimeFormat_UType() + { + Configuration.Default.DateTimeFormat = "u"; + + Assert.AreEqual("u", Configuration.Default.DateTimeFormat); + } + + [Test()] + public void TestDefautlConfiguration() + { + PetApi p1 = new PetApi(); + PetApi p2 = new PetApi(); + Assert.AreSame(p1.Configuration, p2.Configuration); + // same as the default + Assert.AreSame(p1.Configuration, Configuration.Default); + + Configuration c = new Configuration(); + Assert.AreNotSame(c, p1.Configuration); + + PetApi p3 = new PetApi(c); + // same as c + Assert.AreSame(p3.Configuration, c); + // not same as default + Assert.AreNotSame(p3.Configuration, p1.Configuration); + + } + + [Test()] + public void TestUsage() + { + // basic use case using default base URL + PetApi p1 = new PetApi(); + Assert.AreSame(p1.Configuration, Configuration.Default, "PetApi should use default configuration"); + + // using a different base URL + PetApi p2 = new PetApi("http://new-base-url.com/"); + Assert.AreEqual(p2.Configuration.ApiClient.RestClient.BaseUrl.ToString(), "http://new-base-url.com/"); + + // using a different configuration + Configuration c1 = new Configuration(); + PetApi p3 = new PetApi(c1); + Assert.AreSame(p3.Configuration, c1); + + } + + [Test()] + public void TestTimeout() + { + Configuration c1 = new Configuration(); + Assert.AreEqual(100000, c1.Timeout); // default vaue + + c1.Timeout = 50000; + Assert.AreEqual(50000, c1.Timeout); + } + + } +} diff --git a/samples/client/petstore/dart/petstore/.analysis_options b/CI/samples.ci/client/petstore/dart2/petstore/.analysis_options similarity index 100% rename from samples/client/petstore/dart/petstore/.analysis_options rename to CI/samples.ci/client/petstore/dart2/petstore/.analysis_options diff --git a/CI/samples.ci/client/petstore/dart2/petstore/README.md b/CI/samples.ci/client/petstore/dart2/petstore/README.md new file mode 100644 index 000000000000..2139c301745c --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/README.md @@ -0,0 +1,37 @@ +# Background + +## Current state of tests + +TL;DR currently the only tests are e2e tests that were adapted to use a faked http client. While pushing data around as a smoke test has some value, more testing is required. In particular we need comprehensive unit/integration tests. + +- an old set of e2e tests are skipped for CI, as they hit a live endpoint and so are inherently flaky + - `pet_test.dart` + - `store_test.dart` + - `user_test.dart` +- the above set of tests were adapted to use a faked http client + - the tests are not really well suited to being used with a stubbed client, many are basically just testing the endpoint logic + - while not a great set of tests, they do have some value as a smoke test for template changes +- the adapted tests and files that contain test data: + - `pet_test_fake_client.dart` + - `store_test_fake_client.dart` + - `user_test_fake_client.dart` + - `fake_client.dart` + - `file_upload_response.json` + +## Assumptions + +- the tests will be run as part of CI and so have access to dart:io + +# Running + +## If not already done, resolve dependencies + +`pub get` + +## To run tests in a single file: + +`pub run test test/pet_test.dart` + +## To run all tests in the test folder: + +`pub run test` diff --git a/CI/samples.ci/client/petstore/dart2/petstore/pom.xml b/CI/samples.ci/client/petstore/dart2/petstore/pom.xml new file mode 100644 index 000000000000..c4ce7b4d68e7 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + org.openapitools + Dart2PetstoreClientTests + pom + 1.0.0-SNAPSHOT + Dart2 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + export-dartfmt + pre-install-test + + exec + + + export + + DART_FMT_PATH=/usr/local/bin/dartfmt + + + + + pub-get + pre-integration-test + + exec + + + pub + + get + + + + + pub-test + integration-test + + exec + + + pub + + run + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/dart2/petstore/pubspec.lock b/CI/samples.ci/client/petstore/dart2/petstore/pubspec.lock new file mode 100644 index 000000000000..78daa43da5d9 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/pubspec.lock @@ -0,0 +1,355 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "0.38.4" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.2" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + collection: + dependency: "direct dev" + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.14.12" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.1" + front_end: + dependency: transitive + description: + name: front_end + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.26" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.7" + html: + dependency: transitive + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+2" + http: + dependency: "direct dev" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.0+2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.3" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.3" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.1+1" + kernel: + dependency: transitive + description: + name: kernel + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.26" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.5" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.7" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.6+3" + mockito: + dependency: "direct dev" + description: + name: mockito + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.1" + multi_server_socket: + dependency: transitive + description: + name: multi_server_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.8" + openapi: + dependency: "direct main" + description: + path: "../petstore_client_lib" + relative: true + source: path + version: "1.0.0" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + package_resolver: + dependency: transitive + description: + name: package_resolver + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.10" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.4" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0+1" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.2" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "0.7.5" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.8" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.3" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.5" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.8" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.5" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.3" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + test: + dependency: "direct dev" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.8" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.10" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.7+12" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.15" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" +sdks: + dart: ">=2.5.0 <3.0.0" diff --git a/CI/samples.ci/client/petstore/dart2/petstore/pubspec.yaml b/CI/samples.ci/client/petstore/dart2/petstore/pubspec.yaml new file mode 100644 index 000000000000..f26301750933 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/pubspec.yaml @@ -0,0 +1,13 @@ +name: petstore_client +version: 1.0.0 +description: Petstore client using OpenAPI library +environment: + sdk: '>=2.5.0 <3.0.0' +dependencies: + openapi: + path: ../petstore_client_lib +dev_dependencies: + test: ^1.8.0 + mockito: ^4.1.1 + http: ^0.12.0 + collection: ^1.14.12 diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/fake_client.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/fake_client.dart new file mode 100644 index 000000000000..82daf74108e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/fake_client.dart @@ -0,0 +1,133 @@ +import 'dart:convert'; + +import 'package:collection/collection.dart'; +import 'package:http/http.dart'; +import 'package:mockito/mockito.dart'; + +/// A fake client that checks for expected values and returns given responses +/// +/// Checks for the expected values (url, headers, body) and throws if not found +/// +/// If exception is non-null the request will throw the exception, after other +/// checks are performed +class FakeClient extends Fake implements Client { + FakeClient({ + this.throwException, + this.expectedPostRequestBody, + this.postResponseBody, + this.expectedGetRequestBody, + this.getResponseBody, + this.deleteResponseBody, + this.expectedPutRequestBody, + this.putResponseBody, + this.sendResponseBody, + this.expectedUrl, + this.expectedHeaders = const {'Content-Type': 'application/json'}, + }); + + Exception throwException; + Object expectedPostRequestBody; + String postResponseBody; + String expectedGetRequestBody; + String getResponseBody; + String deleteResponseBody; + String expectedPutRequestBody; + String putResponseBody; + String sendResponseBody; + String expectedUrl; + Map expectedHeaders; + + @override + Future post(url, + {Map headers, body, Encoding encoding}) async { + // check that the request was made with expected values + if (url != expectedUrl) { + throw StateError( + 'POST was called with unexpected url: ${url} should be ${expectedUrl}'); + } + if (!MapEquality().equals(headers, expectedHeaders)) { + throw StateError( + 'POST was called with unexpected headers: ${headers} should be ${expectedHeaders}'); + } + // currently we only expect Map (and subtypes) or Strings + if (body is Map) { + if (!MapEquality().equals(body, expectedPostRequestBody)) { + throw StateError( + 'POST was called with unexpected body: ${body} should be ${expectedPostRequestBody}'); + } + } else if (body != expectedPostRequestBody) { + throw StateError( + 'POST was called with unexpected body: ${body} should be ${expectedPostRequestBody}'); + } + + // throw if set to throw + if (throwException != null) throw throwException; + + return Response(postResponseBody, 200); + } + + @override + Future get(url, {Map headers}) async { + // check that the request was made with expected values + if (url != expectedUrl) { + throw StateError( + 'GET was called with unexpected url: ${url} should be ${expectedUrl}'); + } + if (!MapEquality().equals(headers, expectedHeaders)) { + throw StateError( + 'GET was called with unexpected headers: ${headers} should be ${expectedHeaders}'); + } + + // throw if set to throw + if (throwException != null) throw throwException; + + return Response(getResponseBody, 200); + } + + @override + Future delete(url, {Map headers}) async { + // check that the request was made with expected values + if (url != expectedUrl) { + throw StateError( + 'DELETE was called with unexpected url: ${url} should be ${expectedUrl}'); + } + if (!MapEquality().equals(headers, expectedHeaders)) { + throw StateError( + 'DELETE was called with unexpected headers: ${headers} should be ${expectedHeaders}'); + } + + // throw if set to throw + if (throwException != null) throw throwException; + + return Response(deleteResponseBody, 200); + } + + @override + Future put(url, + {Map headers, body, Encoding encoding}) async { + // check that the request was made with expected values + if (url != expectedUrl) { + throw StateError( + 'PUT was called with unexpected url: ${url} should be ${expectedUrl}'); + } + if (!MapEquality().equals(headers, expectedHeaders)) { + throw StateError( + 'PUT was called with unexpected headers: ${headers} should be ${expectedHeaders}'); + } + if (body != expectedPutRequestBody) { + throw StateError( + 'PUT was called with unexpected body: ${body} should be ${expectedPutRequestBody}'); + } + + // throw if set to throw + if (throwException != null) throw throwException; + + return Response(putResponseBody, 200); + } + + @override + Future send(BaseRequest request) async { + List bytes = utf8.encode(sendResponseBody); + return StreamedResponse(Stream.fromIterable([bytes]), 200); + } +} diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/file_upload_response.json b/CI/samples.ci/client/petstore/dart2/petstore/test/file_upload_response.json new file mode 100644 index 000000000000..8855b00d9e38 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/file_upload_response.json @@ -0,0 +1 @@ +{"code":200,"type":"unknown","message":"additionalMetadata: \nFile uploaded to ./null, 4 bytes"} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/inventory_response.json b/CI/samples.ci/client/petstore/dart2/petstore/test/inventory_response.json new file mode 100644 index 000000000000..b4388d1e7b35 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/inventory_response.json @@ -0,0 +1 @@ +{"mine":1,"sold":18,"string":568,"Dead":2,"test":2,"Nonavailable":1,"custom":3,"pending":20,"available":2212,"notAvailable":26,"avaiflable":1,"AVAILABLE":1,"swimming":1,"availablee":2,"success":1,"105":1,"missing":11,"disabled":1,"Available":1,"]]>":1} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/pet_faked_client_test.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/pet_faked_client_test.dart new file mode 100644 index 000000000000..c0374e8c8b1d --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/pet_faked_client_test.dart @@ -0,0 +1,231 @@ +import 'dart:io'; + +import 'package:http/http.dart'; +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +import 'fake_client.dart'; +import 'random_id.dart'; + +void main() { + final petApi = PetApi(); + + Pet makePet({ + int id = 1234, + String name = 'Fluffy', + String status = '', + }) { + final category = Category() + ..id = 1234 + ..name = 'eyeColor'; + final tags = [ + Tag() + ..id = 1234 + ..name = 'New York', + Tag() + ..id = 124321 + ..name = 'Jose' + ]; + return Pet() + ..id = id + ..category = category + ..tags = tags + ..name = name + ..status = status + ..photoUrls = ['https://petstore.com/sample/photo1.jpg']; + } + + /// Setup the fake client then call [petApi.addPet] + Future addPet(Pet pet) { + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPostRequestBody: petApi.apiClient.serialize(pet), + postResponseBody: '', + ); + return petApi.addPet(pet); + } + + group('Pet API with faked client', () { + test('adds a new pet and gets it by id', () async { + final id = newId(); + final newPet = makePet(id: id); + + // use the pet api to add a pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPostRequestBody: petApi.apiClient.serialize(newPet), + postResponseBody: '', + ); + await petApi.addPet(newPet); + + // retrieve the same pet by id + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + getResponseBody: petApi.apiClient.serialize(newPet), + ); + final retrievedPet = await petApi.getPetById(id); + + // check that the retrieved id is as expected + expect(retrievedPet.id, equals(id)); + }); + + test('doesn\'t get non-existing pet by id', () { + final id = newId(); + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + throwException: ApiException(400, 'not found'), + ); + expect( + petApi.getPetById(id), throwsA(equals(TypeMatcher()))); + }); + + test('deletes existing pet by id', () async { + final id = newId(); + Pet newPet = makePet(id: id); + + // add a new pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPostRequestBody: petApi.apiClient.serialize(newPet), + postResponseBody: '', + ); + await petApi.addPet(newPet); + + // delete the pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + expectedHeaders: { + 'Content-Type': 'application/json', + 'api_key': 'special-key' + }, + deleteResponseBody: '', + ); + await petApi.deletePet(id, apiKey: 'special-key'); + + // check for the deleted pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + throwException: ApiException(400, 'Not found'), + ); + expect( + petApi.getPetById(id), throwsA(equals(TypeMatcher()))); + }); + + test('updates pet with form', () async { + final id = newId(); + final newPet = makePet(id: id, name: 'Snowy'); + + // add a new pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPostRequestBody: petApi.apiClient.serialize(newPet), + postResponseBody: '', + ); + await petApi.addPet(newPet); + + final multipartRequest = MultipartRequest(null, null); + multipartRequest.fields['name'] = 'Doge'; + multipartRequest.fields['status'] = ''; + + // update with form + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + expectedHeaders: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + expectedPostRequestBody: {'name': 'Doge', 'status': ''}, + postResponseBody: '', + ); + await petApi.updatePetWithForm(id, name: 'Doge', status: ''); + + // check update worked + newPet.name = 'Doge'; + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + getResponseBody: petApi.apiClient.serialize(newPet), + ); + final pet = await petApi.getPetById(id); + expect(pet.name, equals('Doge')); + }); + + test('updates existing pet', () async { + final id = newId(); + final name = 'Snowy'; + final newPet = makePet(id: id); + final updatePet = makePet(id: id, name: name); + + // add a new pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPostRequestBody: petApi.apiClient.serialize(newPet), + postResponseBody: '', + ); + await petApi.addPet(newPet); + + // update the same pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPutRequestBody: petApi.apiClient.serialize(updatePet), + putResponseBody: '', + ); + await petApi.updatePet(updatePet); + + // check update worked + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet/$id', + getResponseBody: petApi.apiClient.serialize(updatePet), + ); + final pet = await petApi.getPetById(id); + expect(pet.name, equals(name)); + }); + + test('finds pets by status', () async { + final id1 = newId(); + final id2 = newId(); + final id3 = newId(); + final status = 'available'; + final pet1 = makePet(id: id1, status: status); + final pet2 = makePet(id: id2, status: status); + final pet3 = makePet(id: id3, status: 'sold'); + + return Future.wait([addPet(pet1), addPet(pet2), addPet(pet3)]) + .then((_) async { + // retrieve pets by status + petApi.apiClient.client = FakeClient( + expectedUrl: + 'http://petstore.swagger.io/v2/pet/findByStatus?status=$status', + getResponseBody: petApi.apiClient.serialize([pet1, pet2]), + ); + final pets = await petApi.findPetsByStatus([status]); + final petIds = pets.map((pet) => pet.id).toList(); + expect(petIds, contains(id1)); + expect(petIds, contains(id2)); + expect(petIds, isNot(contains(id3))); + }); + }); + + test('uploads a pet image', () async { + final id = newId(); + final newPet = makePet(id: id); + // get some test data (recorded from live response) + final uploadResponse = + await File('test/file_upload_response.json').readAsString(); + + // add a new pet + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + expectedPostRequestBody: petApi.apiClient.serialize(newPet), + postResponseBody: '', + ); + await petApi.addPet(newPet); + + petApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/pet', + sendResponseBody: uploadResponse, + ); + final file = + new MultipartFile.fromBytes('file', [104, 101, 108, 108, 111]); + await petApi.uploadFile(id, additionalMetadata: '', file: file); + }); + }); +} diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/pet_test.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/pet_test.dart new file mode 100644 index 000000000000..b978022e5651 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/pet_test.dart @@ -0,0 +1,103 @@ +import 'dart:async'; + +import 'package:http/http.dart'; +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +import 'random_id.dart'; + +void main() { + var petApi = PetApi(); + + Pet makePet({ + int id = 1234, + String name = 'Fluffy', + String status = '', + }) { + final category = Category() + ..id = 1234 + ..name = 'eyeColor'; + final tags = [ + Tag() + ..id = 1234 + ..name = 'New York', + Tag() + ..id = 124321 + ..name = 'Jose' + ]; + return Pet() + ..id = id + ..category = category + ..tags = tags + ..name = name + ..status = status + ..photoUrls = ['https://petstore.com/sample/photo1.jpg']; + } + + group('Pet API with live client', () { + test('adds a new pet and gets it by id', () async { + var id = newId(); + await petApi.addPet(makePet(id: id)); + var pet = await petApi.getPetById(id); + expect(pet.id, equals(id)); + }); + + test('doesn\'t get non-existing pet by id', () { + expect(petApi.getPetById(newId()), + throwsA(equals(TypeMatcher()))); + }); + + test('deletes existing pet by id', () async { + var id = newId(); + await petApi.addPet(makePet(id: id)); + await petApi.deletePet(id, apiKey: 'special-key'); + expect( + petApi.getPetById(id), throwsA(equals(TypeMatcher()))); + }); + + test('updates pet with form', () async { + var id = newId(); + + await petApi.addPet(makePet(id: id, name: 'Snowy')); + await petApi.updatePetWithForm(id, name: 'Doge', status: ''); + var pet = await petApi.getPetById(id); + expect(pet.name, equals('Doge')); + }); + + test('updates existing pet', () async { + var id = newId(); + var name = 'Snowy'; + + await petApi.addPet(makePet(id: id)); + await petApi.updatePet(makePet(id: id, name: name)); + var pet = await petApi.getPetById(id); + expect(pet.name, equals(name)); + }); + + test('finds pets by status', () async { + var id1 = newId(); + var id2 = newId(); + var id3 = newId(); + var status = 'available'; + + return Future.wait([ + petApi.addPet(makePet(id: id1, status: status)), + petApi.addPet(makePet(id: id2, status: status)), + petApi.addPet(makePet(id: id3, status: 'sold')) + ]).then((_) async { + var pets = await petApi.findPetsByStatus([status]); + var petIds = pets.map((pet) => pet.id).toList(); + expect(petIds, contains(id1)); + expect(petIds, contains(id2)); + expect(petIds, isNot(contains(id3))); + }); + }); + + test('uploads a pet image', () async { + var id = newId(); + await petApi.addPet(makePet(id: id)); + var file = new MultipartFile.fromBytes('file', [104, 101, 108, 108, 111]); + await petApi.uploadFile(id, additionalMetadata: '', file: file); + }); + }, skip: 'e2e tests for CI'); +} diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/random_id.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/random_id.dart new file mode 100644 index 000000000000..0457428c7dd4 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/random_id.dart @@ -0,0 +1,7 @@ +import 'dart:math'; + +final _random = new Random(); + +int newId() { + return _random.nextInt(999999); +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/store_faked_client_test.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/store_faked_client_test.dart new file mode 100644 index 000000000000..dce22ec58b2e --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/store_faked_client_test.dart @@ -0,0 +1,85 @@ +import 'dart:io'; + +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +import 'fake_client.dart'; +import 'random_id.dart'; + +void main() { + var storeApi = new StoreApi(); + + Order makeOrder({int id}) { + return Order() + ..id = id + ..petId = 1234 + ..quantity = 1 + ..shipDate = DateTime.now() + ..status + ..complete = false; + } + + group('Store API with faked client', () { + test('places an order and gets it by id', () async { + final id = newId(); + final newOrder = makeOrder(id: id); + + // use the store api to add an order + storeApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/store/order', + expectedPostRequestBody: storeApi.apiClient.serialize(newOrder), + postResponseBody: storeApi.apiClient.serialize(newOrder), + ); + await storeApi.placeOrder(newOrder); + + // retrieve the same order by id + storeApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id', + getResponseBody: storeApi.apiClient.serialize(newOrder), + ); + final placedOrder = await storeApi.getOrderById(id); + expect(placedOrder.id, equals(id)); + }); + + test('deletes an order', () async { + final id = newId(); + final newOrder = makeOrder(id: id); + + // use the store api to add an order + storeApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/store/order', + expectedPostRequestBody: storeApi.apiClient.serialize(newOrder), + postResponseBody: storeApi.apiClient.serialize(newOrder), + ); + await storeApi.placeOrder(newOrder); + + // delete the same order + storeApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id', + deleteResponseBody: '', + ); + await storeApi.deleteOrder(id.toString()); + + // try and retrieve the order + storeApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/store/order/$id', + throwException: ApiException(400, 'Not found'), + ); + expect(storeApi.getOrderById(id), + throwsA(equals(TypeMatcher()))); + }); + + test('gets the store inventory', () async { + // get some test data (recorded from live response) + final inventoryResponse = + await File('test/inventory_response.json').readAsString(); + // use the store api to get the inventory + storeApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/store/inventory', + getResponseBody: inventoryResponse, + ); + Map inventory = await storeApi.getInventory(); + expect(inventory.length, isNot(equals(0))); + }); + }); +} diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/store_test.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/store_test.dart new file mode 100644 index 000000000000..ce4531e372db --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/store_test.dart @@ -0,0 +1,42 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +import 'random_id.dart'; + +void main() { + var storeApi = new StoreApi(); + + Order makeOrder({int id}) { + return Order() + ..id = id + ..petId = 1234 + ..quantity = 1 + ..shipDate = DateTime.now() + ..status + ..complete = false; + } + + group('Store API with live client', () { + test('places an order and gets it by id', () async { + var id = newId(); + + await storeApi.placeOrder(makeOrder(id: id)); + var order = await storeApi.getOrderById(id); + expect(order.id, equals(id)); + }); + + test('deletes an order', () async { + var id = newId(); + + await storeApi.placeOrder(makeOrder(id: id)); + await storeApi.deleteOrder(id.toString()); + expect(storeApi.getOrderById(id), + throwsA(equals(TypeMatcher()))); + }); + + test('gets the store inventory', () async { + Map inventory = await storeApi.getInventory(); + expect(inventory.length, isNot(equals(0))); + }); + }); // , skip: 'e2e tests for CI' +} diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/user_faked_client_test.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/user_faked_client_test.dart new file mode 100644 index 000000000000..df2b4686f13a --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/user_faked_client_test.dart @@ -0,0 +1,170 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +import 'fake_client.dart'; +import 'random_id.dart'; + +void main() { + var userApi = new UserApi(); + + User makeUser( + {int id, String userName = 'username', String password = 'password'}) { + return User() + ..id = id + ..username = userName + ..firstName = 'firstname' + ..lastName = 'lastname' + ..email = 'email' + ..password = password + ..phone = 'phone' + ..userStatus = 0; + } + + group('User API with faked client', () { + test('creates a user', () async { + final id = newId(); + final username = 'Mally45'; + final newUser = makeUser(id: id, userName: username); + + // use the user api to create a user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user', + expectedPostRequestBody: userApi.apiClient.serialize(newUser), + postResponseBody: userApi.apiClient.serialize(newUser), + ); + await userApi.createUser(newUser); + + // retrieve the same user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user/$username', + getResponseBody: userApi.apiClient.serialize(newUser), + ); + var user = await userApi.getUserByName(username); + expect(user.id, equals(id)); + }); + + test('creates users with list input', () async { + final firstId = newId(); + final joe = 'Joe'; + + final sally = 'Sally'; + final secondId = newId(); + + final users = [ + makeUser(id: firstId, userName: joe), + makeUser(id: secondId, userName: sally), + ]; + + // use the user api to create a list of users + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user/createWithList', + expectedPostRequestBody: userApi.apiClient.serialize(users), + postResponseBody: userApi.apiClient.serialize(users), + ); + await userApi.createUsersWithListInput(users); + + // retrieve the users + userApi.apiClient.client = FakeClient( + expectedUrl: + 'http://petstore.swagger.io/v2/user/${users.elementAt(0).username}', + getResponseBody: userApi.apiClient.serialize( + users.elementAt(0), + ), + ); + final firstUser = await userApi.getUserByName(joe); + userApi.apiClient.client = FakeClient( + expectedUrl: + 'http://petstore.swagger.io/v2/user/${users.elementAt(1).username}', + getResponseBody: userApi.apiClient.serialize( + users.elementAt(1), + ), + ); + final secondUser = await userApi.getUserByName(sally); + expect(firstUser.id, equals(firstId)); + expect(secondUser.id, equals(secondId)); + }); + + test('updates a user', () async { + final username = 'Arkjam89'; + final email = 'test@example.com'; + final newUser = makeUser(id: newId(), userName: username); + + // use the user api to create a user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user', + expectedPostRequestBody: userApi.apiClient.serialize(newUser), + postResponseBody: userApi.apiClient.serialize(newUser), + ); + await userApi.createUser(newUser); + newUser.email = email; + + // use the user api to update the user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user/${newUser.username}', + expectedPutRequestBody: userApi.apiClient.serialize(newUser), + putResponseBody: userApi.apiClient.serialize(newUser), + ); + await userApi.updateUser(username, newUser); + + // retrieve the same user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user/${newUser.username}', + getResponseBody: userApi.apiClient.serialize(newUser), + ); + var foundUser = await userApi.getUserByName(username); + expect(foundUser.email, equals(email)); + }); + + test('deletes a user', () async { + final username = 'Riddlem325'; + final newUser = makeUser(id: newId(), userName: username); + + // use the user api to create a user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user', + expectedPostRequestBody: userApi.apiClient.serialize(newUser), + postResponseBody: userApi.apiClient.serialize(newUser), + ); + await userApi.createUser(newUser); + + // delete the same user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user/${newUser.username}', + deleteResponseBody: '', + ); + await userApi.deleteUser(username); + + // try and retrieve the user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user/${newUser.username}', + throwException: ApiException(400, 'Not found'), + ); + expect(userApi.getUserByName(username), + throwsA(TypeMatcher())); + }); + + test('logs a user in', () async { + final username = 'sgarad625'; + final password = 'lokimoki1'; + final newUser = + makeUser(id: newId(), userName: username, password: password); + + // use the user api to create a user + userApi.apiClient.client = FakeClient( + expectedUrl: 'http://petstore.swagger.io/v2/user', + expectedPostRequestBody: userApi.apiClient.serialize(newUser), + postResponseBody: userApi.apiClient.serialize(newUser), + ); + await userApi.createUser(newUser); + + // use the user api to login + userApi.apiClient.client = FakeClient( + expectedUrl: + 'http://petstore.swagger.io/v2/user/login?username=${newUser.username}&password=${newUser.password}', + getResponseBody: 'logged in user session:', + ); + final result = await userApi.loginUser(username, password); + expect(result, contains('logged in user session:')); + }); + }); +} diff --git a/CI/samples.ci/client/petstore/dart2/petstore/test/user_test.dart b/CI/samples.ci/client/petstore/dart2/petstore/test/user_test.dart new file mode 100644 index 000000000000..ea34b3713fa7 --- /dev/null +++ b/CI/samples.ci/client/petstore/dart2/petstore/test/user_test.dart @@ -0,0 +1,80 @@ +import 'package:openapi/api.dart'; +import 'package:test/test.dart'; + +import 'random_id.dart'; + +void main() { + var userApi = new UserApi(); + + User makeUser( + {int id, String userName = 'username', String password = 'password'}) { + return User() + ..id = id + ..username = userName + ..firstName = 'firstname' + ..lastName = 'lastname' + ..email = 'email' + ..password = password + ..phone = 'phone' + ..userStatus = 0; + } + + group('User API with live client', () { + test('creates a user', () async { + var id = newId(); + var username = 'Mally45'; + await userApi.createUser(makeUser(id: id, userName: username)); + var user = await userApi.getUserByName(username); + expect(user.id, equals(id)); + }); + + test('creates users with list input', () async { + var firstId = newId(); + var joe = 'Joe'; + + var sally = 'Sally'; + var secondId = newId(); + + var users = [ + makeUser(id: firstId, userName: joe), + makeUser(id: secondId, userName: sally), + ]; + + await userApi.createUsersWithListInput(users); + var firstUser = await userApi.getUserByName(joe); + var secondUser = await userApi.getUserByName(sally); + expect(firstUser.id, equals(firstId)); + expect(secondUser.id, equals(secondId)); + }); + + test('updates a user', () async { + var username = 'Arkjam89'; + var email = 'test@example.com'; + var user = makeUser(id: newId(), userName: username); + + await userApi.createUser(user); + user.email = email; + await userApi.updateUser(username, user); + var foundUser = await userApi.getUserByName(username); + expect(foundUser.email, equals(email)); + }); + + test('deletes a user', () async { + var username = 'Riddlem325'; + await userApi.createUser(makeUser(id: newId(), userName: username)); + await userApi.deleteUser(username); + expect(userApi.getUserByName(username), + throwsA(TypeMatcher())); + }); + + test('logs a user in', () async { + var username = 'sgarad625'; + var password = 'lokimoki1'; + var user = makeUser(id: newId(), userName: username, password: password); + + await userApi.createUser(user); + var result = await userApi.loginUser(username, password); + expect(result, contains('logged in user session:')); + }); + }, skip: 'e2e tests for CI'); +} diff --git a/CI/samples.ci/client/petstore/elixir/pom.xml b/CI/samples.ci/client/petstore/elixir/pom.xml new file mode 100644 index 000000000000..589db62d2dca --- /dev/null +++ b/CI/samples.ci/client/petstore/elixir/pom.xml @@ -0,0 +1,75 @@ + + 4.0.0 + io.swagger + ElixirPetstoreClientTests + pom + 1.0-SNAPSHOT + Elixir Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + dep-install + pre-integration-test + + exec + + + mix + + local.hex + --force + + + + + compile + integration-test + + exec + + + mix + + do + deps.get, + compile + + + + + test + integration-test + + exec + + + mix + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/elixir/test/pet_test.exs b/CI/samples.ci/client/petstore/elixir/test/pet_test.exs new file mode 100644 index 000000000000..6011a08ccf58 --- /dev/null +++ b/CI/samples.ci/client/petstore/elixir/test/pet_test.exs @@ -0,0 +1,60 @@ +defmodule PetTest do + use ExUnit.Case + alias OpenapiPetstore.Connection + alias OpenapiPetstore.Api.Pet, as: PetApi + alias OpenapiPetstore.Model.Pet + alias OpenapiPetstore.Model.Category + alias OpenapiPetstore.Model.Tag + + test "add and delete a pet" do + petId = 10007 + pet = %Pet{ + :id => petId, + :name => "elixir client test", + :photoUrls => ["http://test_elixir_unit_test.com"], + :category => %Category{:id => petId, :name=> "test elixir category"}, + :tags => [%Tag{:id => petId, :name => "test elixir tag"}], + } + {:ok, response} = PetApi.add_pet(Connection.new, pet) + assert response.status == 200 + + {:ok, pet} = PetApi.get_pet_by_id(Connection.new, petId) + assert pet.id == petId + assert pet.name == "elixir client test" + assert List.first(pet.photoUrls) == "http://test_elixir_unit_test.com" + assert pet.category.id == petId + assert pet.category.name == "test elixir category" + assert List.first(pet.tags) == %Tag{:id => petId, :name => "test elixir tag"} + + {:ok, response} = PetApi.delete_pet(Connection.new, petId) + assert response.status == 200 + {:ok, response} = PetApi.get_pet_by_id(Connection.new, petId) + assert response.status == 404 + end + + test "update a pet" do + petId = 10007 + pet = %Pet{ + :id => petId, + :name => "elixir client updatePet", + :status => "pending", + :photoUrls => ["http://test_elixir_unit_test.com"] + } + {:ok, response} = PetApi.update_pet(Connection.new, pet) + assert response.status == 200 + + {:ok, pet} = PetApi.get_pet_by_id(Connection.new, petId) + assert pet.id == petId + assert pet.name == "elixir client updatePet" + assert pet.status == "pending" + end + + test "find pet by status" do + {:ok, listPets} = PetApi.find_pets_by_status(Connection.new, "available") + assert List.first(listPets) != nil + + {:ok, listPets} = PetApi.find_pets_by_status(Connection.new, "unknown_and_incorrect_status") + assert List.first(listPets) == nil + end + +end diff --git a/CI/samples.ci/client/petstore/elm-0.18/elm-0.18-compile-test b/CI/samples.ci/client/petstore/elm-0.18/elm-0.18-compile-test new file mode 100755 index 000000000000..c6ba0a25f68d --- /dev/null +++ b/CI/samples.ci/client/petstore/elm-0.18/elm-0.18-compile-test @@ -0,0 +1,14 @@ +#!/bin/bash -e +# elm 0.18 make all elm files under src + +for ELM in `find src -name "*.elm"` +do + echo "Compiling $ELM" + elm make $ELM --output /dev/null --yes + rc=$? + if [[ $rc != 0 ]] + then + echo "ERROR!! FAILED TO COMPILE $ELM" + exit $rc; + fi +done diff --git a/CI/samples.ci/client/petstore/elm-0.18/pom.xml b/CI/samples.ci/client/petstore/elm-0.18/pom.xml new file mode 100644 index 000000000000..7ddfe9d49e7c --- /dev/null +++ b/CI/samples.ci/client/petstore/elm-0.18/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + Elm018ClientTests + pom + 1.0-SNAPSHOT + Elm 0.18 Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + ./elm-0.18-compile-test + + + + + + + diff --git a/samples/openapi3/client/composition/elm/elm-compile-test b/CI/samples.ci/client/petstore/elm/elm-compile-test similarity index 100% rename from samples/openapi3/client/composition/elm/elm-compile-test rename to CI/samples.ci/client/petstore/elm/elm-compile-test diff --git a/CI/samples.ci/client/petstore/elm/pom.xml b/CI/samples.ci/client/petstore/elm/pom.xml new file mode 100644 index 000000000000..abedbfae9c5a --- /dev/null +++ b/CI/samples.ci/client/petstore/elm/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + org.openapitools + ElmClientTests + pom + 1.0-SNAPSHOT + Elm Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + ./elm-compile-test + + + + + + + diff --git a/CI/samples.ci/client/petstore/erlang-client/pom.xml b/CI/samples.ci/client/petstore/erlang-client/pom.xml new file mode 100644 index 000000000000..ba943e98dfe6 --- /dev/null +++ b/CI/samples.ci/client/petstore/erlang-client/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + ErlangClientTests + pom + 1.0-SNAPSHOT + Erlang Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + compile-test + integration-test + + exec + + + rebar3 + + compile + + + + + + + + diff --git a/CI/samples.ci/client/petstore/erlang-proper/.gitignore b/CI/samples.ci/client/petstore/erlang-proper/.gitignore new file mode 100644 index 000000000000..172c6579a4a9 --- /dev/null +++ b/CI/samples.ci/client/petstore/erlang-proper/.gitignore @@ -0,0 +1,2 @@ +_build/ +rebar.lock diff --git a/CI/samples.ci/client/petstore/erlang-proper/pom.xml b/CI/samples.ci/client/petstore/erlang-proper/pom.xml new file mode 100644 index 000000000000..541337e18b33 --- /dev/null +++ b/CI/samples.ci/client/petstore/erlang-proper/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + ErlangProperClientTests + pom + 1.0-SNAPSHOT + Erlang Proper Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.6.0 + + + compile-test + integration-test + + exec + + + rebar3 + + compile + + + + + + + + diff --git a/CI/samples.ci/client/petstore/go-experimental/auth_test.go b/CI/samples.ci/client/petstore/go-experimental/auth_test.go new file mode 100644 index 000000000000..1bb5d8175635 --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/auth_test.go @@ -0,0 +1,260 @@ +package main + +import ( + "context" + "net/http" + "net/http/httputil" + "strings" + "testing" + "time" + + "golang.org/x/oauth2" + + sw "./go-petstore" +) + +func TestOAuth2(t *testing.T) { + // Setup some fake oauth2 configuration + cfg := &oauth2.Config{ + ClientID: "1234567", + ClientSecret: "SuperSecret", + Endpoint: oauth2.Endpoint{ + AuthURL: "https://devnull", + TokenURL: "https://devnull", + }, + RedirectURL: "https://devnull", + } + + // and a fake token + tok := oauth2.Token{ + AccessToken: "FAKE", + RefreshToken: "So Fake", + Expiry: time.Now().Add(time.Hour * 100000), + TokenType: "Bearer", + } + + // then a fake tokenSource + tokenSource := cfg.TokenSource(createContext(nil), &tok) + auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + + if !strings.Contains((string)(reqb), "Authorization: Bearer FAKE") { + t.Errorf("OAuth2 Authentication is missing") + } +} + +func TestBasicAuth(t *testing.T) { + + auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "fakeUser", + Password: "f4k3p455", + }) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(auth, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Basic ZmFrZVVzZXI6ZjRrM3A0NTU") { + t.Errorf("Basic Authentication is missing") + } +} + +func TestAccessToken(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(nil, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Bearer TESTFAKEACCESSTOKENISFAKE") { + t.Errorf("AccessToken Authentication is missing") + } +} + +func TestAPIKeyNoPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123"}}) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestAPIKeyWithPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKeys, map[string]sw.APIKey{"api_key": sw.APIKey{Key: "TEST123", Prefix: "Bearer"}}) + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(nil, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDefaultHeader(t *testing.T) { + + newPet := (sw.Pet{Id: sw.PtrInt64(12992), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(context.Background(), 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Testheader: testvalue") { + t.Errorf("Default Header is missing") + } +} + +func TestHostOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Host != testHost { + t.Errorf("Request Host is %v, expected %v", r.Request.Host, testHost) + } +} + +func TestSchemeOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Scheme != testScheme { + t.Errorf("Request Scheme is %v, expected %v", r.Request.URL.Scheme, testScheme) + } +} + +// Add custom clients to the context. +func createContext(httpClient *http.Client) context.Context { + parent := oauth2.NoContext + ctx := context.WithValue(parent, oauth2.HTTPClient, httpClient) + return ctx +} diff --git a/CI/samples.ci/client/petstore/go-experimental/fake_api_test.go b/CI/samples.ci/client/petstore/go-experimental/fake_api_test.go new file mode 100644 index 000000000000..e97bcb4846a8 --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/fake_api_test.go @@ -0,0 +1,28 @@ +package main + +import ( + "testing" + + sw "./go-petstore" + "golang.org/x/net/context" +) + +// TestPutBodyWithFileSchema ensures a model with the name 'File' +// gets converted properly to the petstore.File struct vs. *os.File +// as specified in typeMapping for 'File'. +func TestPutBodyWithFileSchema(t *testing.T) { + return // early return to test compilation + + schema := sw.FileSchemaTestClass{ + File: &sw.File{SourceURI: sw.PtrString("https://example.com/image.png")}, + Files: &[]sw.File{{SourceURI: sw.PtrString("https://example.com/image.png")}}} + + r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/CI/samples.ci/client/petstore/go-experimental/pet_api_test.go b/CI/samples.ci/client/petstore/go-experimental/pet_api_test.go new file mode 100644 index 000000000000..c1e8006bb0cf --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/pet_api_test.go @@ -0,0 +1,297 @@ +package main + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/antihax/optional" + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +var client *sw.APIClient + +const testHost = "petstore.swagger.io:80" +const testScheme = "http" + +func TestMain(m *testing.M) { + cfg := sw.NewConfiguration() + cfg.AddDefaultHeader("testheader", "testvalue") + cfg.Host = testHost + cfg.Scheme = testScheme + client = sw.NewAPIClient(cfg) + retCode := m.Run() + os.Exit(retCode) +} + +func TestAddPet(t *testing.T) { + newPet := (sw.Pet{Id: sw.PtrInt64(12830), Name: sw.PtrString("gopher"), + PhotoUrls: &[]string{"http://1.com", "http://2.com"}, Status: sw.PtrString("pending"), + Tags: &[]sw.Tag{sw.Tag{Id: sw.PtrInt64(1), Name: sw.PtrString("tag2")}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestFindPetsByStatusWithMissingParam(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestGetPetById(t *testing.T) { + isPetCorrect(t, 12830, "gopher", "pending") +} + +func TestGetPetByIdWithInvalidID(t *testing.T) { + resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999) + if r != nil && r.StatusCode == 404 { + assertedError, ok := err.(sw.GenericOpenAPIError) + a := assert.New(t) + a.True(ok) + a.Contains(string(assertedError.Body()), "type") + + a.Contains(assertedError.Error(), "Not Found") + } else if err != nil { + t.Fatalf("Error while getting pet by invalid id: %v", err) + t.Log(r) + } else { + t.Log(resp) + } +} + +func TestUpdatePetWithForm(t *testing.T) { + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.UpdatePetWithFormOpts{ + Name: optional.NewString("golang"), + Status: optional.NewString("available"), + }) + if err != nil { + t.Fatalf("Error while updating pet by id: %v", err) + t.Log(r) + } + if r.StatusCode != 200 { + t.Log(r) + } + + // get the pet with id 12830 from server to verify the update + isPetCorrect(t, 12830, "golang", "available") +} + +func TestFindPetsByTag(t *testing.T) { + var found = false + resp, r, err := client.PetApi.FindPetsByTags(context.Background(), []string{"tag2"}) + if err != nil { + t.Fatalf("Error while getting pet by tag: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + if *resp[i].Id == 12830 { + assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`") + found = true + } + } + } + + if found == false { + t.Errorf("Error while getting pet by tag could not find 12830") + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestFindPetsByStatus(t *testing.T) { + resp, r, err := client.PetApi.FindPetsByStatus(context.Background(), []string{"available"}) + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + assert.Equal(*resp[i].Status, "available", "Pet status should be `available`") + } + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestUploadFile(t *testing.T) { + file, _ := os.Open("../python/testfiles/foo.png") + + _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ + AdditionalMetadata: optional.NewString("golang"), + File: optional.NewInterface(file), + }) + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestUploadFileRequired(t *testing.T) { + return // remove when server supports this endpoint + file, _ := os.Open("../python/testfiles/foo.png") + + _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830, + file, + &sw.UploadFileWithRequiredFileOpts{ + AdditionalMetadata: optional.NewString("golang"), + }) + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDeletePet(t *testing.T) { + r, err := client.PetApi.DeletePet(context.Background(), 12830, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +/* +// Test we can concurrently create, retrieve, update, and delete. +func TestConcurrency(t *testing.T) { + errc := make(chan error) + + newPets := []sw.Pet{ + sw.Pet{Id: 912345, Name: "gopherFred", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912346, Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912347, Name: "gopherRick", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "mia"}, + sw.Pet{Id: 912348, Name: "gopherJohn", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912349, Name: "gopherAlf", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912350, Name: "gopherRob", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912351, Name: "gopherIan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + } + + // Add the pets. + for _, pet := range newPets { + go func(newPet sw.Pet) { + r, err := client.PetApi.AddPet(nil, newPet) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, pet.Name, pet.Status) + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Update all to active with the name gopherDan + for _, pet := range newPets { + go func(id int64) { + r, err := client.PetApi.UpdatePet(nil, sw.Pet{Id: (int64)(id), Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, "gopherDan", "active") + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Delete them all. + for _, pet := range newPets { + go func(id int64) { + deletePet(t, (int64)(id)) + errc <- nil + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) +} +*/ + +func waitOnFunctions(t *testing.T, errc chan error, n int) { + for i := 0; i < n; i++ { + err := <-errc + if err != nil { + t.Fatalf("Error performing concurrent test: %v", err) + } + } +} + +func deletePet(t *testing.T, id int64) { + r, err := client.PetApi.DeletePet(context.Background(), id, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func isPetCorrect(t *testing.T, id int64, name string, status string) { + assert := assert.New(t) + resp, r, err := client.PetApi.GetPetById(context.Background(), id) + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + } else { + assert.Equal(*resp.Id, int64(id), "Pet id should be equal") + assert.Equal(*resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) + assert.Equal(*resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) + + //t.Log(resp) + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/CI/samples.ci/client/petstore/go-experimental/pom.xml b/CI/samples.ci/client/petstore/go-experimental/pom.xml new file mode 100644 index 000000000000..91e3da8c34b4 --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/pom.xml @@ -0,0 +1,103 @@ + + 4.0.0 + org.openapitools + GoExperimentalPetstore + pom + 1.0.0 + Go Experimental Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + go-get-testify + pre-integration-test + + exec + + + go + + get + github.com/stretchr/testify/assert + + + + + go-get-oauth2 + pre-integration-test + + exec + + + go + + get + golang.org/x/oauth2 + + + + + go-get-context + pre-integration-test + + exec + + + go + + get + golang.org/x/net/context + + + + + go-get-optional + pre-integration-test + + exec + + + go + + get + github.com/antihax/optional + + + + + go-test + integration-test + + exec + + + go + + test + -v + + + + + + + + diff --git a/CI/samples.ci/client/petstore/go-experimental/store_api_test.go b/CI/samples.ci/client/petstore/go-experimental/store_api_test.go new file mode 100644 index 000000000000..81f4fd7e33d9 --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/store_api_test.go @@ -0,0 +1,37 @@ +package main + +import ( + "context" + "regexp" + "testing" + "time" + + sw "./go-petstore" +) + +func TestPlaceOrder(t *testing.T) { + newOrder := sw.Order{ + Id: sw.PtrInt64(0), + PetId: sw.PtrInt64(0), + Quantity: sw.PtrInt32(0), + ShipDate: sw.PtrTime(time.Now().UTC()), + Status: sw.PtrString("placed"), + Complete: sw.PtrBool(false)} + + _, r, err := client.StoreApi.PlaceOrder(context.Background(), newOrder) + + if err != nil { + // Skip parsing time error due to error in Petstore Test Server + // https://github.com/OpenAPITools/openapi-generator/issues/1292 + if regexp. + MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`). + MatchString(err.Error()) { + t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime") + } else { + t.Fatalf("Error while placing order: %v", err) + } + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/CI/samples.ci/client/petstore/go-experimental/test.go.bak b/CI/samples.ci/client/petstore/go-experimental/test.go.bak new file mode 100644 index 000000000000..54e14b9c7a04 --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/test.go.bak @@ -0,0 +1,30 @@ +package main + +import ( + sw "./go-petstore" + "encoding/json" + "fmt" +) + +func main() { + + s := sw.NewPetApi() + + // test POST(body) + newPet := (sw.Pet{Id: 12830, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}) + + jsonNewPet, _ := json.Marshal(newPet) + fmt.Println("newPet:", string(jsonNewPet)) + s.AddPet(newPet) + + // test POST(form) + s.UpdatePetWithForm(12830, "golang", "available") + + // test GET + resp, apiResponse, err := s.GetPetById(12830) + fmt.Println("GetPetById: ", resp, err, apiResponse) + + err2, apiResponse2 := s.DeletePet(12830, "") + fmt.Println("DeletePet: ", err2, apiResponse2) +} diff --git a/CI/samples.ci/client/petstore/go-experimental/user_api_test.go b/CI/samples.ci/client/petstore/go-experimental/user_api_test.go new file mode 100644 index 000000000000..07b82ebb9757 --- /dev/null +++ b/CI/samples.ci/client/petstore/go-experimental/user_api_test.go @@ -0,0 +1,153 @@ +package main + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +func TestCreateUser(t *testing.T) { + newUser := sw.User{ + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher"), + LastName: sw.PtrString("lang"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} + + apiResponse, err := client.UserApi.CreateUser(context.Background(), newUser) + + if err != nil { + t.Fatalf("Error while adding user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +//adding x to skip the test, currently it is failing +func TestCreateUsersWithArrayInput(t *testing.T) { + newUsers := []sw.User{ + sw.User{ + Id: sw.PtrInt64(1001), + FirstName: sw.PtrString("gopher1"), + LastName: sw.PtrString("lang1"), + Username: sw.PtrString("gopher1"), + Password: sw.PtrString("lang1"), + Email: sw.PtrString("lang1@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), + }, + sw.User{ + Id: sw.PtrInt64(1002), + FirstName: sw.PtrString("gopher2"), + LastName: sw.PtrString("lang2"), + Username: sw.PtrString("gopher2"), + Password: sw.PtrString("lang2"), + Email: sw.PtrString("lang2@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1), + }, + } + + apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background(), newUsers) + if err != nil { + t.Fatalf("Error while adding users: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //tear down + _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") + if err1 != nil { + t.Errorf("Error while deleting user") + t.Log(err1) + } + + _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2") + if err2 != nil { + t.Errorf("Error while deleting user") + t.Log(err2) + } +} + +func TestGetUserByName(t *testing.T) { + assert := assert.New(t) + + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.Username, "gopher", "User name should be gopher") + assert.Equal(*resp.LastName, "lang", "Last name should be lang") + //t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestGetUserByNameWithInvalidID(t *testing.T) { + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999") + if apiResponse != nil && apiResponse.StatusCode == 404 { + return // This is a pass condition. API will return with a 404 error. + } else if err != nil { + t.Fatalf("Error while getting user by invalid id: %v", err) + t.Log(apiResponse) + } else { + t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestUpdateUser(t *testing.T) { + assert := assert.New(t) + + newUser := sw.User{ + Id: sw.PtrInt64(1000), + FirstName: sw.PtrString("gopher20"), + LastName: sw.PtrString("lang20"), + Username: sw.PtrString("gopher"), + Password: sw.PtrString("lang"), + Email: sw.PtrString("lang@test.com"), + Phone: sw.PtrString("5101112222"), + UserStatus: sw.PtrInt32(1)} + + apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher", newUser) + if err != nil { + t.Fatalf("Error while deleting user by id: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //verify changings are correct + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(*resp.Id, int64(1000), "User id should be equal") + assert.Equal(*resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(*resp.Password, "lang", "User name should be the same") + } +} + +func TestDeleteUser(t *testing.T) { + apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") + + if err != nil { + t.Fatalf("Error while deleting user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore b/CI/samples.ci/client/petstore/go/.gitignore similarity index 100% rename from samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore rename to CI/samples.ci/client/petstore/go/.gitignore diff --git a/CI/samples.ci/client/petstore/go/auth_test.go b/CI/samples.ci/client/petstore/go/auth_test.go new file mode 100644 index 000000000000..5f817703a886 --- /dev/null +++ b/CI/samples.ci/client/petstore/go/auth_test.go @@ -0,0 +1,254 @@ +package main + +import ( + "context" + "net/http" + "net/http/httputil" + "strings" + "testing" + "time" + + "golang.org/x/oauth2" + + sw "./go-petstore" +) + +func TestOAuth2(t *testing.T) { + // Setup some fake oauth2 configuration + cfg := &oauth2.Config{ + ClientID: "1234567", + ClientSecret: "SuperSecret", + Endpoint: oauth2.Endpoint{ + AuthURL: "https://devnull", + TokenURL: "https://devnull", + }, + RedirectURL: "https://devnull", + } + + // and a fake token + tok := oauth2.Token{ + AccessToken: "FAKE", + RefreshToken: "So Fake", + Expiry: time.Now().Add(time.Hour * 100000), + TokenType: "Bearer", + } + + // then a fake tokenSource + tokenSource := cfg.TokenSource(createContext(nil), &tok) + auth := context.WithValue(context.Background(), sw.ContextOAuth2, tokenSource) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + + if !strings.Contains((string)(reqb), "Authorization: Bearer FAKE") { + t.Errorf("OAuth2 Authentication is missing") + } +} + +func TestBasicAuth(t *testing.T) { + + auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "fakeUser", + Password: "f4k3p455", + }) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(auth, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Basic ZmFrZVVzZXI6ZjRrM3A0NTU") { + t.Errorf("Basic Authentication is missing") + } +} + +func TestAccessToken(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAccessToken, "TESTFAKEACCESSTOKENISFAKE") + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(nil, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Authorization: Bearer TESTFAKEACCESSTOKENISFAKE") { + t.Errorf("AccessToken Authentication is missing") + } +} + +func TestAPIKeyNoPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123"}) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestAPIKeyWithPrefix(t *testing.T) { + auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{Key: "TEST123", Prefix: "Bearer"}) + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(nil, newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + _, r, err = client.PetApi.GetPetById(auth, 12992) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Api_key: Bearer TEST123") { + t.Errorf("APIKey Authentication is missing") + } + + r, err = client.PetApi.DeletePet(auth, 12992, nil) + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDefaultHeader(t *testing.T) { + + newPet := (sw.Pet{Id: 12992, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + + r, err = client.PetApi.DeletePet(context.Background(), 12992, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } + reqb, _ := httputil.DumpRequest(r.Request, true) + if !strings.Contains((string)(reqb), "Testheader: testvalue") { + t.Errorf("Default Header is missing") + } +} + +func TestHostOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Host != testHost { + t.Errorf("Request Host is %v, expected %v", r.Request.Host, testHost) + } +} + +func TestSchemeOverride(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while finding pets by status: %v", err) + } + + if r.Request.URL.Scheme != testScheme { + t.Errorf("Request Scheme is %v, expected %v", r.Request.URL.Scheme, testScheme) + } +} + +// Add custom clients to the context. +func createContext(httpClient *http.Client) context.Context { + parent := oauth2.NoContext + ctx := context.WithValue(parent, oauth2.HTTPClient, httpClient) + return ctx +} diff --git a/CI/samples.ci/client/petstore/go/fake_api_test.go b/CI/samples.ci/client/petstore/go/fake_api_test.go new file mode 100644 index 000000000000..f4242b5048c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/go/fake_api_test.go @@ -0,0 +1,28 @@ +package main + +import ( + "testing" + + sw "./go-petstore" + "golang.org/x/net/context" +) + +// TestPutBodyWithFileSchema ensures a model with the name 'File' +// gets converted properly to the petstore.File struct vs. *os.File +// as specified in typeMapping for 'File'. +func TestPutBodyWithFileSchema(t *testing.T) { + return // early return to test compilation + + schema := sw.FileSchemaTestClass{ + File: sw.File{SourceURI: "https://example.com/image.png"}, + Files: []sw.File{{SourceURI: "https://example.com/image.png"}}} + + r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/CI/samples.ci/client/petstore/go/git_push.sh b/CI/samples.ci/client/petstore/go/git_push.sh new file mode 100644 index 000000000000..1a36388db023 --- /dev/null +++ b/CI/samples.ci/client/petstore/go/git_push.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="YOUR_GIT_USR_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="YOUR_GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment." + git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/CI/samples.ci/client/petstore/go/pet_api_test.go b/CI/samples.ci/client/petstore/go/pet_api_test.go new file mode 100644 index 000000000000..969fab1f667a --- /dev/null +++ b/CI/samples.ci/client/petstore/go/pet_api_test.go @@ -0,0 +1,297 @@ +package main + +import ( + "context" + "fmt" + "os" + "testing" + + "github.com/antihax/optional" + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +var client *sw.APIClient + +const testHost = "petstore.swagger.io:80" +const testScheme = "http" + +func TestMain(m *testing.M) { + cfg := sw.NewConfiguration() + cfg.AddDefaultHeader("testheader", "testvalue") + cfg.Host = testHost + cfg.Scheme = testScheme + client = sw.NewAPIClient(cfg) + retCode := m.Run() + os.Exit(retCode) +} + +func TestAddPet(t *testing.T) { + newPet := (sw.Pet{Id: 12830, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending", Tags: []sw.Tag{sw.Tag{Id: 1, Name: "tag2"}}}) + + r, err := client.PetApi.AddPet(context.Background(), newPet) + + if err != nil { + t.Fatalf("Error while adding pet: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestFindPetsByStatusWithMissingParam(t *testing.T) { + _, r, err := client.PetApi.FindPetsByStatus(context.Background(), nil) + + if err != nil { + t.Fatalf("Error while testing TestFindPetsByStatusWithMissingParam: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestGetPetById(t *testing.T) { + isPetCorrect(t, 12830, "gopher", "pending") +} + +func TestGetPetByIdWithInvalidID(t *testing.T) { + resp, r, err := client.PetApi.GetPetById(context.Background(), 999999999) + if r != nil && r.StatusCode == 404 { + assertedError, ok := err.(sw.GenericOpenAPIError) + a := assert.New(t) + a.True(ok) + a.Contains(string(assertedError.Body()), "type") + + a.Contains(assertedError.Error(), "Not Found") + } else if err != nil { + t.Fatalf("Error while getting pet by invalid id: %v", err) + t.Log(r) + } else { + t.Log(resp) + } +} + +func TestUpdatePetWithForm(t *testing.T) { + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.UpdatePetWithFormOpts{ + Name: optional.NewString("golang"), + Status: optional.NewString("available"), + }) + if err != nil { + t.Fatalf("Error while updating pet by id: %v", err) + t.Log(r) + } + if r.StatusCode != 200 { + t.Log(r) + } + + // get the pet with id 12830 from server to verify the update + isPetCorrect(t, 12830, "golang", "available") +} + +func TestFindPetsByTag(t *testing.T) { + var found = false + resp, r, err := client.PetApi.FindPetsByTags(context.Background(), []string{"tag2"}) + if err != nil { + t.Fatalf("Error while getting pet by tag: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + if resp[i].Id == 12830 { + assert.Equal(resp[i].Status, "available", "Pet status should be `pending`") + found = true + } + } + } + + if found == false { + t.Errorf("Error while getting pet by tag could not find 12830") + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestFindPetsByStatus(t *testing.T) { + resp, r, err := client.PetApi.FindPetsByStatus(context.Background(), []string{"available"}) + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + t.Log(r) + } else { + if len(resp) == 0 { + t.Errorf("Error no pets returned") + } else { + assert := assert.New(t) + for i := 0; i < len(resp); i++ { + assert.Equal(resp[i].Status, "available", "Pet status should be `available`") + } + } + + if r.StatusCode != 200 { + t.Log(r) + } + } +} + +func TestUploadFile(t *testing.T) { + file, _ := os.Open("../python/testfiles/foo.png") + + _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ + AdditionalMetadata: optional.NewString("golang"), + File: optional.NewInterface(file), + }) + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestUploadFileRequired(t *testing.T) { + return // remove when server supports this endpoint + file, _ := os.Open("../python/testfiles/foo.png") + + _, r, err := client.PetApi.UploadFileWithRequiredFile(context.Background(), 12830, + file, + &sw.UploadFileWithRequiredFileOpts{ + AdditionalMetadata: optional.NewString("golang"), + }) + + if err != nil { + t.Fatalf("Error while uploading file: %v", err) + } + + if r.StatusCode != 200 { + t.Log(r) + } +} + +func TestDeletePet(t *testing.T) { + r, err := client.PetApi.DeletePet(context.Background(), 12830, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +/* +// Test we can concurrently create, retrieve, update, and delete. +func TestConcurrency(t *testing.T) { + errc := make(chan error) + + newPets := []sw.Pet{ + sw.Pet{Id: 912345, Name: "gopherFred", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912346, Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912347, Name: "gopherRick", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "mia"}, + sw.Pet{Id: 912348, Name: "gopherJohn", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + sw.Pet{Id: 912349, Name: "gopherAlf", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912350, Name: "gopherRob", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}, + sw.Pet{Id: 912351, Name: "gopherIan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}, + } + + // Add the pets. + for _, pet := range newPets { + go func(newPet sw.Pet) { + r, err := client.PetApi.AddPet(nil, newPet) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, pet.Name, pet.Status) + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Update all to active with the name gopherDan + for _, pet := range newPets { + go func(id int64) { + r, err := client.PetApi.UpdatePet(nil, sw.Pet{Id: (int64)(id), Name: "gopherDan", PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "active"}) + if r.StatusCode != 200 { + t.Log(r) + } + errc <- err + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) + + // Verify they are correct. + for _, pet := range newPets { + go func(pet sw.Pet) { + isPetCorrect(t, pet.Id, "gopherDan", "active") + errc <- nil + }(pet) + } + + waitOnFunctions(t, errc, len(newPets)) + + // Delete them all. + for _, pet := range newPets { + go func(id int64) { + deletePet(t, (int64)(id)) + errc <- nil + }(pet.Id) + } + waitOnFunctions(t, errc, len(newPets)) +} +*/ + +func waitOnFunctions(t *testing.T, errc chan error, n int) { + for i := 0; i < n; i++ { + err := <-errc + if err != nil { + t.Fatalf("Error performing concurrent test: %v", err) + } + } +} + +func deletePet(t *testing.T, id int64) { + r, err := client.PetApi.DeletePet(context.Background(), id, nil) + + if err != nil { + t.Fatalf("Error while deleting pet by id: %v", err) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + +func isPetCorrect(t *testing.T, id int64, name string, status string) { + assert := assert.New(t) + resp, r, err := client.PetApi.GetPetById(context.Background(), id) + if err != nil { + t.Fatalf("Error while getting pet by id: %v", err) + } else { + assert.Equal(resp.Id, int64(id), "Pet id should be equal") + assert.Equal(resp.Name, name, fmt.Sprintf("Pet name should be %s", name)) + assert.Equal(resp.Status, status, fmt.Sprintf("Pet status should be %s", status)) + + //t.Log(resp) + } + if r.StatusCode != 200 { + t.Log(r) + } +} + diff --git a/CI/samples.ci/client/petstore/go/pom.xml b/CI/samples.ci/client/petstore/go/pom.xml new file mode 100644 index 000000000000..7b3edeff64dc --- /dev/null +++ b/CI/samples.ci/client/petstore/go/pom.xml @@ -0,0 +1,103 @@ + + 4.0.0 + org.openapitools + GoPetstore + pom + 1.0.0 + Go Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + go-get-testify + pre-integration-test + + exec + + + go + + get + github.com/stretchr/testify/assert + + + + + go-get-oauth2 + pre-integration-test + + exec + + + go + + get + golang.org/x/oauth2 + + + + + go-get-context + pre-integration-test + + exec + + + go + + get + golang.org/x/net/context + + + + + go-get-optional + pre-integration-test + + exec + + + go + + get + github.com/antihax/optional + + + + + go-test + integration-test + + exec + + + go + + test + -v + + + + + + + + diff --git a/CI/samples.ci/client/petstore/go/store_api_test.go b/CI/samples.ci/client/petstore/go/store_api_test.go new file mode 100644 index 000000000000..3088adf7b40d --- /dev/null +++ b/CI/samples.ci/client/petstore/go/store_api_test.go @@ -0,0 +1,37 @@ +package main + +import ( + "context" + "regexp" + "testing" + "time" + + sw "./go-petstore" +) + +func TestPlaceOrder(t *testing.T) { + newOrder := sw.Order{ + Id: 0, + PetId: 0, + Quantity: 0, + ShipDate: time.Now().UTC(), + Status: "placed", + Complete: false} + + _, r, err := client.StoreApi.PlaceOrder(context.Background(), newOrder) + + if err != nil { + // Skip parsing time error due to error in Petstore Test Server + // https://github.com/OpenAPITools/openapi-generator/issues/1292 + if regexp. + MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`). + MatchString(err.Error()) { + t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime") + } else { + t.Fatalf("Error while placing order: %v", err) + } + } + if r.StatusCode != 200 { + t.Log(r) + } +} diff --git a/CI/samples.ci/client/petstore/go/test.go.bak b/CI/samples.ci/client/petstore/go/test.go.bak new file mode 100644 index 000000000000..54e14b9c7a04 --- /dev/null +++ b/CI/samples.ci/client/petstore/go/test.go.bak @@ -0,0 +1,30 @@ +package main + +import ( + sw "./go-petstore" + "encoding/json" + "fmt" +) + +func main() { + + s := sw.NewPetApi() + + // test POST(body) + newPet := (sw.Pet{Id: 12830, Name: "gopher", + PhotoUrls: []string{"http://1.com", "http://2.com"}, Status: "pending"}) + + jsonNewPet, _ := json.Marshal(newPet) + fmt.Println("newPet:", string(jsonNewPet)) + s.AddPet(newPet) + + // test POST(form) + s.UpdatePetWithForm(12830, "golang", "available") + + // test GET + resp, apiResponse, err := s.GetPetById(12830) + fmt.Println("GetPetById: ", resp, err, apiResponse) + + err2, apiResponse2 := s.DeletePet(12830, "") + fmt.Println("DeletePet: ", err2, apiResponse2) +} diff --git a/CI/samples.ci/client/petstore/go/user_api_test.go b/CI/samples.ci/client/petstore/go/user_api_test.go new file mode 100644 index 000000000000..012c608fab6b --- /dev/null +++ b/CI/samples.ci/client/petstore/go/user_api_test.go @@ -0,0 +1,153 @@ +package main + +import ( + "context" + "testing" + + "github.com/stretchr/testify/assert" + + sw "./go-petstore" +) + +func TestCreateUser(t *testing.T) { + newUser := sw.User{ + Id: 1000, + FirstName: "gopher", + LastName: "lang", + Username: "gopher", + Password: "lang", + Email: "lang@test.com", + Phone: "5101112222", + UserStatus: 1} + + apiResponse, err := client.UserApi.CreateUser(context.Background(), newUser) + + if err != nil { + t.Fatalf("Error while adding user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +//adding x to skip the test, currently it is failing +func TestCreateUsersWithArrayInput(t *testing.T) { + newUsers := []sw.User{ + sw.User{ + Id: int64(1001), + FirstName: "gopher1", + LastName: "lang1", + Username: "gopher1", + Password: "lang1", + Email: "lang1@test.com", + Phone: "5101112222", + UserStatus: int32(1), + }, + sw.User{ + Id: int64(1002), + FirstName: "gopher2", + LastName: "lang2", + Username: "gopher2", + Password: "lang2", + Email: "lang2@test.com", + Phone: "5101112222", + UserStatus: int32(1), + }, + } + + apiResponse, err := client.UserApi.CreateUsersWithArrayInput(context.Background(), newUsers) + if err != nil { + t.Fatalf("Error while adding users: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //tear down + _, err1 := client.UserApi.DeleteUser(context.Background(), "gopher1") + if err1 != nil { + t.Errorf("Error while deleting user") + t.Log(err1) + } + + _, err2 := client.UserApi.DeleteUser(context.Background(), "gopher2") + if err2 != nil { + t.Errorf("Error while deleting user") + t.Log(err2) + } +} + +func TestGetUserByName(t *testing.T) { + assert := assert.New(t) + + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(resp.Id, int64(1000), "User id should be equal") + assert.Equal(resp.Username, "gopher", "User name should be gopher") + assert.Equal(resp.LastName, "lang", "Last name should be lang") + //t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestGetUserByNameWithInvalidID(t *testing.T) { + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "999999999") + if apiResponse != nil && apiResponse.StatusCode == 404 { + return // This is a pass condition. API will return with a 404 error. + } else if err != nil { + t.Fatalf("Error while getting user by invalid id: %v", err) + t.Log(apiResponse) + } else { + t.Log(resp) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} + +func TestUpdateUser(t *testing.T) { + assert := assert.New(t) + + newUser := sw.User{ + Id: 1000, + FirstName: "gopher20", + LastName: "lang20", + Username: "gopher", + Password: "lang", + Email: "lang@test.com", + Phone: "5101112222", + UserStatus: 1} + + apiResponse, err := client.UserApi.UpdateUser(context.Background(), "gopher", newUser) + if err != nil { + t.Fatalf("Error while deleting user by id: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } + + //verify changings are correct + resp, apiResponse, err := client.UserApi.GetUserByName(context.Background(), "gopher") + if err != nil { + t.Fatalf("Error while getting user by id: %v", err) + } else { + assert.Equal(resp.Id, int64(1000), "User id should be equal") + assert.Equal(resp.FirstName, "gopher20", "User name should be gopher") + assert.Equal(resp.Password, "lang", "User name should be the same") + } +} + +func TestDeleteUser(t *testing.T) { + apiResponse, err := client.UserApi.DeleteUser(context.Background(), "gopher") + + if err != nil { + t.Fatalf("Error while deleting user: %v", err) + } + if apiResponse.StatusCode != 200 { + t.Log(apiResponse) + } +} diff --git a/CI/samples.ci/client/petstore/groovy/pom.xml b/CI/samples.ci/client/petstore/groovy/pom.xml new file mode 100644 index 000000000000..ff81e4c0e5fd --- /dev/null +++ b/CI/samples.ci/client/petstore/groovy/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + GroovyPetstoreClientTests + pom + 1.0-SNAPSHOT + Groovy Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/samples/client/petstore/groovy/src/test/groovy/openapitools/PetApiTest.groovy b/CI/samples.ci/client/petstore/groovy/test/groovy/openapitools/PetApiTest.groovy similarity index 100% rename from samples/client/petstore/groovy/src/test/groovy/openapitools/PetApiTest.groovy rename to CI/samples.ci/client/petstore/groovy/test/groovy/openapitools/PetApiTest.groovy diff --git a/CI/samples.ci/client/petstore/haskell-http-client/CONTRIBUTING.md b/CI/samples.ci/client/petstore/haskell-http-client/CONTRIBUTING.md new file mode 100644 index 000000000000..4d86a160843c --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/CONTRIBUTING.md @@ -0,0 +1,29 @@ +### Rebuild jar + +``` + (cd ../../../..; mvn package); +``` + +### Regenerate Template + +1. Run the shell script `haskell-http-client-petstore.sh` to update the Petstore sample + +```bash + (cd ../../../..; ./bin/haskell-http-client-petstore.sh); +``` + +### Typecheck, Build and run Unit tests + +2. Check that the following commands complete build without any errors + +```bash + (rm -Rf ./.stack-work ./example-app/.stack-work ./tests-integration/.stack-work); + (stack haddock && stack test); + (cd ./example-app; stack build); + (cd ./tests-integration; stack build --no-run-tests); +``` + +### Integration Tests + +3. run the integration tests as described in `./tests-integration/README.md` + diff --git a/CI/samples.ci/client/petstore/haskell-http-client/Makefile b/CI/samples.ci/client/petstore/haskell-http-client/Makefile new file mode 100644 index 000000000000..19812ed68a9f --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/Makefile @@ -0,0 +1,10 @@ +STACKCMD := stack --install-ghc +.PHONY: all clean build test test-integration build-example build-integration +all: clean build test build-example build-integration +clean: ; (rm -Rf ./.stack-work ./example-app/.stack-work ./tests-integration/.stack-work); +build: ; ($(STACKCMD) haddock --no-haddock-deps --fast); +test: ; ($(STACKCMD) test --fast); +build-example: build ; (cd ./example-app; $(STACKCMD) build --fast); +# a test-only project may exit with ExitFailure, despite building successfully +build-integration: build ; (cd ./tests-integration; $(STACKCMD) build --no-run-tests --fast); +test-integration: build-integration ; (cd ./tests-integration; $(STACKCMD) test --fast); diff --git a/CI/samples.ci/client/petstore/haskell-http-client/pom.xml b/CI/samples.ci/client/petstore/haskell-http-client/pom.xml new file mode 100644 index 000000000000..2e72fea324c8 --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/pom.xml @@ -0,0 +1,63 @@ + + 4.0.0 + org.openapitools + openapi-petstore-haskell-http-client + pom + 1.0-SNAPSHOT + OpenAPI Petstore - Haskell http-client Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + stack-haddock + pre-integration-test + + exec + + + stack + + --install-ghc + --no-haddock-deps + haddock + --fast + + + + + stack-test + integration-test + + exec + + + stack + + test + --fast + + + + + + + + diff --git a/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/README.md b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/README.md new file mode 100644 index 000000000000..6efc9268c321 --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/README.md @@ -0,0 +1,54 @@ +# openapi-petstore-tests-integration + +This contains integration tests for the haskell http-client openapi-petstore api client library. + +This module is not auto-generated. + +The integration tests require a openapi petstore server running at +`http://0.0.0.0/v2`, or the value of the `HOST` environment variable. + +The api client library bindings are expected to live in the parent folder + + +### Petstore Server + +The petstore server can be obtained at: + +https://github.com/wing328/swagger-samples/tree/docker/java/java-jersey-jaxrs + +Follow the instructions in the readme to install and run the petstore +server (the docker branch is used here, but docker is not required) + +### Usage + +1. Install the [Haskell `stack` tool](http://docs.haskellstack.org/en/stable/README). +2. Start the petstore server (described above) +3. To run the integration tests: +``` +stack --install-ghc test +``` +4. After stack installs ghc on the first run, `--install-ghc` can be omitted + +### Optional Environment Variables + +* `HOST` - the root url of the petstore server +* `http_proxy` - the address of the http proxy + +Example: + +``` +HOST=http://0.0.0.0/v2 http_proxy=http://0.0.0.0:8080 stack --install-ghc test +``` + + +### Running with Maven + +If using Maven, after ensuring the haskell `stack` tool is installed +(run `stack --version` to verify installation), an example command to +run the integration tests with maven in this directory is: + +``` +mvn -q verify -Pintegration-test +``` + +Adjust `pom.xml` as necessary to set environment variables. diff --git a/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal new file mode 100644 index 000000000000..d606f362919b --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/openapi-petstore-tests-integration.cabal @@ -0,0 +1,57 @@ +cabal-version: 1.12 + +-- This file has been generated from package.yaml by hpack version 0.31.2. +-- +-- see: https://github.com/sol/hpack +-- +-- hash: 1de2469e3014acffdfb079309edd15dc88ec7f5acce21f1062b61a1b002418fd + +name: openapi-petstore-tests-integration +version: 0.1.0.0 +synopsis: integration tests for auto-generated openapi-petstore API Client +description: integration tests for auto-generated openapi-petstore API Client +category: Web +homepage: https://openapi-generator.tech +author: Author Name Here +maintainer: author.name@email.com +copyright: YEAR - AUTHOR +license: UnspecifiedLicense +build-type: Simple +extra-source-files: + README.md + +test-suite tests + type: exitcode-stdio-1.0 + main-is: Test.hs + other-modules: + Paths_openapi_petstore_tests_integration + hs-source-dirs: + tests + ghc-options: -Wall -fno-warn-orphans + build-depends: + HUnit >1.5.0 + , QuickCheck + , aeson + , base >=4.7 && <5.0 + , bytestring >=0.10.0 && <0.11 + , case-insensitive + , containers + , exceptions >=0.4 + , hspec >=1.8 + , http-api-data >=0.3.4 && <0.5 + , http-client >=0.5 && <0.7 + , http-client-tls + , http-media >=0.4 && <0.9 + , http-types >=0.8 && <0.13 + , iso8601-time + , microlens >=0.4.3 && <0.5 + , mtl >=2.2.1 + , openapi-petstore + , safe-exceptions <0.2 + , semigroups + , text + , time + , transformers >=0.4.0.0 + , unordered-containers + , vector >=0.10.9 && <0.13 + default-language: Haskell2010 diff --git a/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/package.yaml b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/package.yaml new file mode 100644 index 000000000000..bd2962fb5894 --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/package.yaml @@ -0,0 +1,54 @@ +name: openapi-petstore-tests-integration +version: '0.1.0.0' +synopsis: integration tests for auto-generated openapi-petstore API Client +description: ! ' + integration tests for auto-generated openapi-petstore API Client +' +category: Web +author: Author Name Here +maintainer: author.name@email.com +copyright: YEAR - AUTHOR +license: UnspecifiedLicense +homepage: https://openapi-generator.tech +extra-source-files: +- README.md +ghc-options: -Wall +dependencies: +- base >=4.7 && <5.0 +- transformers >=0.4.0.0 +- mtl >=2.2.1 +- unordered-containers +- containers >=0.5.0.0 && <0.7 +- aeson >=1.0 && <2.0 +- bytestring >=0.10.0 && <0.11 +- http-types >=0.8 && <0.13 +- http-client >=0.5 && <0.7 +- http-client-tls +- http-api-data >= 0.3.4 && <0.5 +- http-media >= 0.4 && < 0.9 +- text >=0.11 && <1.3 +- time >=1.5 && <1.9 +- vector >=0.10.9 && <0.13 +- exceptions >= 0.4 +- case-insensitive +- safe-exceptions <0.2 +- microlens >= 0.4.3 && <0.5 +- openapi-petstore +tests: + tests: + main: Test.hs + source-dirs: tests + ghc-options: + - -fno-warn-orphans + dependencies: + - openapi-petstore + - bytestring >=0.10.0 && <0.11 + - containers + - hspec >=1.8 + - HUnit > 1.5.0 + - text + - time + - iso8601-time + - aeson + - semigroups + - QuickCheck diff --git a/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/pom.xml b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/pom.xml new file mode 100644 index 000000000000..dbe2f2f85b96 --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/pom.xml @@ -0,0 +1,49 @@ + + 4.0.0 + org.openapitools + openapi-petstore-haskell-http-client-tests-integration + pom + 1.0-SNAPSHOT + OpenAPI Petstore - Haskell http-client Client - Integration Tests + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + stack-test + integration-test + + exec + + + + http://0.0.0.0/v2 + + stack + + test + + + + + + + + diff --git a/samples/client/petstore/haskell-http-client/example-app/stack.yaml b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/stack.yaml similarity index 100% rename from samples/client/petstore/haskell-http-client/example-app/stack.yaml rename to CI/samples.ci/client/petstore/haskell-http-client/tests-integration/stack.yaml diff --git a/samples/client/petstore/haskell-http-client/example-app/stack.yaml.lock b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/stack.yaml.lock similarity index 100% rename from samples/client/petstore/haskell-http-client/example-app/stack.yaml.lock rename to CI/samples.ci/client/petstore/haskell-http-client/tests-integration/stack.yaml.lock diff --git a/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/tests/Test.hs b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/tests/Test.hs new file mode 100644 index 000000000000..3f6d4b6fef65 --- /dev/null +++ b/CI/samples.ci/client/petstore/haskell-http-client/tests-integration/tests/Test.hs @@ -0,0 +1,292 @@ +{-# LANGUAGE MultiParamTypeClasses #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE LambdaCase #-} +{-# OPTIONS_GHC -fno-warn-deprecations -fno-warn-unused-matches -fno-warn-unused-imports -fno-warn-unused-binds -fno-warn-orphans #-} + +import qualified Data.Aeson as A +import qualified Data.ByteString.Lazy.Char8 as BCL +import qualified Data.Text as T +import qualified Data.Time as TI +import qualified Lens.Micro as L +import qualified Network.HTTP.Client as NH +import qualified Network.HTTP.Types.Status as NH + +import Data.Typeable (Proxy(..)) +import Test.Hspec +import Test.Hspec.QuickCheck +import Test.HUnit +import Test.HUnit.Lang + +import Control.Monad.IO.Class +import Data.IORef +import qualified Data.Map.Strict as Map +import Data.Map.Strict (Map) +import System.Environment (getEnvironment) + +import qualified OpenAPIPetstore as S + +import Data.Monoid ((<>)) + +-- * UTILS + +assertSuccess :: Expectation +assertSuccess = Success `shouldBe` Success + +-- * MAIN + +main :: IO () +main = do + + env <- getEnvironment + + mgr <- NH.newManager NH.defaultManagerSettings + + config0 <- S.withStdoutLogging =<< S.newConfig + + let config = + -- configure host + case lookup "HOST" env of + Just h -> config0 { S.configHost = BCL.pack h } + _ -> config0 { S.configHost = "http://0.0.0.0/v2" } + -- each configured auth method is only applied to requests that specify them + `S.addAuthMethod` S.AuthBasicHttpBasicTest "username" "password" + `S.addAuthMethod` S.AuthApiKeyApiKey "secret-key" + `S.addAuthMethod` S.AuthApiKeyApiKeyQuery "secret-key" + `S.addAuthMethod` S.AuthOAuthPetstoreAuth "secret-key" + + putStrLn "\n******** CONFIG ********" + putStrLn (show config) + + + hspec $ do + testPetOps mgr config + testStoreOps mgr config + testUserOps mgr config + +-- * PET TESTS + +testPetOps :: NH.Manager -> S.OpenAPIPetstoreConfig -> Spec +testPetOps mgr config = + + describe "** pet operations" $ do + + _pet <- runIO $ newIORef (Nothing :: Maybe S.Pet) + + it "addPet" $ do + let addPetRequest = + S.addPet (S.ContentType S.MimeJSON) (S.mkPet "name" ["url1", "url2"]) + addPetResponse <- S.dispatchLbs mgr config addPetRequest + NH.responseStatus addPetResponse `shouldBe` NH.status200 + case A.eitherDecode (NH.responseBody addPetResponse) of + Right pet -> do + _pet `writeIORef` Just pet + assertSuccess + Left e -> assertFailure e + + around (\go -> + readIORef _pet >>= \case + Just pet@S.Pet {S.petId = Just petId} -> go (petId, pet) + _ -> pendingWith "no petId") $ + it "getPetById" $ \(petId, pet) -> do + let getPetByIdRequest = S.getPetById (S.Accept S.MimeJSON) (S.PetId petId) + getPetByIdRequestResult <- S.dispatchMime mgr config getPetByIdRequest + NH.responseStatus (S.mimeResultResponse getPetByIdRequestResult) `shouldBe` NH.status200 + case S.mimeResult getPetByIdRequestResult of + Right p -> p `shouldBe` pet + Left (S.MimeError e _) -> assertFailure e + + it "findPetsByStatus" $ do + let findPetsByStatusRequest = S.findPetsByStatus (S.Accept S.MimeJSON) + (S.Status [ S.E'Status2'Available + , S.E'Status2'Pending + , S.E'Status2'Sold]) + findPetsByStatusResult <- S.dispatchMime mgr config findPetsByStatusRequest + NH.responseStatus (S.mimeResultResponse findPetsByStatusResult) `shouldBe` NH.status200 + case S.mimeResult findPetsByStatusResult of + Right r -> length r `shouldSatisfy` (> 0) + Left (S.MimeError e _) -> assertFailure e + + it "findPetsByTags" $ do + let findPetsByTagsRequest = S.findPetsByTags (S.Accept S.MimeJSON) (S.Tags ["name","tag1"]) + findPetsByTagsResult <- S.dispatchMime mgr config findPetsByTagsRequest + NH.responseStatus (S.mimeResultResponse findPetsByTagsResult) `shouldBe` NH.status200 + case S.mimeResult findPetsByTagsResult of + Right r -> length r `shouldSatisfy` (> 0) + Left (S.MimeError e _) -> assertFailure e + + around (\go -> + readIORef _pet >>= \case + Just pet -> go pet + _ -> pendingWith "no pet") $ + it "updatePet" $ \pet -> do + let updatePetRequest = S.updatePet (S.ContentType S.MimeJSON) + (pet + { S.petStatus = Just S.E'Status2'Available + , S.petCategory = Just (S.Category (Just 3) "catname") + }) + updatePetResponse <- S.dispatchLbs mgr config updatePetRequest + NH.responseStatus updatePetResponse `shouldBe` NH.status200 + + it "updatePetWithFormRequest" $ do + readIORef _pet >>= \case + Just S.Pet {S.petId = Just petId} -> do + let updatePetWithFormRequest = S.updatePetWithForm + (S.PetId petId) + `S.applyOptionalParam` S.Name2 "petName" + `S.applyOptionalParam` S.StatusText "pending" + updatePetWithFormResponse <- S.dispatchLbs mgr config updatePetWithFormRequest + NH.responseStatus updatePetWithFormResponse `shouldBe` NH.status200 + _ -> pendingWith "no pet" + + around (\go -> + readIORef _pet >>= \case + Just pet@S.Pet {S.petId = Just petId} -> go petId + _ -> pendingWith "no petId") $ + it "uploadFile" $ \petId -> do + let uploadFileRequest = S.uploadFile (S.PetId petId) + `S.applyOptionalParam` S.File2 "package.yaml" + `S.applyOptionalParam` S.AdditionalMetadata "a package.yaml file" + uploadFileRequestResult <- S.dispatchMime mgr config uploadFileRequest + NH.responseStatus (S.mimeResultResponse uploadFileRequestResult) `shouldBe` NH.status200 + case S.mimeResult uploadFileRequestResult of + Right _ -> assertSuccess + Left (S.MimeError e _) -> assertFailure e + + around (\go -> + readIORef _pet >>= \case + Just pet@S.Pet {S.petId = Just petId} -> go petId + _ -> pendingWith "no petId") $ + it "deletePet" $ \petId -> do + let deletePetRequest = S.deletePet (S.PetId petId) + `S.applyOptionalParam` S.ApiKey "api key" + deletePetResponse <- S.dispatchLbs mgr config deletePetRequest + NH.responseStatus deletePetResponse `shouldBe` NH.status200 + +-- * STORE TESTS + +testStoreOps :: NH.Manager -> S.OpenAPIPetstoreConfig -> Spec +testStoreOps mgr config = do + + describe "** store operations" $ do + + _order <- runIO $ newIORef (Nothing :: Maybe S.Order) + + it "getInventory" $ do + let getInventoryRequest = S.getInventory + `S.setHeader` [("api_key","special-key")] + getInventoryRequestRequestResult <- S.dispatchMime mgr config getInventoryRequest + NH.responseStatus (S.mimeResultResponse getInventoryRequestRequestResult) `shouldBe` NH.status200 + case S.mimeResult getInventoryRequestRequestResult of + Right r -> length r `shouldSatisfy` (> 0) + Left (S.MimeError e _) -> assertFailure e + + it "placeOrder" $ do + now <- TI.getCurrentTime + let placeOrderRequest = S.placeOrder (S.ContentType S.MimeJSON) (S.Accept S.MimeJSON) + (S.mkOrder + { S.orderId = Just 21 + , S.orderQuantity = Just 210 + , S.orderShipDate = Just (S.DateTime now) + }) + placeOrderResult <- S.dispatchMime mgr config placeOrderRequest + NH.responseStatus (S.mimeResultResponse placeOrderResult) `shouldBe` NH.status200 + case S.mimeResult placeOrderResult of + Right order -> do + _order `writeIORef` Just order + assertSuccess + Left (S.MimeError e _) -> assertFailure e + + around (\go -> + readIORef _order >>= \case + Just order@S.Order {S.orderId = Just orderId} -> go (orderId, order) + _ -> pendingWith "no orderId") $ + it "getOrderById" $ \(orderId, order) -> do + let getOrderByIdRequest = S.getOrderById (S.Accept S.MimeJSON) (S.OrderId orderId) + getOrderByIdRequestResult <- S.dispatchMime mgr config getOrderByIdRequest + NH.responseStatus (S.mimeResultResponse getOrderByIdRequestResult) `shouldBe` NH.status200 + case S.mimeResult getOrderByIdRequestResult of + Right o -> o `shouldBe` order + Left (S.MimeError e _) -> assertFailure e + + around (\go -> + readIORef _order >>= \case + Just S.Order {S.orderId = Just orderId} -> go (T.pack (show orderId)) + _ -> pendingWith "no orderId") $ + it "deleteOrder" $ \orderId -> do + let deleteOrderRequest = S.deleteOrder (S.OrderIdText orderId) + deleteOrderResult <- S.dispatchLbs mgr config deleteOrderRequest + NH.responseStatus deleteOrderResult `shouldBe` NH.status200 + + +-- * USER TESTS + +testUserOps :: NH.Manager -> S.OpenAPIPetstoreConfig -> Spec +testUserOps mgr config = do + + describe "** user operations" $ do + + let _username = "hsusername" + _password = "password1" + _user = + S.mkUser + { S.userId = Just 21 + , S.userUsername = Just _username + , S.userEmail = Just "xyz@example.com" + , S.userUserStatus = Just 0 + } + _users = + take 8 $ + drop 1 $ + iterate + (L.over (S.userUsernameL . L._Just) (<> "*") . + L.over (S.userIdL . L._Just) (+ 1)) + _user + + before (pure _user) $ + it "createUser" $ \user -> do + let createUserRequest = S.createUser (S.ContentType S.MimeJSON) user + createUserResult <- S.dispatchLbs mgr config createUserRequest + NH.responseStatus createUserResult `shouldBe` NH.status200 + + before (pure _users) $ + it "createUsersWithArrayInput" $ \users -> do + let createUsersWithArrayInputRequest = S.createUsersWithArrayInput (S.ContentType S.MimeJSON) (S.Body users) + createUsersWithArrayInputResult <- S.dispatchLbs mgr config createUsersWithArrayInputRequest + NH.responseStatus createUsersWithArrayInputResult `shouldBe` NH.status200 + + before (pure _users) $ + it "createUsersWithListInput" $ \users -> do + let createUsersWithListInputRequest = S.createUsersWithListInput (S.ContentType S.MimeJSON) (S.Body users) + createUsersWithListInputResult <- S.dispatchLbs mgr config createUsersWithListInputRequest + NH.responseStatus createUsersWithListInputResult `shouldBe` NH.status200 + + before (pure (_username, _user)) $ + it "getUserByName" $ \(username, user) -> do + let getUserByNameRequest = S.getUserByName (S.Accept S.MimeJSON) (S.Username username) + getUserByNameResult <- S.dispatchMime mgr config getUserByNameRequest + NH.responseStatus (S.mimeResultResponse getUserByNameResult) `shouldBe` NH.status200 + case S.mimeResult getUserByNameResult of + Right u -> u `shouldBe` user + Left (S.MimeError e _) -> assertFailure e + + before (pure (_username, _password)) $ + it "loginUser" $ \(username, password) -> do + let loginUserRequest = S.loginUser (S.Accept S.MimeJSON) (S.Username username) (S.Password password) + loginUserResult <- S.dispatchLbs mgr config loginUserRequest + NH.responseStatus loginUserResult `shouldBe` NH.status200 + + before (pure (_username, _user)) $ + it "updateUser" $ \(username, user) -> do + let updateUserRequest = S.updateUser (S.ContentType S.MimeJSON) user (S.Username username) + updateUserResult <- S.dispatchLbs mgr config updateUserRequest + NH.responseStatus updateUserResult `shouldBe` NH.status200 + + it "logoutuser" $ do + logoutUserResult <- S.dispatchLbs mgr config S.logoutUser + NH.responseStatus logoutUserResult `shouldBe` NH.status200 + + before (pure _username) $ + it "deleteUser" $ \username -> do + let deleteUserRequest = S.deleteUser (S.Username username) + deleteUserResult <- S.dispatchLbs mgr config deleteUserRequest + NH.responseStatus deleteUserResult `shouldBe` NH.status200 diff --git a/CI/samples.ci/client/petstore/javascript-es6/package-lock.json b/CI/samples.ci/client/petstore/javascript-es6/package-lock.json new file mode 100644 index 000000000000..4b9d17d02486 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-es6/package-lock.json @@ -0,0 +1,3511 @@ +{ + "name": "open_api_petstore", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "ansi-styles": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", + "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" + }, + "anymatch": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", + "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "optional": true, + "requires": { + "micromatch": "^2.1.5", + "normalize-path": "^2.0.0" + } + }, + "arr-diff": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", + "integrity": "sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=", + "optional": true, + "requires": { + "arr-flatten": "^1.0.1" + } + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-unique": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", + "integrity": "sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=", + "optional": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, + "babel": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel/-/babel-6.23.0.tgz", + "integrity": "sha1-0NHn2APpdHZb7qMjLU4VPA77kPQ=" + }, + "babel-cli": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-cli/-/babel-cli-6.26.0.tgz", + "integrity": "sha1-UCq1SHTX24itALiHoGODzgPQAvE=", + "requires": { + "babel-core": "^6.26.0", + "babel-polyfill": "^6.26.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "chokidar": "^1.6.1", + "commander": "^2.11.0", + "convert-source-map": "^1.5.0", + "fs-readdir-recursive": "^1.0.0", + "glob": "^7.1.2", + "lodash": "^4.17.4", + "output-file-sync": "^1.1.2", + "path-is-absolute": "^1.0.1", + "slash": "^1.0.0", + "source-map": "^0.5.6", + "v8flags": "^2.1.1" + }, + "dependencies": { + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + } + } + }, + "babel-code-frame": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", + "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", + "requires": { + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" + } + }, + "babel-core": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.0.tgz", + "integrity": "sha1-rzL3izGm/O8RnIew/Y2XU/A6C7g=", + "dev": true, + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.0", + "debug": "^2.6.8", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.7", + "slash": "^1.0.0", + "source-map": "^0.5.6" + } + }, + "babel-generator": { + "version": "6.26.1", + "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", + "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "requires": { + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "detect-indent": "^4.0.0", + "jsesc": "^1.3.0", + "lodash": "^4.17.4", + "source-map": "^0.5.7", + "trim-right": "^1.0.1" + } + }, + "babel-helper-bindify-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz", + "integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-builder-binary-assignment-operator-visitor": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", + "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", + "dev": true, + "requires": { + "babel-helper-explode-assignable-expression": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-call-delegate": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", + "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-define-map": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", + "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-explode-assignable-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", + "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-explode-class": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz", + "integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=", + "dev": true, + "requires": { + "babel-helper-bindify-decorators": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", + "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", + "dev": true, + "requires": { + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-get-function-arity": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", + "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-hoist-variables": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", + "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-optimise-call-expression": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", + "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-helper-regex": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", + "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-helper-remap-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", + "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helper-replace-supers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", + "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", + "dev": true, + "requires": { + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-helpers": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", + "integrity": "sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=", + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-messages": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", + "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-check-es2015-constants": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", + "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-syntax-async-functions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", + "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=", + "dev": true + }, + "babel-plugin-syntax-async-generators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz", + "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", + "dev": true + }, + "babel-plugin-syntax-class-constructor-call": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-constructor-call/-/babel-plugin-syntax-class-constructor-call-6.18.0.tgz", + "integrity": "sha1-nLnTn+Q8hgC+yBRkVt3L1OGnZBY=", + "dev": true + }, + "babel-plugin-syntax-class-properties": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", + "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", + "dev": true + }, + "babel-plugin-syntax-decorators": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz", + "integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=", + "dev": true + }, + "babel-plugin-syntax-do-expressions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-do-expressions/-/babel-plugin-syntax-do-expressions-6.13.0.tgz", + "integrity": "sha1-V0d1YTmqJtOQ0JQQsDdEugfkeW0=", + "dev": true + }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=", + "dev": true + }, + "babel-plugin-syntax-exponentiation-operator": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", + "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=", + "dev": true + }, + "babel-plugin-syntax-export-extensions": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-export-extensions/-/babel-plugin-syntax-export-extensions-6.13.0.tgz", + "integrity": "sha1-cKFITw+QiaToStRLrDU8lbmxJyE=", + "dev": true + }, + "babel-plugin-syntax-function-bind": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-function-bind/-/babel-plugin-syntax-function-bind-6.13.0.tgz", + "integrity": "sha1-SMSV8Xe98xqYHnMvVa3AvdJgH0Y=", + "dev": true + }, + "babel-plugin-syntax-object-rest-spread": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", + "dev": true + }, + "babel-plugin-syntax-trailing-function-commas": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", + "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=", + "dev": true + }, + "babel-plugin-transform-async-generator-functions": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz", + "integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-generators": "^6.5.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-async-to-generator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", + "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", + "dev": true, + "requires": { + "babel-helper-remap-async-to-generator": "^6.24.1", + "babel-plugin-syntax-async-functions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-class-constructor-call": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-constructor-call/-/babel-plugin-transform-class-constructor-call-6.24.1.tgz", + "integrity": "sha1-gNwoVQWsBn3LjWxl4vbxGrd2Xvk=", + "dev": true, + "requires": { + "babel-plugin-syntax-class-constructor-call": "^6.18.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-class-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", + "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-plugin-syntax-class-properties": "^6.8.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-decorators": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz", + "integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=", + "dev": true, + "requires": { + "babel-helper-explode-class": "^6.24.1", + "babel-plugin-syntax-decorators": "^6.13.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-do-expressions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-do-expressions/-/babel-plugin-transform-do-expressions-6.22.0.tgz", + "integrity": "sha1-KMyvkoEtlJws0SgfaQyP3EaK6bs=", + "dev": true, + "requires": { + "babel-plugin-syntax-do-expressions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-arrow-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", + "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoped-functions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", + "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-block-scoping": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", + "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", + "dev": true, + "requires": { + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "lodash": "^4.17.4" + } + }, + "babel-plugin-transform-es2015-classes": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", + "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", + "dev": true, + "requires": { + "babel-helper-define-map": "^6.24.1", + "babel-helper-function-name": "^6.24.1", + "babel-helper-optimise-call-expression": "^6.24.1", + "babel-helper-replace-supers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-computed-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", + "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-destructuring": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", + "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-duplicate-keys": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", + "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-for-of": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", + "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-function-name": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", + "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", + "dev": true, + "requires": { + "babel-helper-function-name": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", + "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-modules-amd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", + "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-commonjs": { + "version": "6.26.2", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", + "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", + "dev": true, + "requires": { + "babel-plugin-transform-strict-mode": "^6.24.1", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-types": "^6.26.0" + } + }, + "babel-plugin-transform-es2015-modules-systemjs": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", + "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", + "dev": true, + "requires": { + "babel-helper-hoist-variables": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-modules-umd": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", + "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", + "dev": true, + "requires": { + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-object-super": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", + "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", + "dev": true, + "requires": { + "babel-helper-replace-supers": "^6.24.1", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-parameters": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", + "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", + "dev": true, + "requires": { + "babel-helper-call-delegate": "^6.24.1", + "babel-helper-get-function-arity": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-template": "^6.24.1", + "babel-traverse": "^6.24.1", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-shorthand-properties": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", + "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-spread": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", + "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-sticky-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", + "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-plugin-transform-es2015-template-literals": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", + "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-typeof-symbol": { + "version": "6.23.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", + "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-es2015-unicode-regex": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", + "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", + "dev": true, + "requires": { + "babel-helper-regex": "^6.24.1", + "babel-runtime": "^6.22.0", + "regexpu-core": "^2.0.0" + } + }, + "babel-plugin-transform-exponentiation-operator": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", + "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", + "dev": true, + "requires": { + "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", + "babel-plugin-syntax-exponentiation-operator": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-export-extensions": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-export-extensions/-/babel-plugin-transform-export-extensions-6.22.0.tgz", + "integrity": "sha1-U3OLR+deghhYnuqUbLvTkQm75lM=", + "dev": true, + "requires": { + "babel-plugin-syntax-export-extensions": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-function-bind": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-function-bind/-/babel-plugin-transform-function-bind-6.22.0.tgz", + "integrity": "sha1-xvuOlqwpajELjPjqQBRiQH3fapc=", + "dev": true, + "requires": { + "babel-plugin-syntax-function-bind": "^6.8.0", + "babel-runtime": "^6.22.0" + } + }, + "babel-plugin-transform-object-rest-spread": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz", + "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", + "dev": true, + "requires": { + "babel-plugin-syntax-object-rest-spread": "^6.8.0", + "babel-runtime": "^6.26.0" + } + }, + "babel-plugin-transform-regenerator": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", + "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", + "dev": true, + "requires": { + "regenerator-transform": "^0.10.0" + } + }, + "babel-plugin-transform-strict-mode": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", + "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", + "dev": true, + "requires": { + "babel-runtime": "^6.22.0", + "babel-types": "^6.24.1" + } + }, + "babel-polyfill": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", + "integrity": "sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=", + "requires": { + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "regenerator-runtime": "^0.10.5" + }, + "dependencies": { + "regenerator-runtime": { + "version": "0.10.5", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz", + "integrity": "sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=" + } + } + }, + "babel-preset-env": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", + "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", + "dev": true, + "requires": { + "babel-plugin-check-es2015-constants": "^6.22.0", + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-to-generator": "^6.22.0", + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", + "babel-plugin-transform-es2015-block-scoping": "^6.23.0", + "babel-plugin-transform-es2015-classes": "^6.23.0", + "babel-plugin-transform-es2015-computed-properties": "^6.22.0", + "babel-plugin-transform-es2015-destructuring": "^6.23.0", + "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", + "babel-plugin-transform-es2015-for-of": "^6.23.0", + "babel-plugin-transform-es2015-function-name": "^6.22.0", + "babel-plugin-transform-es2015-literals": "^6.22.0", + "babel-plugin-transform-es2015-modules-amd": "^6.22.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", + "babel-plugin-transform-es2015-modules-umd": "^6.23.0", + "babel-plugin-transform-es2015-object-super": "^6.22.0", + "babel-plugin-transform-es2015-parameters": "^6.23.0", + "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", + "babel-plugin-transform-es2015-spread": "^6.22.0", + "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", + "babel-plugin-transform-es2015-template-literals": "^6.22.0", + "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", + "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", + "babel-plugin-transform-exponentiation-operator": "^6.22.0", + "babel-plugin-transform-regenerator": "^6.22.0", + "browserslist": "^3.2.6", + "invariant": "^2.2.2", + "semver": "^5.3.0" + } + }, + "babel-preset-stage-0": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-0/-/babel-preset-stage-0-6.24.1.tgz", + "integrity": "sha1-VkLRUEL5E4TX5a+LyIsduVsDnmo=", + "dev": true, + "requires": { + "babel-plugin-transform-do-expressions": "^6.22.0", + "babel-plugin-transform-function-bind": "^6.22.0", + "babel-preset-stage-1": "^6.24.1" + } + }, + "babel-preset-stage-1": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-1/-/babel-preset-stage-1-6.24.1.tgz", + "integrity": "sha1-dpLNfc1oSZB+auSgqFWJz7niv7A=", + "dev": true, + "requires": { + "babel-plugin-transform-class-constructor-call": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-preset-stage-2": "^6.24.1" + } + }, + "babel-preset-stage-2": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz", + "integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=", + "dev": true, + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-decorators": "^6.24.1", + "babel-preset-stage-3": "^6.24.1" + } + }, + "babel-preset-stage-3": { + "version": "6.24.1", + "resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz", + "integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=", + "dev": true, + "requires": { + "babel-plugin-syntax-trailing-function-commas": "^6.22.0", + "babel-plugin-transform-async-generator-functions": "^6.24.1", + "babel-plugin-transform-async-to-generator": "^6.24.1", + "babel-plugin-transform-exponentiation-operator": "^6.24.1", + "babel-plugin-transform-object-rest-spread": "^6.22.0" + } + }, + "babel-register": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", + "integrity": "sha1-btAhFz4vy0htestFxgCahW9kcHE=", + "requires": { + "babel-core": "^6.26.0", + "babel-runtime": "^6.26.0", + "core-js": "^2.5.0", + "home-or-tmp": "^2.0.0", + "lodash": "^4.17.4", + "mkdirp": "^0.5.1", + "source-map-support": "^0.4.15" + }, + "dependencies": { + "babel-core": { + "version": "6.26.3", + "resolved": "https://registry.npmjs.org/babel-core/-/babel-core-6.26.3.tgz", + "integrity": "sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-generator": "^6.26.0", + "babel-helpers": "^6.24.1", + "babel-messages": "^6.23.0", + "babel-register": "^6.26.0", + "babel-runtime": "^6.26.0", + "babel-template": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "convert-source-map": "^1.5.1", + "debug": "^2.6.9", + "json5": "^0.5.1", + "lodash": "^4.17.4", + "minimatch": "^3.0.4", + "path-is-absolute": "^1.0.1", + "private": "^0.1.8", + "slash": "^1.0.0", + "source-map": "^0.5.7" + } + } + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "requires": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "babel-template": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", + "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", + "requires": { + "babel-runtime": "^6.26.0", + "babel-traverse": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "lodash": "^4.17.4" + } + }, + "babel-traverse": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", + "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", + "requires": { + "babel-code-frame": "^6.26.0", + "babel-messages": "^6.23.0", + "babel-runtime": "^6.26.0", + "babel-types": "^6.26.0", + "babylon": "^6.18.0", + "debug": "^2.6.8", + "globals": "^9.18.0", + "invariant": "^2.2.2", + "lodash": "^4.17.4" + } + }, + "babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", + "requires": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "binary-extensions": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.12.0.tgz", + "integrity": "sha512-DYWGk01lDcxeS/K9IHPGWfT8PsJmbXRtRd2Sx72Tnb8pcYZQFF1oSDb8hJtS1vhp212q1Rzi5dUf9+nq0o9UIg==", + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/braces/-/braces-1.8.5.tgz", + "integrity": "sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=", + "optional": true, + "requires": { + "expand-range": "^1.8.1", + "preserve": "^0.2.0", + "repeat-element": "^1.1.2" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "caniuse-lite": { + "version": "1.0.30000930", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000930.tgz", + "integrity": "sha512-KD+pw9DderBLB8CGqBzYyFWpnrPVOEjsjargU/CvkNyg60od3cxSPTcTeMPhxJhDbkQPWvOz5BAyBzNl/St9vg==", + "dev": true + }, + "chalk": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", + "requires": { + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" + } + }, + "chokidar": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", + "integrity": "sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=", + "optional": true, + "requires": { + "anymatch": "^1.3.0", + "async-each": "^1.0.0", + "fsevents": "^1.0.0", + "glob-parent": "^2.0.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^2.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "combined-stream": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", + "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", + "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-js": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz", + "integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "detect-indent": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", + "integrity": "sha1-920GQ1LN9Docts5hnE7jqUdd4gg=", + "requires": { + "repeating": "^2.0.0" + } + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "electron-to-chromium": { + "version": "1.3.106", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.106.tgz", + "integrity": "sha512-eXX45p4q9CRxG0G8D3ZBZYSdN3DnrcZfrFvt6VUr1u7aKITEtRY/xwWzJ/UZcWXa7DMqPu/pYwuZ6Nm+bl0GmA==", + "dev": true + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "optional": true, + "requires": { + "is-posix-bracket": "^0.1.0" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "optional": true, + "requires": { + "fill-range": "^2.1.0" + } + }, + "expect.js": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/expect.js/-/expect.js-0.3.1.tgz", + "integrity": "sha1-sKWaDS7/VDdUTr8M6qYBWEHQm1s=", + "dev": true + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "optional": true, + "requires": { + "is-extglob": "^1.0.0" + } + }, + "filename-regex": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", + "integrity": "sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=", + "optional": true + }, + "fill-range": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", + "optional": true, + "requires": { + "is-number": "^2.1.0", + "isobject": "^2.0.0", + "randomatic": "^3.0.0", + "repeat-element": "^1.1.2", + "repeat-string": "^1.5.2" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "for-own": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-0.1.5.tgz", + "integrity": "sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=", + "optional": true, + "requires": { + "for-in": "^1.0.1" + } + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "formatio": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/formatio/-/formatio-1.1.1.tgz", + "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", + "dev": true, + "requires": { + "samsam": "~1.1" + } + }, + "formidable": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", + "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", + "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.2.4", + "bundled": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.3", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.5", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.2.0", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.6.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true + } + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-base": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/glob-base/-/glob-base-0.3.0.tgz", + "integrity": "sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=", + "optional": true, + "requires": { + "glob-parent": "^2.0.0", + "is-glob": "^2.0.0" + } + }, + "glob-parent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-2.0.0.tgz", + "integrity": "sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=", + "requires": { + "is-glob": "^2.0.0" + } + }, + "globals": { + "version": "9.18.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", + "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has-ansi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "home-or-tmp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", + "integrity": "sha1-42w/LSyufXRqhX440Y1fMqeILbg=", + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "is-dotfile": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", + "integrity": "sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=", + "optional": true + }, + "is-equal-shallow": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz", + "integrity": "sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=", + "optional": true, + "requires": { + "is-primitive": "^2.0.0" + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-1.0.0.tgz", + "integrity": "sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=" + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "is-glob": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", + "integrity": "sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=", + "requires": { + "is-extglob": "^1.0.0" + } + }, + "is-number": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", + "integrity": "sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=", + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "is-posix-bracket": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", + "integrity": "sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=", + "optional": true + }, + "is-primitive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-primitive/-/is-primitive-2.0.0.tgz", + "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", + "optional": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "optional": true, + "requires": { + "isarray": "1.0.0" + } + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "jsesc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "lolex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz", + "integrity": "sha1-fD2mL/yzDw9agKJWbKJORdigHzE=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "optional": true + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "micromatch": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", + "integrity": "sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=", + "optional": true, + "requires": { + "arr-diff": "^2.0.0", + "array-unique": "^0.2.1", + "braces": "^1.8.2", + "expand-brackets": "^0.1.4", + "extglob": "^0.3.1", + "filename-regex": "^2.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.1", + "kind-of": "^3.0.2", + "normalize-path": "^2.0.1", + "object.omit": "^2.0.0", + "parse-glob": "^3.0.4", + "regex-cache": "^0.4.2" + } + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.37.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.37.0.tgz", + "integrity": "sha512-R3C4db6bgQhlIhPU48fUtdVmKnflq+hRdad7IyKhtFj06VPNVdk2RhiYL3UjQIlso8L+YxAtFkobT0VK+S/ybg==" + }, + "mime-types": { + "version": "2.1.21", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.21.tgz", + "integrity": "sha512-3iL6DbwpyLzjR3xHSFNFeb9Nz/M8WDkX33t1GFQnFOllWk8pOrh/LSrB5OXlnlW5P9LH73X6loW/eogc+F5lJg==", + "requires": { + "mime-db": "~1.37.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "commander": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "nan": { + "version": "2.12.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", + "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "optional": true + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "object.omit": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", + "integrity": "sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=", + "optional": true, + "requires": { + "for-own": "^0.1.4", + "is-extendable": "^0.1.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + }, + "dependencies": { + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "output-file-sync": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-1.1.2.tgz", + "integrity": "sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=", + "requires": { + "graceful-fs": "^4.1.4", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.0" + } + }, + "parse-glob": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", + "integrity": "sha1-ssN2z7EfNVE7rdFz7wu246OIORw=", + "optional": true, + "requires": { + "glob-base": "^0.3.0", + "is-dotfile": "^1.0.0", + "is-extglob": "^1.0.0", + "is-glob": "^2.0.0" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "optional": true + }, + "preserve": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", + "integrity": "sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=", + "optional": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "qs": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.6.0.tgz", + "integrity": "sha512-KIJqT9jQJDQx5h5uAVPimw6yVg2SekOKu959OCtktD3FjzbpvaPr8i4zzg07DOMz+igA4W/aNM7OV8H37pFYfA==" + }, + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", + "optional": true, + "requires": { + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + }, + "dependencies": { + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "optional": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + } + }, + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "optional": true + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "optional": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "regenerator-transform": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", + "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "dev": true, + "requires": { + "babel-runtime": "^6.18.0", + "babel-types": "^6.19.0", + "private": "^0.1.6" + } + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "optional": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", + "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", + "dev": true, + "requires": { + "regenerate": "^1.2.1", + "regjsgen": "^0.2.0", + "regjsparser": "^0.1.4" + } + }, + "regjsgen": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=", + "dev": true + }, + "regjsparser": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "requires": { + "is-finite": "^1.0.0" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, + "samsam": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.1.2.tgz", + "integrity": "sha1-vsEf3IOp/aBjQBIQ5AF2wwJNFWc=", + "dev": true + }, + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "sinon": { + "version": "1.17.3", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-1.17.3.tgz", + "integrity": "sha1-RNZLx0jQI4gARsFUPO/Oo0xH0X4=", + "dev": true, + "requires": { + "formatio": "1.1.1", + "lolex": "1.3.2", + "samsam": "1.1.2", + "util": ">=0.10.3 <1" + } + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "optional": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "optional": true + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "optional": true, + "requires": { + "kind-of": "^3.2.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.4.18", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz", + "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==", + "requires": { + "source-map": "^0.5.6" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "superagent": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.7.0.tgz", + "integrity": "sha512-/8trxO6NbLx4YXb7IeeFTSmsQ35pQBiTBsLNvobZx7qBzBeHYvKCyIIhW2gNcWbLzYxPAjdgFbiepd8ypwC0Gw==", + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.1.1", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.0.5" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "supports-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" + }, + "to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "optional": true, + "requires": { + "kind-of": "^3.0.2" + } + } + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + } + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + }, + "user-home": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", + "integrity": "sha1-K1viOjK2Onyd640PKNSFcko98ZA=" + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "v8flags": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-2.1.1.tgz", + "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", + "requires": { + "user-home": "^1.1.1" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/CI/samples.ci/client/petstore/javascript-es6/pom.xml b/CI/samples.ci/client/petstore/javascript-es6/pom.xml new file mode 100644 index 000000000000..66f75f962f93 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-es6/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-es6 + pom + 1.0-SNAPSHOT + OpenAPI Petstore JS Client (ES6) + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/javascript-es6/test/ApiClientTest.js b/CI/samples.ci/client/petstore/javascript-es6/test/ApiClientTest.js new file mode 100644 index 000000000000..5e98b685a911 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-es6/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/CI/samples.ci/client/petstore/javascript-flowtyped/package-lock.json b/CI/samples.ci/client/petstore/javascript-flowtyped/package-lock.json new file mode 100644 index 000000000000..7e6301347574 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-flowtyped/package-lock.json @@ -0,0 +1,4477 @@ +{ + "name": "open_api_petstore", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/cli": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.5.0.tgz", + "integrity": "sha512-qNH55fWbKrEsCwID+Qc/3JDPnsSGpIIiMDbppnR8Z6PxLAqMQCFNqBctkIkBrMH49Nx+qqVTrHRWUR+ho2k+qQ==", + "dev": true, + "requires": { + "chokidar": "^2.0.4", + "commander": "^2.8.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "lodash": "^4.17.11", + "mkdirp": "^0.5.1", + "output-file-sync": "^2.0.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + } + }, + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/core": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.5.0.tgz", + "integrity": "sha512-6Isr4X98pwXqHvtigw71CKgmhL1etZjPs5A67jL/w0TkLM9eqmFR40YrnJvEc1WnMZFsskjsmid8bHZyxKEAnw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.5.0", + "@babel/helpers": "^7.5.0", + "@babel/parser": "^7.5.0", + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.5.0", + "@babel/types": "^7.5.0", + "convert-source-map": "^1.1.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.11", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.0.tgz", + "integrity": "sha512-1TTVrt7J9rcG5PMjvO7VEG3FrEoEJNHxumRq66GemPmzboLWtIjjcJgk8rokuAS7IiRSpgVSu5Vb9lc99iJkOA==", + "dev": true, + "requires": { + "@babel/types": "^7.5.0", + "jsesc": "^2.5.1", + "lodash": "^4.17.11", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", + "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.1.0.tgz", + "integrity": "sha512-qNSR4jrmJ8M1VMM9tibvyRAHXQs2PmaksQF7c1CGJNipfe3D8p+wgNwgso/P2A2r2mdgBWAXljNWR0QRZAMW8w==", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-builder-react-jsx": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.3.0.tgz", + "integrity": "sha512-MjA9KgwCuPEkQd9ncSXvSyJ5y+j2sICHyrI0M3L+6fnS4wMSNDc1ARXsbTfbb2cXHn17VisSnU/sHFTCxVxSMw==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0", + "esutils": "^2.0.0" + } + }, + "@babel/helper-call-delegate": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.4.4.tgz", + "integrity": "sha512-l79boDFJ8S1c5hvQvG+rc+wHw6IuH7YldmRKsYtpbawsxURu/paVy57FZMomGK22/JckepaikOkY0MoAmdyOlQ==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.4.4", + "@babel/traverse": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.5.0.tgz", + "integrity": "sha512-EAoMc3hE5vE5LNhMqDOwB1usHvmRjCDAnH8CD4PVkX9/Yr3W/tcz8xE8QvdZxfsFBDICwZnF2UTHIqslRpvxmA==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.4.4", + "@babel/helper-split-export-declaration": "^7.4.4" + } + }, + "@babel/helper-define-map": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.4.4.tgz", + "integrity": "sha512-IX3Ln8gLhZpSuqHJSnTNBWGDE9kdkTEWl21A/K7PQ00tseBwbqCHTvNLHSBd9M0R5rER4h5Rsvj9vw0R5SieBg==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/types": "^7.4.4", + "lodash": "^4.17.11" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.1.0.tgz", + "integrity": "sha512-NRQpfHrJ1msCHtKjbzs9YcMmJZOg6mQMmGRB+hbamEdG5PNpaSm95275VD92DvJKuyl0s2sFiDmMZ+EnnvufqA==", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.4.4.tgz", + "integrity": "sha512-VYk2/H/BnYbZDDg39hr3t2kKyifAm1W6zHRfhx8jGjIHpQEBv9dry7oQ2f3+J703TLu69nYdxsovl0XYfcnK4w==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0.tgz", + "integrity": "sha512-avo+lm/QmZlv27Zsi0xEor2fKcqWG56D5ae9dzklpIaY7cQMK5N8VSpaNVPPagiqmy7LrEjK1IWdGMOqPu5csg==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-module-imports": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", + "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-module-transforms": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.4.4.tgz", + "integrity": "sha512-3Z1yp8TVQf+B4ynN7WoHPKS8EkdTbgAEy0nU0rs/1Kw4pDgmvYH3rz3aI11KgxKCba2cn7N+tqzV1mY2HMN96w==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/template": "^7.4.4", + "@babel/types": "^7.4.4", + "lodash": "^4.17.11" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0.tgz", + "integrity": "sha512-u8nd9NQePYNQV8iPWu/pLLYBqZBa4ZaY1YWRFMuxrid94wKI1QNt67NEZ7GAe5Kc/0LLScbim05xZFWkAdrj9g==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.4.4.tgz", + "integrity": "sha512-Y5nuB/kESmR3tKjU8Nkn1wMGEx1tjJX076HBMeL3XLQCu6vA/YRzuTW0bbb+qRnXvQGn+d6Rx953yffl8vEy7Q==", + "dev": true, + "requires": { + "lodash": "^4.17.11" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", + "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-wrap-function": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-replace-supers": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.4.4.tgz", + "integrity": "sha512-04xGEnd+s01nY1l15EuMS1rfKktNF+1CkKmHoErDppjAAZL+IUBZpzT748x262HF7fibaQPhbvWUl5HeSt1EXg==", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.0.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/traverse": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/helper-simple-access": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", + "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "dev": true, + "requires": { + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/helper-wrap-function": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", + "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.2.0" + } + }, + "@babel/helpers": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.5.1.tgz", + "integrity": "sha512-rVOTDv8sH8kNI72Unenusxw6u+1vEepZgLxeV+jHkhsQlYhzVhzL1EpfoWT7Ub3zpWSv2WV03V853dqsnyoQzA==", + "dev": true, + "requires": { + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.5.0", + "@babel/types": "^7.5.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.0.tgz", + "integrity": "sha512-I5nW8AhGpOXGCCNYGc+p7ExQIBxRFnS2fd/d862bNOKvmoEPjYPcfIjsfdy0ujagYOIYPczKgD9l3FsgTkAzKA==", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", + "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.1.0", + "@babel/plugin-syntax-async-generators": "^7.2.0" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.3.0.tgz", + "integrity": "sha512-wNHxLkEKTQ2ay0tnsam2z7fGZUi+05ziDJflEt3AZTP3oXLKHJp9HqhfroB/vdMvt3sda9fAbq7FsG8QPDrZBg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.3.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-proposal-decorators": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.3.0.tgz", + "integrity": "sha512-3W/oCUmsO43FmZIqermmq6TKaRSYhmh/vybPfVFwQWdSb8xwki38uAIvknCRzuyHRuYfCYmJzL9or1v0AffPjg==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.3.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-decorators": "^7.2.0" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz", + "integrity": "sha512-MAFV1CA/YVmYwZG0fBQyXhmj0BHCB5egZHCKWIFVv/XCxAeVGIHfos3SwDck4LvCllENIAg7xMKOG5kH0dzyUg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-json-strings": "^7.2.0" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.3.2.tgz", + "integrity": "sha512-DjeMS+J2+lpANkYLLO+m6GjoTMygYglKmRe6cDTbFv3L9i6mmiE8fe6B8MtCSLZpVXscD5kn7s6SgtHrDoBWoA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-object-rest-spread": "^7.2.0" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.4.4.tgz", + "integrity": "sha512-j1NwnOqMG9mFUOH58JTFsA/+ZYzQLUZ/drqWUqxCYLGeu2JFZL8YrNC9hBxKmWtAuOCHPcRpgv7fhap09Fb4kA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.5.4" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", + "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-decorators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.2.0.tgz", + "integrity": "sha512-38QdqVoXdHUQfTpZo3rQwqQdWtCn5tMv4uV6r2RMfTqNBuv4ZBhz79SfaQWKTVmxHjeFv/DnXVC/+agHCklYWA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", + "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-flow": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz", + "integrity": "sha512-r6YMuZDWLtLlu0kqIim5o/3TNRAlWb073HwT3e2nKf9I8IIvOggPrnILYPsrrKilmn/mYEMCf/Z07w3yQJF6dg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz", + "integrity": "sha512-5UGYnMSLRE1dqqZwug+1LISpA403HzlSfsg6P9VXU6TBjcSHeNlw4DxDx7LgpF+iKZoOG/+uzqoRHTdcUpiZNg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.2.0.tgz", + "integrity": "sha512-VyN4QANJkRW6lDBmENzRszvZf3/4AXaj9YR7GwrWeeN9tEBPuXbmDYVU9bYBN0D70zCWVwUy0HWq2553VCb6Hw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.2.0.tgz", + "integrity": "sha512-t0JKGgqk2We+9may3t0xDdmneaXmyxq0xieYcKHxIsrJO64n1OiMWNUtc5gQK1PA0NpdCRrtZp4z+IUaKugrSA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-typescript": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.3.3.tgz", + "integrity": "sha512-dGwbSMA1YhVS8+31CnPR7LB4pcbrzcV99wQzby4uAfrkZPYZlQ7ImwdpzLqi6Z6IL02b8IAL379CaMwo0x5Lag==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.2.0.tgz", + "integrity": "sha512-ER77Cax1+8/8jCB9fo4Ud161OZzWN5qawi4GusDuRLcDbDG+bIGYY20zb2dfAFdTRGzrfq2xZPvF0R64EHnimg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.5.0.tgz", + "integrity": "sha512-mqvkzwIGkq0bEF1zLRRiTdjfomZJDV33AH3oQzHVGkI2VzEmXLpKKOBvEVaFZBJdN0XTyH38s9j/Kiqr68dggg==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.1.0" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.2.0.tgz", + "integrity": "sha512-ntQPR6q1/NKuphly49+QiQiTN0O63uOwjdD6dhIjSWBI5xlrbUFh720TIpzBhpnrLfv2tNH/BXvLIab1+BAI0w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.4.4.tgz", + "integrity": "sha512-jkTUyWZcTrwxu5DD4rWz6rDB5Cjdmgz6z7M7RLXOJyCUkFBawssDGcGh8M/0FTSB87avyJI1HsTwUXp9nKA1PA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "lodash": "^4.17.11" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.2.2.tgz", + "integrity": "sha512-gEZvgTy1VtcDOaQty1l10T3jQmJKlNVxLDCs+3rCVPr6nMkODLELxViq5X9l+rfxbie3XrfrMCYYY6eX3aOcOQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-define-map": "^7.1.0", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-optimise-call-expression": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.2.0.tgz", + "integrity": "sha512-kP/drqTxY6Xt3NNpKiMomfgkNn4o7+vKxK2DDKcBG9sHj51vHqMBGy8wbDS/J4lMxnqs153/T3+DmCEAkC5cpA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.3.2.tgz", + "integrity": "sha512-Lrj/u53Ufqxl/sGxyjsJ2XNtNuEjDyjpqdhMNh5aZ+XFOdThL46KBj27Uem4ggoezSYBxKWAil6Hu8HtwqesYw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.4.4.tgz", + "integrity": "sha512-P05YEhRc2h53lZDjRPk/OektxCVevFzZs2Gfjd545Wde3k+yFDbXORgl2e0xpbq8mLcKJ7Idss4fAg0zORN/zg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.5.4" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.5.0.tgz", + "integrity": "sha512-igcziksHizyQPlX9gfSjHkE2wmoCH3evvD2qR5w29/Dk0SMKE/eOI7f1HhBdNhR/zxJDqrgpoDTq5YSLH/XMsQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.2.0.tgz", + "integrity": "sha512-umh4hR6N7mu4Elq9GG8TOu9M0bakvlsREEC+ialrQN6ABS4oDQ69qJv1VtR3uxlKMCQMCvzk7vr17RHKcjx68A==", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-flow-strip-types": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.4.4.tgz", + "integrity": "sha512-WyVedfeEIILYEaWGAUWzVNyqG4sfsNooMhXWsu/YzOvVGcsnPb5PguysjJqI3t3qiaYj0BR8T2f5njdjTGe44Q==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.2.0" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.4.4.tgz", + "integrity": "sha512-9T/5Dlr14Z9TIEXLXkt8T1DU7F24cbhwhMNUziN3hB1AXoZcdzPcTiKGRn/6iOymDqtTKWnr/BtRKN9JwbKtdQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.4.4.tgz", + "integrity": "sha512-iU9pv7U+2jC9ANQkKeNF6DrPy4GBa4NWQtl6dHB4Pb3izX2JOEvDTFarlNsBj/63ZEzNNIAMs3Qw4fNCcSOXJA==", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.2.0.tgz", + "integrity": "sha512-2ThDhm4lI4oV7fVQ6pNNK+sx+c/GM5/SaML0w/r4ZB7sAneD/piDJtwdKlNckXeyGK7wlwg2E2w33C/Hh+VFCg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.5.0.tgz", + "integrity": "sha512-n20UsQMKnWrltocZZm24cRURxQnWIvsABPJlw/fvoy9c6AgHZzoelAIzajDHAQrDpuKFFPPcFGd7ChsYuIUMpg==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0", + "babel-plugin-dynamic-import-node": "^2.3.0" + }, + "dependencies": { + "babel-plugin-dynamic-import-node": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", + "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + } + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.5.0.tgz", + "integrity": "sha512-xmHq0B+ytyrWJvQTc5OWAC4ii6Dhr0s22STOoydokG51JjWhyYo5mRPXoi+ZmtHQhZZwuXNN+GG5jy5UZZJxIQ==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.4.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0", + "babel-plugin-dynamic-import-node": "^2.3.0" + }, + "dependencies": { + "babel-plugin-dynamic-import-node": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", + "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + } + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.5.0.tgz", + "integrity": "sha512-Q2m56tyoQWmuNGxEtUyeEkm6qJYFqs4c+XyXH5RAuYxObRNz9Zgj/1g2GMnjYp2EUyEy7YTrxliGCXzecl/vJg==", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.4.4", + "@babel/helper-plugin-utils": "^7.0.0", + "babel-plugin-dynamic-import-node": "^2.3.0" + }, + "dependencies": { + "babel-plugin-dynamic-import-node": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", + "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + } + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.2.0.tgz", + "integrity": "sha512-BV3bw6MyUH1iIsGhXlOK6sXhmSarZjtJ/vMiD9dNmpY8QXFFQTj+6v92pcfy1iqa8DeAfJFwoxcrS/TUZda6sw==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.1.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.4.5.tgz", + "integrity": "sha512-z7+2IsWafTBbjNsOxU/Iv5CvTJlr5w4+HGu1HovKYTtgJ362f7kBcQglkfmlspKKZ3bgrbSGvLfNx++ZJgCWsg==", + "dev": true, + "requires": { + "regexp-tree": "^0.1.6" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.4.4.tgz", + "integrity": "sha512-r1z3T2DNGQwwe2vPGZMBNjioT2scgWzK9BCnDEh+46z8EEwXBq24uRzd65I7pjtugzPSj921aM15RpESgzsSuA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz", + "integrity": "sha512-VMyhPYZISFZAqAPVkiYb7dUe2AsVi2/wCT5+wZdsNO31FojQJa9ns40hzZ6U9f50Jlq4w6qwzdBB2uwqZ00ebg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-replace-supers": "^7.1.0" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.4.4.tgz", + "integrity": "sha512-oMh5DUO1V63nZcu/ZVLQFqiihBGo4OpxJxR1otF50GMeCLiRx5nUdtokd+u9SuVJrvvuIh9OosRFPP4pIPnwmw==", + "dev": true, + "requires": { + "@babel/helper-call-delegate": "^7.4.4", + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-react-constant-elements": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-constant-elements/-/plugin-transform-react-constant-elements-7.2.0.tgz", + "integrity": "sha512-YYQFg6giRFMsZPKUM9v+VcHOdfSQdz9jHCx3akAi3UYgyjndmdYGSXylQ/V+HswQt4fL8IklchD9HTsaOCrWQQ==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-react-display-name": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.2.0.tgz", + "integrity": "sha512-Htf/tPa5haZvRMiNSQSFifK12gtr/8vwfr+A9y69uF0QcU77AVu4K7MiHEkTxF7lQoHOL0F9ErqgfNEAKgXj7A==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-react-jsx": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.3.0.tgz", + "integrity": "sha512-a/+aRb7R06WcKvQLOu4/TpjKOdvVEKRLWFpKcNuHhiREPgGRB4TQJxq07+EZLS8LFVYpfq1a5lDUnuMdcCpBKg==", + "dev": true, + "requires": { + "@babel/helper-builder-react-jsx": "^7.3.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@babel/plugin-transform-react-jsx-self": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.2.0.tgz", + "integrity": "sha512-v6S5L/myicZEy+jr6ielB0OR8h+EH/1QFx/YJ7c7Ua+7lqsjj/vW6fD5FR9hB/6y7mGbfT4vAURn3xqBxsUcdg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@babel/plugin-transform-react-jsx-source": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.5.0.tgz", + "integrity": "sha512-58Q+Jsy4IDCZx7kqEZuSDdam/1oW8OdDX8f+Loo6xyxdfg1yF0GE2XNJQSTZCaMol93+FBzpWiPEwtbMloAcPg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-jsx": "^7.2.0" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.4.5.tgz", + "integrity": "sha512-gBKRh5qAaCWntnd09S8QC7r3auLCqq5DI6O0DlfoyDjslSBVqBibrMdsqO+Uhmx3+BlOmE/Kw1HFxmGbv0N9dA==", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.0" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.2.0.tgz", + "integrity": "sha512-jIgkljDdq4RYDnJyQsiWbdvGeei/0MOTtSHKO/rfbd/mXBxNpdlulMx49L0HQ4pug1fXannxoqCI+fYSle9eSw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "resolve": "^1.8.1", + "semver": "^5.5.1" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.2.0.tgz", + "integrity": "sha512-QP4eUM83ha9zmYtpbnyjTLAGKQritA5XW/iG9cjtuOI8s1RuL/3V6a3DeSHfKutJQ+ayUfeZJPcnCYEQzaPQqg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.2.2.tgz", + "integrity": "sha512-KWfky/58vubwtS0hLqEnrWJjsMGaOeSBn90Ezn5Jeg9Z8KKHmELbP1yGylMlm5N6TPKeY9A2+UaSYLdxahg01w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.2.0.tgz", + "integrity": "sha512-KKYCoGaRAf+ckH8gEL3JHUaFVyNHKe3ASNsZ+AlktgHevvxGigoIttrEJb8iKN03Q7Eazlv1s6cx2B2cQ3Jabw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.0.0" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.4.4.tgz", + "integrity": "sha512-mQrEC4TWkhLN0z8ygIvEL9ZEToPhG5K7KDW3pzGqOfIGZ28Jb0POUkeWcoz8HnHvhFy6dwAT1j8OzqN8s804+g==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.2.0.tgz", + "integrity": "sha512-2LNhETWYxiYysBtrBTqL8+La0jIoQQnIScUJc74OYvUGRmkskNY4EzLCnjHBzdmb38wqtTaixpo1NctEcvMDZw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-typescript": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.5.1.tgz", + "integrity": "sha512-dzJ4e/vIFjQOucCu6d+s/ebr+kc8/sAaSscI35X34yEX0gfS6yxY9pKX15U2kumeXe3ScQiTnTQcvRv48bmMtQ==", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.5.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-typescript": "^7.2.0" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz", + "integrity": "sha512-il+/XdNw01i93+M9J9u4T7/e/Ue/vWfNZE4IRUQjplu2Mqb/AFTDimkw2tdEdSH50wuQXZAbXSql0UphQke+vA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.5.4" + } + }, + "@babel/preset-env": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.3.1.tgz", + "integrity": "sha512-FHKrD6Dxf30e8xgHQO0zJZpUPfVZg+Xwgz5/RdSWCbza9QLNk4Qbp40ctRoqDxml3O8RMzB1DU55SXeDG6PqHQ==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-async-generator-functions": "^7.2.0", + "@babel/plugin-proposal-json-strings": "^7.2.0", + "@babel/plugin-proposal-object-rest-spread": "^7.3.1", + "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.2.0", + "@babel/plugin-syntax-async-generators": "^7.2.0", + "@babel/plugin-syntax-json-strings": "^7.2.0", + "@babel/plugin-syntax-object-rest-spread": "^7.2.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.2.0", + "@babel/plugin-transform-arrow-functions": "^7.2.0", + "@babel/plugin-transform-async-to-generator": "^7.2.0", + "@babel/plugin-transform-block-scoped-functions": "^7.2.0", + "@babel/plugin-transform-block-scoping": "^7.2.0", + "@babel/plugin-transform-classes": "^7.2.0", + "@babel/plugin-transform-computed-properties": "^7.2.0", + "@babel/plugin-transform-destructuring": "^7.2.0", + "@babel/plugin-transform-dotall-regex": "^7.2.0", + "@babel/plugin-transform-duplicate-keys": "^7.2.0", + "@babel/plugin-transform-exponentiation-operator": "^7.2.0", + "@babel/plugin-transform-for-of": "^7.2.0", + "@babel/plugin-transform-function-name": "^7.2.0", + "@babel/plugin-transform-literals": "^7.2.0", + "@babel/plugin-transform-modules-amd": "^7.2.0", + "@babel/plugin-transform-modules-commonjs": "^7.2.0", + "@babel/plugin-transform-modules-systemjs": "^7.2.0", + "@babel/plugin-transform-modules-umd": "^7.2.0", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.3.0", + "@babel/plugin-transform-new-target": "^7.0.0", + "@babel/plugin-transform-object-super": "^7.2.0", + "@babel/plugin-transform-parameters": "^7.2.0", + "@babel/plugin-transform-regenerator": "^7.0.0", + "@babel/plugin-transform-shorthand-properties": "^7.2.0", + "@babel/plugin-transform-spread": "^7.2.0", + "@babel/plugin-transform-sticky-regex": "^7.2.0", + "@babel/plugin-transform-template-literals": "^7.2.0", + "@babel/plugin-transform-typeof-symbol": "^7.2.0", + "@babel/plugin-transform-unicode-regex": "^7.2.0", + "browserslist": "^4.3.4", + "invariant": "^2.2.2", + "js-levenshtein": "^1.1.3", + "semver": "^5.3.0" + } + }, + "@babel/preset-flow": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/preset-flow/-/preset-flow-7.0.0.tgz", + "integrity": "sha512-bJOHrYOPqJZCkPVbG1Lot2r5OSsB+iUOaxiHdlOeB1yPWS6evswVHwvkDLZ54WTaTRIk89ds0iHmGZSnxlPejQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.0.0" + } + }, + "@babel/preset-react": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0.tgz", + "integrity": "sha512-oayxyPS4Zj+hF6Et11BwuBkmpgT/zMxyuZgFrMeZID6Hdh3dGlk4sHCAhdBCpuCKW2ppBfl2uCCetlrUIJRY3w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-react-display-name": "^7.0.0", + "@babel/plugin-transform-react-jsx": "^7.0.0", + "@babel/plugin-transform-react-jsx-self": "^7.0.0", + "@babel/plugin-transform-react-jsx-source": "^7.0.0" + } + }, + "@babel/preset-typescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.1.0.tgz", + "integrity": "sha512-LYveByuF9AOM8WrsNne5+N79k1YxjNB6gmpCQsnuSBAcV8QUeB+ZUxQzL7Rz7HksPbahymKkq2qBR+o36ggFZA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.1.0" + } + }, + "@babel/runtime": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.1.tgz", + "integrity": "sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA==", + "dev": true, + "requires": { + "regenerator-runtime": "^0.12.0" + } + }, + "@babel/template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" + } + }, + "@babel/traverse": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.0.tgz", + "integrity": "sha512-SnA9aLbyOCcnnbQEGwdfBggnc142h/rbqqsXcaATj2hZcegCl903pUD/lfpsNBlBSuWow/YDfRyJuWi2EPR5cg==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.5.0", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.5.0", + "@babel/types": "^7.5.0", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.11" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.0.tgz", + "integrity": "sha512-UFpDVqRABKsW01bvw7/wSUe56uy6RXM5+VJibVVAybDGxEW25jdwiFJEf7ASvSaC7sN7rbE/l3cLp2izav+CtQ==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.11", + "to-fast-properties": "^2.0.0" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "optional": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "optional": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "optional": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "optional": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "optional": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true, + "optional": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "optional": true + }, + "babel-loader": { + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz", + "integrity": "sha512-NTnHnVRd2JnRqPC0vW+iOQWU5pchDbYXsG2E6DMXEpMfUcQKclF9gmf3G3ZMhzG7IG9ji4coL0cm+FxeWxDpnw==", + "dev": true, + "requires": { + "find-cache-dir": "^2.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1", + "util.promisify": "^1.0.0" + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.2.0.tgz", + "integrity": "sha512-fP899ELUnTaBcIzmrW7nniyqqdYWrWuJUyPWHxFa/c7r7hS6KC8FscNfLlBNIoPSc55kYMGEEKjPjJGCLbE1qA==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-macros": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/babel-plugin-macros/-/babel-plugin-macros-2.5.0.tgz", + "integrity": "sha512-BWw0lD0kVZAXRD3Od1kMrdmfudqzDzYv2qrN3l2ISR1HVp1EgLKfbOrYV9xmY5k3qx3RIu5uPAUZZZHpo0o5Iw==", + "dev": true, + "requires": { + "cosmiconfig": "^5.0.5", + "resolve": "^1.8.1" + } + }, + "babel-plugin-transform-react-remove-prop-types": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-remove-prop-types/-/babel-plugin-transform-react-remove-prop-types-0.4.24.tgz", + "integrity": "sha512-eqj0hVcJUR57/Ug2zE1Yswsw4LhuqqHhD+8v120T1cl3kjg76QwtyBrdIk4WVwK+lAhBJVYCd/v+4nc4y+8JsA==", + "dev": true + }, + "babel-preset-react-app": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/babel-preset-react-app/-/babel-preset-react-app-7.0.2.tgz", + "integrity": "sha512-mwCk/u2wuiO8qQqblN5PlDa44taY0acq7hw6W+a70W522P7a9mIcdggL1fe5/LgAT7tqCq46q9wwhqaMoYKslQ==", + "dev": true, + "requires": { + "@babel/core": "7.2.2", + "@babel/plugin-proposal-class-properties": "7.3.0", + "@babel/plugin-proposal-decorators": "7.3.0", + "@babel/plugin-proposal-object-rest-spread": "7.3.2", + "@babel/plugin-syntax-dynamic-import": "7.2.0", + "@babel/plugin-transform-classes": "7.2.2", + "@babel/plugin-transform-destructuring": "7.3.2", + "@babel/plugin-transform-flow-strip-types": "7.2.3", + "@babel/plugin-transform-react-constant-elements": "7.2.0", + "@babel/plugin-transform-react-display-name": "7.2.0", + "@babel/plugin-transform-runtime": "7.2.0", + "@babel/preset-env": "7.3.1", + "@babel/preset-react": "7.0.0", + "@babel/preset-typescript": "7.1.0", + "@babel/runtime": "7.3.1", + "babel-loader": "8.0.5", + "babel-plugin-dynamic-import-node": "2.2.0", + "babel-plugin-macros": "2.5.0", + "babel-plugin-transform-react-remove-prop-types": "0.4.24" + }, + "dependencies": { + "@babel/core": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.2.2.tgz", + "integrity": "sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.2.2", + "@babel/helpers": "^7.2.0", + "@babel/parser": "^7.2.2", + "@babel/template": "^7.2.2", + "@babel/traverse": "^7.2.2", + "@babel/types": "^7.2.2", + "convert-source-map": "^1.1.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.10", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, + "@babel/plugin-transform-flow-strip-types": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.2.3.tgz", + "integrity": "sha512-xnt7UIk9GYZRitqCnsVMjQK1O2eKZwFB3CvvHjf5SGx6K6vr/MScCKQDnf1DxRaj501e3pXjti+inbSXX2ZUoQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-flow": "^7.2.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "optional": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "browserslist": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.6.3.tgz", + "integrity": "sha512-CNBqTCq22RKM8wKJNowcqihHJ4SkI8CGeK7KOR9tPboXUuS5Zk5lQgzzTbs4oxD8x+6HUshZUa2OyNI9lR93bQ==", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30000975", + "electron-to-chromium": "^1.3.164", + "node-releases": "^1.1.23" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "optional": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "caller-callsite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz", + "integrity": "sha1-hH4PzgoiN1CpoCfFSzNzGtMVQTQ=", + "dev": true, + "requires": { + "callsites": "^2.0.0" + } + }, + "caller-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-2.0.0.tgz", + "integrity": "sha1-Ro+DBE42mrIBD6xfBs7uFbsssfQ=", + "dev": true, + "requires": { + "caller-callsite": "^2.0.0" + } + }, + "callsites": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-2.0.0.tgz", + "integrity": "sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30000980", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000980.tgz", + "integrity": "sha512-as0PRtWHaX3gl2gpC7qA7bX88lr+qLacMMXm1QKLLQtBCwT/Ljbgrv5EXKMNBoeEX6yFZ4vIsBb4Nh+PEwW2Rw==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chokidar": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "optional": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "cosmiconfig": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz", + "integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==", + "dev": true, + "requires": { + "import-fresh": "^2.0.0", + "is-directory": "^0.3.1", + "js-yaml": "^3.13.1", + "parse-json": "^4.0.0" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "optional": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "electron-to-chromium": { + "version": "1.3.188", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.188.tgz", + "integrity": "sha512-tEQcughYIMj8WDMc59EGEtNxdGgwal/oLLTDw+NEqJRJwGflQvH3aiyiexrWeZOETP4/ko78PVr6gwNhdozvuQ==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "~0.4.13" + } + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "optional": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "flow-copy-source": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/flow-copy-source/-/flow-copy-source-2.0.7.tgz", + "integrity": "sha512-/9oYivwSRgIyRMWqRkzJgulUCRPqMA8JSt7l0uoW0Xmtp8ItJpURnBczJUvnAKnHp0TNttNILCeuqW2w9cwTFg==", + "dev": true, + "requires": { + "chokidar": "^3.0.0", + "fs-extra": "^8.1.0", + "glob": "^7.0.0", + "kefir": "^3.7.3", + "yargs": "^13.1.0" + }, + "dependencies": { + "anymatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.0.3.tgz", + "integrity": "sha512-c6IvoeBECQlMVuYUjSwimnhmztImpErfxJzWZhIQinIvQWoGOnB0dLIgifbPHQt5heS6mNlaZG16f06H3C8t1g==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.0.2.tgz", + "integrity": "sha512-c4PR2egjNjI1um6bamCQ6bUNPDiyofNQruHvKgHQ4gDUP/ITSVSzNsiI5OWtHOsX323i5ha/kk4YmOZ1Ktg7KA==", + "dev": true, + "requires": { + "anymatch": "^3.0.1", + "braces": "^3.0.2", + "fsevents": "^2.0.6", + "glob-parent": "^5.0.0", + "is-binary-path": "^2.1.0", + "is-glob": "^4.0.1", + "normalize-path": "^3.0.0", + "readdirp": "^3.1.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", + "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.0.0.tgz", + "integrity": "sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "readdirp": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.1.tgz", + "integrity": "sha512-XXdSXZrQuvqoETj50+JAitxz1UPdt5dupjT6T5nVB+WvjMv2XKYj+s7hPeAVCXvmJrL36O4YYyWlIC3an2ePiQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "optional": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "optional": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "resolved": false, + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": false, + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "resolved": false, + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "resolved": false, + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": false, + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "resolved": false, + "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": false, + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": false, + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "resolved": false, + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "dev": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "resolved": false, + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "resolved": false, + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "resolved": false, + "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "resolved": false, + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": false, + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "resolved": false, + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": false, + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "resolved": false, + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": false, + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": false, + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "resolved": false, + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": false, + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": false, + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": false, + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "resolved": false, + "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "resolved": false, + "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": false, + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.3.0.tgz", + "integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==", + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.12.0.tgz", + "integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==", + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "resolved": false, + "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.6.tgz", + "integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==", + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.1.tgz", + "integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==", + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "resolved": false, + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": false, + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": false, + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "resolved": false, + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "resolved": false, + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": false, + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": false, + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "resolved": false, + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": false, + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": false, + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "resolved": false, + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": false, + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": false, + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "resolved": false, + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": false, + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": false, + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": false, + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": false, + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": false, + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "resolved": false, + "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": false, + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": false, + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "resolved": false, + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true, + "optional": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "optional": true + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "import-fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha1-2BNVwVYS04bGH53dOSLUMEgipUY=", + "dev": true, + "requires": { + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "optional": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + }, + "is-directory": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", + "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", + "dev": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "optional": true + }, + "js-levenshtein": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.6.tgz", + "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json5": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz", + "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, + "kefir": { + "version": "3.8.6", + "resolved": "https://registry.npmjs.org/kefir/-/kefir-3.8.6.tgz", + "integrity": "sha512-H/8ZTjmEEme2YL388rgy5fFlz2NM4ZImNI2rJrTsR8og454kpY3lPVv53W9lfevNELfNeYD33gMdIKHL25z7WA==", + "dev": true, + "requires": { + "symbol-observable": "1.0.4" + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true, + "optional": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.14.tgz", + "integrity": "sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw==", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "optional": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "optional": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "optional": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "requires": { + "encoding": "^0.1.11", + "is-stream": "^1.0.1" + } + }, + "node-releases": { + "version": "1.1.25", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.25.tgz", + "integrity": "sha512-fI5BXuk83lKEoZDdH3gRhtsNgh05/wZacuXkgbiYkceE7+QIMXOg98n9ZV7mz27B+kFHnqHcUpscZZlGRSmTpQ==", + "dev": true, + "requires": { + "semver": "^5.3.0" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "optional": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "output-file-sync": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/output-file-sync/-/output-file-sync-2.0.1.tgz", + "integrity": "sha512-mDho4qm7WgIXIGf4eYU1RHN2UU5tPfVYVSRwDJw0uTmj35DQUt/eNp19N7v6T3SrR0ESTEf2up2CGO73qI35zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "is-plain-obj": "^1.1.0", + "mkdirp": "^0.5.1" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "optional": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true, + "optional": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "portable-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/portable-fetch/-/portable-fetch-3.0.0.tgz", + "integrity": "sha1-PL9KptvFpXNLQcBBnJJzMTv9mtg=", + "requires": { + "node-fetch": "^1.0.1", + "whatwg-fetch": ">=0.10.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "optional": true + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "optional": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.12.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz", + "integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.0.tgz", + "integrity": "sha512-rtOelq4Cawlbmq9xuMR5gdFmv7ku/sFoB7sRiywx7aq53bc52b4j6zvH7Te1Vt/X2YveDKnCGUbioieU7FEL3w==", + "dev": true, + "requires": { + "private": "^0.1.6" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexp-tree": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.11.tgz", + "integrity": "sha512-7/l/DgapVVDzZobwMCCgMlqiqyLFJ0cduo/j+3BcDJIB+yJdsYCfKuI3l/04NV+H/rfNRdPIDbXNZHM9XvQatg==", + "dev": true + }, + "regexpu-core": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.4.tgz", + "integrity": "sha512-BtizvGtFQKGPUcTy56o3nk1bGRp4SZOTYrDtGNlqCQufptV5IkkLN6Emw+yunAJjzf+C9FQFtvq7IoA3+oMYHQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.0.2", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", + "dev": true + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true, + "optional": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "optional": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "optional": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true, + "optional": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "optional": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "optional": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "optional": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "optional": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true, + "optional": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "optional": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "symbol-observable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.4.tgz", + "integrity": "sha1-Kb9hXUqnEhvdiYsi1LP5vE4qoD0=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "optional": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "optional": true + } + } + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true, + "optional": true + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true, + "optional": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "whatwg-fetch": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", + "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/CI/samples.ci/client/petstore/javascript-flowtyped/pom.xml b/CI/samples.ci/client/petstore/javascript-flowtyped/pom.xml new file mode 100644 index 000000000000..42f19fcf2e17 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-flowtyped/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-flowtyped + pom + 1.0-SNAPSHOT + Petstore JS Flowtyped Client + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + run + build + + + + + + + + diff --git a/CI/samples.ci/client/petstore/javascript-promise-es6/pom.xml b/CI/samples.ci/client/petstore/javascript-promise-es6/pom.xml new file mode 100644 index 000000000000..793a531b460e --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise-es6/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-promise-es6 + pom + 1.0-SNAPSHOT + OpenAPI Petstore JS Client (ES6, Promise) + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/javascript-promise-es6/test/ApiClientTest.js b/CI/samples.ci/client/petstore/javascript-promise-es6/test/ApiClientTest.js new file mode 100644 index 000000000000..5e98b685a911 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise-es6/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/CI/samples.ci/client/petstore/javascript-promise/.gitignore b/CI/samples.ci/client/petstore/javascript-promise/.gitignore new file mode 100644 index 000000000000..2ccbe4656c60 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise/.gitignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/CI/samples.ci/client/petstore/javascript-promise/pom.xml b/CI/samples.ci/client/petstore/javascript-promise/pom.xml new file mode 100644 index 000000000000..7aa5b80ba8cc --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript-promise + pom + 1.0-SNAPSHOT + OpenAPI Petstore JS Client (Promise) + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/javascript-promise/test/ApiClientTest.js b/CI/samples.ci/client/petstore/javascript-promise/test/ApiClientTest.js new file mode 100644 index 000000000000..5e98b685a911 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var SwaggerPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = SwaggerPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* comment out the following as these fake security def (testing purpose) + * are removed from the spec, we'll add these back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new SwaggerPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new SwaggerPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + /* + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new SwaggerPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +*/ + +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts); +} diff --git a/CI/samples.ci/client/petstore/javascript-promise/test/mocha.opts b/CI/samples.ci/client/petstore/javascript-promise/test/mocha.opts new file mode 100644 index 000000000000..907011807d68 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise/test/mocha.opts @@ -0,0 +1 @@ +--timeout 10000 diff --git a/CI/samples.ci/client/petstore/javascript-promise/test/run_tests.html b/CI/samples.ci/client/petstore/javascript-promise/test/run_tests.html new file mode 100644 index 000000000000..2f3e3f1e33ae --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript-promise/test/run_tests.html @@ -0,0 +1,41 @@ + + + + Mocha Tests + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/javascript/.gitignore b/CI/samples.ci/client/petstore/javascript/.gitignore new file mode 100644 index 000000000000..2ccbe4656c60 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript/.gitignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/CI/samples.ci/client/petstore/javascript/pom.xml b/CI/samples.ci/client/petstore/javascript/pom.xml new file mode 100644 index 000000000000..3d461be47216 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + org.openapitools + openapi-petstore-javascript + pom + 1.0-SNAPSHOT + OpenAPI Petstore JS Client + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + npm-install + pre-integration-test + + exec + + + npm + + install + + + + + mocha + integration-test + + exec + + + npm + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/javascript/test/ApiClientTest.js b/CI/samples.ci/client/petstore/javascript/test/ApiClientTest.js new file mode 100755 index 000000000000..2674cf9e1359 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript/test/ApiClientTest.js @@ -0,0 +1,393 @@ +if (typeof module === 'object' && module.exports) { + var expect = require('expect.js'); + var OpenAPIPetstore = require('../src/index'); + var sinon = require('sinon'); +} + +var apiClient = OpenAPIPetstore.ApiClient.instance; + +describe('ApiClient', function() { + describe('defaults', function() { + it('should have correct default values with the default API client', function() { + expect(apiClient).to.be.ok(); + expect(apiClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(apiClient.authentications).to.eql({ + petstore_auth: {type: 'oauth2'}, + http_basic_test: {type: 'basic'}, + api_key: {type: 'apiKey', 'in': 'header', name: 'api_key'}, + api_key_query: {type: 'apiKey', 'in': 'query', name: 'api_key_query'}, + /* commented out the following as these fake security def (testing purpose) + * has been removed from the spec, we'll add it back after updating the + * petstore server + * + test_http_basic: {type: 'basic'}, + test_api_client_id: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_id' + }, + test_api_client_secret: { + type: 'apiKey', + 'in': 'header', + name: 'x-test_api_client_secret' + }, + test_api_key_query: { + type: 'apiKey', + 'in': 'query', + name: 'test_api_key_query' + }, + test_api_key_header: { + type: 'apiKey', + 'in': 'header', + name: 'test_api_key_header' + }*/ + }); + }); + + it('should have correct default values with new API client and can customize it', function() { + var newClient = new OpenAPIPetstore.ApiClient; + expect(newClient.basePath).to.be('http://petstore.swagger.io:80/v2'); + expect(newClient.buildUrl('/abc', {})).to.be('http://petstore.swagger.io:80/v2/abc'); + + newClient.basePath = 'http://example.com'; + expect(newClient.basePath).to.be('http://example.com'); + expect(newClient.buildUrl('/abc', {})).to.be('http://example.com/abc'); + }); + }); + + describe('#paramToString', function() { + it('should return empty string for null and undefined', function() { + expect(apiClient.paramToString(null)).to.be(''); + expect(apiClient.paramToString(undefined)).to.be(''); + }); + + it('should return string', function() { + expect(apiClient.paramToString('')).to.be(''); + expect(apiClient.paramToString('abc')).to.be('abc'); + expect(apiClient.paramToString(123)).to.be('123'); + }); + }); + + describe('#buildCollectionParam', function() { + var param; + + beforeEach(function() { + param = ['aa', 'bb', 123]; + }); + + it('works for csv', function() { + expect(apiClient.buildCollectionParam(param, 'csv')).to.be('aa,bb,123'); + }); + + it('works for ssv', function() { + expect(apiClient.buildCollectionParam(param, 'ssv')).to.be('aa bb 123'); + }); + + it('works for tsv', function() { + expect(apiClient.buildCollectionParam(param, 'tsv')).to.be('aa\tbb\t123'); + }); + + it('works for pipes', function() { + expect(apiClient.buildCollectionParam(param, 'pipes')).to.be('aa|bb|123'); + }); + + it('works for multi', function() { + expect(apiClient.buildCollectionParam(param, 'multi')).to.eql(['aa', 'bb', '123']); + }); + + it('fails for invalid collection format', function() { + expect(function() { apiClient.buildCollectionParam(param, 'INVALID'); }).to.throwError(); + }); + }); + + describe('#buildUrl', function() { + it('should work without path parameters in the path', function() { + expect(apiClient.buildUrl('/abc', {})).to + .be('http://petstore.swagger.io:80/v2/abc'); + expect(apiClient.buildUrl('/abc/def?ok', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/abc/def?ok'); + }); + + it('should work with path parameters in the path', function() { + expect(apiClient.buildUrl('/{id}', {id: 123})).to + .be('http://petstore.swagger.io:80/v2/123'); + expect(apiClient.buildUrl('/abc/{id}/{name}?ok', {id: 456, name: 'a b'})).to. + be('http://petstore.swagger.io:80/v2/abc/456/a%20b?ok'); + }); + }); + + describe('#isJsonMime', function() { + it('should return true for JSON MIME', function() { + expect(apiClient.isJsonMime('application/json')).to.be(true); + expect(apiClient.isJsonMime('application/json; charset=UTF8')).to.be(true); + expect(apiClient.isJsonMime('APPLICATION/JSON')).to.be(true); + }); + + it('should return false for non-JSON MIME', function() { + expect(apiClient.isJsonMime('')).to.be(false); + expect(apiClient.isJsonMime('text/plain')).to.be(false); + expect(apiClient.isJsonMime('application/xml')).to.be(false); + expect(apiClient.isJsonMime('application/jsonp')).to.be(false); + }); + }); + + describe('#applyAuthToRequest', function() { + var req, newClient; + + beforeEach(function() { + req = { + auth: function() {}, + set: function() {}, + query: function() {} + }; + sinon.stub(req, 'auth'); + sinon.stub(req, 'set'); + sinon.stub(req, 'query'); + newClient = new OpenAPIPetstore.ApiClient(); + }); + + describe('basic', function() { + var authName = 'testBasicAuth'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'basic'}; + auth = newClient.authentications[authName]; + }); + + it('sets auth header with username and password set', function() { + auth.username = 'user'; + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjpwYXNz' is base64-encoded string of 'user:pass' + sinon.assert.calledWithMatch(req.auth, 'user', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only username set', function() { + auth.username = 'user'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'dXNlcjo=' is base64-encoded string of 'user:' + sinon.assert.calledWithMatch(req.auth, 'user', ''); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('sets header with only password set', function() { + auth.password = 'pass'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.auth); + // 'OnBhc3M=' is base64-encoded string of ':pass' + sinon.assert.calledWithMatch(req.auth, '', 'pass'); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + + it('does not set header when username and password are not set', function() { + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.query); + }); + }); + + describe('apiKey', function() { + var authName = 'testApiKey'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'apiKey', name: 'api_key'}; + auth = newClient.authentications[authName]; + }); + + it('sets api key in header', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('sets api key in query', function() { + auth.in = 'query'; + auth.apiKey = 'my-api-key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + + it('sets api key in header with prefix', function() { + auth.in = 'header'; + auth.apiKey = 'my-api-key'; + auth.apiKeyPrefix = 'Key'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'api_key': 'Key my-api-key'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when api key is not set', function() { + auth.in = 'query'; + auth.apiKey = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('oauth2', function() { + var authName = 'testOAuth2'; + var authNames = [authName]; + var auth; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'oauth2'}; + auth = newClient.authentications[authName]; + }); + + it('sets access token in header', function() { + auth.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + + it('works when access token is not set', function() { + auth.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('apiKey and oauth2', function() { + var apiKeyAuthName = 'testApiKey'; + var oauth2Name = 'testOAuth2'; + var authNames = [apiKeyAuthName, oauth2Name]; + var apiKeyAuth, oauth2; + + beforeEach(function() { + newClient.authentications[apiKeyAuthName] = {type: 'apiKey', name: 'api_key', 'in': 'query'}; + newClient.authentications[oauth2Name] = {type: 'oauth2'}; + apiKeyAuth = newClient.authentications[apiKeyAuthName]; + oauth2 = newClient.authentications[oauth2Name]; + }); + + it('works when setting both api key and access token', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = 'my-access-token'; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.calledOnce(req.set); + sinon.assert.calledWithMatch(req.set, {'Authorization': 'Bearer my-access-token'}); + sinon.assert.notCalled(req.auth); + }); + + it('works when setting only api key', function() { + apiKeyAuth.apiKey = 'my-api-key'; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.calledOnce(req.query); + sinon.assert.calledWithMatch(req.query, {'api_key': 'my-api-key'}); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + }); + + it('works when neither api key nor access token is set', function() { + apiKeyAuth.apiKey = null; + oauth2.accessToken = null; + newClient.applyAuthToRequest(req, authNames); + sinon.assert.notCalled(req.query); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.set); + }); + }); + + describe('unknown type', function() { + var authName = 'unknown'; + var authNames = [authName]; + + beforeEach(function() { + newClient.authentications[authName] = {type: 'UNKNOWN'}; + }); + + it('throws error for unknown auth type', function() { + expect(function() { + newClient.applyAuthToRequest(req, authNames); + }).to.throwError(); + sinon.assert.notCalled(req.set); + sinon.assert.notCalled(req.auth); + sinon.assert.notCalled(req.query); + }); + }); + }); + + describe('#defaultHeaders', function() { + it('should initialize default headers to be an empty object', function() { + expect(apiClient.defaultHeaders).to.eql({}); + }); + + it('should put default headers in request', function() { + var newClient = new OpenAPIPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var expected = {'Content-Type': 'text/plain', 'api_key': 'special-key'}; + expect(newClient.defaultHeaders).to.eql(expected); + var req = makeDumbRequest(newClient); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + + it('should override default headers with provided header params', function() { + var newClient = new OpenAPIPetstore.ApiClient; + newClient.defaultHeaders['Content-Type'] = 'text/plain' + newClient.defaultHeaders['api_key'] = 'special-key' + + var headerParams = {'Content-Type': 'application/json', 'Authorization': 'Bearer test-token'} + var expected = { + 'Content-Type': 'application/json', + 'api_key': 'special-key', + 'Authorization': 'Bearer test-token' + }; + var req = makeDumbRequest(newClient, {headerParams: headerParams}); + req.unset('User-Agent'); + expect(req.header).to.eql(expected); + }); + }); +}); + +function makeDumbRequest(apiClient, opts) { + opts = opts || {}; + var path = opts.path || '/store/inventory'; + var httpMethod = opts.httpMethod || 'GET'; + var pathParams = opts.pathParams || {}; + var queryParams = opts.queryParams || {}; + var collectionQueryParams = opts.collectionQueryParams || {}; + var headerParams = opts.headerParams || {}; + var formParams = opts.formParams || {}; + var bodyParam = opts.bodyParam; + var authNames = []; + var contentTypes = opts.contentTypes || []; + var accepts = opts.accepts || []; + var callback = opts.callback; + return apiClient.callApi(path, httpMethod, pathParams, queryParams, collectionQueryParams, + headerParams, formParams, bodyParam, authNames, contentTypes, accepts, + callback + ); +} diff --git a/CI/samples.ci/client/petstore/javascript/test/mocha.opts b/CI/samples.ci/client/petstore/javascript/test/mocha.opts new file mode 100644 index 000000000000..907011807d68 --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript/test/mocha.opts @@ -0,0 +1 @@ +--timeout 10000 diff --git a/CI/samples.ci/client/petstore/javascript/test/run_tests.html b/CI/samples.ci/client/petstore/javascript/test/run_tests.html new file mode 100644 index 000000000000..059f3a112ada --- /dev/null +++ b/CI/samples.ci/client/petstore/javascript/test/run_tests.html @@ -0,0 +1,45 @@ + + + + Mocha Tests + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/kotlin-gson/pom.xml b/CI/samples.ci/client/petstore/kotlin-gson/pom.xml new file mode 100644 index 000000000000..46e3845d39ba --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin-gson/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + io.swagger + KotlinGsonPetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Gson Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/kotlin-multiplatform/pom.xml b/CI/samples.ci/client/petstore/kotlin-multiplatform/pom.xml new file mode 100644 index 000000000000..bf62ae66e66c --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin-multiplatform/pom.xml @@ -0,0 +1,47 @@ + + 4.0.0 + io.swagger + KotlinMultiPlatformClientTests + pom + 1.0-SNAPSHOT + Kotlin MultiPlatform Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + /bin/bash + + gradlew + build + + + + + + + + diff --git a/CI/samples.ci/client/petstore/kotlin-nonpublic/pom.xml b/CI/samples.ci/client/petstore/kotlin-nonpublic/pom.xml new file mode 100644 index 000000000000..2b400e564b9a --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin-nonpublic/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + io.swagger + KotlinNonpublicPetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Nonpublic Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/CI/samples.ci/client/petstore/kotlin/.gitignore b/CI/samples.ci/client/petstore/kotlin/.gitignore new file mode 100644 index 000000000000..2983e3c1db32 --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin/.gitignore @@ -0,0 +1,106 @@ +./bin/ +# Created by https://www.gitignore.io/api/java,intellij,gradle + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml + +# Gradle: +.idea/**/gradle.xml +.idea/**/libraries + +# CMake +cmake-build-debug/ + +# Mongo Explorer plugin: +.idea/**/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +### Intellij Patch ### +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 + +# *.iml +# modules.xml +# .idea/misc.xml +# *.ipr + +# Sonarlint plugin +.idea/sonarlint + +### Java ### +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +### Gradle ### +.gradle +/build/ + +# Ignore Gradle GUI config +gradle-app.setting + +# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) +!gradle-wrapper.jar + +# Cache of project +.gradletasknamecache + +# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 +# gradle/wrapper/gradle-wrapper.properties + +# End of https://www.gitignore.io/api/java,intellij,gradle diff --git a/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.jar b/CI/samples.ci/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.jar rename to CI/samples.ci/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.jar diff --git a/CI/samples.ci/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties b/CI/samples.ci/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..7dc503f149d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/CI/samples.ci/client/petstore/kotlin/gradlew b/CI/samples.ci/client/petstore/kotlin/gradlew new file mode 100755 index 000000000000..4453ccea33d9 --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save ( ) { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/android/httpclient/gradlew.bat b/CI/samples.ci/client/petstore/kotlin/gradlew.bat similarity index 100% rename from samples/client/petstore/android/httpclient/gradlew.bat rename to CI/samples.ci/client/petstore/kotlin/gradlew.bat diff --git a/CI/samples.ci/client/petstore/kotlin/pom.xml b/CI/samples.ci/client/petstore/kotlin/pom.xml new file mode 100644 index 000000000000..e52f9e969b08 --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + io.swagger + KotlinPetstoreClientTests + pom + 1.0-SNAPSHOT + Kotlin Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + gradle + + test + + + + + + + + diff --git a/samples/client/petstore/kotlin-string/src/test/kotlin/org/openapitools/client/PetApiTest.kt b/CI/samples.ci/client/petstore/kotlin/src/test/kotlin/org/openapitools/client/PetApiTest.kt similarity index 100% rename from samples/client/petstore/kotlin-string/src/test/kotlin/org/openapitools/client/PetApiTest.kt rename to CI/samples.ci/client/petstore/kotlin/src/test/kotlin/org/openapitools/client/PetApiTest.kt diff --git a/CI/samples.ci/client/petstore/kotlin/src/test/kotlin/org/openapitools/client/StoreApiTest.kt b/CI/samples.ci/client/petstore/kotlin/src/test/kotlin/org/openapitools/client/StoreApiTest.kt new file mode 100644 index 000000000000..1807e516eb07 --- /dev/null +++ b/CI/samples.ci/client/petstore/kotlin/src/test/kotlin/org/openapitools/client/StoreApiTest.kt @@ -0,0 +1,48 @@ +package org.openapitools.client + +import io.kotlintest.shouldBe +import io.kotlintest.specs.ShouldSpec +import org.openapitools.client.apis.PetApi +import org.openapitools.client.apis.StoreApi +import org.openapitools.client.models.Order +import org.openapitools.client.models.Pet +import java.time.LocalDateTime.now + +class StoreApiTest : ShouldSpec() { + init { + + val petId:Long = 10006 + val petApi = PetApi() + val storeApi = StoreApi() + + val pet = Pet( + id = petId, + name = "kotlin client test", + photoUrls = arrayOf("http://test_kotlin_unit_test.com") + ) + petApi.addPet(pet) + + should("add an order") { + + val order = Order( + id = 12, + petId = petId, + quantity = 2, + shipDate = now(), + complete = true + ) + storeApi.placeOrder(order); + + } + + should("get order by id") { + val result = storeApi.getOrderById(12) + + // verify order + result.petId shouldBe (petId) + result.quantity shouldBe (2) + } + + } + +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/composer.json b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/composer.json new file mode 100644 index 000000000000..370d12656b25 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/composer.json @@ -0,0 +1,39 @@ +{ + "name": "GIT_USER_ID/GIT_REPO_ID", + "description": "This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI-Generator contributors", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": ">=7.1", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^6.2" + }, + "require-dev": { + "phpunit/phpunit": "^7.4", + "squizlabs/php_codesniffer": "~2.6", + "friendsofphp/php-cs-fixer": "~2.12" + }, + "autoload": { + "psr-4": { "OpenAPI\\Client\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "OpenAPI\\Client\\" : "test/" } + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/pom.xml b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/pom.xml new file mode 100644 index 000000000000..da15e1c40968 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/pom.xml @@ -0,0 +1,59 @@ + + 4.0.0 + org.openapitools + PhpPetstoreOAS2Tests + pom + 1.0-SNAPSHOT + PHP OpenAPI OAS2 Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-install + pre-integration-test + + exec + + + composer + + install + + + + + bundle-test + integration-test + + exec + + + vendor/bin/phpunit + + tests + + + + + + + + diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php new file mode 100644 index 000000000000..a1af7b1238b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/AsyncTest.php @@ -0,0 +1,91 @@ +api = new Api\PetApi(); + + $this->petId = 10005; + $pet = new Model\Pet; + $pet->setId($this->petId); + $pet->setName("PHP Unit Test"); + $pet->setPhotoUrls(array("http://test_php_unit_test.com")); + // new tag + $tag= new Model\Tag; + $tag->setId($this->petId); // use the same id as pet + $tag->setName("test php tag"); + // new category + $category = new Model\Category; + $category->setId($this->petId); // use the same id as pet + $category->setName("test php category"); + + $pet->setTags(array($tag)); + $pet->setCategory($category); + + $pet_api = new Api\PetApi(); + // add a new pet (model) + $add_response = $pet_api->addPet($pet); + } + + public function testAsyncRequest() + { + $promise = $this->api->getPetByIdAsync(10005); + + $promise2 = $this->api->getPetByIdAsync(10005); + + $pet = $promise->wait(); + $pet2 = $promise2->wait(); + $this->assertInstanceOf(Pet::class, $pet); + $this->assertInstanceOf(Pet::class, $pet2); + } + + public function testAsyncRequestWithHttpInfo() + { + $promise = $this->api->getPetByIdAsyncWithHttpInfo($this->petId); + + list($pet, $status, $headers) = $promise->wait(); + $this->assertEquals(200, $status); + $this->assertInternalType('array', $headers); + $this->assertInstanceOf(Pet::class, $pet); + } + + /** + * @expectedException \OpenAPI\Client\ApiException + */ + public function testAsyncThrowingException() + { + $promise = $this->api->getPetByIdAsync(0); + $promise->wait(); + } + + /** + * @doesNotPerformAssertions + */ + public function testAsyncApiExceptionWithoutWaitIsNotThrown() + { + $promise = $this->api->getPetByIdAsync(0); + sleep(1); + } + + /** + * @expectedException \OpenAPI\Client\ApiException + */ + public function testAsyncHttpInfoThrowingException() + { + $promise = $this->api->getPetByIdAsyncWithHttpInfo(0); + $promise->wait(); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php new file mode 100644 index 000000000000..daafb50ede7c --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/AuthTest.php @@ -0,0 +1,63 @@ +setApiKey('api_key', '123qwe'); + + $fakeHttpClient = new FakeHttpClient(); + $api = new PetApi($fakeHttpClient, $authConfig); + $api->getPetById(123); + + $headers = $fakeHttpClient->getLastRequest()->getHeaders(); + + $this->assertArrayHasKey('api_key', $headers); + $this->assertEquals(['123qwe'], $headers['api_key']); + } + + public function testApiToken() + { + $authConfig = new Configuration(); + $authConfig->setAccessToken('asd123'); + + $fakeHttpClient = new FakeHttpClient(); + $api = new PetApi($fakeHttpClient, $authConfig); + $api->addPet(new Pet()); + + $headers = $fakeHttpClient->getLastRequest()->getHeaders(); + + $this->assertArrayHasKey('Authorization', $headers); + $this->assertEquals(['Bearer asd123'], $headers['Authorization']); + } + + public function testBasicAuth() + { + $username = 'user'; + $password = 'password'; + + $authConfig = new Configuration(); + $authConfig->setUsername($username); + $authConfig->setPassword($password); + + $fakeHttpClient = new FakeHttpClient(); + $api = new FakeApi($fakeHttpClient, $authConfig); + $api->testEndpointParameters(123, 100.1, 'ASD_', 'ASD'); + + $headers = $fakeHttpClient->getLastRequest()->getHeaders(); + + $this->assertArrayHasKey('Authorization', $headers); + $encodedCredentials = base64_encode("$username:$password"); + $this->assertEquals(["Basic $encodedCredentials"], $headers['Authorization']); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php new file mode 100644 index 000000000000..3a889cba6dae --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/DateTimeSerializerTest.php @@ -0,0 +1,35 @@ + $dateTime, + ]); + + $data = ObjectSerializer::sanitizeForSerialization($input); + + $this->assertEquals($data->dateTime, '1973-04-30T17:05:00+02:00'); + } + + public function testDateSanitazion() + { + $dateTime = new \DateTime('April 30, 1973 17:05 CEST'); + + $input = new FormatTest([ + 'date' => $dateTime, + ]); + + $data = ObjectSerializer::sanitizeForSerialization($input); + + $this->assertEquals($data->date, '1973-04-30'); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php new file mode 100644 index 000000000000..375b054b4791 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/DebugTest.php @@ -0,0 +1,28 @@ +expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#'); + + $config = new Configuration(); + $config->setDebug(true); + $api = new Api\PetApi(null, $config); + $api->getPetById(1); + } + + public function testEnableDebugOutputAsync() + { + $this->expectOutputRegex('#GET /v2/pet/1 HTTP/1.1#'); + + $config = new Configuration(); + $config->setDebug(true); + $api = new Api\PetApi(null, $config); + $promise = $api->getPetByIdAsync(1); + $promise->wait(); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php new file mode 100644 index 000000000000..fbc089c7f187 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/EnumClassTest.php @@ -0,0 +1,16 @@ +assertSame(EnumClass::ABC, '_abc'); + $this->assertSame(EnumClass::EFG, '-efg'); + $this->assertSame(EnumClass::XYZ, '(xyz)'); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php new file mode 100644 index 000000000000..24fdbeabb7e5 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/EnumTestTest.php @@ -0,0 +1,59 @@ +assertSame(EnumTest::ENUM_STRING_UPPER, "UPPER"); + $this->assertSame(EnumTest::ENUM_STRING_LOWER, "lower"); + $this->assertSame(EnumTest::ENUM_INTEGER_1, 1); + $this->assertSame(EnumTest::ENUM_INTEGER_MINUS_1, -1); + $this->assertSame(EnumTest::ENUM_NUMBER_1_DOT_1, 1.1); + $this->assertSame(EnumTest::ENUM_NUMBER_MINUS_1_DOT_2, -1.2); + } + + public function testStrictValidation() + { + $enum = new EnumTest([ + 'enum_string' => 0, + ]); + + $this->assertFalse($enum->valid()); + + $expected = [ + "invalid value for 'enum_string', must be one of 'UPPER', 'lower', ''", + "'enum_string_required' can't be null", + ]; + $this->assertSame($expected, $enum->listInvalidProperties()); + } + + /** + * @expectedException \InvalidArgumentException + */ + public function testThrowExceptionWhenInvalidAmbiguousValueHasPassed() + { + $enum = new EnumTest(); + $enum->setEnumString(0); + } + + public function testNonRequiredPropertyIsOptional() + { + $enum = new EnumTest([ + 'enum_string_required' => 'UPPER', + ]); + $this->assertSame([], $enum->listInvalidProperties()); + $this->assertTrue($enum->valid()); + } + + public function testRequiredProperty() + { + $enum = new EnumTest(); + $this->assertSame(["'enum_string_required' can't be null"], $enum->listInvalidProperties()); + $this->assertFalse($enum->valid()); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php new file mode 100644 index 000000000000..ac69620fa2fc --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ExceptionTest.php @@ -0,0 +1,42 @@ +setHost('http://petstore.swagger.io/INVALID_URL'); + + $api = new Api\StoreApi( + new Client(), + $config + ); + $api->getInventory(); + } + + /** + * @expectedException \OpenAPI\Client\ApiException + * @expectedExceptionMessage Could not resolve host + */ + public function testWrongHost() + { + $config = new Configuration(); + $config->setHost('http://wrong_host.zxc'); + + $api = new Api\StoreApi( + new Client(), + $config + ); + $api->getInventory(); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php new file mode 100644 index 000000000000..d93b8f8b0b36 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/FakeHttpClient.php @@ -0,0 +1,69 @@ +request; + } + + /** + * @param null|ResponseInterface $response + */ + public function setResponse(ResponseInterface $response = null) + { + $this->response = $response; + } + + /** + * Send an HTTP request. + * + * @param RequestInterface $request Request to send + * @param array $options Request options to apply to the given + * request and to the transfer. + * + * @return ResponseInterface + * @throws GuzzleException + */ + public function send(RequestInterface $request, array $options = []) + { + $this->request = $request; + return $this->response ?: new Response(200); + } + + public function sendAsync(RequestInterface $request, array $options = []) + { + throw new \RuntimeException('not implemented'); + } + + public function request($method, $uri, array $options = []) + { + throw new \RuntimeException('not implemented'); + } + + public function requestAsync($method, $uri, array $options = []) + { + throw new \RuntimeException('not implemented'); + } + + public function getConfig($option = null) + { + throw new \RuntimeException('not implemented'); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/FormatTestTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/FormatTestTest.php new file mode 100644 index 000000000000..0d96987614c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/FormatTestTest.php @@ -0,0 +1,27 @@ + $the64MultiByteStrings, + // mandatory parameters + 'number' => 500, + 'byte' => base64_encode('test'), + 'date' => new DateTime(), + ]); + + $this->assertEmpty($formatTest->listInvalidProperties()); + + // Pass the strings via setter. + // Throws InvalidArgumentException if it doesn't count the length correctly. + $formatTest->setPassword($the64MultiByteStrings); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php new file mode 100644 index 000000000000..6dd19a675f6a --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/HeaderSelectorTest.php @@ -0,0 +1,58 @@ +selectHeaders([ + 'application/xml', + 'application/json' + ], []); + $this->assertSame('application/json', $headers['Accept']); + + $headers = $selector->selectHeaders([], []); + $this->assertArrayNotHasKey('Accept', $headers); + + $header = $selector->selectHeaders([ + 'application/yaml', + 'application/xml' + ], []); + $this->assertSame('application/yaml,application/xml', $header['Accept']); + + // test selectHeaderContentType + $headers = $selector->selectHeaders([], [ + 'application/xml', + 'application/json' + ]); + $this->assertSame('application/json', $headers['Content-Type']); + + $headers = $selector->selectHeaders([], []); + $this->assertSame('application/json', $headers['Content-Type']); + $headers = $selector->selectHeaders([], [ + 'application/yaml', + 'application/xml' + ]); + $this->assertSame('application/yaml,application/xml', $headers['Content-Type']); + } + + public function testSelectingHeadersForMultipartBody() + { + // test selectHeaderAccept + $selector = new HeaderSelector(); + $headers = $selector->selectHeadersForMultipart([ + 'application/xml', + 'application/json' + ]); + $this->assertSame('application/json', $headers['Accept']); + $this->assertArrayNotHasKey('Content-Type', $headers); + + $headers = $selector->selectHeadersForMultipart([]); + $this->assertArrayNotHasKey('Accept', $headers); + $this->assertArrayNotHasKey('Content-Type', $headers); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php new file mode 100644 index 000000000000..4054876ee0e1 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/HeadersTest.php @@ -0,0 +1,33 @@ +fakeHttpClient = new FakeHttpClient(); + } + + public function testUserAgent() + { + $config = new Configuration(); + $config->setUserAgent('value'); + $api = new Api\PetApi($this->fakeHttpClient, $config); + + $api->getPetById(3); + + $request = $this->fakeHttpClient->getLastRequest(); + $headers = $request->getHeaders(); + + $this->assertArrayHasKey('User-Agent', $headers); + $this->assertEquals(['value'], $headers['User-Agent']); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php new file mode 100644 index 000000000000..333b88bbedaa --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ModelInheritanceTest.php @@ -0,0 +1,96 @@ +assertSame('red', $dog->getColor()); + $this->assertSame('red', $animal->getColor()); + } + + /** + * test inheritance in the model + */ + public function testInheritance() + { + $newDog = new Dog; + // the object should be an instance of the derived class + $this->assertInstanceOf(Dog::class, $newDog); + // the object should also be an instance of the parent class + $this->assertInstanceOf(Animal::class, $newDog); + } + + /** + * test inheritance constructor is working with data initialization + */ + public function testInheritanceConstructorDataInitialization() + { + // initialize the object with data in the constructor + $data = [ + 'class_name' => 'Dog', + 'breed' => 'Great Dane', + ]; + $newDog = new Dog($data); + + // the property on the derived class should be set + $this->assertSame('Great Dane', $newDog->getBreed()); + // the property on the parent class should be set + $this->assertSame('Dog', $newDog->getClassName()); + } + + /** + * test if discriminator is initialized automatically + */ + public function testDiscriminatorInitialization() + { + $newDog = new Dog(); + $this->assertSame('Dog', $newDog->getClassName()); + } + + /** + * test if ArrayAccess interface works + */ + public function testArrayStuff() + { + // create an array of Animal + $farm = array(); + + // add some animals to the farm to make sure the ArrayAccess interface works + $farm[] = new Dog(); + $farm[] = new Cat(); + $farm[] = new Animal(); + + // assert we can look up the animals in the farm by array indices (let's try a random order) + $this->assertInstanceOf(Cat::class, $farm[1]); + $this->assertInstanceOf(Dog::class, $farm[0]); + $this->assertInstanceOf(Animal::class, $farm[2]); + + // let's try to `foreach` the animals in the farm and let's try to use the objects we loop through + foreach ($farm as $animal) { + $this->assertContains($animal->getClassName(), ['Dog', 'Cat', 'Animal']); + $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $animal); + } + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php new file mode 100644 index 000000000000..818568873aa1 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ObjectSerializerTest.php @@ -0,0 +1,27 @@ +assertSame("sun.gif", $s->sanitizeFilename("sun.gif")); + $this->assertSame("sun.gif", $s->sanitizeFilename("../sun.gif")); + $this->assertSame("sun.gif", $s->sanitizeFilename("/var/tmp/sun.gif")); + $this->assertSame("sun.gif", $s->sanitizeFilename("./sun.gif")); + + $this->assertSame("sun", $s->sanitizeFilename("sun")); + $this->assertSame("sun.gif", $s->sanitizeFilename("..\sun.gif")); + $this->assertSame("sun.gif", $s->sanitizeFilename("\var\tmp\sun.gif")); + $this->assertSame("sun.gif", $s->sanitizeFilename("c:\var\tmp\sun.gif")); + $this->assertSame("sun.gif", $s->sanitizeFilename(".\sun.gif")); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php new file mode 100644 index 000000000000..60c1fc6f47ed --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/OrderApiTest.php @@ -0,0 +1,135 @@ +assertSame(Model\Order::STATUS_PLACED, "placed"); + $this->assertSame(Model\Order::STATUS_APPROVED, "approved"); + } + + // test get inventory + public function testOrder() + { + // initialize the API client + $order = new Model\Order(); + + $order->setStatus("placed"); + $this->assertSame("placed", $order->getStatus()); + } + + /** + * @expectedException InvalidArgumentException + */ + public function testOrderException() + { + // initialize the API client + $order = new Model\Order(); + $order->setStatus("invalid_value"); + } + + // test deseralization of order + public function testDeserializationOfOrder() + { + $order_json = <<assertInstanceOf('OpenAPI\Client\Model\Order', $order); + $this->assertSame(10, $order->getId()); + $this->assertSame(20, $order->getPetId()); + $this->assertSame(30, $order->getQuantity()); + $this->assertTrue(new \DateTime("2015-08-22T07:13:36.613Z") == $order->getShipDate()); + $this->assertSame("placed", $order->getStatus()); + $this->assertSame(false, $order->getComplete()); + } + + // test deseralization of array of array of order + public function testDeserializationOfArrayOfArrayOfOrder() + { + $order_json = <<assertArrayHasKey(0, $order); + $this->assertArrayHasKey(0, $order[0]); + $_order = $order[0][0]; + $this->assertInstanceOf('OpenAPI\Client\Model\Order', $_order); + $this->assertSame(10, $_order->getId()); + $this->assertSame(20, $_order->getPetId()); + $this->assertSame(30, $_order->getQuantity()); + $this->assertTrue(new \DateTime("2015-08-22T07:13:36.613Z") == $_order->getShipDate()); + $this->assertSame("placed", $_order->getStatus()); + $this->assertSame(false, $_order->getComplete()); + } + + // test deseralization of map of map of order + public function testDeserializationOfMapOfMapOfOrder() + { + $order_json = <<assertArrayHasKey('test', $order); + $this->assertArrayHasKey('test2', $order['test']); + $_order = $order['test']['test2']; + $this->assertInstanceOf('OpenAPI\Client\Model\Order', $_order); + $this->assertSame(10, $_order->getId()); + $this->assertSame(20, $_order->getPetId()); + $this->assertSame(30, $_order->getQuantity()); + $this->assertTrue(new \DateTime("2015-08-22T07:13:36.613Z") == $_order->getShipDate()); + $this->assertSame("placed", $_order->getStatus()); + $this->assertSame(false, $_order->getComplete()); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php new file mode 100644 index 000000000000..71a28e466ce9 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/OuterEnumTest.php @@ -0,0 +1,99 @@ +assertInternalType('string', $result); + $this->assertEquals('placed', $result); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Invalid value for enum + */ + public function testDeserializeInvalidValue() + { + ObjectSerializer::deserialize( + "lkjfalgkdfjg", + OuterEnum::class + ); + } + + public function testDeserializeNested() + { + $json = '{ + "enum_string": "UPPER", + "enum_integer": -1, + "enum_number": -1.2, + "outerEnum": "approved" + }'; + + /** * @var EnumTest $result */ + $result = ObjectSerializer::deserialize( + json_decode($json), + EnumTest::class + ); + + $this->assertInstanceOf(EnumTest::class, $result); + $this->assertEquals('approved', $result->getOuterEnum()); + } + + public function testSanitize() + { + $json = "placed"; + + $result = ObjectSerializer::sanitizeForSerialization( + $json + ); + + $this->assertInternalType('string', $result); + } + + public function testSanitizeNested() + { + $input = new EnumTest([ + 'enum_string' => 'UPPER', + 'enum_integer' => -1, + 'enum_number' => -1.2, + 'outer_enum' => 'approved' + ]); + + $result = ObjectSerializer::sanitizeForSerialization( + $input + ); + + $this->assertInternalType('object', $result); + $this->assertInstanceOf(\stdClass::class, $result); + + $this->assertInternalType('string', $result->outerEnum); + $this->assertEquals('approved', $result->outerEnum); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Invalid value for enum + */ + public function testSanitizeNestedInvalidValue() + { + $input = new EnumTest([ + 'enum_string' => 'UPPER', + 'enum_integer' => -1, + 'enum_number' => -1.2, + 'outer_enum' => 'invalid_value' + ]); + + ObjectSerializer::sanitizeForSerialization($input); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php new file mode 100644 index 000000000000..c70a5c60e471 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ParametersTest.php @@ -0,0 +1,66 @@ +fakeHttpClient = new FakeHttpClient(); + $this->fakeApi = new Api\FakeApi($this->fakeHttpClient); + $this->userApi = new Api\UserApi($this->fakeHttpClient); + } + + public function testHeaderParam() + { + $this->fakeApi->testEnumParameters([], 'something'); + + $request = $this->fakeHttpClient->getLastRequest(); + $headers = $request->getHeaders(); + + $this->assertArrayHasKey('enum_header_string', $headers); + $this->assertEquals(['something'], $headers['enum_header_string']); + } + + public function testHeaderParamCollection() + { + $this->fakeApi->testEnumParameters(['string1', 'string2']); + + $request = $this->fakeHttpClient->getLastRequest(); + $headers = $request->getHeaders(); + + $this->assertArrayHasKey('enum_header_string_array', $headers); + $this->assertEquals(['string1,string2'], $headers['enum_header_string_array']); + } + + public function testInlineAdditionalProperties() + { + $param = new \stdClass(); + $param->foo = 'bar'; + $this->fakeApi->testInlineAdditionalProperties($param); + + $request = $this->fakeHttpClient->getLastRequest(); + $this->assertSame('{"foo":"bar"}', $request->getBody()->getContents()); + } + +// missing example for collection path param in config +// public function testPathParamCollection() +// { +// $this->userApi->getUserByNameWithHttpInfo(['aa', 'bb']); +// $request = $this->fakeHttpClient->getLastRequest(); +// $this->assertEquals('user/aa,bb', urldecode($request->getUri()->getPath())); +// } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php new file mode 100644 index 000000000000..9e7f1c54b3a9 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/PetApiTest.php @@ -0,0 +1,391 @@ +setId($newPetId); + $newPet->setName("PHP Unit Test"); + $newPet->setPhotoUrls(["http://test_php_unit_test.com"]); + // new tag + $tag = new Model\Tag; + $tag->setId($newPetId); // use the same id as pet + $tag->setName("test php tag"); + // new category + $category = new Model\Category; + $category->setId($newPetId); // use the same id as pet + $category->setName("test php category"); + + $newPet->setTags(array($tag)); + $newPet->setCategory($category); + + $config = new Configuration(); + $petApi = new Api\PetApi(null, $config); + + // add a new pet (model) + list(, $status) = $petApi->addPetWithHttpInfo($newPet); + Assert::assertEquals(200, $status); + } + + public function setUp() + { + $this->api = new Api\PetApi(); + } + + public function testGetPetById() + { + $petId = 10005; + + $pet = $this->api->getPetById($petId); + $this->assertSame($pet->getId(), $petId); + $this->assertSame($pet->getName(), 'PHP Unit Test'); + $this->assertSame($pet->getPhotoUrls()[0], 'http://test_php_unit_test.com'); + $this->assertSame($pet->getCategory()->getId(), $petId); + $this->assertSame($pet->getCategory()->getName(), 'test php category'); + $this->assertSame($pet->getTags()[0]->getId(), $petId); + $this->assertSame($pet->getTags()[0]->getName(), 'test php tag'); + } + + /** + * comment out as we've removed invalid endpoints from the spec, we'll introduce something + * similar in the future when we've time to update the petstore server + * + * // test getPetById with a Pet object (id 10005) + * public function testGetPetByIdInObject() + * { + * // initialize the API client without host + * $pet_id = 10005; // ID of pet that needs to be fetched + * $pet_api = new Api\PetApi(); + * $pet_api->getApiClient()->getConfig()->setApiKey('api_key', '111222333444555'); + * // return Pet (inline model) + * $response = $pet_api->getPetByIdInObject($pet_id); + * $this->assertInstanceOf('OpenAPI\Client\Model\InlineResponse200', $response); + * $this->assertSame($response->getId(), $pet_id); + * $this->assertSame($response->getName(), 'PHP Unit Test'); + * $this->assertSame($response->getPhotoUrls()[0], 'http://test_php_unit_test.com'); + * + * // category is type "object" + * $this->assertInternalType('array', $response->getCategory()); + * $this->assertSame($response->getCategory()['id'], $pet_id); + * $this->assertSame($response->getCategory()['name'], 'test php category'); + * + * $this->assertSame($response->getTags()[0]->getId(), $pet_id); + * $this->assertSame($response->getTags()[0]->getName(), 'test php tag'); + * } + */ + + // test getPetByIdWithHttpInfo with a Pet object (id 10005) + public function testGetPetByIdWithHttpInfo() + { + // initialize the API client without host + $petId = 10005; // ID of pet that needs to be fetched + + /** @var $pet Pet */ + list($pet, $status_code, $response_headers) = $this->api->getPetByIdWithHttpInfo($petId); + $this->assertSame($pet->getId(), $petId); + $this->assertSame($pet->getName(), 'PHP Unit Test'); + $this->assertSame($pet->getCategory()->getId(), $petId); + $this->assertSame($pet->getCategory()->getName(), 'test php category'); + $this->assertSame($pet->getTags()[0]->getId(), $petId); + $this->assertSame($pet->getTags()[0]->getName(), 'test php tag'); + $this->assertSame($status_code, 200); + $this->assertSame($response_headers['Content-Type'], ['application/json']); + } + + public function testFindPetByStatus() + { + $response = $this->api->findPetsByStatus('available'); + $this->assertGreaterThan(0, count($response)); // at least one object returned + + $this->assertSame(get_class($response[0]), Pet::class); // verify the object is Pet + foreach ($response as $pet) { + $this->assertSame($pet['status'], 'available'); + } + + $response = $this->api->findPetsByStatus('unknown_and_incorrect_status'); + $this->assertCount(0, $response); + } + + public function testUpdatePet() + { + $petId = 10001; + $updatedPet = new Model\Pet; + $updatedPet->setId($petId); + $updatedPet->setName('updatePet'); + $updatedPet->setStatus('pending'); + $result = $this->api->updatePet($updatedPet); + $this->assertNull($result); + + // verify updated Pet + $result = $this->api->getPetById($petId); + $this->assertSame($result->getId(), $petId); + $this->assertSame($result->getStatus(), 'pending'); + $this->assertSame($result->getName(), 'updatePet'); + } + + // test updatePetWithFormWithHttpInfo and verify by the "name" of the response + public function testUpdatePetWithFormWithHttpInfo() + { + $petId = 10001; // ID of pet that needs to be fetched + + // update Pet (form) + list($update_response, $status_code, $http_headers) = $this->api->updatePetWithFormWithHttpInfo( + $petId, + 'update pet with form with http info' + ); + // return nothing (void) + $this->assertNull($update_response); + $this->assertSame($status_code, 200); + $this->assertSame($http_headers['Content-Type'], ['application/json']); + $response = $this->api->getPetById($petId); + $this->assertSame($response->getId(), $petId); + $this->assertSame($response->getName(), 'update pet with form with http info'); + } + + // test updatePetWithForm and verify by the "name" and "status" of the response + public function testUpdatePetWithForm() + { + $pet_id = 10001; // ID of pet that needs to be fetched + $result = $this->api->updatePetWithForm($pet_id, 'update pet with form', 'sold'); + // return nothing (void) + $this->assertNull($result); + + $response = $this->api->getPetById($pet_id); + $this->assertSame($response->getId(), $pet_id); + $this->assertSame($response->getName(), 'update pet with form'); + $this->assertSame($response->getStatus(), 'sold'); + } + + // test addPet and verify by the "id" and "name" of the response + public function testAddPet() + { + $new_pet_id = 10005; + $newPet = new Model\Pet; + $newPet->setId($new_pet_id); + $newPet->setName("PHP Unit Test 2"); + + // add a new pet (model) + $add_response = $this->api->addPet($newPet); + // return nothing (void) + $this->assertNull($add_response); + + // verify added Pet + $response = $this->api->getPetById($new_pet_id); + $this->assertSame($response->getId(), $new_pet_id); + $this->assertSame($response->getName(), 'PHP Unit Test 2'); + } + + /* + * comment out as we've removed invalid endpoints from the spec, we'll introduce something + * similar in the future when we've time to update the petstore server + * + // test addPetUsingByteArray and verify by the "id" and "name" of the response + public function testAddPetUsingByteArray() + { + // initialize the API client + $config = (new Configuration())->setHost('http://petstore.swagger.io/v2'); + $api_client = new ApiClient($config); + + $new_pet_id = 10005; + $new_pet = new Model\Pet; + $new_pet->setId($new_pet_id); + $new_pet->setName("PHP Unit Test 3"); + // new tag + $tag= new Model\Tag; + $tag->setId($new_pet_id); // use the same id as pet + $tag->setName("test php tag"); + // new category + $category = new Model\Category; + $category->setId($new_pet_id); // use the same id as pet + $category->setName("test php category"); + + $new_pet->setTags(array($tag)); + $new_pet->setCategory($category); + + $pet_api = new Api\PetApi($api_client); + // add a new pet (model) + $object_serializer = new ObjectSerializer(); + $pet_json_string = json_encode($object_serializer->sanitizeForSerialization($new_pet)); + $add_response = $pet_api->addPetUsingByteArray($pet_json_string); + // return nothing (void) + $this->assertSame($add_response, NULL); + // verify added Pet + $response = $pet_api->getPetById($new_pet_id); + $this->assertSame($response->getId(), $new_pet_id); + $this->assertSame($response->getName(), 'PHP Unit Test 3'); + } + */ + + // test upload file + public function testUploadFile() + { + // upload file + $pet_id = 10001; + $response = $this->api->uploadFile($pet_id, 'test meta', __DIR__ . '/../composer.json'); + // return ApiResponse + $this->assertInstanceOf(ApiResponse::class, $response); + } + + /* + * comment out as we've removed invalid endpoints from the spec, we'll introduce something + * similar in the future when we've time to update the petstore server + * + // test byte array response + public function testGetPetByIdWithByteArray() + { + // initialize the API client + $config = new Configuration(); + $config->setHost('http://petstore.swagger.io/v2'); + $api_client = new APIClient($config); + $pet_api = new Api\PetApi($api_client); + // test getPetByIdWithByteArray + $pet_id = 10005; + $bytes = $pet_api->petPetIdtestingByteArraytrueGet($pet_id); + $json = json_decode($bytes, true); + + $this->assertInternalType("string", $bytes); + + $this->assertSame($json['id'], $pet_id); + // not testing name as it's tested by addPetUsingByteArray + //$this->assertSame($json['name'], 'PHP Unit Test'); + $this->assertSame($json['category']['id'], $pet_id); + $this->assertSame($json['category']['name'], 'test php category'); + $this->assertSame($json['tags'][0]['id'], $pet_id); + $this->assertSame($json['tags'][0]['name'], 'test php tag'); + } + */ + + // test empty object serialization + public function testEmptyPetSerialization() + { + $new_pet = new Model\Pet; + // the empty object should be serialised to {} + $this->assertSame("{}", "$new_pet"); + } + + // test inheritance in the model + public function testInheritance() + { + $new_dog = new Model\Dog; + // the object should be an instance of the derived class + $this->assertInstanceOf('OpenAPI\Client\Model\Dog', $new_dog); + // the object should also be an instance of the parent class + $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $new_dog); + } + + // test inheritance constructor is working with data + // initialization + public function testInheritanceConstructorDataInitialization() + { + // initialize the object with data in the constructor + $data = array( + 'class_name' => 'Dog', + 'breed' => 'Great Dane' + ); + $new_dog = new Model\Dog($data); + + // the property on the derived class should be set + $this->assertSame('Great Dane', $new_dog->getBreed()); + // the property on the parent class should be set + $this->assertSame('Dog', $new_dog->getClassName()); + } + + // test if discriminator is initialized automatically + public function testDiscriminatorInitialization() + { + $new_dog = new Model\Dog(); + $this->assertSame('Dog', $new_dog->getClassName()); + } + + // test if ArrayAccess interface works + public function testArrayStuff() + { + // create an array of Animal + $farm = array(); + + // add some animals to the farm to make sure the ArrayAccess + // interface works + $farm[] = new Model\Dog(); + $farm[] = new Model\Cat(); + $farm[] = new Model\Animal(); + + // assert we can look up the animals in the farm by array + // indices (let's try a random order) + $this->assertInstanceOf('OpenAPI\Client\Model\Cat', $farm[1]); + $this->assertInstanceOf('OpenAPI\Client\Model\Dog', $farm[0]); + $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $farm[2]); + + // let's try to `foreach` the animals in the farm and let's + // try to use the objects we loop through + foreach ($farm as $animal) { + $this->assertContains($animal->getClassName(), array('Dog', 'Cat', 'Animal')); + $this->assertInstanceOf('OpenAPI\Client\Model\Animal', $animal); + } + } + + // test if default values works + public function testDefaultValues() + { + // add some animals to the farm to make sure the ArrayAccess + // interface works + $dog = new Model\Dog(); + $animal = new Model\Animal(); + + // assert we can look up the animals in the farm by array + // indices (let's try a random order) + $this->assertSame('red', $dog->getColor()); + $this->assertSame('red', $animal->getColor()); + } + + /** + * test invalid argument + * + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage Missing the required parameter $status when calling findPetsByStatus + */ + public function testInvalidArgument() + { + // the argument is required, and we must specify one or some from 'available', 'pending', 'sold' + $this->api->findPetsByStatus([]); + } + +// Disabled as currently we don't have any endpoint that would return file +// For testing I just replaced url and return type in Api method. +// public function testDownloadingLargeFile() +// { +// $petId = 10005; +// $config = new Configuration(); +// $config->setHost('https://getcomposer.org'); +// $api = new PetApi(new Client(), $config); +// $result = $api->getPetById($petId); +// $this->assertInstanceOf(\SplFileObject::class, $result); +// var_dump([ +// 'peak mem (MiB)' => memory_get_peak_usage(true)/1024/1024, +// 'file size (MiB)' => $result->getSize()/1024/1024, +// 'path' => sys_get_temp_dir() . '/' . $result->getFilename() +// ]); +// } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/PetTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/PetTest.php new file mode 100644 index 000000000000..c3c4ee8950e3 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/PetTest.php @@ -0,0 +1,19 @@ +assertSame("{}", "$new_pet"); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php new file mode 100644 index 000000000000..3bec91563618 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/RequestTest.php @@ -0,0 +1,37 @@ +fakeClient = new FakeHttpClient(); + $this->api = new Api\FakeApi($this->fakeClient); + } + + public function testFormDataEncodingToJson() + { + $this->api->testJsonFormData('value', 'value2'); + + $request = $this->fakeClient->getLastRequest(); + $contentType = $request->getHeader('Content-Type'); + $this->assertEquals(['application/x-www-form-urlencoded'], $contentType); + + $requestContent = $request->getBody()->getContents(); + + // JSON serialization of form data is not supported + $this->assertEquals('param=value¶m2=value2', $requestContent); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php new file mode 100644 index 000000000000..499007fa03e0 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/ResponseTypesTest.php @@ -0,0 +1,96 @@ +fakeHttpClient = new FakeHttpClient(); + $this->api = new PetApi($this->fakeHttpClient); + } + + public function testDefined200ReturnType() + { + $this->fakeHttpClient->setResponse(new Response(200, [], json_encode([]))); + $result = $this->api->getPetById(123); + + $this->assertInstanceOf(Pet::class, $result); + } + + public function testDefault2xxReturnType() + { + $this->fakeHttpClient->setResponse(new Response(255, [], json_encode([]))); + $result = $this->api->getPetById(123); + + $this->assertInstanceOf(Pet::class, $result); + } + + /** + * @expectedException \OpenAPI\Client\ApiException + * @expectedExceptionCode 400 + */ + public function testDefinedErrorException() + { + $statusCode = 400; + + $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); + $this->api->getPetById(123); + } + +// missing case in spec: +// responses: +// '400': +// description: failure +// schema: +// $ref: '#/definitions/Error' +// public function testDefinedErrorResponseObject() +// { +// $result = null; +// try { +// $this->fakeHttpClient->setResponse(new Response(400, [], '{}')); +// $this->api->getPetById(123); +// } catch (ApiException $e) { +// $result = $e->getResponseObject(); +// } +// +// $this->assertInstanceOf(Error::class, $result); +// } + + /** + * @expectedException \OpenAPI\Client\ApiException + * @expectedExceptionCode 404 + */ + public function testDefaultErrorException() + { + $statusCode = 404; + + $this->fakeHttpClient->setResponse(new Response($statusCode, [], '{}')); + $this->api->getPetById(123); + } + + public function testDefaultErrorResponseObject() + { + $result = null; + try { + $this->fakeHttpClient->setResponse(new Response(404, [], '{}')); + $this->api->getPetById(123); + } catch (ApiException $e) { + $result = $e->getResponseObject(); + } + + $this->assertNull($result); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php new file mode 100644 index 000000000000..f18f3ce66cae --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/StoreApiTest.php @@ -0,0 +1,57 @@ +api = new StoreApi(); + } + + /** + * Setup before running each test case + */ + public static function setUpBeforeClass() + { + // add a new pet (id 10005) to ensure the pet object is available for all the tests + // new pet + $id = 10005; + $pet = new Pet(); + $pet->setId($id); + $pet->setName('PHP Unit Test'); + $pet->setStatus('available'); + // new tag + $tag = new Tag(); + $tag->setId($id); // use the same id as pet + $tag->setName('test php tag'); + // new category + $category = new Category(); + $category->setId($id); // use the same id as pet + $category->setName('test php category'); + + $pet->setTags([$tag]); + $pet->setCategory($category); + + $api = new PetApi(); + $api->addPet($pet); + } + + public function testGetInventory() + { + $result = $this->api->getInventory(); + + $this->assertInternalType('array', $result); + $this->assertInternalType('int', $result['available']); + } +} diff --git a/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php new file mode 100644 index 000000000000..41d4f2b3e6d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/php/OpenAPIClient-php/tests/UserApiTest.php @@ -0,0 +1,33 @@ +api = new Api\UserApi(); + } + + // test login use + public function testLoginUser() + { + // initialize the API client + // login + $response = $this->api->loginUser('xxxxx', 'yyyyyyyy'); + + $this->assertInternalType('string', $response); + $this->assertRegExp( + '/^logged in user session/', + $response, + "response string starts with 'logged in user session'" + ); + } +} diff --git a/CI/samples.ci/client/petstore/python-asyncio/Makefile b/CI/samples.ci/client/petstore/python-asyncio/Makefile new file mode 100644 index 000000000000..8d0afd4974d6 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-asyncio/Makefile @@ -0,0 +1,18 @@ + #!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test-all: clean + bash ./test_python3.sh diff --git a/CI/samples.ci/client/petstore/python-asyncio/dev-requirements.txt b/CI/samples.ci/client/petstore/python-asyncio/dev-requirements.txt new file mode 100644 index 000000000000..49182426e202 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-asyncio/dev-requirements.txt @@ -0,0 +1,4 @@ +tox +coverage +randomize +flake8 diff --git a/CI/samples.ci/client/petstore/python-asyncio/pom.xml b/CI/samples.ci/client/petstore/python-asyncio/pom.xml new file mode 100644 index 000000000000..6907f8a2a3e8 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-asyncio/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonAsyncioClientTests + pom + 1.0-SNAPSHOT + Python Asyncio Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + pytest-test + integration-test + + exec + + + make + + test-all + + + + + + + + diff --git a/CI/samples.ci/client/petstore/python-asyncio/test_python3.sh b/CI/samples.ci/client/petstore/python-asyncio/test_python3.sh new file mode 100755 index 000000000000..9160e25714ad --- /dev/null +++ b/CI/samples.ci/client/petstore/python-asyncio/test_python3.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy --python python3.6 + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +python setup.py develop + +### run tests +tox || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/CI/samples.ci/client/petstore/python-asyncio/testfiles/foo.png b/CI/samples.ci/client/petstore/python-asyncio/testfiles/foo.png new file mode 100644 index 000000000000..a9b12cf5927a Binary files /dev/null and b/CI/samples.ci/client/petstore/python-asyncio/testfiles/foo.png differ diff --git a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/__init__.py b/CI/samples.ci/client/petstore/python-asyncio/tests/__init__.py similarity index 100% rename from samples/openapi3/server/petstore/python-flask-python2/openapi_server/__init__.py rename to CI/samples.ci/client/petstore/python-asyncio/tests/__init__.py diff --git a/CI/samples.ci/client/petstore/python-asyncio/tests/test_pet_api.py b/CI/samples.ci/client/petstore/python-asyncio/tests/test_pet_api.py new file mode 100644 index 000000000000..32a336a4ac7d --- /dev/null +++ b/CI/samples.ci/client/petstore/python-asyncio/tests/test_pet_api.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pytest -vv +""" + +import os +import unittest +import asyncio +import pytest + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ApiException + +from .util import id_gen + +import json + +import urllib3 + +HOST = 'http://localhost:80/v2' + + +def async_test(f): + def wrapper(*args, **kwargs): + coro = asyncio.coroutine(f) + future = coro(*args, **kwargs) + loop = asyncio.get_event_loop() + loop.run_until_complete(future) + return wrapper + + +class TestPetApiTests(unittest.TestCase): + + def setUp(self): + config = Configuration() + config.host = HOST + + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + self.setUpFiles() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "openapi-generator-python-pet-tag" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + self.foo = os.path.join(self.test_file_dir, "foo.png") + + def test_separate_default_client_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client, pet_api2.api_client) + + pet_api.api_client.user_agent = 'api client 3' + pet_api2.api_client.user_agent = 'api client 4' + + self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) + + def test_separate_default_config_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) + + pet_api.api_client.configuration.host = 'somehost' + pet_api2.api_client.configuration.host = 'someotherhost' + self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) + + @async_test + async def test_async_with_result(self): + await self.pet_api.add_pet(self.pet) + + calls = [self.pet_api.get_pet_by_id(self.pet.id), + self.pet_api.get_pet_by_id(self.pet.id)] + + responses, _ = await asyncio.wait(calls) + for response in responses: + self.assertEqual(response.result().id, self.pet.id) + self.assertEqual(len(responses), 2) + + @async_test + async def test_exception(self): + await self.pet_api.add_pet(self.pet) + + try: + await self.pet_api.get_pet_by_id("-9999999999999") + except ApiException as e: + exception = e + + self.assertIsInstance(exception, ApiException) + self.assertEqual(exception.status, 404) + + @async_test + async def test_add_pet_and_get_pet_by_id(self): + await self.pet_api.add_pet(self.pet) + + fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertIsNotNone(fetched.category) + self.assertEqual(self.pet.category.name, fetched.category.name) + + @async_test + async def test_add_pet_and_get_pet_by_id_with_http_info(self): + await self.pet_api.add_pet(self.pet) + + fetched = await self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched[0].id) + self.assertIsNotNone(fetched[0].category) + self.assertEqual(self.pet.category.name, fetched[0].category.name) + + @async_test + async def test_update_pet(self): + self.pet.name = "hello kity with updated" + await self.pet_api.update_pet(self.pet) + + fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(self.pet.name, fetched.name) + self.assertIsNotNone(fetched.category) + self.assertEqual(fetched.category.name, self.pet.category.name) + + @async_test + async def test_find_pets_by_status(self): + await self.pet_api.add_pet(self.pet) + pets = await self.pet_api.find_pets_by_status(status=[self.pet.status]) + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), pets)) + ) + + @async_test + async def test_find_pets_by_tags(self): + await self.pet_api.add_pet(self.pet) + pets = await self.pet_api.find_pets_by_tags(tags=[self.tag.name]) + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), pets)) + ) + + @async_test + async def test_update_pet_with_form(self): + await self.pet_api.add_pet(self.pet) + + name = "hello kity with form updated" + status = "pending" + await self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) + + fetched = await self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(name, fetched.name) + self.assertEqual(status, fetched.status) + + @async_test + async def test_upload_file(self): + # upload file with form parameter + try: + additional_metadata = "special" + await self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata=additional_metadata, + file=self.foo + ) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + # upload only file + try: + await self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + @async_test + async def test_delete_pet(self): + await self.pet_api.add_pet(self.pet) + await self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") + + try: + await self.pet_api.get_pet_by_id(pet_id=self.pet.id) + raise Exception("expected an error") + except ApiException as e: + self.assertEqual(404, e.status) + + +if __name__ == '__main__': + import logging + logging.basicConfig(level=logging.DEBUG) + unittest.main() diff --git a/CI/samples.ci/client/petstore/python-asyncio/tests/util.py b/CI/samples.ci/client/petstore/python-asyncio/tests/util.py new file mode 100644 index 000000000000..39fba1514b33 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-asyncio/tests/util.py @@ -0,0 +1,11 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) + + + diff --git a/CI/samples.ci/client/petstore/python-experimental/Makefile b/CI/samples.ci/client/petstore/python-experimental/Makefile new file mode 100644 index 000000000000..a7ff5e1e2441 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/Makefile @@ -0,0 +1,21 @@ + #!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python2.sh + +test-all: clean + bash ./test_python2_and_3.sh diff --git a/CI/samples.ci/client/petstore/python-experimental/dev-requirements.txt b/CI/samples.ci/client/petstore/python-experimental/dev-requirements.txt new file mode 100644 index 000000000000..f50c13b5c503 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/dev-requirements.txt @@ -0,0 +1,5 @@ +nose +tox +coverage +randomize +flake8 diff --git a/CI/samples.ci/client/petstore/python-experimental/pom.xml b/CI/samples.ci/client/petstore/python-experimental/pom.xml new file mode 100644 index 000000000000..3c9463331861 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonExperimentalPetstoreClientTests + pom + 1.0-SNAPSHOT + Python Experimental OpenAPI Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + nose-test + integration-test + + exec + + + make + + test-all + + + + + + + + diff --git a/CI/samples.ci/client/petstore/python-experimental/setup.cfg b/CI/samples.ci/client/petstore/python-experimental/setup.cfg new file mode 100644 index 000000000000..26b7a359d580 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/setup.cfg @@ -0,0 +1,11 @@ +[nosetests] +logging-clear-handlers=true +verbosity=2 +randomize=true +exe=true +with-coverage=true +cover-package=petstore_api +cover-erase=true + +[flake8] +max-line-length=99 diff --git a/CI/samples.ci/client/petstore/python-experimental/test_python2.sh b/CI/samples.ci/client/petstore/python-experimental/test_python2.sh new file mode 100644 index 000000000000..b68d0bd20a73 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/test_python2.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +python setup.py develop + +### run tests +nosetests || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi + diff --git a/CI/samples.ci/client/petstore/python-experimental/test_python2_and_3.sh b/CI/samples.ci/client/petstore/python-experimental/test_python2_and_3.sh new file mode 100644 index 000000000000..8511d46cd795 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/test_python2_and_3.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +python setup.py develop + +### run tests +tox || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/CI/samples.ci/client/petstore/python-experimental/testfiles/foo.png b/CI/samples.ci/client/petstore/python-experimental/testfiles/foo.png new file mode 100644 index 000000000000..a9b12cf5927a Binary files /dev/null and b/CI/samples.ci/client/petstore/python-experimental/testfiles/foo.png differ diff --git a/samples/openapi3/server/petstore/python-flask-python2/openapi_server/controllers/__init__.py b/CI/samples.ci/client/petstore/python-experimental/tests/__init__.py similarity index 100% rename from samples/openapi3/server/petstore/python-flask-python2/openapi_server/controllers/__init__.py rename to CI/samples.ci/client/petstore/python-experimental/tests/__init__.py diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_api_client.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_api_client.py new file mode 100644 index 000000000000..a41dbaba9c9f --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_api_client.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIetstore-python +$ nosetests -v +""" + +import os +import time +import unittest +from dateutil.parser import parse + +import petstore_api +import petstore_api.configuration + +HOST = 'http://petstore.swagger.io/v2' + + +class ApiClientTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + + def test_configuration(self): + config = petstore_api.Configuration() + config.host = 'http://localhost/' + + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = 'PREFIX' + config.username = 'test_username' + config.password = 'test_password' + + header_params = {'test1': 'value1'} + query_params = {'test2': 'value2'} + auth_settings = ['api_key', 'unknown'] + + client = petstore_api.ApiClient(config) + + # test prefix + self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings) + + # test api key auth + self.assertEqual(header_params['test1'], 'value1') + self.assertEqual(header_params['api_key'], 'PREFIX 123456') + self.assertEqual(query_params['test2'], 'value2') + + # test basic auth + self.assertEqual('test_username', client.configuration.username) + self.assertEqual('test_password', client.configuration.password) + + def test_select_header_accept(self): + accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/json', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/xml', 'application/json'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['text/plain', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'text/plain, application/xml') + + accepts = [] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, None) + + def test_select_header_content_type(self): + content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/json', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/xml', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['text/plain', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'text/plain') + + content_types = [] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + def test_sanitize_for_serialization(self): + # None + data = None + result = self.api_client.sanitize_for_serialization(None) + self.assertEqual(result, data) + + # str + data = "test string" + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # int + data = 1 + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # bool + data = True + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # date + data = parse("1997-07-16").date() # date + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16") + + # datetime + data = parse("1997-07-16T19:20:30.45+01:00") # datetime + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + + # list + data = [1] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # dict + data = {"test key": "test value"} + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # model + pet_dict = {"id": 1, "name": "monkey", + "category": {"id": 1, "name": "test category"}, + "tags": [{"id": 1, "name": "test tag1"}, + {"id": 2, "name": "test tag2"}], + "status": "available", + "photoUrls": ["http://foo.bar.com/3", + "http://foo.bar.com/4"]} + pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) + pet.id = pet_dict["id"] + cate = petstore_api.Category() + cate.id = pet_dict["category"]["id"] + cate.name = pet_dict["category"]["name"] + pet.category = cate + tag1 = petstore_api.Tag() + tag1.id = pet_dict["tags"][0]["id"] + tag1.name = pet_dict["tags"][0]["name"] + tag2 = petstore_api.Tag() + tag2.id = pet_dict["tags"][1]["id"] + tag2.name = pet_dict["tags"][1]["name"] + pet.tags = [tag1, tag2] + pet.status = pet_dict["status"] + + data = pet + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, pet_dict) + + # list of models + list_of_pet_dict = [pet_dict] + data = [pet] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, list_of_pet_dict) diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_api_exception.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_api_exception.py new file mode 100644 index 000000000000..a05c3e902c58 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_api_exception.py @@ -0,0 +1,84 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException + +from .util import id_gen + +class ApiExceptionTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "blank" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def test_404_error(self): + self.pet_api.add_pet(self.pet) + self.pet_api.delete_pet(pet_id=self.pet.id) + + with self.checkRaiseRegex(ApiException, "Pet not found"): + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + + try: + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + except ApiException as e: + self.assertEqual(e.status, 404) + self.assertEqual(e.reason, "Not Found") + self.checkRegex(e.body, "Pet not found") + + def test_500_error(self): + self.pet_api.add_pet(self.pet) + + with self.checkRaiseRegex(ApiException, "Internal Server Error"): + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata="special" + ) + + try: + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata="special" + ) + except ApiException as e: + self.assertEqual(e.status, 500) + self.assertEqual(e.reason, "Internal Server Error") + self.checkRegex(e.body, "Error 500 Internal Server Error") + + def checkRaiseRegex(self, expected_exception, expected_regex): + if sys.version_info < (3, 0): + return self.assertRaisesRegexp(expected_exception, expected_regex) + + return self.assertRaisesRegex(expected_exception, expected_regex) + + def checkRegex(self, text, expected_regex): + if sys.version_info < (3, 0): + return self.assertRegexpMatches(text, expected_regex) + + return self.assertRegex(text, expected_regex) diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_deserialization.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_deserialization.py new file mode 100644 index 000000000000..10c5ecef4239 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_deserialization.py @@ -0,0 +1,288 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIPetstore-python +$ nosetests -v +""" +from collections import namedtuple +import json +import os +import time +import unittest +import datetime + +import petstore_api + + +MockResponse = namedtuple('MockResponse', 'data') + + +class DeserializationTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + self.deserialize = self.api_client.deserialize + + def test_enum_test(self): + """ deserialize dict(str, Enum_Test) """ + data = { + 'enum_test': { + "enum_string": "UPPER", + "enum_string_required": "lower", + "enum_integer": 1, + "enum_number": 1.1, + "outerEnum": "placed" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, EnumTest)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue( + isinstance(deserialized['enum_test'], petstore_api.EnumTest)) + outer_enum_value = ( + petstore_api.OuterEnum.allowed_values[('value',)]["PLACED"]) + outer_enum = petstore_api.OuterEnum(outer_enum_value) + sample_instance = petstore_api.EnumTest( + enum_string="UPPER", + enum_string_required="lower", + enum_integer=1, + enum_number=1.1, + outer_enum=outer_enum + ) + self.assertEqual(deserialized['enum_test'], sample_instance) + + def test_deserialize_dict_str_pet(self): + """ deserialize dict(str, Pet) """ + data = { + 'pet': { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, Pet)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet)) + + def test_deserialize_dict_str_dog(self): + """ deserialize dict(str, Dog), use discriminator""" + data = { + 'dog': { + "id": 0, + "className": "Dog", + "color": "white", + "bread": "Jack Russel Terrier" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, Animal)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog)) + + def test_deserialize_dict_str_int(self): + """ deserialize dict(str, int) """ + data = { + 'integer': 1 + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, int)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['integer'], int)) + + def test_deserialize_str(self): + """ deserialize str """ + data = "test str" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "str") + self.assertTrue(isinstance(deserialized, str)) + + def test_deserialize_date(self): + """ deserialize date """ + data = "1997-07-16" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "date") + self.assertTrue(isinstance(deserialized, datetime.date)) + + def test_deserialize_datetime(self): + """ deserialize datetime """ + data = "1997-07-16T19:20:30.45+01:00" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "datetime") + self.assertTrue(isinstance(deserialized, datetime.datetime)) + + def test_deserialize_pet(self): + """ deserialize pet """ + data = { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "Pet") + self.assertTrue(isinstance(deserialized, petstore_api.Pet)) + self.assertEqual(deserialized.id, 0) + self.assertEqual(deserialized.name, "doggie") + self.assertTrue(isinstance(deserialized.category, petstore_api.Category)) + self.assertEqual(deserialized.category.name, "string") + self.assertTrue(isinstance(deserialized.tags, list)) + self.assertEqual(deserialized.tags[0].name, "string") + + def test_deserialize_list_of_pet(self): + """ deserialize list[Pet] """ + data = [ + { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie0", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + }, + { + "id": 1, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie1", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + }] + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "list[Pet]") + self.assertTrue(isinstance(deserialized, list)) + self.assertTrue(isinstance(deserialized[0], petstore_api.Pet)) + self.assertEqual(deserialized[0].id, 0) + self.assertEqual(deserialized[1].id, 1) + self.assertEqual(deserialized[0].name, "doggie0") + self.assertEqual(deserialized[1].name, "doggie1") + + def test_deserialize_nested_dict(self): + """ deserialize dict(str, dict(str, int)) """ + data = { + "foo": { + "bar": 1 + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "dict(str, dict(str, int))") + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized["foo"], dict)) + self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) + + def test_deserialize_nested_list(self): + """ deserialize list[list[str]] """ + data = [["foo"]] + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "list[list[str]]") + self.assertTrue(isinstance(deserialized, list)) + self.assertTrue(isinstance(deserialized[0], list)) + self.assertTrue(isinstance(deserialized[0][0], str)) + + def test_deserialize_none(self): + """ deserialize None """ + response = MockResponse(data=json.dumps(None)) + + deserialized = self.deserialize(response, "datetime") + self.assertIsNone(deserialized) + + def test_deserialize_OuterEnum(self): + """ deserialize OuterEnum """ + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + self.deserialize( + MockResponse(data=json.dumps("test str")), + "OuterEnum" + ) + + # valid value works + placed_str = ( + petstore_api.OuterEnum.allowed_values[('value',)]["PLACED"] + ) + response = MockResponse(data=json.dumps(placed_str)) + outer_enum = self.deserialize(response, "OuterEnum") + self.assertTrue(isinstance(outer_enum, petstore_api.OuterEnum)) + self.assertTrue(outer_enum.value == placed_str) + + def test_deserialize_OuterNumber(self): + """ deserialize OuterNumber """ + # make sure that an exception is thrown on an invalid type value + with self.assertRaises(petstore_api.ApiValueError): + deserialized = self.deserialize( + MockResponse(data=json.dumps("test str")), + "OuterNumber" + ) + + # make sure that an exception is thrown on an invalid value + with self.assertRaises(petstore_api.ApiValueError): + deserialized = self.deserialize( + MockResponse(data=json.dumps(21)), + "OuterNumber" + ) + + # valid value works + number_val = 11 + response = MockResponse(data=json.dumps(number_val)) + outer_number = self.deserialize(response, "OuterNumber") + self.assertTrue(isinstance(outer_number, petstore_api.OuterNumber)) + self.assertTrue(outer_number.value == number_val) \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_enum_arrays.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_enum_arrays.py new file mode 100644 index 000000000000..2f7e347f9c35 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_enum_arrays.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class EnumArraysTests(unittest.TestCase): + + def test_enumarrays_init(self): + # + # Check various combinations of valid values. + # + fish_or_crab = petstore_api.EnumArrays(just_symbol=">=") + self.assertEqual(fish_or_crab.just_symbol, ">=") + self.assertEqual(fish_or_crab.array_enum, None) + + fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = petstore_api.EnumArrays(just_symbol=">=", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, ">=") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = petstore_api.EnumArrays("$", ["crab"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + + # + # Check if setting invalid values fails + # + try: + fish_or_crab = petstore_api.EnumArrays(just_symbol="<=") + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + try: + fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["dog"]) + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + try: + fish_or_crab = petstore_api.EnumArrays(just_symbol=["$"], array_enum=["dog"]) + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + + def test_enumarrays_setter(self): + + # + # Check various combinations of valid values + # + fish_or_crab = petstore_api.EnumArrays() + + fish_or_crab.just_symbol = ">=" + self.assertEqual(fish_or_crab.just_symbol, ">=") + + fish_or_crab.just_symbol = "$" + self.assertEqual(fish_or_crab.just_symbol, "$") + + fish_or_crab.array_enum = [] + self.assertEqual(fish_or_crab.array_enum, []) + + fish_or_crab.array_enum = ["fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab.array_enum = ["fish", "fish", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) + + fish_or_crab.array_enum = ["crab"] + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + fish_or_crab.array_enum = ["crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) + + fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) + + # + # Check if setting invalid values fails + # + fish_or_crab = petstore_api.EnumArrays() + try: + fish_or_crab.just_symbol = "!=" + except ValueError: + self.assertEqual(fish_or_crab.just_symbol, None) + + try: + fish_or_crab.just_symbol = ["fish"] + except ValueError: + self.assertEqual(fish_or_crab.just_symbol, None) + + try: + fish_or_crab.array_enum = ["cat"] + except ValueError: + self.assertEqual(fish_or_crab.array_enum, None) + + try: + fish_or_crab.array_enum = ["fish", "crab", "dog"] + except ValueError: + self.assertEqual(fish_or_crab.array_enum, None) + + try: + fish_or_crab.array_enum = "fish" + except ValueError: + self.assertEqual(fish_or_crab.array_enum, None) + + + def test_todict(self): + # + # Check if dictionary serialization works + # + dollar_fish_crab_dict = { + 'just_symbol': "$", + 'array_enum': ["fish", "crab"] + } + + dollar_fish_crab = petstore_api.EnumArrays("$", ["fish", "crab"]) + + self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) + + # + # Sanity check for different arrays + # + dollar_crab_fish_dict = { + 'just_symbol': "$", + 'array_enum': ["crab", "fish"] + } + + dollar_fish_crab = petstore_api.EnumArrays("$", ["fish", "crab"]) + + self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) + + + def test_equals(self): + # + # Check if object comparison works + # + fish1 = petstore_api.EnumArrays("$", ["fish"]) + fish2 = petstore_api.EnumArrays("$", ["fish"]) + self.assertEqual(fish1, fish2) + + fish = petstore_api.EnumArrays("$", ["fish"]) + crab = petstore_api.EnumArrays("$", ["crab"]) + self.assertNotEqual(fish, crab) + + dollar = petstore_api.EnumArrays("$") + greater = petstore_api.EnumArrays(">=") + self.assertNotEqual(dollar, greater) \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_map_test.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_map_test.py new file mode 100644 index 000000000000..6031cebf3a2b --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_map_test.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class MapTestTests(unittest.TestCase): + + def test_maptest_init(self): + # + # Test MapTest construction with valid values + # + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test = petstore_api.MapTest(map_of_enum_string=up_or_low_dict) + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + map_of_map_of_strings = { + 'val1': 1, + 'valText': "Text", + 'valueDict': up_or_low_dict + } + map_enum_test = petstore_api.MapTest(map_map_of_string=map_of_map_of_strings) + + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + + # + # Make sure that the init fails for invalid enum values + # + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + try: + map_enum_test = petstore_api.MapTest(map_of_enum_string=black_or_white_dict) + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + def test_maptest_setter(self): + # + # Check with some valid values + # + map_enum_test = petstore_api.MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test.map_of_enum_string = up_or_low_dict + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + # + # Check if the setter fails for invalid enum values + # + map_enum_test = petstore_api.MapTest() + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + try: + map_enum_test.map_of_enum_string = black_or_white_dict + except ValueError: + self.assertEqual(map_enum_test.map_of_enum_string, None) + + def test_todict(self): + # + # Check dictionary serialization + # + map_enum_test = petstore_api.MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_of_map_of_strings = { + 'val1': 1, + 'valText': "Text", + 'valueDict': up_or_low_dict + } + indirect_map = { + 'option1': True + } + direct_map = { + 'option2': False + } + map_enum_test.map_of_enum_string = up_or_low_dict + map_enum_test.map_map_of_string = map_of_map_of_strings + map_enum_test.indirect_map = indirect_map + map_enum_test.direct_map = direct_map + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + self.assertEqual(map_enum_test.indirect_map, indirect_map) + self.assertEqual(map_enum_test.direct_map, direct_map) + + expected_dict = { + 'map_of_enum_string': up_or_low_dict, + 'map_map_of_string': map_of_map_of_strings, + 'indirect_map': indirect_map, + 'direct_map': direct_map + } + + self.assertEqual(map_enum_test.to_dict(), expected_dict) diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_order_model.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_order_model.py new file mode 100644 index 000000000000..31dc6e3661cd --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_order_model.py @@ -0,0 +1,27 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class OrderModelTests(unittest.TestCase): + + def test_status(self): + order = petstore_api.Order() + order.status = "placed" + self.assertEqual("placed", order.status) + + with self.assertRaises(ValueError): + order.status = "invalid" diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_pet_api.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_pet_api.py new file mode 100644 index 000000000000..f536f5ca288e --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_pet_api.py @@ -0,0 +1,276 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import unittest + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ApiException + +from .util import id_gen + +import json + +import urllib3 + +HOST = 'http://localhost/v2' + + +class TimeoutWithEqual(urllib3.Timeout): + def __init__(self, *arg, **kwargs): + super(TimeoutWithEqual, self).__init__(*arg, **kwargs) + + def __eq__(self, other): + return self._read == other._read and self._connect == other._connect and self.total == other.total + + +class MockPoolManager(object): + def __init__(self, tc): + self._tc = tc + self._reqs = [] + + def expect_request(self, *args, **kwargs): + self._reqs.append((args, kwargs)) + + def request(self, *args, **kwargs): + self._tc.assertTrue(len(self._reqs) > 0) + r = self._reqs.pop(0) + self._tc.maxDiff = None + self._tc.assertEqual(r[0], args) + self._tc.assertEqual(r[1], kwargs) + return urllib3.HTTPResponse(status=200, body=b'test') + + +class PetApiTests(unittest.TestCase): + + def setUp(self): + config = Configuration() + config.host = HOST + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + self.setUpFiles() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "python-pet-tag" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + self.foo = os.path.join(self.test_file_dir, "foo.png") + + def test_preload_content_flag(self): + self.pet_api.add_pet(self.pet) + + resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False) + + # return response should at least have read and close methods. + self.assertTrue(hasattr(resp, 'read')) + self.assertTrue(hasattr(resp, 'close')) + + # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it. + self.assertTrue(hasattr(resp, 'release_conn')) + + # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking + # change, however supporting above methods should be enough for most usecases. Remove this test case if + # we followed the breaking change procedure for python client (e.g. increasing major version). + self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse') + + resp.close() + resp.release_conn() + + def test_timeout(self): + mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(total=5)) + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) + + self.pet_api.add_pet(self.pet, _request_timeout=5) + self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + + def test_separate_default_client_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client, pet_api2.api_client) + + pet_api.api_client.user_agent = 'api client 3' + pet_api2.api_client.user_agent = 'api client 4' + + self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) + + def test_separate_default_config_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) + + pet_api.api_client.configuration.host = 'somehost' + pet_api2.api_client.configuration.host = 'someotherhost' + self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) + + def test_async_request(self): + thread = self.pet_api.add_pet(self.pet, async_req=True) + response = thread.get() + self.assertIsNone(response) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + result = thread.get() + self.assertIsInstance(result, petstore_api.Pet) + + def test_async_with_result(self): + self.pet_api.add_pet(self.pet, async_req=False) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + + response = thread.get() + response2 = thread2.get() + + self.assertEquals(response.id, self.pet.id) + self.assertIsNotNone(response2.id, self.pet.id) + + def test_async_with_http_info(self): + self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True, + _return_http_data_only=False) + data, status, headers = thread.get() + + self.assertIsInstance(data, petstore_api.Pet) + self.assertEquals(status, 200) + + def test_async_exception(self): + self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id("-9999999999999", async_req=True) + + exception = None + try: + thread.get() + except ApiException as e: + exception = e + + self.assertIsInstance(exception, ApiException) + self.assertEqual(exception.status, 404) + + def test_add_pet_and_get_pet_by_id(self): + self.pet_api.add_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertIsNotNone(fetched.category) + self.assertEqual(self.pet.category.name, fetched.category.name) + + def test_add_pet_and_get_pet_by_id_with_http_info(self): + self.pet_api.add_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id( + pet_id=self.pet.id, + _return_http_data_only=False + ) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched[0].id) + self.assertIsNotNone(fetched[0].category) + self.assertEqual(self.pet.category.name, fetched[0].category.name) + + def test_update_pet(self): + self.pet.name = "hello kity with updated" + self.pet_api.update_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(self.pet.name, fetched.name) + self.assertIsNotNone(fetched.category) + self.assertEqual(fetched.category.name, self.pet.category.name) + + def test_find_pets_by_status(self): + self.pet_api.add_pet(self.pet) + + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_status(status=[self.pet.status]))) + ) + + def test_find_pets_by_tags(self): + self.pet_api.add_pet(self.pet) + + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name]))) + ) + + def test_update_pet_with_form(self): + self.pet_api.add_pet(self.pet) + + name = "hello kity with form updated" + status = "pending" + self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(name, fetched.name) + self.assertEqual(status, fetched.status) + + def test_upload_file(self): + # upload file with form parameter + try: + additional_metadata = "special" + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata=additional_metadata, + file=self.foo + ) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + # upload only file + try: + self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + def test_delete_pet(self): + self.pet_api.add_pet(self.pet) + self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") + + try: + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + raise Exception("expected an error") + except ApiException as e: + self.assertEqual(404, e.status) + +if __name__ == '__main__': + unittest.main() diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_pet_model.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_pet_model.py new file mode 100644 index 000000000000..70ab1a007a06 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_pet_model.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class PetModelTests(unittest.TestCase): + + def setUp(self): + self.pet = petstore_api.Pet(name="test name", photo_urls=["string"]) + self.pet.id = 1 + self.pet.status = "available" + cate = petstore_api.Category() + cate.id = 1 + cate.name = "dog" + self.pet.category = cate + tag = petstore_api.Tag() + tag.id = 1 + self.pet.tags = [tag] + + def test_to_str(self): + data = ("{'category': {'id': 1, 'name': 'dog'},\n" + " 'id': 1,\n" + " 'name': 'test name',\n" + " 'photo_urls': ['string'],\n" + " 'status': 'available',\n" + " 'tags': [{'id': 1, 'name': None}]}") + self.assertEqual(data, self.pet.to_str()) + + def test_equal(self): + self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"]) + self.pet1.id = 1 + self.pet1.status = "available" + cate1 = petstore_api.Category() + cate1.id = 1 + cate1.name = "dog" + self.pet.category = cate1 + tag1 = petstore_api.Tag() + tag1.id = 1 + self.pet1.tags = [tag1] + + self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"]) + self.pet2.id = 1 + self.pet2.status = "available" + cate2 = petstore_api.Category() + cate2.id = 1 + cate2.name = "dog" + self.pet.category = cate2 + tag2 = petstore_api.Tag() + tag2.id = 1 + self.pet2.tags = [tag2] + + self.assertTrue(self.pet1 == self.pet2) + + # reset pet1 tags to empty array so that object comparison returns false + self.pet1.tags = [] + self.assertFalse(self.pet1 == self.pet2) diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/test_store_api.py b/CI/samples.ci/client/petstore/python-experimental/tests/test_store_api.py new file mode 100644 index 000000000000..1817477aba69 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/test_store_api.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAP/Petstore-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api +from petstore_api.rest import ApiException + + +class StoreApiTests(unittest.TestCase): + + def setUp(self): + self.store_api = petstore_api.StoreApi() + + def tearDown(self): + # sleep 1 sec between two every 2 tests + time.sleep(1) + + def test_get_inventory(self): + data = self.store_api.get_inventory() + self.assertIsNotNone(data) + self.assertTrue(isinstance(data, dict)) diff --git a/CI/samples.ci/client/petstore/python-experimental/tests/util.py b/CI/samples.ci/client/petstore/python-experimental/tests/util.py new file mode 100644 index 000000000000..113d7dcc5478 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-experimental/tests/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) diff --git a/CI/samples.ci/client/petstore/python-tornado/Makefile b/CI/samples.ci/client/petstore/python-tornado/Makefile new file mode 100644 index 000000000000..1f9d56252268 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-tornado/Makefile @@ -0,0 +1,18 @@ + #!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test-all: clean + bash ./test_python2_and_3.sh diff --git a/CI/samples.ci/client/petstore/python-tornado/dev-requirements.txt b/CI/samples.ci/client/petstore/python-tornado/dev-requirements.txt new file mode 100644 index 000000000000..f50c13b5c503 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-tornado/dev-requirements.txt @@ -0,0 +1,5 @@ +nose +tox +coverage +randomize +flake8 diff --git a/CI/samples.ci/client/petstore/python-tornado/pom.xml b/CI/samples.ci/client/petstore/python-tornado/pom.xml new file mode 100644 index 000000000000..821e12dfe8d3 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-tornado/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonTornadoClientTests + pom + 1.0-SNAPSHOT + Python Tornado Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + nose-test + integration-test + + exec + + + make + + test-all + + + + + + + + diff --git a/CI/samples.ci/client/petstore/python-tornado/test_python2_and_3.sh b/CI/samples.ci/client/petstore/python-tornado/test_python2_and_3.sh new file mode 100755 index 000000000000..7b5795ec24a9 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-tornado/test_python2_and_3.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +python setup.py develop + +### run tests +tox || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/CI/samples.ci/client/petstore/python-tornado/testfiles/foo.png b/CI/samples.ci/client/petstore/python-tornado/testfiles/foo.png new file mode 100644 index 000000000000..a9b12cf5927a Binary files /dev/null and b/CI/samples.ci/client/petstore/python-tornado/testfiles/foo.png differ diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/__init__.py b/CI/samples.ci/client/petstore/python-tornado/tests/__init__.py similarity index 100% rename from samples/openapi3/server/petstore/python-flask/openapi_server/__init__.py rename to CI/samples.ci/client/petstore/python-tornado/tests/__init__.py diff --git a/CI/samples.ci/client/petstore/python-tornado/tests/test_pet_api.py b/CI/samples.ci/client/petstore/python-tornado/tests/test_pet_api.py new file mode 100644 index 000000000000..468dd867f558 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-tornado/tests/test_pet_api.py @@ -0,0 +1,220 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import unittest + +from tornado.testing import AsyncTestCase, gen_test +from tornado.ioloop import IOLoop + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ApiException + +from .util import id_gen + +import json + +import urllib3 + +HOST = 'http://localhost/v2' + +class PetApiTests(AsyncTestCase): + + def setUp(self): + AsyncTestCase.setUp(self) + config = Configuration() + config.host = HOST + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + self.setUpFiles() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "opeanpi-generator-python-pet-tag" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + self.foo = os.path.join(self.test_file_dir, "foo.png") + + def get_new_ioloop(self): + return IOLoop.instance() + + @gen_test + def test_separate_default_client_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client, pet_api2.api_client) + + pet_api.api_client.user_agent = 'api client 3' + pet_api2.api_client.user_agent = 'api client 4' + + self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) + + @gen_test + def test_separate_default_config_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) + + pet_api.api_client.configuration.host = 'somehost' + pet_api2.api_client.configuration.host = 'someotherhost' + self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) + + @gen_test + def test_async_request(self): + # It works but tornado is async by default and creating threadpool + # to do it looks crazy ;) + thread = self.pet_api.add_pet(self.pet, async_req=True) + response = yield thread.get() + self.assertIsNone(response) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + result = yield thread.get() + self.assertIsInstance(result, petstore_api.Pet) + + @gen_test + def test_async_with_result(self): + yield self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + + response = yield thread.get() + response2 = yield thread2.get() + + self.assertEquals(response.id, self.pet.id) + self.assertIsNotNone(response2.id, self.pet.id) + + @gen_test + def test_tornado_async_with_result(self): + yield self.pet_api.add_pet(self.pet) + + query1 = self.pet_api.get_pet_by_id(self.pet.id) + query2 = self.pet_api.get_pet_by_id(self.pet.id) + + response1 = yield query1 + response2 = yield query2 + + self.assertEquals(response1.id, self.pet.id) + self.assertIsNotNone(response2.id, self.pet.id) + + @gen_test + def test_add_pet_and_get_pet_by_id(self): + yield self.pet_api.add_pet(self.pet) + + fetched = yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertIsNotNone(fetched.category) + self.assertEqual(self.pet.category.name, fetched.category.name) + + @gen_test + def test_add_pet_and_get_pet_by_id_with_http_info(self): + yield self.pet_api.add_pet(self.pet) + + fetched = yield self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched[0].id) + self.assertIsNotNone(fetched[0].category) + self.assertEqual(self.pet.category.name, fetched[0].category.name) + + @gen_test + def test_update_pet(self): + self.pet.name = "hello kity with updated" + yield self.pet_api.update_pet(self.pet) + + fetched = yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(self.pet.name, fetched.name) + self.assertIsNotNone(fetched.category) + self.assertEqual(fetched.category.name, self.pet.category.name) + + @gen_test + def test_find_pets_by_status(self): + yield self.pet_api.add_pet(self.pet) + pets = yield self.pet_api.find_pets_by_status(status=[self.pet.status]) + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), pets)) + ) + + @gen_test + def test_find_pets_by_tags(self): + yield self.pet_api.add_pet(self.pet) + pets = yield self.pet_api.find_pets_by_tags(tags=[self.tag.name]) + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), pets)) + ) + + @gen_test + def test_update_pet_with_form(self): + yield self.pet_api.add_pet(self.pet) + + name = "hello kity with form updated" + status = "pending" + yield self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) + + fetched = yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(name, fetched.name) + self.assertEqual(status, fetched.status) + + @gen_test(timeout=10) + def test_upload_file(self): + # upload file with form parameter + try: + additional_metadata = "special" + yield self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata=additional_metadata, + file=self.foo + ) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + # upload only file + try: + yield self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + @gen_test + def test_delete_pet(self): + yield self.pet_api.add_pet(self.pet) + yield self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") + + try: + yield self.pet_api.get_pet_by_id(pet_id=self.pet.id) + raise Exception("expected an error") + except ApiException as e: + self.assertEqual(404, e.status) + + +if __name__ == '__main__': + import logging + logging.basicConfig(level=logging.DEBUG) + unittest.main() diff --git a/CI/samples.ci/client/petstore/python-tornado/tests/util.py b/CI/samples.ci/client/petstore/python-tornado/tests/util.py new file mode 100644 index 000000000000..113d7dcc5478 --- /dev/null +++ b/CI/samples.ci/client/petstore/python-tornado/tests/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) diff --git a/CI/samples.ci/client/petstore/python/Makefile b/CI/samples.ci/client/petstore/python/Makefile new file mode 100644 index 000000000000..ba5c5e73c63c --- /dev/null +++ b/CI/samples.ci/client/petstore/python/Makefile @@ -0,0 +1,21 @@ + #!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv + +clean: + rm -rf $(REQUIREMENTS_OUT) + rm -rf $(SETUP_OUT) + rm -rf $(VENV) + rm -rf .tox + rm -rf .coverage + find . -name "*.py[oc]" -delete + find . -name "__pycache__" -delete + +test: clean + bash ./test_python2.sh + +test-all: clean + bash ./test_python2_and_3.sh diff --git a/CI/samples.ci/client/petstore/python/dev-requirements.txt b/CI/samples.ci/client/petstore/python/dev-requirements.txt new file mode 100644 index 000000000000..f50c13b5c503 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/dev-requirements.txt @@ -0,0 +1,5 @@ +nose +tox +coverage +randomize +flake8 diff --git a/CI/samples.ci/client/petstore/python/pom.xml b/CI/samples.ci/client/petstore/python/pom.xml new file mode 100644 index 000000000000..db2d09246c3b --- /dev/null +++ b/CI/samples.ci/client/petstore/python/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + PythonPetstoreClientTests + pom + 1.0-SNAPSHOT + Python OpenAPI Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + nose-test + integration-test + + exec + + + make + + test-all + + + + + + + + diff --git a/CI/samples.ci/client/petstore/python/setup.cfg b/CI/samples.ci/client/petstore/python/setup.cfg new file mode 100644 index 000000000000..26b7a359d580 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/setup.cfg @@ -0,0 +1,11 @@ +[nosetests] +logging-clear-handlers=true +verbosity=2 +randomize=true +exe=true +with-coverage=true +cover-package=petstore_api +cover-erase=true + +[flake8] +max-line-length=99 diff --git a/CI/samples.ci/client/petstore/python/test_python2.sh b/CI/samples.ci/client/petstore/python/test_python2.sh new file mode 100755 index 000000000000..fb0eaed6ffa0 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/test_python2.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +python setup.py develop + +### run tests +nosetests || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi + diff --git a/CI/samples.ci/client/petstore/python/test_python2_and_3.sh b/CI/samples.ci/client/petstore/python/test_python2_and_3.sh new file mode 100755 index 000000000000..7b5795ec24a9 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/test_python2_and_3.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +REQUIREMENTS_FILE=dev-requirements.txt +REQUIREMENTS_OUT=dev-requirements.txt.log +SETUP_OUT=*.egg-info +VENV=.venv +DEACTIVE=false + +export LC_ALL=en_US.UTF-8 +export LANG=en_US.UTF-8 + +### set virtualenv +if [ -z "$VIRTUAL_ENV" ]; then + virtualenv $VENV --no-site-packages --always-copy + source $VENV/bin/activate + DEACTIVE=true +fi + +### install dependencies +pip install -r $REQUIREMENTS_FILE | tee -a $REQUIREMENTS_OUT +python setup.py develop + +### run tests +tox || exit 1 + +### static analysis of code +flake8 --show-source petstore_api/ + +### deactivate virtualenv +#if [ $DEACTIVE == true ]; then +# deactivate +#fi diff --git a/CI/samples.ci/client/petstore/python/testfiles/foo.png b/CI/samples.ci/client/petstore/python/testfiles/foo.png new file mode 100644 index 000000000000..a9b12cf5927a Binary files /dev/null and b/CI/samples.ci/client/petstore/python/testfiles/foo.png differ diff --git a/samples/openapi3/server/petstore/python-flask/openapi_server/controllers/__init__.py b/CI/samples.ci/client/petstore/python/tests/__init__.py similarity index 100% rename from samples/openapi3/server/petstore/python-flask/openapi_server/controllers/__init__.py rename to CI/samples.ci/client/petstore/python/tests/__init__.py diff --git a/CI/samples.ci/client/petstore/python/tests/test_api_client.py b/CI/samples.ci/client/petstore/python/tests/test_api_client.py new file mode 100644 index 000000000000..a41dbaba9c9f --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_api_client.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIetstore-python +$ nosetests -v +""" + +import os +import time +import unittest +from dateutil.parser import parse + +import petstore_api +import petstore_api.configuration + +HOST = 'http://petstore.swagger.io/v2' + + +class ApiClientTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + + def test_configuration(self): + config = petstore_api.Configuration() + config.host = 'http://localhost/' + + config.api_key['api_key'] = '123456' + config.api_key_prefix['api_key'] = 'PREFIX' + config.username = 'test_username' + config.password = 'test_password' + + header_params = {'test1': 'value1'} + query_params = {'test2': 'value2'} + auth_settings = ['api_key', 'unknown'] + + client = petstore_api.ApiClient(config) + + # test prefix + self.assertEqual('PREFIX', client.configuration.api_key_prefix['api_key']) + + # update parameters based on auth setting + client.update_params_for_auth(header_params, query_params, auth_settings) + + # test api key auth + self.assertEqual(header_params['test1'], 'value1') + self.assertEqual(header_params['api_key'], 'PREFIX 123456') + self.assertEqual(query_params['test2'], 'value2') + + # test basic auth + self.assertEqual('test_username', client.configuration.username) + self.assertEqual('test_password', client.configuration.password) + + def test_select_header_accept(self): + accepts = ['APPLICATION/JSON', 'APPLICATION/XML'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/json', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['application/xml', 'application/json'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'application/json') + + accepts = ['text/plain', 'application/xml'] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, 'text/plain, application/xml') + + accepts = [] + accept = self.api_client.select_header_accept(accepts) + self.assertEqual(accept, None) + + def test_select_header_content_type(self): + content_types = ['APPLICATION/JSON', 'APPLICATION/XML'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/json', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['application/xml', 'application/json'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + content_types = ['text/plain', 'application/xml'] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'text/plain') + + content_types = [] + content_type = self.api_client.select_header_content_type(content_types) + self.assertEqual(content_type, 'application/json') + + def test_sanitize_for_serialization(self): + # None + data = None + result = self.api_client.sanitize_for_serialization(None) + self.assertEqual(result, data) + + # str + data = "test string" + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # int + data = 1 + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # bool + data = True + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # date + data = parse("1997-07-16").date() # date + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16") + + # datetime + data = parse("1997-07-16T19:20:30.45+01:00") # datetime + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, "1997-07-16T19:20:30.450000+01:00") + + # list + data = [1] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # dict + data = {"test key": "test value"} + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, data) + + # model + pet_dict = {"id": 1, "name": "monkey", + "category": {"id": 1, "name": "test category"}, + "tags": [{"id": 1, "name": "test tag1"}, + {"id": 2, "name": "test tag2"}], + "status": "available", + "photoUrls": ["http://foo.bar.com/3", + "http://foo.bar.com/4"]} + pet = petstore_api.Pet(name=pet_dict["name"], photo_urls=pet_dict["photoUrls"]) + pet.id = pet_dict["id"] + cate = petstore_api.Category() + cate.id = pet_dict["category"]["id"] + cate.name = pet_dict["category"]["name"] + pet.category = cate + tag1 = petstore_api.Tag() + tag1.id = pet_dict["tags"][0]["id"] + tag1.name = pet_dict["tags"][0]["name"] + tag2 = petstore_api.Tag() + tag2.id = pet_dict["tags"][1]["id"] + tag2.name = pet_dict["tags"][1]["name"] + pet.tags = [tag1, tag2] + pet.status = pet_dict["status"] + + data = pet + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, pet_dict) + + # list of models + list_of_pet_dict = [pet_dict] + data = [pet] + result = self.api_client.sanitize_for_serialization(data) + self.assertEqual(result, list_of_pet_dict) diff --git a/CI/samples.ci/client/petstore/python/tests/test_api_exception.py b/CI/samples.ci/client/petstore/python/tests/test_api_exception.py new file mode 100644 index 000000000000..75bf81a8de07 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_api_exception.py @@ -0,0 +1,86 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import sys +import unittest + +import petstore_api +from petstore_api.rest import ApiException + +from .util import id_gen + +class ApiExceptionTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "blank" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def test_404_error(self): + self.pet_api.add_pet(self.pet) + self.pet_api.delete_pet(pet_id=self.pet.id) + + with self.checkRaiseRegex(ApiException, "Pet not found"): + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + + try: + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + except ApiException as e: + self.assertEqual(e.status, 404) + self.assertEqual(e.reason, "Not Found") + self.checkRegex(e.body, "Pet not found") + + def test_500_error(self): + self.pet_api.add_pet(self.pet) + + with self.checkRaiseRegex(ApiException, "Internal Server Error"): + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata="special", + file=None + ) + + try: + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata="special", + file=None + ) + except ApiException as e: + self.assertEqual(e.status, 500) + self.assertEqual(e.reason, "Internal Server Error") + self.checkRegex(e.body, "Error 500 Internal Server Error") + + def checkRaiseRegex(self, expected_exception, expected_regex): + if sys.version_info < (3, 0): + return self.assertRaisesRegexp(expected_exception, expected_regex) + + return self.assertRaisesRegex(expected_exception, expected_regex) + + def checkRegex(self, text, expected_regex): + if sys.version_info < (3, 0): + return self.assertRegexpMatches(text, expected_regex) + + return self.assertRegex(text, expected_regex) diff --git a/CI/samples.ci/client/petstore/python/tests/test_deserialization.py b/CI/samples.ci/client/petstore/python/tests/test_deserialization.py new file mode 100644 index 000000000000..6c4e083d1cd7 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_deserialization.py @@ -0,0 +1,241 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAPIPetstore-python +$ nosetests -v +""" +from collections import namedtuple +import json +import os +import time +import unittest +import datetime + +import petstore_api + + +MockResponse = namedtuple('MockResponse', 'data') + + +class DeserializationTests(unittest.TestCase): + + def setUp(self): + self.api_client = petstore_api.ApiClient() + self.deserialize = self.api_client.deserialize + + def test_enum_test(self): + """ deserialize dict(str, Enum_Test) """ + data = { + 'enum_test': { + "enum_string": "UPPER", + "enum_string_required": "lower", + "enum_integer": 1, + "enum_number": 1.1, + "outerEnum": "placed" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, EnumTest)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['enum_test'], petstore_api.EnumTest)) + self.assertEqual(deserialized['enum_test'], + petstore_api.EnumTest(enum_string="UPPER", + enum_string_required="lower", + enum_integer=1, + enum_number=1.1, + outer_enum=petstore_api.OuterEnum.PLACED)) + + def test_deserialize_dict_str_pet(self): + """ deserialize dict(str, Pet) """ + data = { + 'pet': { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, Pet)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['pet'], petstore_api.Pet)) + + def test_deserialize_dict_str_dog(self): + """ deserialize dict(str, Dog), use discriminator""" + data = { + 'dog': { + "id": 0, + "className": "Dog", + "color": "white", + "bread": "Jack Russel Terrier" + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, Animal)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['dog'], petstore_api.Dog)) + + def test_deserialize_dict_str_int(self): + """ deserialize dict(str, int) """ + data = { + 'integer': 1 + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, 'dict(str, int)') + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized['integer'], int)) + + def test_deserialize_str(self): + """ deserialize str """ + data = "test str" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "str") + self.assertTrue(isinstance(deserialized, str)) + + def test_deserialize_date(self): + """ deserialize date """ + data = "1997-07-16" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "date") + self.assertTrue(isinstance(deserialized, datetime.date)) + + def test_deserialize_datetime(self): + """ deserialize datetime """ + data = "1997-07-16T19:20:30.45+01:00" + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "datetime") + self.assertTrue(isinstance(deserialized, datetime.datetime)) + + def test_deserialize_pet(self): + """ deserialize pet """ + data = { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "Pet") + self.assertTrue(isinstance(deserialized, petstore_api.Pet)) + self.assertEqual(deserialized.id, 0) + self.assertEqual(deserialized.name, "doggie") + self.assertTrue(isinstance(deserialized.category, petstore_api.Category)) + self.assertEqual(deserialized.category.name, "string") + self.assertTrue(isinstance(deserialized.tags, list)) + self.assertEqual(deserialized.tags[0].name, "string") + + def test_deserialize_list_of_pet(self): + """ deserialize list[Pet] """ + data = [ + { + "id": 0, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie0", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + }, + { + "id": 1, + "category": { + "id": 0, + "name": "string" + }, + "name": "doggie1", + "photoUrls": [ + "string" + ], + "tags": [ + { + "id": 0, + "name": "string" + } + ], + "status": "available" + }] + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "list[Pet]") + self.assertTrue(isinstance(deserialized, list)) + self.assertTrue(isinstance(deserialized[0], petstore_api.Pet)) + self.assertEqual(deserialized[0].id, 0) + self.assertEqual(deserialized[1].id, 1) + self.assertEqual(deserialized[0].name, "doggie0") + self.assertEqual(deserialized[1].name, "doggie1") + + def test_deserialize_nested_dict(self): + """ deserialize dict(str, dict(str, int)) """ + data = { + "foo": { + "bar": 1 + } + } + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "dict(str, dict(str, int))") + self.assertTrue(isinstance(deserialized, dict)) + self.assertTrue(isinstance(deserialized["foo"], dict)) + self.assertTrue(isinstance(deserialized["foo"]["bar"], int)) + + def test_deserialize_nested_list(self): + """ deserialize list[list[str]] """ + data = [["foo"]] + response = MockResponse(data=json.dumps(data)) + + deserialized = self.deserialize(response, "list[list[str]]") + self.assertTrue(isinstance(deserialized, list)) + self.assertTrue(isinstance(deserialized[0], list)) + self.assertTrue(isinstance(deserialized[0][0], str)) + + def test_deserialize_none(self): + """ deserialize None """ + response = MockResponse(data=json.dumps(None)) + + deserialized = self.deserialize(response, "datetime") + self.assertIsNone(deserialized) diff --git a/CI/samples.ci/client/petstore/python/tests/test_enum_arrays.py b/CI/samples.ci/client/petstore/python/tests/test_enum_arrays.py new file mode 100644 index 000000000000..2f7e347f9c35 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_enum_arrays.py @@ -0,0 +1,165 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class EnumArraysTests(unittest.TestCase): + + def test_enumarrays_init(self): + # + # Check various combinations of valid values. + # + fish_or_crab = petstore_api.EnumArrays(just_symbol=">=") + self.assertEqual(fish_or_crab.just_symbol, ">=") + self.assertEqual(fish_or_crab.array_enum, None) + + fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = petstore_api.EnumArrays(just_symbol=">=", array_enum=["fish"]) + self.assertEqual(fish_or_crab.just_symbol, ">=") + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab = petstore_api.EnumArrays("$", ["crab"]) + self.assertEqual(fish_or_crab.just_symbol, "$") + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + + # + # Check if setting invalid values fails + # + try: + fish_or_crab = petstore_api.EnumArrays(just_symbol="<=") + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + try: + fish_or_crab = petstore_api.EnumArrays(just_symbol="$", array_enum=["dog"]) + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + try: + fish_or_crab = petstore_api.EnumArrays(just_symbol=["$"], array_enum=["dog"]) + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + + def test_enumarrays_setter(self): + + # + # Check various combinations of valid values + # + fish_or_crab = petstore_api.EnumArrays() + + fish_or_crab.just_symbol = ">=" + self.assertEqual(fish_or_crab.just_symbol, ">=") + + fish_or_crab.just_symbol = "$" + self.assertEqual(fish_or_crab.just_symbol, "$") + + fish_or_crab.array_enum = [] + self.assertEqual(fish_or_crab.array_enum, []) + + fish_or_crab.array_enum = ["fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish"]) + + fish_or_crab.array_enum = ["fish", "fish", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["fish", "fish", "fish"]) + + fish_or_crab.array_enum = ["crab"] + self.assertEqual(fish_or_crab.array_enum, ["crab"]) + + fish_or_crab.array_enum = ["crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish"]) + + fish_or_crab.array_enum = ["crab", "fish", "crab", "fish"] + self.assertEqual(fish_or_crab.array_enum, ["crab", "fish", "crab", "fish"]) + + # + # Check if setting invalid values fails + # + fish_or_crab = petstore_api.EnumArrays() + try: + fish_or_crab.just_symbol = "!=" + except ValueError: + self.assertEqual(fish_or_crab.just_symbol, None) + + try: + fish_or_crab.just_symbol = ["fish"] + except ValueError: + self.assertEqual(fish_or_crab.just_symbol, None) + + try: + fish_or_crab.array_enum = ["cat"] + except ValueError: + self.assertEqual(fish_or_crab.array_enum, None) + + try: + fish_or_crab.array_enum = ["fish", "crab", "dog"] + except ValueError: + self.assertEqual(fish_or_crab.array_enum, None) + + try: + fish_or_crab.array_enum = "fish" + except ValueError: + self.assertEqual(fish_or_crab.array_enum, None) + + + def test_todict(self): + # + # Check if dictionary serialization works + # + dollar_fish_crab_dict = { + 'just_symbol': "$", + 'array_enum': ["fish", "crab"] + } + + dollar_fish_crab = petstore_api.EnumArrays("$", ["fish", "crab"]) + + self.assertEqual(dollar_fish_crab_dict, dollar_fish_crab.to_dict()) + + # + # Sanity check for different arrays + # + dollar_crab_fish_dict = { + 'just_symbol': "$", + 'array_enum': ["crab", "fish"] + } + + dollar_fish_crab = petstore_api.EnumArrays("$", ["fish", "crab"]) + + self.assertNotEqual(dollar_crab_fish_dict, dollar_fish_crab.to_dict()) + + + def test_equals(self): + # + # Check if object comparison works + # + fish1 = petstore_api.EnumArrays("$", ["fish"]) + fish2 = petstore_api.EnumArrays("$", ["fish"]) + self.assertEqual(fish1, fish2) + + fish = petstore_api.EnumArrays("$", ["fish"]) + crab = petstore_api.EnumArrays("$", ["crab"]) + self.assertNotEqual(fish, crab) + + dollar = petstore_api.EnumArrays("$") + greater = petstore_api.EnumArrays(">=") + self.assertNotEqual(dollar, greater) \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/python/tests/test_map_test.py b/CI/samples.ci/client/petstore/python/tests/test_map_test.py new file mode 100644 index 000000000000..6031cebf3a2b --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_map_test.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class MapTestTests(unittest.TestCase): + + def test_maptest_init(self): + # + # Test MapTest construction with valid values + # + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test = petstore_api.MapTest(map_of_enum_string=up_or_low_dict) + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + map_of_map_of_strings = { + 'val1': 1, + 'valText': "Text", + 'valueDict': up_or_low_dict + } + map_enum_test = petstore_api.MapTest(map_map_of_string=map_of_map_of_strings) + + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + + # + # Make sure that the init fails for invalid enum values + # + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + try: + map_enum_test = petstore_api.MapTest(map_of_enum_string=black_or_white_dict) + self.assertTrue(0) + except ValueError: + self.assertTrue(1) + + def test_maptest_setter(self): + # + # Check with some valid values + # + map_enum_test = petstore_api.MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_enum_test.map_of_enum_string = up_or_low_dict + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + + # + # Check if the setter fails for invalid enum values + # + map_enum_test = petstore_api.MapTest() + black_or_white_dict = { + 'black': "UP", + 'white': "low" + } + try: + map_enum_test.map_of_enum_string = black_or_white_dict + except ValueError: + self.assertEqual(map_enum_test.map_of_enum_string, None) + + def test_todict(self): + # + # Check dictionary serialization + # + map_enum_test = petstore_api.MapTest() + up_or_low_dict = { + 'UPPER': "UP", + 'lower': "low" + } + map_of_map_of_strings = { + 'val1': 1, + 'valText': "Text", + 'valueDict': up_or_low_dict + } + indirect_map = { + 'option1': True + } + direct_map = { + 'option2': False + } + map_enum_test.map_of_enum_string = up_or_low_dict + map_enum_test.map_map_of_string = map_of_map_of_strings + map_enum_test.indirect_map = indirect_map + map_enum_test.direct_map = direct_map + + self.assertEqual(map_enum_test.map_of_enum_string, up_or_low_dict) + self.assertEqual(map_enum_test.map_map_of_string, map_of_map_of_strings) + self.assertEqual(map_enum_test.indirect_map, indirect_map) + self.assertEqual(map_enum_test.direct_map, direct_map) + + expected_dict = { + 'map_of_enum_string': up_or_low_dict, + 'map_map_of_string': map_of_map_of_strings, + 'indirect_map': indirect_map, + 'direct_map': direct_map + } + + self.assertEqual(map_enum_test.to_dict(), expected_dict) diff --git a/CI/samples.ci/client/petstore/python/tests/test_order_model.py b/CI/samples.ci/client/petstore/python/tests/test_order_model.py new file mode 100644 index 000000000000..31dc6e3661cd --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_order_model.py @@ -0,0 +1,27 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class OrderModelTests(unittest.TestCase): + + def test_status(self): + order = petstore_api.Order() + order.status = "placed" + self.assertEqual("placed", order.status) + + with self.assertRaises(ValueError): + order.status = "invalid" diff --git a/CI/samples.ci/client/petstore/python/tests/test_pet_api.py b/CI/samples.ci/client/petstore/python/tests/test_pet_api.py new file mode 100644 index 000000000000..4f38fbd6e176 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_pet_api.py @@ -0,0 +1,272 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ docker pull swaggerapi/petstore +$ docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import unittest + +import petstore_api +from petstore_api import Configuration +from petstore_api.rest import ApiException + +from .util import id_gen + +import json + +import urllib3 + +HOST = 'http://localhost/v2' + + +class TimeoutWithEqual(urllib3.Timeout): + def __init__(self, *arg, **kwargs): + super(TimeoutWithEqual, self).__init__(*arg, **kwargs) + + def __eq__(self, other): + return self._read == other._read and self._connect == other._connect and self.total == other.total + + +class MockPoolManager(object): + def __init__(self, tc): + self._tc = tc + self._reqs = [] + + def expect_request(self, *args, **kwargs): + self._reqs.append((args, kwargs)) + + def request(self, *args, **kwargs): + self._tc.assertTrue(len(self._reqs) > 0) + r = self._reqs.pop(0) + self._tc.maxDiff = None + self._tc.assertEqual(r[0], args) + self._tc.assertEqual(r[1], kwargs) + return urllib3.HTTPResponse(status=200, body=b'test') + + +class PetApiTests(unittest.TestCase): + + def setUp(self): + config = Configuration() + config.host = HOST + self.api_client = petstore_api.ApiClient(config) + self.pet_api = petstore_api.PetApi(self.api_client) + self.setUpModels() + self.setUpFiles() + + def setUpModels(self): + self.category = petstore_api.Category() + self.category.id = id_gen() + self.category.name = "dog" + self.tag = petstore_api.Tag() + self.tag.id = id_gen() + self.tag.name = "python-pet-tag" + self.pet = petstore_api.Pet(name="hello kity", photo_urls=["http://foo.bar.com/1", "http://foo.bar.com/2"]) + self.pet.id = id_gen() + self.pet.status = "sold" + self.pet.category = self.category + self.pet.tags = [self.tag] + + def setUpFiles(self): + self.test_file_dir = os.path.join(os.path.dirname(__file__), "..", "testfiles") + self.test_file_dir = os.path.realpath(self.test_file_dir) + self.foo = os.path.join(self.test_file_dir, "foo.png") + + def test_preload_content_flag(self): + self.pet_api.add_pet(self.pet) + + resp = self.pet_api.find_pets_by_status(status=[self.pet.status], _preload_content=False) + + # return response should at least have read and close methods. + self.assertTrue(hasattr(resp, 'read')) + self.assertTrue(hasattr(resp, 'close')) + + # Also we need to make sure we can release the connection to a pool (if exists) when we are done with it. + self.assertTrue(hasattr(resp, 'release_conn')) + + # Right now, the client returns urllib3.HTTPResponse. If that changed in future, it is probably a breaking + # change, however supporting above methods should be enough for most usecases. Remove this test case if + # we followed the breaking change procedure for python client (e.g. increasing major version). + self.assertTrue(resp.__class__, 'urllib3.response.HTTPResponse') + + resp.close() + resp.release_conn() + + def test_timeout(self): + mock_pool = MockPoolManager(self) + self.api_client.rest_client.pool_manager = mock_pool + + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(total=5)) + mock_pool.expect_request('POST', 'http://localhost/v2/pet', + body=json.dumps(self.api_client.sanitize_for_serialization(self.pet)), + headers={'Content-Type': 'application/json', + 'Authorization': 'Bearer ', + 'User-Agent': 'OpenAPI-Generator/1.0.0/python'}, + preload_content=True, timeout=TimeoutWithEqual(connect=1, read=2)) + + self.pet_api.add_pet(self.pet, _request_timeout=5) + self.pet_api.add_pet(self.pet, _request_timeout=(1, 2)) + + def test_separate_default_client_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client, pet_api2.api_client) + + pet_api.api_client.user_agent = 'api client 3' + pet_api2.api_client.user_agent = 'api client 4' + + self.assertNotEqual(pet_api.api_client.user_agent, pet_api2.api_client.user_agent) + + def test_separate_default_config_instances(self): + pet_api = petstore_api.PetApi() + pet_api2 = petstore_api.PetApi() + self.assertNotEqual(pet_api.api_client.configuration, pet_api2.api_client.configuration) + + pet_api.api_client.configuration.host = 'somehost' + pet_api2.api_client.configuration.host = 'someotherhost' + self.assertNotEqual(pet_api.api_client.configuration.host, pet_api2.api_client.configuration.host) + + def test_async_request(self): + thread = self.pet_api.add_pet(self.pet, async_req=True) + response = thread.get() + self.assertIsNone(response) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + result = thread.get() + self.assertIsInstance(result, petstore_api.Pet) + + def test_async_with_result(self): + self.pet_api.add_pet(self.pet, async_req=False) + + thread = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + thread2 = self.pet_api.get_pet_by_id(self.pet.id, async_req=True) + + response = thread.get() + response2 = thread2.get() + + self.assertEquals(response.id, self.pet.id) + self.assertIsNotNone(response2.id, self.pet.id) + + def test_async_with_http_info(self): + self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id_with_http_info(self.pet.id, async_req=True) + data, status, headers = thread.get() + + self.assertIsInstance(data, petstore_api.Pet) + self.assertEquals(status, 200) + + def test_async_exception(self): + self.pet_api.add_pet(self.pet) + + thread = self.pet_api.get_pet_by_id("-9999999999999", async_req=True) + + exception = None + try: + thread.get() + except ApiException as e: + exception = e + + self.assertIsInstance(exception, ApiException) + self.assertEqual(exception.status, 404) + + def test_add_pet_and_get_pet_by_id(self): + self.pet_api.add_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertIsNotNone(fetched.category) + self.assertEqual(self.pet.category.name, fetched.category.name) + + def test_add_pet_and_get_pet_by_id_with_http_info(self): + self.pet_api.add_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id_with_http_info(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched[0].id) + self.assertIsNotNone(fetched[0].category) + self.assertEqual(self.pet.category.name, fetched[0].category.name) + + def test_update_pet(self): + self.pet.name = "hello kity with updated" + self.pet_api.update_pet(self.pet) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertIsNotNone(fetched) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(self.pet.name, fetched.name) + self.assertIsNotNone(fetched.category) + self.assertEqual(fetched.category.name, self.pet.category.name) + + def test_find_pets_by_status(self): + self.pet_api.add_pet(self.pet) + + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_status(status=[self.pet.status]))) + ) + + def test_find_pets_by_tags(self): + self.pet_api.add_pet(self.pet) + + self.assertIn( + self.pet.id, + list(map(lambda x: getattr(x, 'id'), self.pet_api.find_pets_by_tags(tags=[self.tag.name]))) + ) + + def test_update_pet_with_form(self): + self.pet_api.add_pet(self.pet) + + name = "hello kity with form updated" + status = "pending" + self.pet_api.update_pet_with_form(pet_id=self.pet.id, name=name, status=status) + + fetched = self.pet_api.get_pet_by_id(pet_id=self.pet.id) + self.assertEqual(self.pet.id, fetched.id) + self.assertEqual(name, fetched.name) + self.assertEqual(status, fetched.status) + + def test_upload_file(self): + # upload file with form parameter + try: + additional_metadata = "special" + self.pet_api.upload_file( + pet_id=self.pet.id, + additional_metadata=additional_metadata, + file=self.foo + ) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + # upload only file + try: + self.pet_api.upload_file(pet_id=self.pet.id, file=self.foo) + except ApiException as e: + self.fail("upload_file() raised {0} unexpectedly".format(type(e))) + + def test_delete_pet(self): + self.pet_api.add_pet(self.pet) + self.pet_api.delete_pet(pet_id=self.pet.id, api_key="special-key") + + try: + self.pet_api.get_pet_by_id(pet_id=self.pet.id) + raise Exception("expected an error") + except ApiException as e: + self.assertEqual(404, e.status) + +if __name__ == '__main__': + unittest.main() diff --git a/CI/samples.ci/client/petstore/python/tests/test_pet_model.py b/CI/samples.ci/client/petstore/python/tests/test_pet_model.py new file mode 100644 index 000000000000..70ab1a007a06 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_pet_model.py @@ -0,0 +1,69 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd petstore_api-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api + + +class PetModelTests(unittest.TestCase): + + def setUp(self): + self.pet = petstore_api.Pet(name="test name", photo_urls=["string"]) + self.pet.id = 1 + self.pet.status = "available" + cate = petstore_api.Category() + cate.id = 1 + cate.name = "dog" + self.pet.category = cate + tag = petstore_api.Tag() + tag.id = 1 + self.pet.tags = [tag] + + def test_to_str(self): + data = ("{'category': {'id': 1, 'name': 'dog'},\n" + " 'id': 1,\n" + " 'name': 'test name',\n" + " 'photo_urls': ['string'],\n" + " 'status': 'available',\n" + " 'tags': [{'id': 1, 'name': None}]}") + self.assertEqual(data, self.pet.to_str()) + + def test_equal(self): + self.pet1 = petstore_api.Pet(name="test name", photo_urls=["string"]) + self.pet1.id = 1 + self.pet1.status = "available" + cate1 = petstore_api.Category() + cate1.id = 1 + cate1.name = "dog" + self.pet.category = cate1 + tag1 = petstore_api.Tag() + tag1.id = 1 + self.pet1.tags = [tag1] + + self.pet2 = petstore_api.Pet(name="test name", photo_urls=["string"]) + self.pet2.id = 1 + self.pet2.status = "available" + cate2 = petstore_api.Category() + cate2.id = 1 + cate2.name = "dog" + self.pet.category = cate2 + tag2 = petstore_api.Tag() + tag2.id = 1 + self.pet2.tags = [tag2] + + self.assertTrue(self.pet1 == self.pet2) + + # reset pet1 tags to empty array so that object comparison returns false + self.pet1.tags = [] + self.assertFalse(self.pet1 == self.pet2) diff --git a/CI/samples.ci/client/petstore/python/tests/test_store_api.py b/CI/samples.ci/client/petstore/python/tests/test_store_api.py new file mode 100644 index 000000000000..1817477aba69 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/test_store_api.py @@ -0,0 +1,32 @@ +# coding: utf-8 + +# flake8: noqa + +""" +Run the tests. +$ pip install nose (optional) +$ cd OpenAP/Petstore-python +$ nosetests -v +""" + +import os +import time +import unittest + +import petstore_api +from petstore_api.rest import ApiException + + +class StoreApiTests(unittest.TestCase): + + def setUp(self): + self.store_api = petstore_api.StoreApi() + + def tearDown(self): + # sleep 1 sec between two every 2 tests + time.sleep(1) + + def test_get_inventory(self): + data = self.store_api.get_inventory() + self.assertIsNotNone(data) + self.assertTrue(isinstance(data, dict)) diff --git a/CI/samples.ci/client/petstore/python/tests/util.py b/CI/samples.ci/client/petstore/python/tests/util.py new file mode 100644 index 000000000000..113d7dcc5478 --- /dev/null +++ b/CI/samples.ci/client/petstore/python/tests/util.py @@ -0,0 +1,8 @@ +# flake8: noqa + +import random + + +def id_gen(bits=32): + """ Returns a n-bit randomly generated int """ + return int(random.getrandbits(bits)) diff --git a/CI/samples.ci/client/petstore/ruby/Gemfile.lock b/CI/samples.ci/client/petstore/ruby/Gemfile.lock new file mode 100644 index 000000000000..14030efc945a --- /dev/null +++ b/CI/samples.ci/client/petstore/ruby/Gemfile.lock @@ -0,0 +1,79 @@ +PATH + remote: . + specs: + petstore (1.0.0) + json (~> 2.1, >= 2.1.0) + typhoeus (~> 1.0, >= 1.0.1) + +GEM + remote: https://rubygems.org/ + specs: + ZenTest (4.11.2) + addressable (2.5.2) + public_suffix (>= 2.0.2, < 4.0) + autotest (4.4.6) + ZenTest (>= 4.4.1) + autotest-fsevent (0.2.14) + sys-uname + autotest-growl (0.2.16) + autotest-rails-pure (4.1.2) + byebug (10.0.2) + coderay (1.1.2) + crack (0.4.3) + safe_yaml (~> 1.0.0) + diff-lcs (1.3) + ethon (0.11.0) + ffi (>= 1.3.0) + ffi (1.9.25) + hashdiff (0.3.7) + json (2.1.0) + method_source (0.9.0) + pry (0.11.3) + coderay (~> 1.1.0) + method_source (~> 0.9.0) + pry-byebug (3.6.0) + byebug (~> 10.0) + pry (~> 0.10) + public_suffix (3.0.3) + rake (12.0.0) + rspec (3.8.0) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-core (3.8.0) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.0) + safe_yaml (1.0.4) + sys-uname (1.0.3) + ffi (>= 1.0.0) + typhoeus (1.3.0) + ethon (>= 0.9.0) + vcr (3.0.3) + webmock (1.24.6) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff + +PLATFORMS + ruby + +DEPENDENCIES + autotest (~> 4.4, >= 4.4.6) + autotest-fsevent (~> 0.2, >= 0.2.12) + autotest-growl (~> 0.2, >= 0.2.16) + autotest-rails-pure (~> 4.1, >= 4.1.2) + petstore! + pry-byebug + rake (~> 12.0.0) + rspec (~> 3.6, >= 3.6.0) + vcr (~> 3.0, >= 3.0.1) + webmock (~> 1.24, >= 1.24.3) + +BUNDLED WITH + 1.16.1 diff --git a/CI/samples.ci/client/petstore/rust/.gitignore b/CI/samples.ci/client/petstore/rust/.gitignore new file mode 100644 index 000000000000..a9d37c560c6a --- /dev/null +++ b/CI/samples.ci/client/petstore/rust/.gitignore @@ -0,0 +1,2 @@ +target +Cargo.lock diff --git a/CI/samples.ci/client/petstore/rust/Cargo.toml b/CI/samples.ci/client/petstore/rust/Cargo.toml new file mode 100644 index 000000000000..46b06cf9bbe3 --- /dev/null +++ b/CI/samples.ci/client/petstore/rust/Cargo.toml @@ -0,0 +1,2 @@ +[workspace] +members = ["hyper/*", "reqwest/*"] diff --git a/CI/samples.ci/client/petstore/rust/pom.xml b/CI/samples.ci/client/petstore/rust/pom.xml new file mode 100644 index 000000000000..86adf2289ece --- /dev/null +++ b/CI/samples.ci/client/petstore/rust/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + org.openapitools + RustPetstoreClientTests + pom + 1.0-SNAPSHOT + Rust Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + bundle-test + integration-test + + exec + + + cargo + + check + + + + + + + + diff --git a/samples/client/petstore/scala-httpclient/bin/PetApiTest.scala b/CI/samples.ci/client/petstore/scala-httpclient/src/test/scala/PetApiTest.scala similarity index 100% rename from samples/client/petstore/scala-httpclient/bin/PetApiTest.scala rename to CI/samples.ci/client/petstore/scala-httpclient/src/test/scala/PetApiTest.scala diff --git a/samples/client/petstore/scala-httpclient/bin/StoreApiTest.scala b/CI/samples.ci/client/petstore/scala-httpclient/src/test/scala/StoreApiTest.scala similarity index 100% rename from samples/client/petstore/scala-httpclient/bin/StoreApiTest.scala rename to CI/samples.ci/client/petstore/scala-httpclient/src/test/scala/StoreApiTest.scala diff --git a/samples/client/petstore/scala-httpclient/bin/UserApiTest.scala b/CI/samples.ci/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala similarity index 100% rename from samples/client/petstore/scala-httpclient/bin/UserApiTest.scala rename to CI/samples.ci/client/petstore/scala-httpclient/src/test/scala/UserApiTest.scala diff --git a/CI/samples.ci/client/petstore/scalaz/pom.xml b/CI/samples.ci/client/petstore/scalaz/pom.xml new file mode 100644 index 000000000000..166ba81bda7d --- /dev/null +++ b/CI/samples.ci/client/petstore/scalaz/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + org.openapitools + scalaz-petstore-client + pom + 1.0-SNAPSHOT + scalaz-petstore-client + + + + org.codehaus.mojo + exec-maven-plugin + 1.5.0 + + + sbt-test + integration-test + + exec + + + sbt + + test + + + + + + + + diff --git a/samples/client/test/swift4/default/.gitignore b/CI/samples.ci/client/petstore/swift/.gitignore similarity index 100% rename from samples/client/test/swift4/default/.gitignore rename to CI/samples.ci/client/petstore/swift/.gitignore diff --git a/samples/client/petstore/async-scala/.openapi-generator-ignore b/CI/samples.ci/client/petstore/swift/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/async-scala/.openapi-generator-ignore rename to CI/samples.ci/client/petstore/swift/.openapi-generator-ignore diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..218aae4920f5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/Podfile @@ -0,0 +1,11 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..d8ae490623cf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,529 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; + A77F0668DAC6BFAB9DBB7D37 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E9AE2FEF8E8F914C1D2F168B /* Pods_SwaggerClient.framework */; }; + C6AAAD211D8718D00016A515 /* ISOFullDateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6AAAD201D8718D00016A515 /* ISOFullDateTests.swift */; }; + F3FCC41175F14274266B53FA /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A3C56BADD08FA3D474DBDF71 /* Pods_SwaggerClientTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6D4EFB901C692C6300B96B06; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + 78ED7EF301CC6DF958B4BFAB /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + A3C56BADD08FA3D474DBDF71 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C6AAAD201D8718D00016A515 /* ISOFullDateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ISOFullDateTests.swift; sourceTree = ""; }; + E9AE2FEF8E8F914C1D2F168B /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + EA2BED756A4C5389B0F46BC4 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + EA32712FFC62EA5F96CC006F /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + F18FDCB0CAAA15B973147EED /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A77F0668DAC6BFAB9DBB7D37 /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + F3FCC41175F14274266B53FA /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C07EC0A94AA0F86D60668B32 /* Pods.framework */, + E9AE2FEF8E8F914C1D2F168B /* Pods_SwaggerClient.framework */, + A3C56BADD08FA3D474DBDF71 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6D4EFB881C692C6300B96B06 = { + isa = PBXGroup; + children = ( + 6D4EFB931C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, + 6D4EFB921C692C6300B96B06 /* Products */, + 3FABC56EC0BA84CBF4F99564 /* Frameworks */, + D598C75400476D9194EADBAA /* Pods */, + ); + sourceTree = ""; + }; + 6D4EFB921C692C6300B96B06 /* Products */ = { + isa = PBXGroup; + children = ( + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, + 6D4EFB961C692C6300B96B06 /* ViewController.swift */, + 6D4EFB981C692C6300B96B06 /* Main.storyboard */, + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, + 6D4EFBA01C692C6300B96B06 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + 6D4EFBAB1C692C6300B96B06 /* Info.plist */, + C6AAAD201D8718D00016A515 /* ISOFullDateTests.swift */, + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; + D598C75400476D9194EADBAA /* Pods */ = { + isa = PBXGroup; + children = ( + EA2BED756A4C5389B0F46BC4 /* Pods-SwaggerClient.debug.xcconfig */, + F18FDCB0CAAA15B973147EED /* Pods-SwaggerClient.release.xcconfig */, + 78ED7EF301CC6DF958B4BFAB /* Pods-SwaggerClientTests.debug.xcconfig */, + EA32712FFC62EA5F96CC006F /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + E5F6E842A9A53DF5152241BC /* [CP] Check Pods Manifest.lock */, + 6D4EFB8D1C692C6300B96B06 /* Sources */, + 6D4EFB8E1C692C6300B96B06 /* Frameworks */, + 6D4EFB8F1C692C6300B96B06 /* Resources */, + 4A8C29C17AE187506924CE72 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + 18CD551FE8D8E7492A1C4100 /* [CP] Check Pods Manifest.lock */, + 6D4EFBA11C692C6300B96B06 /* Sources */, + 6D4EFBA21C692C6300B96B06 /* Frameworks */, + 6D4EFBA31C692C6300B96B06 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6D4EFB891C692C6300B96B06 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + 6D4EFB901C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + }; + 6D4EFBA41C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + TestTargetID = 6D4EFB901C692C6300B96B06; + }; + }; + }; + buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6D4EFB881C692C6300B96B06; + productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6D4EFB901C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6D4EFB8F1C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA31C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 18CD551FE8D8E7492A1C4100 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 4A8C29C17AE187506924CE72 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + E5F6E842A9A53DF5152241BC /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6D4EFB8D1C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA11C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C6AAAD211D8718D00016A515 /* ISOFullDateTests.swift in Sources */, + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; + targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB991C692C6300B96B06 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB9E1C692C6300B96B06 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6D4EFBAC1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6D4EFBAD1C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6D4EFBAF1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EA2BED756A4C5389B0F46BC4 /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6D4EFBB01C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F18FDCB0CAAA15B973147EED /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 6D4EFBB21C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 78ED7EF301CC6DF958B4BFAB /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + 6D4EFBB31C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EA32712FFC62EA5F96CC006F /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAC1C692C6300B96B06 /* Debug */, + 6D4EFBAD1C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAF1C692C6300B96B06 /* Debug */, + 6D4EFBB01C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBB21C692C6300B96B06 /* Debug */, + 6D4EFBB31C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..5ba034cec55a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..3769667ad9cc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..eeea76c2db59 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,73 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..bb71d00fa8ae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..cd7e9a167615 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift new file mode 100644 index 000000000000..67d841cc7c6d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/ISOFullDateTests.swift @@ -0,0 +1,83 @@ +/// Copyright 2012-2016 (C) Butterfly Network, Inc. + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +final class ISOFullDateTests: XCTestCase { + + var fullDate = ISOFullDate(year: 1999, month: 12, day: 31) + + func testValidDate() { + XCTAssertEqual(fullDate.year, 1999) + XCTAssertEqual(fullDate.month, 12) + XCTAssertEqual(fullDate.day, 31) + } + + func testFromDate() { + let date = NSDate() + let fullDate = ISOFullDate.from(date: date) + + guard let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { + XCTFail() + return + } + + let components = calendar.components( + [ + .Year, + .Month, + .Day, + ], + fromDate: date + ) + + XCTAssertEqual(fullDate?.year, components.year) + XCTAssertEqual(fullDate?.month, components.month) + XCTAssertEqual(fullDate?.day, components.day) + } + + func testFromString() { + let string = "1999-12-31" + let fullDate = ISOFullDate.from(string: string) + XCTAssertEqual(fullDate?.year, 1999) + XCTAssertEqual(fullDate?.month, 12) + XCTAssertEqual(fullDate?.day, 31) + } + + func testFromInvalidString() { + XCTAssertNil(ISOFullDate.from(string: "1999-12")) + } + + func testToDate() { + let fullDate = ISOFullDate(year: 1999, month: 12, day: 31) + + guard let date = fullDate.toDate(), + let calendar = NSCalendar(identifier: NSCalendarIdentifierGregorian) else { + XCTFail() + return + } + + let components = calendar.components( + [ + .Year, + .Month, + .Day, + ], + fromDate: date + ) + + XCTAssertEqual(fullDate.year, components.year) + XCTAssertEqual(fullDate.month, components.month) + XCTAssertEqual(fullDate.day, components.day) + } + + func testDescription() { + XCTAssertEqual(fullDate.description, "1999-12-31") + } + + func testEncodeToJSON() { + XCTAssertEqual(fullDate.encodeToJSON() as? String, "1999-12-31") + } + +} diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..802f84f540d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..7446c53aa3b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,86 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectationWithDescription("testCreatePet") + + let newPet = Pet() + let category = PetstoreClient.Category() + category.id = 1234 + category.name = "eyeColor" + newPet.category = category + newPet.id = 1000 + newPet.name = "Fluffy" + newPet.status = .Available + + PetAPI.addPet(body: newPet) { (error) in + guard error == nil else { + XCTFail("error creating pet") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectationWithDescription("testGetPet") + + PetAPI.getPetById(petId: 1000) { (pet, error) in + guard error == nil else { + XCTFail("error retrieving pet") + return + } + + if let pet = pet { + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + + expectation.fulfill() + } + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectationWithDescription("testDeletePet") + + PetAPI.deletePet(petId: 1000) { (error) in + guard error == nil else { + XCTFail("error deleting pet") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..ba235ca32db7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,122 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + + let testTimeout = 10.0 + + func test1PlaceOrder() { + let expectation = self.expectationWithDescription("testPlaceOrder") + let shipDate = NSDate() + + let newOrder = Order() + newOrder.id = 1000 + newOrder.petId = 1000 + newOrder.complete = false + newOrder.quantity = 10 + newOrder.shipDate = shipDate + // use explicit naming to reference the enum so that we test we don't regress on enum naming + newOrder.status = Order.Status.Placed + + StoreAPI.placeOrder(body: newOrder) { (order, error) in + guard error == nil else { + XCTFail("error placing order: \(error.debugDescription)") + return + } + + if let order = order { + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .Placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + } + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectationWithDescription("testGetOrder") + + StoreAPI.getOrderById(orderId: "1000") { (order, error) in + guard error == nil else { + XCTFail("error retrieving order: \(error.debugDescription)") + return + } + + if let order = order { + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .Placed, "invalid status") + + expectation.fulfill() + } + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectationWithDescription("testDeleteOrder") + + StoreAPI.deleteOrder(orderId: "1000") { (error) in + guard error == nil else { + XCTFail("error deleting order") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func testDownloadProgress() { + let responseExpectation = self.expectationWithDescription("obtain response") + let progressExpectation = self.expectationWithDescription("obtain progress") + let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: "1000") + + requestBuilder.onProgressReady = { (progress) in + progressExpectation.fulfill() + } + + requestBuilder.execute { (response, error) in + responseExpectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} + +private extension NSDate { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(date: NSDate, format: String) -> Bool { + let fmt = NSDateFormatter() + fmt.dateFormat = format + return fmt.stringFromDate(self).isEqual(fmt.stringFromDate(date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..fc8b19d66299 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,119 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + + func testLogin() { + let expectation = self.expectationWithDescription("testLogin") + + UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in + guard error == nil else { + XCTFail("error logging in") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectationWithDescription("testLogout") + + UserAPI.logoutUser { (error) in + guard error == nil else { + XCTFail("error logging out") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test1CreateUser() { + let expectation = self.expectationWithDescription("testCreateUser") + + let newUser = User() + newUser.email = "test@test.com" + // TODO comment out the following as dateOfBirth has been removed + // from petstore.json, we'll need to add back the test after switching + // to petstore-with-fake-endpoints-models-for-testing.yaml + ////newUser.dateOfBirth = ISOFullDate.from(string: "1999-12-31") + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + UserAPI.createUser(body: newUser) { (error) in + guard error == nil else { + XCTFail("error creating user") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetUser() { + let expectation = self.expectationWithDescription("testGetUser") + + UserAPI.getUserByName(username: "test@test.com") { (user, error) in + guard error == nil else { + XCTFail("error getting user") + return + } + + if let user = user { + XCTAssert(user.userStatus == 0, "invalid userStatus") + XCTAssert(user.email == "test@test.com", "invalid email") + XCTAssert(user.firstName == "Test", "invalid firstName") + XCTAssert(user.lastName == "Tester", "invalid lastName") + XCTAssert(user.password == "test!", "invalid password") + XCTAssert(user.phone == "867-5309", "invalid phone") + // TODO comment out the following as dateOfBirth has been removed + // from petstore.json, we'll need to add back the test after switching + // to petstore-with-fake-endpoints-models-for-testing.yaml + //XCTAssert(user.dateOfBirth?.description == "1999-12-31", "invalid date of birth") + + expectation.fulfill() + } + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeleteUser() { + let expectation = self.expectationWithDescription("testDeleteUser") + + UserAPI.deleteUser(username: "test@test.com") { (error) in + guard error == nil else { + XCTFail("error deleting user") + return + } + + expectation.fulfill() + } + + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..741fd2170882 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + SwiftPetstoreClientTests + pom + 1.0-SNAPSHOT + Swift Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..edcc142971b7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/default/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty + +pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..218aae4920f5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Podfile @@ -0,0 +1,11 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end + diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Download.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Manager.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Stream.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Upload.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Manifest.lock diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/OMGHTTPURLRQ/OMGHTTPURLRQ-umbrella.h diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig similarity index 100% rename from samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig rename to CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..b1c5cd52bee3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,550 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6D4EFB901C692C6300B96B06; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0CAA98BEFA303B94D3664C7D /* Pods */ = { + isa = PBXGroup; + children = ( + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C07EC0A94AA0F86D60668B32 /* Pods.framework */, + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6D4EFB881C692C6300B96B06 = { + isa = PBXGroup; + children = ( + 6D4EFB931C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, + 6D4EFB921C692C6300B96B06 /* Products */, + 3FABC56EC0BA84CBF4F99564 /* Frameworks */, + 0CAA98BEFA303B94D3664C7D /* Pods */, + ); + sourceTree = ""; + }; + 6D4EFB921C692C6300B96B06 /* Products */ = { + isa = PBXGroup; + children = ( + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, + 6D4EFB961C692C6300B96B06 /* ViewController.swift */, + 6D4EFB981C692C6300B96B06 /* Main.storyboard */, + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, + 6D4EFBA01C692C6300B96B06 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + 6D4EFBAB1C692C6300B96B06 /* Info.plist */, + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, + 6D4EFB8D1C692C6300B96B06 /* Sources */, + 6D4EFB8E1C692C6300B96B06 /* Frameworks */, + 6D4EFB8F1C692C6300B96B06 /* Resources */, + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, + 808CE4A0CE801CAC5ABF5B08 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, + 6D4EFBA11C692C6300B96B06 /* Sources */, + 6D4EFBA21C692C6300B96B06 /* Frameworks */, + 6D4EFBA31C692C6300B96B06 /* Resources */, + 796EAD48F1BCCDAA291CD963 /* [CP] Embed Pods Frameworks */, + 1652CB1A246A4689869E442D /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6D4EFB891C692C6300B96B06 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + 6D4EFB901C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + }; + 6D4EFBA41C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + TestTargetID = 6D4EFB901C692C6300B96B06; + }; + }; + }; + buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6D4EFB881C692C6300B96B06; + productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6D4EFB901C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6D4EFB8F1C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA31C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1652CB1A246A4689869E442D /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 796EAD48F1BCCDAA291CD963 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 808CE4A0CE801CAC5ABF5B08 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6D4EFB8D1C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA11C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; + targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB991C692C6300B96B06 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB9E1C692C6300B96B06 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6D4EFBAC1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6D4EFBAD1C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6D4EFBAF1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6D4EFBB01C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 6D4EFBB21C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + 6D4EFBB31C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAC1C692C6300B96B06 /* Debug */, + 6D4EFBAD1C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAF1C692C6300B96B06 /* Debug */, + 6D4EFBB01C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBB21C692C6300B96B06 /* Debug */, + 6D4EFBB31C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..5ba034cec55a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..3769667ad9cc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..eeea76c2db59 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,73 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..bb71d00fa8ae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..cd7e9a167615 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..802f84f540d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..e76c5700aa2b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,69 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectationWithDescription("testCreatePet") + let newPet = Pet() + let category = PetstoreClient.Category() + category.id = 1234 + category.name = "eyeColor" + newPet.category = category + newPet.id = 1000 + newPet.name = "Fluffy" + newPet.status = .Available + PetAPI.addPet(body: newPet).then { + expectation.fulfill() + }.always { + // Noop for now + }.error { errorType -> Void in + XCTFail("error creating pet") + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectationWithDescription("testGetPet") + PetAPI.getPetById(petId: 1000).then { pet -> Void in + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + expectation.fulfill() + }.always { + // Noop for now + }.error { errorType -> Void in + XCTFail("error creating pet") + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectationWithDescription("testDeletePet") + PetAPI.deletePet(petId: 1000).then { + expectation.fulfill() + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } +} diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..2e37e3d3917e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,88 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + + let testTimeout = 10.0 + + func test1PlaceOrder() { + let order = Order() + let shipDate = NSDate() + order.id = 1000 + order.petId = 1000 + order.complete = false + order.quantity = 10 + order.shipDate = shipDate + // use explicit naming to reference the enum so that we test we don't regress on enum naming + order.status = Order.Status.Placed + let expectation = self.expectationWithDescription("testPlaceOrder") + StoreAPI.placeOrder(body: order).then { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .Placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + }.always { + // Noop for now + }.error { errorType -> Void in + XCTFail("error placing order") + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectationWithDescription("testGetOrder") + StoreAPI.getOrderById(orderId: "1000").then { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .Placed, "invalid status") + expectation.fulfill() + }.always { + // Noop for now + }.error { errorType -> Void in + XCTFail("error placing order") + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectationWithDescription("testDeleteOrder") + StoreAPI.deleteOrder(orderId: "1000").then { + expectation.fulfill() + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} + +private extension NSDate { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(date: NSDate, format: String) -> Bool { + let fmt = NSDateFormatter() + fmt.dateFormat = format + return fmt.stringFromDate(self).isEqual(fmt.stringFromDate(date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..2caacc8d6dad --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,77 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + + func testLogin() { + let expectation = self.expectationWithDescription("testLogin") + UserAPI.loginUser(username: "swiftTester", password: "swift").then { _ -> Void in + expectation.fulfill() + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectationWithDescription("testLogout") + UserAPI.logoutUser().then { + expectation.fulfill() + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test1CreateUser() { + let expectation = self.expectationWithDescription("testCreateUser") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + UserAPI.createUser(body: newUser).then { + expectation.fulfill() + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetUser() { + let expectation = self.expectationWithDescription("testGetUser") + UserAPI.getUserByName(username: "test@test.com").then {user -> Void in + XCTAssert(user.userStatus == 0, "invalid userStatus") + XCTAssert(user.email == "test@test.com", "invalid email") + XCTAssert(user.firstName == "Test", "invalid firstName") + XCTAssert(user.lastName == "Tester", "invalid lastName") + XCTAssert(user.password == "test!", "invalid password") + XCTAssert(user.phone == "867-5309", "invalid phone") + expectation.fulfill() + }.always { + // Noop for now + }.error { errorType -> Void in + XCTFail("error getting user") + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeleteUser() { + let expectation = self.expectationWithDescription("testDeleteUser") + UserAPI.deleteUser(username: "test@test.com").then { + expectation.fulfill() + } + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..11686eaaede9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + SwiftPromiseKitPetstoreClientTests + pom + 1.0-SNAPSHOT + Swift PromiseKit Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..edcc142971b7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/promisekit/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty + +pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..29843508b65b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/Podfile @@ -0,0 +1,10 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..d6a4062151e3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,649 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */; }; + B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */; }; + EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */; }; + EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */; }; + EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */; }; + EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */; }; + EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */; }; + EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */; }; + EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */; }; + EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EAEC0BB61D4E30CE00C908A3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = EAEC0BBD1D4E30CE00C908A3; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; + 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + EAEC0BC61D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EAEC0BCB1D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + EAEC0BCD1D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EAEC0BD81D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EAEC0BBB1D4E30CE00C908A3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EAEC0BCF1D4E30CE00C908A3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */, + 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CB19142D951AB5DD885404A8 /* Pods */ = { + isa = PBXGroup; + children = ( + 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */, + 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */, + 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */, + EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + EAEC0BB51D4E30CE00C908A3 = { + isa = PBXGroup; + children = ( + EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */, + EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */, + EAEC0BBF1D4E30CE00C908A3 /* Products */, + CB19142D951AB5DD885404A8 /* Pods */, + 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */, + ); + sourceTree = ""; + }; + EAEC0BBF1D4E30CE00C908A3 /* Products */ = { + isa = PBXGroup; + children = ( + EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */, + EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */, + EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */, + EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */, + EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */, + EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */, + EAEC0BCD1D4E30CE00C908A3 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + EAEC0BD81D4E30CE00C908A3 /* Info.plist */, + EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */, + EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */, + EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + C70A8FFDB7B0A20D2C3436C9 /* [CP] Check Pods Manifest.lock */, + 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */, + EAEC0BBA1D4E30CE00C908A3 /* Sources */, + EAEC0BBB1D4E30CE00C908A3 /* Frameworks */, + EAEC0BBC1D4E30CE00C908A3 /* Resources */, + 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */, + E008DDC7FA2126F111F972F5 /* [CP] Copy Pods Resources */, + 374C38046621787C3C859B01 /* 📦 Embed Pods Frameworks */, + 73DCA4494CB87F25D3D5F63E /* 📦 Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + 48EADFABBF79C1D5C79CE9A6 /* [CP] Check Pods Manifest.lock */, + 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */, + EAEC0BCE1D4E30CE00C908A3 /* Sources */, + EAEC0BCF1D4E30CE00C908A3 /* Frameworks */, + EAEC0BD01D4E30CE00C908A3 /* Resources */, + 3920D9C143B997879E5A5B9C /* [CP] Embed Pods Frameworks */, + 60E7B02FBDEB028CCE7CCCC5 /* [CP] Copy Pods Resources */, + 5879911F238B959C753C7FC4 /* 📦 Embed Pods Frameworks */, + AA1A263EEA3CDAE83EC2DFB9 /* 📦 Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EAEC0BB61D4E30CE00C908A3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0730; + LastUpgradeCheck = 0730; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + EAEC0BBD1D4E30CE00C908A3 = { + CreatedOnToolsVersion = 7.3.1; + }; + EAEC0BD11D4E30CE00C908A3 = { + CreatedOnToolsVersion = 7.3.1; + TestTargetID = EAEC0BBD1D4E30CE00C908A3; + }; + }; + }; + buildConfigurationList = EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EAEC0BB51D4E30CE00C908A3; + productRefGroup = EAEC0BBF1D4E30CE00C908A3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */, + EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EAEC0BBC1D4E30CE00C908A3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */, + EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */, + EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EAEC0BD01D4E30CE00C908A3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 374C38046621787C3C859B01 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 3920D9C143B997879E5A5B9C /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 48EADFABBF79C1D5C79CE9A6 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 5879911F238B959C753C7FC4 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 60E7B02FBDEB028CCE7CCCC5 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 73DCA4494CB87F25D3D5F63E /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + AA1A263EEA3CDAE83EC2DFB9 /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + C70A8FFDB7B0A20D2C3436C9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + E008DDC7FA2126F111F972F5 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EAEC0BBA1D4E30CE00C908A3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */, + EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EAEC0BCE1D4E30CE00C908A3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */, + EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */, + EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */; + targetProxy = EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EAEC0BC61D4E30CE00C908A3 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EAEC0BCB1D4E30CE00C908A3 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EAEC0BD91D4E30CE00C908A3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EAEC0BDA1D4E30CE00C908A3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EAEC0BDC1D4E30CE00C908A3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EAEC0BDD1D4E30CE00C908A3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + EAEC0BDF1D4E30CE00C908A3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + EAEC0BE01D4E30CE00C908A3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EAEC0BD91D4E30CE00C908A3 /* Debug */, + EAEC0BDA1D4E30CE00C908A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EAEC0BDC1D4E30CE00C908A3 /* Debug */, + EAEC0BDD1D4E30CE00C908A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EAEC0BDF1D4E30CE00C908A3 /* Debug */, + EAEC0BE01D4E30CE00C908A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EAEC0BB61D4E30CE00C908A3 /* Project object */; +} diff --git a/samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/petstore/objc/core-data/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..ec4a1f5eb1c2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..387a82565020 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,45 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..118c98f7461b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,38 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..3d8b6fc4a709 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,58 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..14180180be44 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,24 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..619bf44ed70e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..3074080455ce --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,78 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import RxSwift +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + let disposeBag = DisposeBag() + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectationWithDescription("testCreatePet") + let newPet = Pet() + let category = PetstoreClient.Category() + category.id = 1234 + category.name = "eyeColor" + newPet.category = category + newPet.id = 1000 + newPet.name = "Fluffy" + newPet.status = .Available + PetAPI.addPet(body: newPet).subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + XCTFail("error creating pet") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectationWithDescription("testGetPet") + PetAPI.getPetById(petId: 1000).subscribe(onNext: { pet in + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + expectation.fulfill() + }, onError: { errorType in + XCTFail("error getting pet") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectationWithDescription("testDeletePet") + PetAPI.deletePet(petId: 1000).subscribe(onNext: { +// expectation.fulfill() + }, onError: { errorType in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error deleting pet") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } +} diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..dc808766116a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,97 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import RxSwift +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + + let testTimeout = 10.0 + let disposeBag = DisposeBag() + + func test1PlaceOrder() { + let order = Order() + let shipDate = NSDate() + order.id = 1000 + order.petId = 1000 + order.complete = false + order.quantity = 10 + order.shipDate = shipDate + // use explicit naming to reference the enum so that we test we don't regress on enum naming + order.status = Order.Status.Placed + let expectation = self.expectationWithDescription("testPlaceOrder") + StoreAPI.placeOrder(body: order).subscribe(onNext: { order in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .Placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + }, onError: { errorType in + XCTFail("error placing order") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectationWithDescription("testGetOrder") + StoreAPI.getOrderById(orderId: "1000").subscribe(onNext: { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .Placed, "invalid status") + expectation.fulfill() + }, onError: { errorType in + XCTFail("error placing order") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectationWithDescription("testDeleteOrder") + StoreAPI.deleteOrder(orderId: "1000").subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType -> Void in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error deleting order") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} + +private extension NSDate { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(date: NSDate, format: String) -> Bool { + let fmt = NSDateFormatter() + fmt.dateFormat = format + return fmt.stringFromDate(self).isEqual(fmt.stringFromDate(date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..c9fc3f0bd962 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,133 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import RxSwift +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + let disposeBag = DisposeBag() + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testLogin() { + let expectation = self.expectationWithDescription("testLogin") + UserAPI.loginUser(username: "swiftTester", password: "swift").subscribe(onNext: { _ in + expectation.fulfill() + }, onError: { errorType in + // The server isn't returning JSON - and currently the alamofire implementation + // always parses responses as JSON, so making an exception for this here + // Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." + // UserInfo={NSDebugDescription=Invalid value around character 0.} + let error = errorType as NSError + if error.code == 3840 { + expectation.fulfill() + } else { + XCTFail("error logging in") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectationWithDescription("testLogout") + UserAPI.logoutUser().subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error logging out") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test1CreateUser() { + let expectation = self.expectationWithDescription("testCreateUser") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + UserAPI.createUser(body: newUser).subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error creating user") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test2GetUser() { + let expectation = self.expectationWithDescription("testGetUser") + UserAPI.getUserByName(username: "test@test.com").subscribe(onNext: {user -> Void in + XCTAssert(user.userStatus == 0, "invalid userStatus") + XCTAssert(user.email == "test@test.com", "invalid email") + XCTAssert(user.firstName == "Test", "invalid firstName") + XCTAssert(user.lastName == "Tester", "invalid lastName") + XCTAssert(user.password == "test!", "invalid password") + XCTAssert(user.phone == "867-5309", "invalid phone") + expectation.fulfill() + }, onError: { errorType in + XCTFail("error getting user") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + + func test3DeleteUser() { + let expectation = self.expectationWithDescription("testDeleteUser") + UserAPI.deleteUser(username: "test@test.com").subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType -> Void in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error deleting user") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectationsWithTimeout(testTimeout, handler: nil) + } + +} diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..86f773d7a253 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + SwiftRxSwiftPetstoreClientTests + pom + 1.0-SNAPSHOT + Swift RxSwift Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..edcc142971b7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift/rxswift/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +#pod install && xcodebuild clean test -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -sdk iphonesimulator GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES | xcpretty + +pod install && xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty diff --git a/samples/client/petstore/swift4/unwrapRequired/.gitignore b/CI/samples.ci/client/petstore/swift3/.gitignore similarity index 100% rename from samples/client/petstore/swift4/unwrapRequired/.gitignore rename to CI/samples.ci/client/petstore/swift3/.gitignore diff --git a/samples/client/petstore/dart/.openapi-generator-ignore b/CI/samples.ci/client/petstore/swift3/.openapi-generator-ignore similarity index 100% rename from samples/client/petstore/dart/.openapi-generator-ignore rename to CI/samples.ci/client/petstore/swift3/.openapi-generator-ignore diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..77b1f16f2fe6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Podfile @@ -0,0 +1,18 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |configuration| + configuration.build_settings['SWIFT_VERSION'] = "3.0" + end + end +end diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Podfile.lock diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/LICENSE diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/README.md diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Manifest.lock diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire-dummy.m rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Alamofire/Alamofire.modulemap rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/TestClient/Info.plist b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/TestClient/Info.plist rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m new file mode 100644 index 000000000000..749b412f85c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PetstoreClient : NSObject +@end +@implementation PodsDummy_PetstoreClient +@end diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/TestClient/TestClient-prefix.pch b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/TestClient/TestClient-prefix.pch rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h new file mode 100644 index 000000000000..2a366623a36f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double PetstoreClientVersionNumber; +FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap new file mode 100644 index 000000000000..7fdfc46cf796 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap @@ -0,0 +1,6 @@ +framework module PetstoreClient { + umbrella header "PetstoreClient-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m new file mode 100644 index 000000000000..6236440163b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClient : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClient +@end diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h new file mode 100644 index 000000000000..b7da51aaf252 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[]; + diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap new file mode 100644 index 000000000000..ef919b6c0d1f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClient { + umbrella header "Pods-SwaggerClient-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests-acknowledgements.markdown rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown diff --git a/samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests-acknowledgements.plist b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/Pods/Target Support Files/Pods-TestClientAppTests/Pods-TestClientAppTests-acknowledgements.plist rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m new file mode 100644 index 000000000000..bb17fa2b80ff --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClientTests : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClientTests +@end diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh new file mode 100755 index 000000000000..08e3eaaca45a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -0,0 +1,146 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h new file mode 100644 index 000000000000..b2e4925a9e41 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[]; + diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap new file mode 100644 index 000000000000..a848da7ffb30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClientTests { + umbrella header "Pods-SwaggerClientTests-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig similarity index 100% rename from samples/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..a6881f1db9fe --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,615 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6D4EFB901C692C6300B96B06; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0CAA98BEFA303B94D3664C7D /* Pods */ = { + isa = PBXGroup; + children = ( + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C07EC0A94AA0F86D60668B32 /* Pods.framework */, + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6D4EFB881C692C6300B96B06 = { + isa = PBXGroup; + children = ( + 6D4EFB931C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, + 6D4EFB921C692C6300B96B06 /* Products */, + 3FABC56EC0BA84CBF4F99564 /* Frameworks */, + 0CAA98BEFA303B94D3664C7D /* Pods */, + ); + sourceTree = ""; + }; + 6D4EFB921C692C6300B96B06 /* Products */ = { + isa = PBXGroup; + children = ( + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, + 6D4EFB961C692C6300B96B06 /* ViewController.swift */, + 6D4EFB981C692C6300B96B06 /* Main.storyboard */, + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, + 6D4EFBA01C692C6300B96B06 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + 6D4EFBAB1C692C6300B96B06 /* Info.plist */, + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */, + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, + 6D4EFB8D1C692C6300B96B06 /* Sources */, + 6D4EFB8E1C692C6300B96B06 /* Frameworks */, + 6D4EFB8F1C692C6300B96B06 /* Resources */, + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, + 3D9471620628F03313096EB2 /* 📦 Embed Pods Frameworks */, + EEEC2B2D0497D38CEAD2DB24 /* 📦 Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */, + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, + 6D4EFBA11C692C6300B96B06 /* Sources */, + 6D4EFBA21C692C6300B96B06 /* Frameworks */, + 6D4EFBA31C692C6300B96B06 /* Resources */, + ECE47F6BF90C3848F6E94AFF /* 📦 Embed Pods Frameworks */, + 1494090872F3F18E536E8902 /* 📦 Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6D4EFB891C692C6300B96B06 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + 6D4EFB901C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + }; + 6D4EFBA41C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + TestTargetID = 6D4EFB901C692C6300B96B06; + }; + }; + }; + buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6D4EFB881C692C6300B96B06; + productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6D4EFB901C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6D4EFB8F1C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA31C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1494090872F3F18E536E8902 /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 3D9471620628F03313096EB2 /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + B4DB169E5F018305D6759D34 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + CF310079E3CB0BE5BE604471 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + ECE47F6BF90C3848F6E94AFF /* 📦 Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + EEEC2B2D0497D38CEAD2DB24 /* 📦 Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "📦 Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6D4EFB8D1C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA11C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; + targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB991C692C6300B96B06 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB9E1C692C6300B96B06 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6D4EFBAC1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6D4EFBAD1C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6D4EFBAF1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 6D4EFBB01C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 6D4EFBB21C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + 6D4EFBB31C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAC1C692C6300B96B06 /* Debug */, + 6D4EFBAD1C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAF1C692C6300B96B06 /* Debug */, + 6D4EFBB01C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBB21C692C6300B96B06 /* Debug */, + 6D4EFBB31C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..5ba034cec55a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..7fd692961767 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/samples/client/test/swift4/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from samples/client/test/swift4/default/TestClientApp/TestClientApp/Assets.xcassets/AppIcon.appiconset/Contents.json rename to CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..bb71d00fa8ae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..cd7e9a167615 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..802f84f540d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..ffb9e8b209f4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,86 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectation(description: "testCreatePet") + + let newPet = Pet() + let category = PetstoreClient.Category() + category.id = 1234 + category.name = "eyeColor" + newPet.category = category + newPet.id = 1000 + newPet.name = "Fluffy" + newPet.status = .available + + PetAPI.addPet(body: newPet) { (error) in + guard error == nil else { + XCTFail("error creating pet") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectation(description: "testGetPet") + + PetAPI.getPetById(petId: 1000) { (pet, error) in + guard error == nil else { + XCTFail("error retrieving pet") + return + } + + if let pet = pet { + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectation(description: "testDeletePet") + + PetAPI.deletePet(petId: 1000) { (error) in + guard error == nil else { + XCTFail("error deleting pet") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..c48355a6ff8f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,122 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + + let testTimeout = 10.0 + + func test1PlaceOrder() { + let expectation = self.expectation(description: "testPlaceOrder") + let shipDate = Date() + + let newOrder = Order() + newOrder.id = 1000 + newOrder.petId = 1000 + newOrder.complete = false + newOrder.quantity = 10 + newOrder.shipDate = shipDate + // use explicit naming to reference the enum so that we test we don't regress on enum naming + newOrder.status = Order.Status.placed + + StoreAPI.placeOrder(body: newOrder) { (order, error) in + guard error == nil else { + XCTFail("error placing order: \(error.debugDescription)") + return + } + + if let order = order { + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectation(description: "testGetOrder") + + StoreAPI.getOrderById(orderId: 1000) { (order, error) in + guard error == nil else { + XCTFail("error retrieving order: \(error.debugDescription)") + return + } + + if let order = order { + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectation(description: "testDeleteOrder") + + StoreAPI.deleteOrder(orderId: "1000") { (error) in + guard error == nil else { + XCTFail("error deleting order") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testDownloadProgress() { + let responseExpectation = self.expectation(description: "obtain response") + let progressExpectation = self.expectation(description: "obtain progress") + let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) + + requestBuilder.onProgressReady = { (progress) in + progressExpectation.fulfill() + } + + requestBuilder.execute { (response, error) in + responseExpectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} + +private extension Date { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(_ date: Date, format: String) -> Bool { + let fmt = DateFormatter() + fmt.dateFormat = format + return fmt.string(from: self).isEqual(fmt.string(from: date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..f6f87e9e7634 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,164 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testLogin() { + let expectation = self.expectation(description: "testLogin") + + UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in + guard error == nil else { + XCTFail("error logging in") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectation(description: "testLogout") + + UserAPI.logoutUser { (error) in + guard error == nil else { + XCTFail("error logging out") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test1CreateUser() { + let expectation = self.expectation(description: "testCreateUser") + + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + UserAPI.createUser(body: newUser) { (error) in + guard error == nil else { + XCTFail("error creating user") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testCreateUserWithArray() { + let expectation = self.expectation(description: "testCreateUserWithArray") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + let newUser2 = User() + newUser2.email = "test2@test.com" + newUser2.firstName = "Test2" + newUser2.lastName = "Tester2" + newUser2.id = 1001 + newUser2.password = "test2!" + newUser2.phone = "867-5302" + newUser2.username = "test2@test.com" + newUser2.userStatus = 0 + + UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]) { (error) in + guard error == nil else { + XCTFail("error creating users") + return + } + + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetUser() { + let expectation = self.expectation(description: "testGetUser") + + UserAPI.getUserByName(username: "test@test.com") { (user, error) in + guard error == nil else { + XCTFail("error getting user") + return + } + + if let user = user { + XCTAssert(user.userStatus == 0, "invalid userStatus") + XCTAssert(user.email == "test@test.com", "invalid email") + XCTAssert(user.firstName == "Test", "invalid firstName") + XCTAssert(user.lastName == "Tester", "invalid lastName") + XCTAssert(user.password == "test!", "invalid password") + XCTAssert(user.phone == "867-5309", "invalid phone") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteUser() { + let expectation = self.expectation(description: "testDeleteUser") + + UserAPI.deleteUser(username: "test@test.com") { (error) in + guard error == nil else { + XCTFail("error deleting user") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testPathParamsAreEscaped() { + // The path for this operation is /user/{userId}. In order to make a usable path, + // then we must make sure that {userId} is percent-escaped when it is substituted + // into the path. So we intentionally introduce a path with spaces. + let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") + let urlContainsSpace = userRequestBuilder.URLString.contains(" ") + + XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..10919bfdda98 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift3PetstoreClientTests + pom + 1.0-SNAPSHOT + Swift3 Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..85622eef70df --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/default/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..5556eaf23442 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile @@ -0,0 +1,18 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |configuration| + configuration.build_settings['SWIFT_VERSION'] = "3.0" + end + end +end \ No newline at end of file diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Podfile.lock diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/README.md diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Manifest.lock diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/LICENSE b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/LICENSE new file mode 100644 index 000000000000..c547fa84913d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/LICENSE @@ -0,0 +1,20 @@ +Copyright 2016, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h new file mode 100644 index 000000000000..756ba7b7b4d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h @@ -0,0 +1,38 @@ +@import Foundation.NSError; +@import Foundation.NSPointerArray; + +#if TARGET_OS_IPHONE + #define NSPointerArrayMake(N) ({ \ + NSPointerArray *aa = [NSPointerArray strongObjectsPointerArray]; \ + aa.count = N; \ + aa; \ + }) +#else + static inline NSPointerArray * __nonnull NSPointerArrayMake(NSUInteger count) { + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSPointerArray *aa = [[NSPointerArray class] respondsToSelector:@selector(strongObjectsPointerArray)] + ? [NSPointerArray strongObjectsPointerArray] + : [NSPointerArray pointerArrayWithStrongObjects]; + #pragma clang diagnostic pop + aa.count = count; + return aa; + } +#endif + +#define IsError(o) [o isKindOfClass:[NSError class]] +#define IsPromise(o) [o isKindOfClass:[AnyPromise class]] + +#import "AnyPromise.h" + +@interface AnyPromise (Swift) +- (AnyPromise * __nonnull)__thenOn:(__nonnull dispatch_queue_t)q execute:(id __nullable (^ __nonnull)(id __nullable))body; +- (AnyPromise * __nonnull)__catchOn:(__nonnull dispatch_queue_t)q withPolicy:(PMKCatchPolicy)policy execute:(id __nullable (^ __nonnull)(id __nullable))body; +- (AnyPromise * __nonnull)__alwaysOn:(__nonnull dispatch_queue_t)q execute:(void (^ __nonnull)(void))body; +- (void)__pipe:(void(^ __nonnull)(__nullable id))body; +- (AnyPromise * __nonnull)initWithResolverBlock:(void (^ __nonnull)(PMKResolver __nonnull))resolver; +@end + +extern NSError * __nullable PMKProcessUnhandledException(id __nonnull thrown); + +@class PMKArray; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m new file mode 100644 index 000000000000..c0f81f4c30b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m @@ -0,0 +1,141 @@ +#import "PMKCallVariadicBlock.m" +#import "AnyPromise+Private.h" + +extern dispatch_queue_t PMKDefaultDispatchQueue(void); + +NSString *const PMKErrorDomain = @"PMKErrorDomain"; + + +@implementation AnyPromise (objc) + +- (instancetype)initWithResolver:(PMKResolver __strong *)resolver { + return [[self class] promiseWithResolverBlock:^(PMKResolver resolve){ + *resolver = resolve; + }]; +} + +- (AnyPromise *(^)(id))then { + return ^(id block) { + return [self __thenOn:PMKDefaultDispatchQueue() execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, id))thenOn { + return ^(dispatch_queue_t queue, id block) { + return [self __thenOn:queue execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))thenInBackground { + return ^(id block) { + return [self __thenOn:dispatch_get_global_queue(0, 0) execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, id))catchOn { + return ^(dispatch_queue_t q, id block) { + return [self __catchOn:q withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catch { + return ^(id block) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catchInBackground { + return ^(id block) { + return [self __catchOn:dispatch_get_global_queue(0, 0) withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, PMKCatchPolicy, id))catchOnWithPolicy { + return ^(dispatch_queue_t q, PMKCatchPolicy policy, id block) { + return [self __catchOn:q withPolicy:policy execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(PMKCatchPolicy, id))catchWithPolicy { + return ^(PMKCatchPolicy policy, id block) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:policy execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_block_t))always { + return ^(dispatch_block_t block) { + return [self __alwaysOn:PMKDefaultDispatchQueue() execute:block]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, dispatch_block_t))alwaysOn { + return ^(dispatch_queue_t queue, dispatch_block_t block) { + return [self __alwaysOn:queue execute:block]; + }; +} + +@end + + + +@implementation AnyPromise (Adapters) + ++ (instancetype)promiseWithAdapterBlock:(void (^)(PMKAdapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(id value, id error){ + resolve(error ?: value); + }); + }]; +} + ++ (instancetype)promiseWithIntegerAdapterBlock:(void (^)(PMKIntegerAdapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(NSInteger value, id error){ + if (error) { + resolve(error); + } else { + resolve(@(value)); + } + }); + }]; +} + ++ (instancetype)promiseWithBooleanAdapterBlock:(void (^)(PMKBooleanAdapter adapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(BOOL value, id error){ + if (error) { + resolve(error); + } else { + resolve(@(value)); + } + }); + }]; +} + +- (id)value { + id obj = [self valueForKey:@"__value"]; + + if ([obj isKindOfClass:[PMKArray class]]) { + return obj[0]; + } else { + return obj; + } +} + +@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/DispatchQueue+Promise.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/DispatchQueue+Promise.swift new file mode 100644 index 000000000000..2c912129e2bf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/DispatchQueue+Promise.swift @@ -0,0 +1,53 @@ +import Dispatch + +extension DispatchQueue { + /** + Submits a block for asynchronous execution on a dispatch queue. + + DispatchQueue.global().promise { + try md5(input) + }.then { md5 in + //… + } + + - Parameter body: The closure that resolves this promise. + - Returns: A new promise resolved by the result of the provided closure. + + - SeeAlso: `DispatchQueue.async(group:qos:flags:execute:)` + - SeeAlso: `dispatch_promise()` + - SeeAlso: `dispatch_promise_on()` + */ + public final func promise(group: DispatchGroup? = nil, qos: DispatchQoS = .default, flags: DispatchWorkItemFlags = [], execute body: @escaping () throws -> T) -> Promise { + + return Promise(sealant: { resolve in + async(group: group, qos: qos, flags: flags) { + do { + resolve(.fulfilled(try body())) + } catch { + resolve(Resolution(error)) + } + } + }) + } + + /// Unavailable due to Swift compiler issues + @available(*, unavailable) + public final func promise(group: DispatchGroup? = nil, qos: DispatchQoS = .default, flags: DispatchWorkItemFlags = [], execute body: () throws -> Promise) -> Promise { fatalError() } + + /** + The default queue for all handlers. + + Defaults to `DispatchQueue.main`. + + - SeeAlso: `PMKDefaultDispatchQueue()` + - SeeAlso: `PMKSetDefaultDispatchQueue()` + */ + class public final var `default`: DispatchQueue { + get { + return __PMKDefaultDispatchQueue() + } + set { + __PMKSetDefaultDispatchQueue(newValue) + } + } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/GlobalState.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/GlobalState.m new file mode 100644 index 000000000000..c156cde9480f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/GlobalState.m @@ -0,0 +1,76 @@ +#import "PromiseKit.h" + +@interface NSError (PMK) +- (BOOL)isCancelled; +@end + +static dispatch_once_t __PMKDefaultDispatchQueueToken; +static dispatch_queue_t __PMKDefaultDispatchQueue; + +dispatch_queue_t PMKDefaultDispatchQueue() { + dispatch_once(&__PMKDefaultDispatchQueueToken, ^{ + if (__PMKDefaultDispatchQueue == nil) { + __PMKDefaultDispatchQueue = dispatch_get_main_queue(); + } + }); + return __PMKDefaultDispatchQueue; +} + +void PMKSetDefaultDispatchQueue(dispatch_queue_t newDefaultQueue) { + dispatch_once(&__PMKDefaultDispatchQueueToken, ^{ + __PMKDefaultDispatchQueue = newDefaultQueue; + }); +} + + +static dispatch_once_t __PMKErrorUnhandlerToken; +static void (^__PMKErrorUnhandler)(NSError *); + +void PMKUnhandledErrorHandler(NSError *error) { + dispatch_once(&__PMKErrorUnhandlerToken, ^{ + if (__PMKErrorUnhandler == nil) { + __PMKErrorUnhandler = ^(NSError *error){ + if (!error.isCancelled) { + NSLog(@"PromiseKit: unhandled error: %@", error); + } + }; + } + }); + return __PMKErrorUnhandler(error); +} + +void PMKSetUnhandledErrorHandler(void(^newHandler)(NSError *)) { + dispatch_once(&__PMKErrorUnhandlerToken, ^{ + __PMKErrorUnhandler = newHandler; + }); +} + + +static dispatch_once_t __PMKUnhandledExceptionHandlerToken; +static NSError *(^__PMKUnhandledExceptionHandler)(id); + +NSError *PMKProcessUnhandledException(id thrown) { + + dispatch_once(&__PMKUnhandledExceptionHandlerToken, ^{ + __PMKUnhandledExceptionHandler = ^id(id reason){ + if ([reason isKindOfClass:[NSError class]]) + return reason; + if ([reason isKindOfClass:[NSString class]]) + return [NSError errorWithDomain:PMKErrorDomain code:PMKUnexpectedError userInfo:@{NSLocalizedDescriptionKey: reason}]; + return nil; + }; + }); + + id err = __PMKUnhandledExceptionHandler(thrown); + if (!err) { + NSLog(@"PromiseKit no longer catches *all* exceptions. However you can change this behavior by setting a new PMKProcessUnhandledException handler."); + @throw thrown; + } + return err; +} + +void PMKSetUnhandledExceptionHandler(NSError *(^newHandler)(id)) { + dispatch_once(&__PMKUnhandledExceptionHandlerToken, ^{ + __PMKUnhandledExceptionHandler = newHandler; + }); +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m new file mode 100644 index 000000000000..700c1b37ef7c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m @@ -0,0 +1,77 @@ +#import + +struct PMKBlockLiteral { + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int flags; + int reserved; + void (*invoke)(void *, ...); + struct block_descriptor { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + // optional helper functions + void (*copy_helper)(void *dst, void *src); // IFF (1<<25) + void (*dispose_helper)(void *src); // IFF (1<<25) + // required ABI.2010.3.16 + const char *signature; // IFF (1<<30) + } *descriptor; + // imported variables +}; + +typedef NS_OPTIONS(NSUInteger, PMKBlockDescriptionFlags) { + PMKBlockDescriptionFlagsHasCopyDispose = (1 << 25), + PMKBlockDescriptionFlagsHasCtor = (1 << 26), // helpers have C++ code + PMKBlockDescriptionFlagsIsGlobal = (1 << 28), + PMKBlockDescriptionFlagsHasStret = (1 << 29), // IFF BLOCK_HAS_SIGNATURE + PMKBlockDescriptionFlagsHasSignature = (1 << 30) +}; + +// It appears 10.7 doesn't support quotes in method signatures. Remove them +// via @rabovik's method. See https://github.com/OliverLetterer/SLObjectiveCRuntimeAdditions/pull/2 +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 +NS_INLINE static const char * pmk_removeQuotesFromMethodSignature(const char *str){ + char *result = malloc(strlen(str) + 1); + BOOL skip = NO; + char *to = result; + char c; + while ((c = *str++)) { + if ('"' == c) { + skip = !skip; + continue; + } + if (skip) continue; + *to++ = c; + } + *to = '\0'; + return result; +} +#endif + +static NSMethodSignature *NSMethodSignatureForBlock(id block) { + if (!block) + return nil; + + struct PMKBlockLiteral *blockRef = (__bridge struct PMKBlockLiteral *)block; + PMKBlockDescriptionFlags flags = (PMKBlockDescriptionFlags)blockRef->flags; + + if (flags & PMKBlockDescriptionFlagsHasSignature) { + void *signatureLocation = blockRef->descriptor; + signatureLocation += sizeof(unsigned long int); + signatureLocation += sizeof(unsigned long int); + + if (flags & PMKBlockDescriptionFlagsHasCopyDispose) { + signatureLocation += sizeof(void(*)(void *dst, void *src)); + signatureLocation += sizeof(void (*)(void *src)); + } + + const char *signature = (*(const char **)signatureLocation); +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 + signature = pmk_removeQuotesFromMethodSignature(signature); + NSMethodSignature *nsSignature = [NSMethodSignature signatureWithObjCTypes:signature]; + free((void *)signature); + + return nsSignature; +#endif + return [NSMethodSignature signatureWithObjCTypes:signature]; + } + return 0; +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m new file mode 100644 index 000000000000..f89197ec04e8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m @@ -0,0 +1,114 @@ +#import "NSMethodSignatureForBlock.m" +#import +#import +#import "AnyPromise+Private.h" +#import +#import +#import + +#ifndef PMKLog +#define PMKLog NSLog +#endif + +@interface PMKArray : NSObject { +@public + id objs[3]; + NSUInteger count; +} @end + +@implementation PMKArray + +- (id)objectAtIndexedSubscript:(NSUInteger)idx { + if (count <= idx) { + // this check is necessary due to lack of checks in `pmk_safely_call_block` + return nil; + } + return objs[idx]; +} + +@end + +id __PMKArrayWithCount(NSUInteger count, ...) { + PMKArray *this = [PMKArray new]; + this->count = count; + va_list args; + va_start(args, count); + for (NSUInteger x = 0; x < count; ++x) + this->objs[x] = va_arg(args, id); + va_end(args); + return this; +} + + +static inline id _PMKCallVariadicBlock(id frock, id result) { + NSCAssert(frock, @""); + + NSMethodSignature *sig = NSMethodSignatureForBlock(frock); + const NSUInteger nargs = sig.numberOfArguments; + const char rtype = sig.methodReturnType[0]; + + #define call_block_with_rtype(type) ({^type{ \ + switch (nargs) { \ + case 1: \ + return ((type(^)(void))frock)(); \ + case 2: { \ + const id arg = [result class] == [PMKArray class] ? result[0] : result; \ + return ((type(^)(id))frock)(arg); \ + } \ + case 3: { \ + type (^block)(id, id) = frock; \ + return [result class] == [PMKArray class] \ + ? block(result[0], result[1]) \ + : block(result, nil); \ + } \ + case 4: { \ + type (^block)(id, id, id) = frock; \ + return [result class] == [PMKArray class] \ + ? block(result[0], result[1], result[2]) \ + : block(result, nil, nil); \ + } \ + default: \ + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"PromiseKit: The provided block’s argument count is unsupported." userInfo:nil]; \ + }}();}) + + switch (rtype) { + case 'v': + call_block_with_rtype(void); + return nil; + case '@': + return call_block_with_rtype(id) ?: nil; + case '*': { + char *str = call_block_with_rtype(char *); + return str ? @(str) : nil; + } + case 'c': return @(call_block_with_rtype(char)); + case 'i': return @(call_block_with_rtype(int)); + case 's': return @(call_block_with_rtype(short)); + case 'l': return @(call_block_with_rtype(long)); + case 'q': return @(call_block_with_rtype(long long)); + case 'C': return @(call_block_with_rtype(unsigned char)); + case 'I': return @(call_block_with_rtype(unsigned int)); + case 'S': return @(call_block_with_rtype(unsigned short)); + case 'L': return @(call_block_with_rtype(unsigned long)); + case 'Q': return @(call_block_with_rtype(unsigned long long)); + case 'f': return @(call_block_with_rtype(float)); + case 'd': return @(call_block_with_rtype(double)); + case 'B': return @(call_block_with_rtype(_Bool)); + case '^': + if (strcmp(sig.methodReturnType, "^v") == 0) { + call_block_with_rtype(void); + return nil; + } + // else fall through! + default: + @throw [NSException exceptionWithName:@"PromiseKit" reason:@"PromiseKit: Unsupported method signature." userInfo:nil]; + } +} + +static id PMKCallVariadicBlock(id frock, id result) { + @try { + return _PMKCallVariadicBlock(frock, result); + } @catch (id thrown) { + return PMKProcessUnhandledException(thrown); + } +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+AnyPromise.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+AnyPromise.swift new file mode 100644 index 000000000000..5d77d4c83328 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+AnyPromise.swift @@ -0,0 +1,41 @@ +import class Dispatch.DispatchQueue + +extension Promise { + /** + The provided closure executes once this promise resolves. + + - Parameter on: The queue on which the provided closure executes. + - Parameter body: The closure that is executed when this promise fulfills. + - Returns: A new promise that resolves when the `AnyPromise` returned from the provided closure resolves. For example: + + URLSession.GET(url).then { (data: NSData) -> AnyPromise in + //… + return SCNetworkReachability() + }.then { _ in + //… + } + */ + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> AnyPromise) -> Promise { + return Promise(sealant: { resolve in + state.then(on: q, else: resolve) { value in + try body(value).state.pipe(resolve) + } + }) + } + + @available(*, unavailable, message: "unwrap the promise") + public func then(on: DispatchQueue = .default, execute body: (T) throws -> AnyPromise?) -> Promise { fatalError() } +} + +/** + `firstly` can make chains more readable. +*/ +public func firstly(execute body: () throws -> AnyPromise) -> Promise { + return Promise(sealant: { resolve in + do { + try body().state.pipe(resolve) + } catch { + resolve(Resolution(error)) + } + }) +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift new file mode 100644 index 000000000000..251ea6dcb4b6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift @@ -0,0 +1,57 @@ +extension Promise { + /** + - Returns: The error with which this promise was rejected; `nil` if this promise is not rejected. + */ + public var error: Error? { + switch state.get() { + case .none: + return nil + case .some(.fulfilled): + return nil + case .some(.rejected(let error, _)): + return error + } + } + + /** + - Returns: `true` if the promise has not yet resolved. + */ + public var isPending: Bool { + return state.get() == nil + } + + /** + - Returns: `true` if the promise has resolved. + */ + public var isResolved: Bool { + return !isPending + } + + /** + - Returns: `true` if the promise was fulfilled. + */ + public var isFulfilled: Bool { + return value != nil + } + + /** + - Returns: `true` if the promise was rejected. + */ + public var isRejected: Bool { + return error != nil + } + + /** + - Returns: The value with which this promise was fulfilled or `nil` if this promise is pending or rejected. + */ + public var value: T? { + switch state.get() { + case .none: + return nil + case .some(.fulfilled(let value)): + return value + case .some(.rejected): + return nil + } + } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h new file mode 100644 index 000000000000..2651530cbc92 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h @@ -0,0 +1,7 @@ +#import "fwd.h" +#import "AnyPromise.h" + +#import // `FOUNDATION_EXPORT` + +FOUNDATION_EXPORT double PromiseKitVersionNumber; +FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m new file mode 100644 index 000000000000..25f9966fc59e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m @@ -0,0 +1,14 @@ +#import "AnyPromise.h" +@import Dispatch; +@import Foundation.NSDate; +@import Foundation.NSValue; + +/// @return A promise that fulfills after the specified duration. +AnyPromise *PMKAfter(NSTimeInterval duration) { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)); + dispatch_after(time, dispatch_get_global_queue(0, 0), ^{ + resolve(@(duration)); + }); + }]; +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift new file mode 100644 index 000000000000..902dc4264a30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift @@ -0,0 +1,37 @@ +import struct Foundation.TimeInterval +import Dispatch + +/** + - Returns: A new promise that fulfills after the specified duration. +*/ +@available(*, deprecated: 4.3, message: "Use after(seconds:)") +public func after(interval: TimeInterval) -> Promise { + return after(seconds: interval) +} + +/** + after(.seconds(2)).then { + } + +- Returns: A new promise that fulfills after the specified duration. +*/ +public func after(seconds: TimeInterval) -> Promise { + return Promise { fulfill, _ in + let when = DispatchTime.now() + seconds + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + } +} + +/** + - Returns: A new promise that fulfills after the specified duration. +*/ +public func after(interval: DispatchTimeInterval) -> Promise { + return Promise { fulfill, _ in + let when = DispatchTime.now() + interval + #if swift(>=4.0) + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + #else + DispatchQueue.global().asyncAfter(deadline: when, execute: fulfill) + #endif + } +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m new file mode 100644 index 000000000000..ecb89f711183 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m @@ -0,0 +1,10 @@ +#import "AnyPromise.h" +@import Dispatch; + +AnyPromise *dispatch_promise_on(dispatch_queue_t queue, id block) { + return [AnyPromise promiseWithValue:nil].thenOn(queue, block); +} + +AnyPromise *dispatch_promise(id block) { + return dispatch_promise_on(dispatch_get_global_queue(0, 0), block); +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m new file mode 100644 index 000000000000..1065d91f2f3b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m @@ -0,0 +1,29 @@ +#import "AnyPromise.h" +#import "AnyPromise+Private.h" +@import CoreFoundation.CFRunLoop; + +/** + Suspends the active thread waiting on the provided promise. + + @return The value of the provided promise once resolved. + */ +id PMKHang(AnyPromise *promise) { + if (promise.pending) { + static CFRunLoopSourceContext context; + + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + CFRunLoopSourceRef runLoopSource = CFRunLoopSourceCreate(NULL, 0, &context); + CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopDefaultMode); + + promise.always(^{ + CFRunLoopStop(runLoop); + }); + while (promise.pending) { + CFRunLoopRun(); + } + CFRunLoopRemoveSource(runLoop, runLoopSource, kCFRunLoopDefaultMode); + CFRelease(runLoopSource); + } + + return promise.value; +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m new file mode 100644 index 000000000000..979f092df088 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m @@ -0,0 +1,54 @@ +@import Foundation.NSDictionary; +#import "AnyPromise+Private.h" +#import +@import Foundation.NSError; +@import Foundation.NSNull; +#import "PromiseKit.h" +#import + +/** + Waits on all provided promises. + + `PMKWhen` rejects as soon as one of the provided promises rejects. `PMKJoin` waits on all provided promises, then rejects if any of those promises rejects, otherwise it fulfills with values from the provided promises. + + - Returns: A new promise that resolves once all the provided promises resolve. +*/ +AnyPromise *PMKJoin(NSArray *promises) { + if (promises == nil) + return [AnyPromise promiseWithValue:[NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"PMKJoin(nil)"}]]; + + if (promises.count == 0) + return [AnyPromise promiseWithValue:promises]; + + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + NSPointerArray *results = NSPointerArrayMake(promises.count); + __block atomic_int countdown = promises.count; + __block BOOL rejected = NO; + + [promises enumerateObjectsUsingBlock:^(AnyPromise *promise, NSUInteger ii, BOOL *stop) { + [promise __pipe:^(id value) { + + if (IsError(value)) { + rejected = YES; + } + + //FIXME surely this isn't thread safe on multiple cores? + [results replacePointerAtIndex:ii withPointer:(__bridge void *)(value ?: [NSNull null])]; + + atomic_fetch_sub_explicit(&countdown, 1, memory_order_relaxed); + + if (countdown == 0) { + if (!rejected) { + resolve(results.allObjects); + } else { + id userInfo = @{PMKJoinPromisesKey: promises}; + id err = [NSError errorWithDomain:PMKErrorDomain code:PMKJoinError userInfo:userInfo]; + resolve(err); + } + } + }]; + + (void) stop; + }]; + }]; +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift new file mode 100644 index 000000000000..9ff17005c9e3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift @@ -0,0 +1,40 @@ +/** + Resolves with the first resolving promise from a set of promises. + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: A new promise that resolves when the first promise in the provided promises resolves. + - Warning: If any of the provided promises reject, the returned promise is rejected. + - Warning: aborts if the array is empty. +*/ +public func race(promises: [Promise]) -> Promise { + guard promises.count > 0 else { + fatalError("Cannot race with an empty array of promises") + } + return _race(promises: promises) +} + +/** + Resolves with the first resolving promise from a set of promises. + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: A new promise that resolves when the first promise in the provided promises resolves. + - Warning: If any of the provided promises reject, the returned promise is rejected. + - Warning: aborts if the array is empty. +*/ +public func race(_ promises: Promise...) -> Promise { + return _race(promises: promises) +} + +private func _race(promises: [Promise]) -> Promise { + return Promise(sealant: { resolve in + for promise in promises { + promise.state.pipe(resolve) + } + }) +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m new file mode 100644 index 000000000000..cafb54720c98 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m @@ -0,0 +1,100 @@ +@import Foundation.NSDictionary; +#import "AnyPromise+Private.h" +@import Foundation.NSProgress; +#import +@import Foundation.NSError; +@import Foundation.NSNull; +#import "PromiseKit.h" + +// NSProgress resources: +// * https://robots.thoughtbot.com/asynchronous-nsprogress +// * http://oleb.net/blog/2014/03/nsprogress/ +// NSProgress! Beware! +// * https://github.com/AFNetworking/AFNetworking/issues/2261 + +/** + Wait for all promises in a set to resolve. + + @note If *any* of the provided promises reject, the returned promise is immediately rejected with that error. + @warning In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed, in such situations use `when(resolved:)`. + @param promises The promises upon which to wait before the returned promise resolves. + @note PMKWhen provides NSProgress. + @return A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. +*/ +AnyPromise *PMKWhen(id promises) { + if (promises == nil) + return [AnyPromise promiseWithValue:[NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"PMKWhen(nil)"}]]; + + if ([promises isKindOfClass:[NSArray class]] || [promises isKindOfClass:[NSDictionary class]]) { + if ([promises count] == 0) + return [AnyPromise promiseWithValue:promises]; + } else if ([promises isKindOfClass:[AnyPromise class]]) { + promises = @[promises]; + } else { + return [AnyPromise promiseWithValue:promises]; + } + +#ifndef PMKDisableProgress + NSProgress *progress = [NSProgress progressWithTotalUnitCount:(int64_t)[promises count]]; + progress.pausable = NO; + progress.cancellable = NO; +#else + struct PMKProgress { + int completedUnitCount; + int totalUnitCount; + double fractionCompleted; + }; + __block struct PMKProgress progress; +#endif + + __block int32_t countdown = (int32_t)[promises count]; + BOOL const isdict = [promises isKindOfClass:[NSDictionary class]]; + + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + NSInteger index = 0; + + for (__strong id key in promises) { + AnyPromise *promise = isdict ? promises[key] : key; + if (!isdict) key = @(index); + + if (![promise isKindOfClass:[AnyPromise class]]) + promise = [AnyPromise promiseWithValue:promise]; + + [promise __pipe:^(id value){ + if (progress.fractionCompleted >= 1) + return; + + if (IsError(value)) { + progress.completedUnitCount = progress.totalUnitCount; + + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:[value userInfo] ?: @{}]; + userInfo[PMKFailingPromiseIndexKey] = key; + [userInfo setObject:value forKey:NSUnderlyingErrorKey]; + id err = [[NSError alloc] initWithDomain:[value domain] code:[value code] userInfo:userInfo]; + resolve(err); + } + else if (OSAtomicDecrement32(&countdown) == 0) { + progress.completedUnitCount = progress.totalUnitCount; + + id results; + if (isdict) { + results = [NSMutableDictionary new]; + for (id key in promises) { + id promise = promises[key]; + results[key] = IsPromise(promise) ? ((AnyPromise *)promise).value : promise; + } + } else { + results = [NSMutableArray new]; + for (AnyPromise *promise in promises) { + id value = IsPromise(promise) ? (promise.value ?: [NSNull null]) : promise; + [results addObject:value]; + } + } + resolve(results); + } else { + progress.completedUnitCount++; + } + }]; + } + }]; +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m new file mode 100644 index 000000000000..a6c4594242e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Alamofire : NSObject +@end +@implementation PodsDummy_Alamofire +@end diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h new file mode 100644 index 000000000000..00014e3cd82a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap new file mode 100644 index 000000000000..d1f125fab6b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap @@ -0,0 +1,6 @@ +framework module Alamofire { + umbrella header "Alamofire-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist new file mode 100644 index 000000000000..cba258550bd0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m new file mode 100644 index 000000000000..749b412f85c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PetstoreClient : NSObject +@end +@implementation PodsDummy_PetstoreClient +@end diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h new file mode 100644 index 000000000000..2a366623a36f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double PetstoreClientVersionNumber; +FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap new file mode 100644 index 000000000000..7fdfc46cf796 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap @@ -0,0 +1,6 @@ +framework module PetstoreClient { + umbrella header "PetstoreClient-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m new file mode 100644 index 000000000000..6236440163b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClient : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClient +@end diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h new file mode 100644 index 000000000000..b7da51aaf252 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[]; + diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap new file mode 100644 index 000000000000..ef919b6c0d1f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClient { + umbrella header "Pods-SwaggerClient-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown new file mode 100644 index 000000000000..102af7538517 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist new file mode 100644 index 000000000000..7acbad1eabbf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m new file mode 100644 index 000000000000..bb17fa2b80ff --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClientTests : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClientTests +@end diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh new file mode 100755 index 000000000000..08e3eaaca45a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -0,0 +1,146 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h new file mode 100644 index 000000000000..b2e4925a9e41 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[]; + diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap new file mode 100644 index 000000000000..a848da7ffb30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClientTests { + umbrella header "Pods-SwaggerClientTests-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist new file mode 100644 index 000000000000..df276491a16e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.4.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m new file mode 100644 index 000000000000..ce92451305bc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PromiseKit : NSObject +@end +@implementation PodsDummy_PromiseKit +@end diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap new file mode 100644 index 000000000000..2b26033e4ab5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap @@ -0,0 +1,6 @@ +framework module PromiseKit { + umbrella header "PromiseKit-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig similarity index 100% rename from samples/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig rename to CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..fafcbb55afc4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,528 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6D4EFB901C692C6300B96B06; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0CAA98BEFA303B94D3664C7D /* Pods */ = { + isa = PBXGroup; + children = ( + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C07EC0A94AA0F86D60668B32 /* Pods.framework */, + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6D4EFB881C692C6300B96B06 = { + isa = PBXGroup; + children = ( + 6D4EFB931C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, + 6D4EFB921C692C6300B96B06 /* Products */, + 3FABC56EC0BA84CBF4F99564 /* Frameworks */, + 0CAA98BEFA303B94D3664C7D /* Pods */, + ); + sourceTree = ""; + }; + 6D4EFB921C692C6300B96B06 /* Products */ = { + isa = PBXGroup; + children = ( + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, + 6D4EFB961C692C6300B96B06 /* ViewController.swift */, + 6D4EFB981C692C6300B96B06 /* Main.storyboard */, + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, + 6D4EFBA01C692C6300B96B06 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + 6D4EFBAB1C692C6300B96B06 /* Info.plist */, + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, + 6D4EFB8D1C692C6300B96B06 /* Sources */, + 6D4EFB8E1C692C6300B96B06 /* Frameworks */, + 6D4EFB8F1C692C6300B96B06 /* Resources */, + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, + 6D4EFBA11C692C6300B96B06 /* Sources */, + 6D4EFBA21C692C6300B96B06 /* Frameworks */, + 6D4EFBA31C692C6300B96B06 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6D4EFB891C692C6300B96B06 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + 6D4EFB901C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + }; + 6D4EFBA41C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + TestTargetID = 6D4EFB901C692C6300B96B06; + }; + }; + }; + buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6D4EFB881C692C6300B96B06; + productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6D4EFB901C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6D4EFB8F1C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA31C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6D4EFB8D1C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA11C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; + targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB991C692C6300B96B06 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB9E1C692C6300B96B06 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6D4EFBAC1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6D4EFBAD1C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6D4EFBAF1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + 6D4EFBB01C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + 6D4EFBB21C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + 6D4EFBB31C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAC1C692C6300B96B06 /* Debug */, + 6D4EFBAD1C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAF1C692C6300B96B06 /* Debug */, + 6D4EFBB01C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBB21C692C6300B96B06 /* Debug */, + 6D4EFBB31C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..4d00ed5f92e4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..7fd692961767 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..1d060ed28827 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..bb71d00fa8ae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..cd7e9a167615 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,25 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..802f84f540d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..7151720bf4e5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,69 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectation(description: "testCreatePet") + let newPet = Pet() + let category = PetstoreClient.Category() + category.id = 1234 + category.name = "eyeColor" + newPet.category = category + newPet.id = 1000 + newPet.name = "Fluffy" + newPet.status = .available + PetAPI.addPet(body: newPet).then { + expectation.fulfill() + }.always { + // Noop for now + }.catch { errorType in + XCTFail("error creating pet") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectation(description: "testGetPet") + PetAPI.getPetById(petId: 1000).then { pet -> Void in + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + expectation.fulfill() + }.always { + // Noop for now + }.catch { errorType in + XCTFail("error creating pet") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectation(description: "testDeletePet") + PetAPI.deletePet(petId: 1000).then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..6a40c5643786 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,88 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + + let testTimeout = 10.0 + + func test1PlaceOrder() { + let order = Order() + let shipDate = Date() + order.id = 1000 + order.petId = 1000 + order.complete = false + order.quantity = 10 + order.shipDate = shipDate + // use explicit naming to reference the enum so that we test we don't regress on enum naming + order.status = Order.Status.placed + let expectation = self.expectation(description: "testPlaceOrder") + StoreAPI.placeOrder(body: order).then { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + }.always { + // Noop for now + }.catch { errorType in + XCTFail("error placing order") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectation(description: "testGetOrder") + StoreAPI.getOrderById(orderId: 1000).then { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + expectation.fulfill() + }.always { + // Noop for now + }.catch { errorType in + XCTFail("error placing order") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectation(description: "testDeleteOrder") + StoreAPI.deleteOrder(orderId: "1000").then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} + +private extension Date { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(_ date: Date, format: String) -> Bool { + let fmt = DateFormatter() + fmt.dateFormat = format + return fmt.string(from: self).isEqual(fmt.string(from: date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..ec8631589c2d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,115 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + + func testLogin() { + let expectation = self.expectation(description: "testLogin") + UserAPI.loginUser(username: "swiftTester", password: "swift").then { _ -> Void in + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectation(description: "testLogout") + UserAPI.logoutUser().then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test1CreateUser() { + let expectation = self.expectation(description: "testCreateUser") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + UserAPI.createUser(body: newUser).then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testCreateUserWithArray() { + let expectation = self.expectation(description: "testCreateUserWithArray") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + let newUser2 = User() + newUser2.email = "test2@test.com" + newUser2.firstName = "Test2" + newUser2.lastName = "Tester2" + newUser2.id = 1001 + newUser2.password = "test2!" + newUser2.phone = "867-5302" + newUser2.username = "test2@test.com" + newUser2.userStatus = 0 + + _ = UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]).then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetUser() { + let expectation = self.expectation(description: "testGetUser") + UserAPI.getUserByName(username: "test@test.com").then {user -> Void in + XCTAssert(user.userStatus == 0, "invalid userStatus") + XCTAssert(user.email == "test@test.com", "invalid email") + XCTAssert(user.firstName == "Test", "invalid firstName") + XCTAssert(user.lastName == "Tester", "invalid lastName") + XCTAssert(user.password == "test!", "invalid password") + XCTAssert(user.phone == "867-5309", "invalid phone") + expectation.fulfill() + }.always { + // Noop for now + }.catch { errorType in + XCTFail("error getting user") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteUser() { + let expectation = self.expectation(description: "testDeleteUser") + UserAPI.deleteUser(username: "test@test.com").then { + expectation.fulfill() + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testPathParamsAreEscaped() { + // The path for this operation is /user/{userId}. In order to make a usable path, + // then we must make sure that {userId} is percent-escaped when it is substituted + // into the path. So we intentionally introduce a path with spaces. + let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") + let urlContainsSpace = userRequestBuilder.URLString.contains(" ") + + XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..16941c95284d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift3PromiseKitPetstoreClientTests + pom + 1.0-SNAPSHOT + Swift3 PromiseKit Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..f1d496086680 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/promisekit/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..77b1f16f2fe6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile @@ -0,0 +1,18 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |configuration| + configuration.build_settings['SWIFT_VERSION'] = "3.0" + end + end +end diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Podfile.lock diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/README.md diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Manifest.lock diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/LICENSE.md b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/LICENSE.md new file mode 100644 index 000000000000..d6765d9c9b9b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/LICENSE.md @@ -0,0 +1,9 @@ +**The MIT License** +**Copyright © 2015 Krunoslav Zaher** +**All rights reserved.** + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift new file mode 100644 index 000000000000..552314a16909 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift @@ -0,0 +1,21 @@ +// +// DispatchQueue+Extensions.swift +// Platform +// +// Created by Krunoslav Zaher on 10/22/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Dispatch + +extension DispatchQueue { + private static var token: DispatchSpecificKey<()> = { + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + return key + }() + + static var isMain: Bool { + return DispatchQueue.getSpecific(key: token) != nil + } +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/RecursiveLock.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/RecursiveLock.swift new file mode 100644 index 000000000000..c03471d502f4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/RecursiveLock.swift @@ -0,0 +1,34 @@ +// +// RecursiveLock.swift +// Platform +// +// Created by Krunoslav Zaher on 12/18/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import class Foundation.NSRecursiveLock + +#if TRACE_RESOURCES + class RecursiveLock: NSRecursiveLock { + override init() { + _ = Resources.incrementTotal() + super.init() + } + + override func lock() { + super.lock() + _ = Resources.incrementTotal() + } + + override func unlock() { + super.unlock() + _ = Resources.decrementTotal() + } + + deinit { + _ = Resources.decrementTotal() + } + } +#else + typealias RecursiveLock = NSRecursiveLock +#endif diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/README.md diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedSubscribeType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift new file mode 100644 index 000000000000..d89c5aa70b9c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift @@ -0,0 +1,18 @@ +// +// ObservableConvertibleType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Type that can be converted to observable sequence (`Observable`). +public protocol ObservableConvertibleType { + /// Type of elements in sequence. + associatedtype E + + /// Converts `self` to `Observable` sequence. + /// + /// - returns: Observable sequence that represents `self`. + func asObservable() -> Observable +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Reactive.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Reactive.swift new file mode 100644 index 000000000000..b87399664f3e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Reactive.swift @@ -0,0 +1,74 @@ +// +// Reactive.swift +// RxSwift +// +// Created by Yury Korolev on 5/2/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +/** + Use `Reactive` proxy as customization point for constrained protocol extensions. + + General pattern would be: + + // 1. Extend Reactive protocol with constrain on Base + // Read as: Reactive Extension where Base is a SomeType + extension Reactive where Base: SomeType { + // 2. Put any specific reactive extension for SomeType here + } + + With this approach we can have more specialized methods and properties using + `Base` and not just specialized on common base type. + + */ + +public struct Reactive { + /// Base object to extend. + public let base: Base + + /// Creates extensions with base object. + /// + /// - parameter base: Base object. + public init(_ base: Base) { + self.base = base + } +} + +/// A type that has reactive extensions. +public protocol ReactiveCompatible { + /// Extended type + associatedtype CompatibleType + + /// Reactive extensions. + static var rx: Reactive.Type { get set } + + /// Reactive extensions. + var rx: Reactive { get set } +} + +extension ReactiveCompatible { + /// Reactive extensions. + public static var rx: Reactive.Type { + get { + return Reactive.self + } + set { + // this enables using Reactive to "mutate" base type + } + } + + /// Reactive extensions. + public var rx: Reactive { + get { + return Reactive(self) + } + set { + // this enables using Reactive to "mutate" base object + } + } +} + +import class Foundation.NSObject + +/// Extend NSObject with `rx` proxy. +extension NSObject: ReactiveCompatible { } diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ImmediateScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/AnonymousInvocable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift new file mode 100644 index 000000000000..0dba4336a743 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift @@ -0,0 +1,17 @@ +// +// InvocableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol InvocableType { + func invoke() +} + +protocol InvocableWithValueType { + associatedtype Value + + func invoke(_ value: Value) +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/AsyncSubject.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/BehaviorSubject.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/PublishSubject.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/ReplaySubject.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/SubjectType.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/Variable.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/Variable.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/Variable.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Subjects/Variable.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/Completable+AndThen.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence+Zip+arity.swift diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Traits/PrimitiveSequence.swift diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m new file mode 100644 index 000000000000..a6c4594242e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Alamofire : NSObject +@end +@implementation PodsDummy_Alamofire +@end diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h new file mode 100644 index 000000000000..00014e3cd82a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap new file mode 100644 index 000000000000..d1f125fab6b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap @@ -0,0 +1,6 @@ +framework module Alamofire { + umbrella header "Alamofire-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist new file mode 100644 index 000000000000..c1c4a98b9a1e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.5.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist new file mode 100644 index 000000000000..cba258550bd0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m new file mode 100644 index 000000000000..749b412f85c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PetstoreClient : NSObject +@end +@implementation PodsDummy_PetstoreClient +@end diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h new file mode 100644 index 000000000000..2a366623a36f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double PetstoreClientVersionNumber; +FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap new file mode 100644 index 000000000000..7fdfc46cf796 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap @@ -0,0 +1,6 @@ +framework module PetstoreClient { + umbrella header "PetstoreClient-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m new file mode 100644 index 000000000000..6236440163b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClient : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClient +@end diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h new file mode 100644 index 000000000000..b7da51aaf252 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[]; + diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap new file mode 100644 index 000000000000..ef919b6c0d1f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClient { + umbrella header "Pods-SwaggerClient-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown new file mode 100644 index 000000000000..102af7538517 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist new file mode 100644 index 000000000000..7acbad1eabbf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m new file mode 100644 index 000000000000..bb17fa2b80ff --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClientTests : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClientTests +@end diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh new file mode 100755 index 000000000000..08e3eaaca45a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -0,0 +1,146 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h new file mode 100644 index 000000000000..b2e4925a9e41 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[]; + diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap new file mode 100644 index 000000000000..a848da7ffb30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClientTests { + umbrella header "Pods-SwaggerClientTests-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/Info.plist similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/Info.plist rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/Info.plist diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-dummy.m b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-dummy.m new file mode 100644 index 000000000000..3783f72cea34 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_RxSwift : NSObject +@end +@implementation PodsDummy_RxSwift +@end diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h new file mode 100644 index 000000000000..9a2721193781 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double RxSwiftVersionNumber; +FOUNDATION_EXPORT const unsigned char RxSwiftVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.modulemap b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.modulemap new file mode 100644 index 000000000000..eae3d1c4187b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.modulemap @@ -0,0 +1,6 @@ +framework module RxSwift { + umbrella header "RxSwift-umbrella.h" + + export * + module * { export * } +} diff --git a/samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig similarity index 100% rename from samples/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/Pods/Target Support Files/RxSwift/RxSwift.xcconfig diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..1db674bd3aa5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,531 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */; }; + B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */; }; + EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */; }; + EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */; }; + EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */; }; + EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */; }; + EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */; }; + EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */; }; + EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */; }; + EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = EAEC0BB61D4E30CE00C908A3 /* Project object */; + proxyType = 1; + remoteGlobalIDString = EAEC0BBD1D4E30CE00C908A3; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; + 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + EAEC0BC61D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + EAEC0BCB1D4E30CE00C908A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + EAEC0BCD1D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + EAEC0BD81D4E30CE00C908A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + EAEC0BBB1D4E30CE00C908A3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B024164FBFF71BF644D4419A /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EAEC0BCF1D4E30CE00C908A3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + B1D0246C8960F47A60098F37 /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 177A58DD5CF63F2989335DCC /* Pods_SwaggerClient.framework */, + 6F96A0131101344CC5406CB3 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + CB19142D951AB5DD885404A8 /* Pods */ = { + isa = PBXGroup; + children = ( + 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */, + 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */, + 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */, + EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + EAEC0BB51D4E30CE00C908A3 = { + isa = PBXGroup; + children = ( + EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */, + EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */, + EAEC0BBF1D4E30CE00C908A3 /* Products */, + CB19142D951AB5DD885404A8 /* Pods */, + 55DC454FF5FFEF8A9CBC1CA3 /* Frameworks */, + ); + sourceTree = ""; + }; + EAEC0BBF1D4E30CE00C908A3 /* Products */ = { + isa = PBXGroup; + children = ( + EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */, + EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + EAEC0BC01D4E30CE00C908A3 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + EAEC0BC11D4E30CE00C908A3 /* AppDelegate.swift */, + EAEC0BC31D4E30CE00C908A3 /* ViewController.swift */, + EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */, + EAEC0BC81D4E30CE00C908A3 /* Assets.xcassets */, + EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */, + EAEC0BCD1D4E30CE00C908A3 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + EAEC0BD51D4E30CE00C908A3 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + EAEC0BD81D4E30CE00C908A3 /* Info.plist */, + EAEC0BE31D4E330700C908A3 /* PetAPITests.swift */, + EAEC0BE51D4E379000C908A3 /* StoreAPITests.swift */, + EAEC0BE71D4E38CB00C908A3 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */, + EAEC0BBA1D4E30CE00C908A3 /* Sources */, + EAEC0BBB1D4E30CE00C908A3 /* Frameworks */, + EAEC0BBC1D4E30CE00C908A3 /* Resources */, + 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = EAEC0BBE1D4E30CE00C908A3 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */, + EAEC0BCE1D4E30CE00C908A3 /* Sources */, + EAEC0BCF1D4E30CE00C908A3 /* Frameworks */, + EAEC0BD01D4E30CE00C908A3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = EAEC0BD21D4E30CE00C908A3 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + EAEC0BB61D4E30CE00C908A3 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0730; + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + EAEC0BBD1D4E30CE00C908A3 = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0800; + }; + EAEC0BD11D4E30CE00C908A3 = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 0800; + TestTargetID = EAEC0BBD1D4E30CE00C908A3; + }; + }; + }; + buildConfigurationList = EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = EAEC0BB51D4E30CE00C908A3; + productRefGroup = EAEC0BBF1D4E30CE00C908A3 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */, + EAEC0BD11D4E30CE00C908A3 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + EAEC0BBC1D4E30CE00C908A3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EAEC0BCC1D4E30CE00C908A3 /* LaunchScreen.storyboard in Resources */, + EAEC0BC91D4E30CE00C908A3 /* Assets.xcassets in Resources */, + EAEC0BC71D4E30CE00C908A3 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EAEC0BD01D4E30CE00C908A3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 82CB35D52E274C6177DAC0DD /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 898E536ECC2C4811DDDF67C1 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 8A7961360961F06AADAF17C9 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + "${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + EAEC0BBA1D4E30CE00C908A3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EAEC0BC41D4E30CE00C908A3 /* ViewController.swift in Sources */, + EAEC0BC21D4E30CE00C908A3 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EAEC0BCE1D4E30CE00C908A3 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EAEC0BE81D4E38CB00C908A3 /* UserAPITests.swift in Sources */, + EAEC0BE61D4E379000C908A3 /* StoreAPITests.swift in Sources */, + EAEC0BE41D4E330700C908A3 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + EAEC0BD41D4E30CE00C908A3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = EAEC0BBD1D4E30CE00C908A3 /* SwaggerClient */; + targetProxy = EAEC0BD31D4E30CE00C908A3 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + EAEC0BC51D4E30CE00C908A3 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EAEC0BC61D4E30CE00C908A3 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + EAEC0BCA1D4E30CE00C908A3 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + EAEC0BCB1D4E30CE00C908A3 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + EAEC0BD91D4E30CE00C908A3 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + EAEC0BDA1D4E30CE00C908A3 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + EAEC0BDC1D4E30CE00C908A3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 8D99518E8E05FD856A952698 /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + EAEC0BDD1D4E30CE00C908A3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 2DEFA8828BD4E38FA5262F53 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + EAEC0BDF1D4E30CE00C908A3 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4EF2021609D112A6F5AE0F55 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + EAEC0BE01D4E30CE00C908A3 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = EFD8AB05F53C74985527D117 /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CLANG_ENABLE_MODULES = YES; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + EAEC0BB91D4E30CE00C908A3 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EAEC0BD91D4E30CE00C908A3 /* Debug */, + EAEC0BDA1D4E30CE00C908A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EAEC0BDB1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EAEC0BDC1D4E30CE00C908A3 /* Debug */, + EAEC0BDD1D4E30CE00C908A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + EAEC0BDE1D4E30CE00C908A3 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + EAEC0BDF1D4E30CE00C908A3 /* Debug */, + EAEC0BE01D4E30CE00C908A3 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = EAEC0BB61D4E30CE00C908A3 /* Project object */; +} diff --git a/samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/petstore/objc/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..7e4b2d97f313 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..cd894e005de4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,45 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..b8236c653481 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,48 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..3d8b6fc4a709 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,58 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..14180180be44 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,24 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + + +} diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..619bf44ed70e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,35 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..1d1d03d9c0e7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,78 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import RxSwift +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + let disposeBag = DisposeBag() + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectation(description: "testCreatePet") + let newPet = Pet() + let category = PetstoreClient.Category() + category.id = 1234 + category.name = "eyeColor" + newPet.category = category + newPet.id = 1000 + newPet.name = "Fluffy" + newPet.status = .available + PetAPI.addPet(body: newPet).subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + XCTFail("error creating pet") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectation(description: "testGetPet") + PetAPI.getPetById(petId: 1000).subscribe(onNext: { pet in + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + expectation.fulfill() + }, onError: { errorType in + XCTFail("error getting pet") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectation(description: "testDeletePet") + PetAPI.deletePet(petId: 1000).subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error deleting pet") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } +} diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..150afad08bd3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,97 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import RxSwift +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + + let testTimeout = 10.0 + let disposeBag = DisposeBag() + + func test1PlaceOrder() { + let order = Order() + let shipDate = Date() + order.id = 1000 + order.petId = 1000 + order.complete = false + order.quantity = 10 + order.shipDate = shipDate + // use explicit naming to reference the enum so that we test we don't regress on enum naming + order.status = Order.Status.placed + let expectation = self.expectation(description: "testPlaceOrder") + StoreAPI.placeOrder(body: order).subscribe(onNext: { order in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + }, onError: { errorType in + XCTFail("error placing order") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectation(description: "testGetOrder") + StoreAPI.getOrderById(orderId: 1000).subscribe(onNext: { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + expectation.fulfill() + }, onError: { errorType in + XCTFail("error placing order") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectation(description: "testDeleteOrder") + StoreAPI.deleteOrder(orderId: "1000").subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType -> Void in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error deleting order") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} + +private extension Date { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(_ date: Date, format: String) -> Bool { + let fmt = DateFormatter() + fmt.dateFormat = format + return fmt.string(from: self).isEqual(fmt.string(from: date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..dca3e169ebf7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,173 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Tony Wang on 7/31/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import RxSwift +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + let disposeBag = DisposeBag() + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testLogin() { + let expectation = self.expectation(description: "testLogin") + UserAPI.loginUser(username: "swiftTester", password: "swift").subscribe(onNext: { _ in + expectation.fulfill() + }, onError: { errorType in + // The server isn't returning JSON - and currently the alamofire implementation + // always parses responses as JSON, so making an exception for this here + // Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." + // UserInfo={NSDebugDescription=Invalid value around character 0.} + let error = errorType as NSError + if error.code == 3840 { + expectation.fulfill() + } else { + XCTFail("error logging in") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectation(description: "testLogout") + UserAPI.logoutUser().subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error logging out") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test1CreateUser() { + let expectation = self.expectation(description: "testCreateUser") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + UserAPI.createUser(body: newUser).subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error creating user") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testCreateUserWithArray() { + let expectation = self.expectation(description: "testCreateUserWithArray") + let newUser = User() + newUser.email = "test@test.com" + newUser.firstName = "Test" + newUser.lastName = "Tester" + newUser.id = 1000 + newUser.password = "test!" + newUser.phone = "867-5309" + newUser.username = "test@test.com" + newUser.userStatus = 0 + + let newUser2 = User() + newUser2.email = "test2@test.com" + newUser2.firstName = "Test2" + newUser2.lastName = "Tester2" + newUser2.id = 1001 + newUser2.password = "test2!" + newUser2.phone = "867-5302" + newUser2.username = "test2@test.com" + newUser2.userStatus = 0 + + _ = UserAPI.createUsersWithArrayInput(body: [newUser, newUser2]).subscribe(onNext: { + expectation.fulfill() + }, onError: { _ in + XCTFail("error creating users") + }) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetUser() { + let expectation = self.expectation(description: "testGetUser") + UserAPI.getUserByName(username: "test@test.com").subscribe(onNext: {user -> Void in + XCTAssert(user.userStatus == 0, "invalid userStatus") + XCTAssert(user.email == "test@test.com", "invalid email") + XCTAssert(user.firstName == "Test", "invalid firstName") + XCTAssert(user.lastName == "Tester", "invalid lastName") + XCTAssert(user.password == "test!", "invalid password") + XCTAssert(user.phone == "867-5309", "invalid phone") + expectation.fulfill() + }, onError: { errorType in + XCTFail("error getting user") + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteUser() { + let expectation = self.expectation(description: "testDeleteUser") + UserAPI.deleteUser(username: "test@test.com").subscribe(onNext: { + expectation.fulfill() + }, onError: { errorType -> Void in + // The server gives us no data back so alamofire parsing fails - at least + // verify that is the error we get here + // Error Domain=com.alamofire.error Code=-6006 "JSON could not be serialized. Input data was nil or zero + // length." UserInfo={NSLocalizedFailureReason=JSON could not be serialized. Input data was nil or zero + // length.} + let error = errorType as NSError + if error.code == -6006 { + expectation.fulfill() + } else { + XCTFail("error deleting user") + } + }, onCompleted: nil, onDisposed: nil).addDisposableTo(disposeBag) + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testPathParamsAreEscaped() { + // The path for this operation is /user/{userId}. In order to make a usable path, + // then we must make sure that {userId} is percent-escaped when it is substituted + // into the path. So we intentionally introduce a path with spaces. + let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") + let urlContainsSpace = userRequestBuilder.URLString.contains(" ") + + XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") + } + +} diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..29e61aa13a9a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift3RxSwiftPetstoreClientTests + pom + 1.0-SNAPSHOT + Swift3 RxSwift Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..f1d496086680 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift3/rxswift/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 6,OS=9.3" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/samples/client/petstore/swift4/objcCompatible/.gitignore b/CI/samples.ci/client/petstore/swift4/.gitignore similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/.gitignore rename to CI/samples.ci/client/petstore/swift4/.gitignore diff --git a/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..6d0f6ef15b4b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.pbxproj @@ -0,0 +1,569 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 02903CEC38DC202565BC08CB040AC4E9 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */; }; + 0462F801432CF94C7EF51D0532737A7E /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */; }; + 08D87E4FECF24910F0DA0F1D2E2D955A /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */; }; + 1143FFF06DEE01E5B0F1368AA05BE1B4 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */; }; + 122BBAE8245606CC040EEB6B9254E376 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */; }; + 12327BF7304AA897C5D2A1250B1659B7 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */; }; + 12BB95C66D63090732BB9E0379836E3C /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */; }; + 16E9A5E22B4823DE282E7F4C18A21EA8 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */; }; + 18F19872A0DFB4CC3D9C696BBCA64EFD /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */; }; + 196E9846B27D736630CCF90497696859 /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */; }; + 271D94A05C47B602A2433B9CD3D9DCDC /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */; }; + 293F4E0FBFC8297E414A3CDBB7F29A96 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */; }; + 297E365D1E4672C43C56E0AFD855FFBF /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */; }; + 2A35688C985E9CB1EB7732AC2AD46B82 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */; }; + 2DF4544D4D3D6CF7047A59FB89ED31BD /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */; }; + 3251A3722981CE46261615CFBA96A08D /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */; }; + 36734C4EB3362A114A7CB5F25EE39E6D /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */; }; + 3D8E407B1DF4FA5A5F16B64E3A285781 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */; }; + 41D8A105135868152A56E2AC475049BB /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */; }; + 42C51BC034E8B0CAA29A068F6B0DC815 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */; }; + 491676EC91BFEF95A12556888EED87B5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */; }; + 4C28BFEC5E7C8150DEFD83E09C1A1D32 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */; }; + 58F9704B295AC436D6FB98FA669E2344 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */; }; + 59C00CBB07761CAC8DCE7054E34AD5D9 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */; }; + 59C2F5495C98836BFA9E10BF5C13BC2C /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */; }; + 5ACDD7CC312167589335E9CA5998E770 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */; }; + 655AA371771C7BD72EE0AAC0C90DFFF0 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */; }; + 6600BB1500AE35A3C80F7C83F6444552 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */; }; + 6CD20EE568DDAD2304BF0C4B1A70C8DC /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */; }; + 7367A9D91D4B101F2D28AC56ED89F175 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */; }; + 82D4D0C8AD0354A700C8ACD421ABED55 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */; }; + 83A2D1863FB136C0DFC423319F4EED65 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */; }; + 92FB161BF1E57D11B116AF0292D5835C /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718FF4525C81 /* Client.swift */; }; + 97C99615237E1B662242E04F527B38B9 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */; }; + A190AF5A3988639ED4B78163D0EA3CA4 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */; }; + A438970025AE69ED407BC1E67CC6359E /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */; }; + A9F1AAF6CE029DD3B4F8AC841F0B6BC6 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */; }; + AE9D2E1DB59AF6575AC4AC6756C5A937 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */; }; + B399A1742F23330FDCA450EAB98F51F1 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */; }; + BF7D58FBCF5E4D3F2932FCC0E62BED40 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */; }; + C15AC1CC631E96D0360EB8C15BF30452 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */; }; + C1CACABE18A7ADCE37D1CD9DC9128304 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A4315C49A /* List.swift */; }; + C2EDEB747887399B13A6DFD72A219CB2 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */; }; + C329EE55B2FCC9174ED3B128D67C5E8C /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */; }; + D3A17B7FAFA8A7A210875BBCDCC30116 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + D70EC94E346077DE1482231DD4498BED /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */; }; + DB1CE39011A741D07E187663291B5DE5 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */; }; + DB724C4F1AD5DF025B53A9A2E0A49E3D /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */; }; + DDBC3CF5E447D8D838F0FE200420EEE3 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */; }; + DEC892724574BB29BD65869374F83982 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */; }; + E2C40F0E34DB8C21A806262C72841A51 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118F057604D /* SpecialModelName.swift */; }; + E51ADEC931806B20A041303E539A8BE2 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */; }; + F02BEF9A8503B3848B045370451E85F6 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4CF550442B /* Models.swift */; }; + F21D10C71A9DE7D0467AFD23FD391D2E /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08AA65292F7 /* Return.swift */; }; + FB4A053CDCD75E48B755CC22D463A3FC /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */; }; + FECA03F0388E84AE1B22638605D8AC9F /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; + 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; + 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; + 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 386FD590658E90509C121118F057604D /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; + 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; + 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; + 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 7A6070F581E611FF44AFD40A4315C49A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; + 8699F7966F748ED026A6FB4CF550442B /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; + 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; + A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; + A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; + A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + A913A57E72D723632E9A718FF4525C81 /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; + B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + C81447828475F76C5CF4F08AA65292F7 /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; + ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D1990C2A394CCF025EF98A2FB828C79A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C28BFEC5E7C8150DEFD83E09C1A1D32 /* Alamofire.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1E464C0937FE0D3A7A0FE29AF446553C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7861EE241895128F64DD787367B3022D /* Carthage */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4FBDCF1330A9AB9122780DB3FA21DE4C /* Models */ = { + isa = PBXGroup; + children = ( + 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */, + 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */, + 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */, + A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */, + 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */, + B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */, + F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */, + A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */, + 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */, + 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */, + 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */, + 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */, + A913A57E72D723632E9A718FF4525C81 /* Client.swift */, + C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */, + A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */, + 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */, + 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */, + FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */, + 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */, + 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */, + 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */, + 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */, + 7A6070F581E611FF44AFD40A4315C49A /* List.swift */, + 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */, + 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */, + 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */, + B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */, + 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */, + F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */, + C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */, + ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */, + 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */, + C81447828475F76C5CF4F08AA65292F7 /* Return.swift */, + 386FD590658E90509C121118F057604D /* SpecialModelName.swift */, + 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */, + B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */, + EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */, + 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */, + E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */, + ); + path = Models; + sourceTree = ""; + }; + 5FBA6AE5F64CD737F88B4565AC3CCD3B = { + isa = PBXGroup; + children = ( + 9B364C01750D7AA4F983B9E77B01BCC6 /* PetstoreClient */, + 1E464C0937FE0D3A7A0FE29AF446553C /* Frameworks */, + 857F0DEA1890CE66D6DAD556C55821A6 /* Products */, + ); + sourceTree = ""; + }; + 67BF3478113E6B4DF1C4E04F40BF58C4 /* OpenAPIs */ = { + isa = PBXGroup; + children = ( + 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */, + 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */, + 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */, + 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */, + 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */, + B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */, + 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */, + 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */, + 8699F7966F748ED026A6FB4CF550442B /* Models.swift */, + F956D0CCAE23BCFD1C7BDD5D47944AA5 /* APIs */, + 4FBDCF1330A9AB9122780DB3FA21DE4C /* Models */, + ); + path = OpenAPIs; + sourceTree = ""; + }; + 7861EE241895128F64DD787367B3022D /* Carthage */ = { + isa = PBXGroup; + children = ( + A012205B41CB71A62B86EECDEAFB0990 /* iOS */, + ); + name = Carthage; + path = Carthage/Build; + sourceTree = ""; + }; + 857F0DEA1890CE66D6DAD556C55821A6 /* Products */ = { + isa = PBXGroup; + children = ( + 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */, + ); + name = Products; + sourceTree = ""; + }; + 9B364C01750D7AA4F983B9E77B01BCC6 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + EF4C81BDD734856ED5023B777D35098B /* Classes */, + ); + path = PetstoreClient; + sourceTree = ""; + }; + A012205B41CB71A62B86EECDEAFB0990 /* iOS */ = { + isa = PBXGroup; + children = ( + A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */, + ); + path = iOS; + sourceTree = ""; + }; + EF4C81BDD734856ED5023B777D35098B /* Classes */ = { + isa = PBXGroup; + children = ( + 67BF3478113E6B4DF1C4E04F40BF58C4 /* OpenAPIs */, + ); + path = Classes; + sourceTree = ""; + }; + F956D0CCAE23BCFD1C7BDD5D47944AA5 /* APIs */ = { + isa = PBXGroup; + children = ( + 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */, + 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */, + B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */, + 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */, + A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */, + 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */, + ); + path = APIs; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C1282C2230015E0D204BEAEDDFB49453 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = B46EDEB1A7F0D78FE6394544C60169D1 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + E539708354CE60FE486F81EDE56D13C8 /* Sources */, + D1990C2A394CCF025EF98A2FB828C79A /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E7D276EE2369D8C455513C2E05F9AED0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1000; + }; + buildConfigurationList = ECAB17FF35111B5E14DAAC0883031714 /* Build configuration list for PBXProject "PetstoreClient" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 5FBA6AE5F64CD737F88B4565AC3CCD3B; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C1282C2230015E0D204BEAEDDFB49453 /* PetstoreClient */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + E539708354CE60FE486F81EDE56D13C8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A35688C985E9CB1EB7732AC2AD46B82 /* APIHelper.swift in Sources */, + 0462F801432CF94C7EF51D0532737A7E /* APIs.swift in Sources */, + 12327BF7304AA897C5D2A1250B1659B7 /* AdditionalPropertiesClass.swift in Sources */, + 58F9704B295AC436D6FB98FA669E2344 /* AlamofireImplementations.swift in Sources */, + 02903CEC38DC202565BC08CB040AC4E9 /* Animal.swift in Sources */, + DB1CE39011A741D07E187663291B5DE5 /* AnimalFarm.swift in Sources */, + 83A2D1863FB136C0DFC423319F4EED65 /* AnotherFakeAPI.swift in Sources */, + 97C99615237E1B662242E04F527B38B9 /* ApiResponse.swift in Sources */, + 3251A3722981CE46261615CFBA96A08D /* ArrayOfArrayOfNumberOnly.swift in Sources */, + A190AF5A3988639ED4B78163D0EA3CA4 /* ArrayOfNumberOnly.swift in Sources */, + C2EDEB747887399B13A6DFD72A219CB2 /* ArrayTest.swift in Sources */, + 7367A9D91D4B101F2D28AC56ED89F175 /* Capitalization.swift in Sources */, + 18F19872A0DFB4CC3D9C696BBCA64EFD /* Cat.swift in Sources */, + 41D8A105135868152A56E2AC475049BB /* CatAllOf.swift in Sources */, + 42C51BC034E8B0CAA29A068F6B0DC815 /* Category.swift in Sources */, + 5ACDD7CC312167589335E9CA5998E770 /* ClassModel.swift in Sources */, + 92FB161BF1E57D11B116AF0292D5835C /* Client.swift in Sources */, + 6CD20EE568DDAD2304BF0C4B1A70C8DC /* CodableHelper.swift in Sources */, + DEC892724574BB29BD65869374F83982 /* Configuration.swift in Sources */, + D70EC94E346077DE1482231DD4498BED /* Dog.swift in Sources */, + 271D94A05C47B602A2433B9CD3D9DCDC /* DogAllOf.swift in Sources */, + A438970025AE69ED407BC1E67CC6359E /* EnumArrays.swift in Sources */, + 59C00CBB07761CAC8DCE7054E34AD5D9 /* EnumClass.swift in Sources */, + 08D87E4FECF24910F0DA0F1D2E2D955A /* EnumTest.swift in Sources */, + C329EE55B2FCC9174ED3B128D67C5E8C /* Extensions.swift in Sources */, + 297E365D1E4672C43C56E0AFD855FFBF /* FakeAPI.swift in Sources */, + A9F1AAF6CE029DD3B4F8AC841F0B6BC6 /* FakeClassnameTags123API.swift in Sources */, + FECA03F0388E84AE1B22638605D8AC9F /* File.swift in Sources */, + 491676EC91BFEF95A12556888EED87B5 /* FileSchemaTestClass.swift in Sources */, + 36734C4EB3362A114A7CB5F25EE39E6D /* FormatTest.swift in Sources */, + DDBC3CF5E447D8D838F0FE200420EEE3 /* HasOnlyReadOnly.swift in Sources */, + 16E9A5E22B4823DE282E7F4C18A21EA8 /* JSONEncodableEncoding.swift in Sources */, + 12BB95C66D63090732BB9E0379836E3C /* JSONEncodingHelper.swift in Sources */, + C1CACABE18A7ADCE37D1CD9DC9128304 /* List.swift in Sources */, + 655AA371771C7BD72EE0AAC0C90DFFF0 /* MapTest.swift in Sources */, + D3A17B7FAFA8A7A210875BBCDCC30116 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 2DF4544D4D3D6CF7047A59FB89ED31BD /* Model200Response.swift in Sources */, + F02BEF9A8503B3848B045370451E85F6 /* Models.swift in Sources */, + C15AC1CC631E96D0360EB8C15BF30452 /* Name.swift in Sources */, + AE9D2E1DB59AF6575AC4AC6756C5A937 /* NumberOnly.swift in Sources */, + 59C2F5495C98836BFA9E10BF5C13BC2C /* Order.swift in Sources */, + 82D4D0C8AD0354A700C8ACD421ABED55 /* OuterComposite.swift in Sources */, + 1143FFF06DEE01E5B0F1368AA05BE1B4 /* OuterEnum.swift in Sources */, + B399A1742F23330FDCA450EAB98F51F1 /* Pet.swift in Sources */, + 3D8E407B1DF4FA5A5F16B64E3A285781 /* PetAPI.swift in Sources */, + 293F4E0FBFC8297E414A3CDBB7F29A96 /* ReadOnlyFirst.swift in Sources */, + F21D10C71A9DE7D0467AFD23FD391D2E /* Return.swift in Sources */, + E2C40F0E34DB8C21A806262C72841A51 /* SpecialModelName.swift in Sources */, + 122BBAE8245606CC040EEB6B9254E376 /* StoreAPI.swift in Sources */, + 196E9846B27D736630CCF90497696859 /* StringBooleanMap.swift in Sources */, + E51ADEC931806B20A041303E539A8BE2 /* Tag.swift in Sources */, + 6600BB1500AE35A3C80F7C83F6444552 /* TypeHolderDefault.swift in Sources */, + FB4A053CDCD75E48B755CC22D463A3FC /* TypeHolderExample.swift in Sources */, + BF7D58FBCF5E4D3F2932FCC0E62BED40 /* User.swift in Sources */, + DB724C4F1AD5DF025B53A9A2E0A49E3D /* UserAPI.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3B2C02AFB91CB5C82766ED5CF21FF628 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + A9EB0A02B94C427CBACFEC7CFFC6A816 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + DD3EEB93949E9EBA4437E9CDBF4A26F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + F81D4E5FECD46E9AA6DD2C299CEBEF64 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B46EDEB1A7F0D78FE6394544C60169D1 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD3EEB93949E9EBA4437E9CDBF4A26F6 /* Debug */, + 3B2C02AFB91CB5C82766ED5CF21FF628 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; + ECAB17FF35111B5E14DAAC0883031714 /* Build configuration list for PBXProject "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9EB0A02B94C427CBACFEC7CFFC6A816 /* Debug */, + F81D4E5FECD46E9AA6DD2C299CEBEF64 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = E7D276EE2369D8C455513C2E05F9AED0 /* Project object */; +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme rename to CI/samples.ci/client/petstore/swift4/default/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..29843508b65b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Podfile @@ -0,0 +1,10 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock new file mode 100644 index 000000000000..ec15c4176b83 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Podfile.lock @@ -0,0 +1,23 @@ +PODS: + - Alamofire (4.9.0) + - PetstoreClient (1.0.0): + - Alamofire (~> 4.9.0) + +DEPENDENCIES: + - PetstoreClient (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + +EXTERNAL SOURCES: + PetstoreClient: + :path: "../" + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + PetstoreClient: e5c71b862a32097342e341f7088805bbfc033a3e + +PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d + +COCOAPODS: 1.6.1 diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/LICENSE b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/LICENSE new file mode 100644 index 000000000000..38a301a1db8f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/README.md new file mode 100644 index 000000000000..9fdc9c738737 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/README.md @@ -0,0 +1,242 @@ +![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/master/alamofire.png) + +[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) +[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](https://alamofire.github.io/Alamofire) +[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](https://twitter.com/AlamofireSF) +[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +Alamofire is an HTTP networking library written in Swift. + +- [Features](#features) +- [Component Libraries](#component-libraries) +- [Requirements](#requirements) +- [Migration Guides](#migration-guides) +- [Communication](#communication) +- [Installation](#installation) +- [Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md) + - **Intro -** [Making a Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#making-a-request), [Response Handling](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-handling), [Response Validation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-validation), [Response Caching](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-caching) + - **HTTP -** [HTTP Methods](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-methods), [Parameter Encoding](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#parameter-encoding), [HTTP Headers](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-headers), [Authentication](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#authentication) + - **Large Data -** [Downloading Data to a File](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#downloading-data-to-a-file), [Uploading Data to a Server](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#uploading-data-to-a-server) + - **Tools -** [Statistical Metrics](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#statistical-metrics), [cURL Command Output](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#curl-command-output) +- [Advanced Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md) + - **URL Session -** [Session Manager](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-manager), [Session Delegate](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-delegate), [Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#request) + - **Routing -** [Routing Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#routing-requests), [Adapting and Retrying Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#adapting-and-retrying-requests) + - **Model Objects -** [Custom Response Serialization](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#custom-response-serialization) + - **Connection -** [Security](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#security), [Network Reachability](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#network-reachability) +- [Open Radars](#open-radars) +- [FAQ](#faq) +- [Credits](#credits) +- [Donations](#donations) +- [License](#license) + +## Features + +- [x] Chainable Request / Response Methods +- [x] URL / JSON / plist Parameter Encoding +- [x] Upload File / Data / Stream / MultipartFormData +- [x] Download File using Request or Resume Data +- [x] Authentication with URLCredential +- [x] HTTP Response Validation +- [x] Upload and Download Progress Closures with Progress +- [x] cURL Command Output +- [x] Dynamically Adapt and Retry Requests +- [x] TLS Certificate and Public Key Pinning +- [x] Network Reachability +- [x] Comprehensive Unit and Integration Test Coverage +- [x] [Complete Documentation](https://alamofire.github.io/Alamofire) + +## Component Libraries + +In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. + +- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. +- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. + +## Requirements + +- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ +- Xcode 8.3+ +- Swift 3.1+ + +## Migration Guides + +- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) +- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) +- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) + +## Communication +- If you **need help with making network requests**, use [Stack Overflow](https://stackoverflow.com/questions/tagged/alamofire) and tag `alamofire`. +- If you need to **find or understand an API**, check [our documentation](http://alamofire.github.io/Alamofire/) or [Apple's documentation for `URLSession`](https://developer.apple.com/documentation/foundation/url_loading_system), on top of which Alamofire is built. +- If you need **help with an Alamofire feature**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you'd like to **discuss Alamofire best practices**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you'd like to **discuss a feature request**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you **found a bug**, open an issue and follow the guide. The more detail the better! +- If you **want to contribute**, submit a pull request. + +## Installation + +### CocoaPods + +[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +> CocoaPods 1.7+ is required to build Alamofire 4.9+. + +To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '10.0' +use_frameworks! + +target '' do + pod 'Alamofire', '~> 4.9' +end +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +You can install Carthage with [Homebrew](https://brew.sh/) using the following command: + +```bash +$ brew install carthage +``` + +To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "Alamofire/Alamofire" ~> 4.9 +``` + +Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. + +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. + +Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +#### Swift 3 + +```swift +dependencies: [ + .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) +] +``` + +#### Swift 4 + +```swift +dependencies: [ + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") +] +``` + +### Manually + +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. + +#### Embedded Framework + +- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: + + ```bash + $ git init + ``` + +- Add Alamofire as a git [submodule](https://git-scm.com/docs/git-submodule) by running the following command: + + ```bash + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` + +- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. + + > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. + +- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. +- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. +- In the tab bar at the top of that window, open the "General" panel. +- Click on the `+` button under the "Embedded Binaries" section. +- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. + + > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. + +- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. + + > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. + +- And that's it! + + > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. + +## Open Radars + +The following radars have some effect on the current implementation of Alamofire. + +- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case +- `rdar://26870455` - Background URL Session Configurations do not work in the simulator +- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` +- [`rdar://36082113`](http://openradar.appspot.com/radar?id=4942308441063424) - `URLSessionTaskMetrics` failing to link on watchOS 3.0+ + +## Resolved Radars + +The following radars have been resolved over time after being filed against the Alamofire project. + +- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage (Resolved on 9/1/17 in Xcode 9 beta 6). + +## FAQ + +### What's the origin of the name Alamofire? + +Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. + +### What logic belongs in a Router vs. a Request Adapter? + +Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. + +The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. + +## Credits + +Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. + +### Security Disclosure + +If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. + +## Donations + +The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially stay registered as a federal non-profit organization. +Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. +Donating to the ASF will enable us to: + +- Pay our yearly legal fees to keep the non-profit in good status +- Pay for our mail servers to help us stay on top of all questions and security issues +- Potentially fund test servers to make it easier for us to test the edge cases +- Potentially fund developers to work on one of our projects full-time + +The community adoption of the ASF libraries has been amazing. +We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. +With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. +If you use any of our libraries for work, see if your employers would be interested in donating. +Any amount you can donate today to help us reach our goal would be greatly appreciated. + +[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W34WPEE74APJQ) + +## License + +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift new file mode 100644 index 000000000000..b163f6038fae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift @@ -0,0 +1,460 @@ +// +// AFError.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with +/// their own associated reasons. +/// +/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. +/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. +/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. +/// - responseValidationFailed: Returned when a `validate()` call fails. +/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. +public enum AFError: Error { + /// The underlying reason the parameter encoding error occurred. + /// + /// - missingURL: The URL request did not have a URL to encode. + /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the + /// encoding process. + /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during + /// encoding process. + public enum ParameterEncodingFailureReason { + case missingURL + case jsonEncodingFailed(error: Error) + case propertyListEncodingFailed(error: Error) + } + + /// The underlying reason the multipart encoding error occurred. + /// + /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a + /// file URL. + /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty + /// `lastPathComponent` or `pathExtension. + /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. + /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw + /// an error. + /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. + /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by + /// the system. + /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided + /// threw an error. + /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. + /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the + /// encoded data to disk. + /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file + /// already exists at the provided `fileURL`. + /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is + /// not a file URL. + /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an + /// underlying error. + /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with + /// underlying system error. + public enum MultipartEncodingFailureReason { + case bodyPartURLInvalid(url: URL) + case bodyPartFilenameInvalid(in: URL) + case bodyPartFileNotReachable(at: URL) + case bodyPartFileNotReachableWithError(atURL: URL, error: Error) + case bodyPartFileIsDirectory(at: URL) + case bodyPartFileSizeNotAvailable(at: URL) + case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) + case bodyPartInputStreamCreationFailed(for: URL) + + case outputStreamCreationFailed(for: URL) + case outputStreamFileAlreadyExists(at: URL) + case outputStreamURLInvalid(url: URL) + case outputStreamWriteFailed(error: Error) + + case inputStreamReadFailed(error: Error) + } + + /// The underlying reason the response validation error occurred. + /// + /// - dataFileNil: The data file containing the server response did not exist. + /// - dataFileReadFailed: The data file containing the server response could not be read. + /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` + /// provided did not contain wildcard type. + /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided + /// `acceptableContentTypes`. + /// - unacceptableStatusCode: The response status code was not acceptable. + public enum ResponseValidationFailureReason { + case dataFileNil + case dataFileReadFailed(at: URL) + case missingContentType(acceptableContentTypes: [String]) + case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) + case unacceptableStatusCode(code: Int) + } + + /// The underlying reason the response serialization error occurred. + /// + /// - inputDataNil: The server response contained no data. + /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. + /// - inputFileNil: The file containing the server response did not exist. + /// - inputFileReadFailed: The file containing the server response could not be read. + /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. + /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. + /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. + public enum ResponseSerializationFailureReason { + case inputDataNil + case inputDataNilOrZeroLength + case inputFileNil + case inputFileReadFailed(at: URL) + case stringSerializationFailed(encoding: String.Encoding) + case jsonSerializationFailed(error: Error) + case propertyListSerializationFailed(error: Error) + } + + case invalidURL(url: URLConvertible) + case parameterEncodingFailed(reason: ParameterEncodingFailureReason) + case multipartEncodingFailed(reason: MultipartEncodingFailureReason) + case responseValidationFailed(reason: ResponseValidationFailureReason) + case responseSerializationFailed(reason: ResponseSerializationFailureReason) +} + +// MARK: - Adapt Error + +struct AdaptError: Error { + let error: Error +} + +extension Error { + var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } +} + +// MARK: - Error Booleans + +extension AFError { + /// Returns whether the AFError is an invalid URL error. + public var isInvalidURLError: Bool { + if case .invalidURL = self { return true } + return false + } + + /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will + /// contain the associated value. + public var isParameterEncodingError: Bool { + if case .parameterEncodingFailed = self { return true } + return false + } + + /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties + /// will contain the associated values. + public var isMultipartEncodingError: Bool { + if case .multipartEncodingFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, + /// `responseContentType`, and `responseCode` properties will contain the associated values. + public var isResponseValidationError: Bool { + if case .responseValidationFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and + /// `underlyingError` properties will contain the associated values. + public var isResponseSerializationError: Bool { + if case .responseSerializationFailed = self { return true } + return false + } +} + +// MARK: - Convenience Properties + +extension AFError { + /// The `URLConvertible` associated with the error. + public var urlConvertible: URLConvertible? { + switch self { + case .invalidURL(let url): + return url + default: + return nil + } + } + + /// The `URL` associated with the error. + public var url: URL? { + switch self { + case .multipartEncodingFailed(let reason): + return reason.url + default: + return nil + } + } + + /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, + /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. + public var underlyingError: Error? { + switch self { + case .parameterEncodingFailed(let reason): + return reason.underlyingError + case .multipartEncodingFailed(let reason): + return reason.underlyingError + case .responseSerializationFailed(let reason): + return reason.underlyingError + default: + return nil + } + } + + /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. + public var acceptableContentTypes: [String]? { + switch self { + case .responseValidationFailed(let reason): + return reason.acceptableContentTypes + default: + return nil + } + } + + /// The response `Content-Type` of a `.responseValidationFailed` error. + public var responseContentType: String? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseContentType + default: + return nil + } + } + + /// The response code of a `.responseValidationFailed` error. + public var responseCode: Int? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseCode + default: + return nil + } + } + + /// The `String.Encoding` associated with a failed `.stringResponse()` call. + public var failedStringEncoding: String.Encoding? { + switch self { + case .responseSerializationFailed(let reason): + return reason.failedStringEncoding + default: + return nil + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var underlyingError: Error? { + switch self { + case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var url: URL? { + switch self { + case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), + .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), + .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), + .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), + .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): + return url + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), + .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.ResponseValidationFailureReason { + var acceptableContentTypes: [String]? { + switch self { + case .missingContentType(let types), .unacceptableContentType(let types, _): + return types + default: + return nil + } + } + + var responseContentType: String? { + switch self { + case .unacceptableContentType(_, let responseType): + return responseType + default: + return nil + } + } + + var responseCode: Int? { + switch self { + case .unacceptableStatusCode(let code): + return code + default: + return nil + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var failedStringEncoding: String.Encoding? { + switch self { + case .stringSerializationFailed(let encoding): + return encoding + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): + return error + default: + return nil + } + } +} + +// MARK: - Error Descriptions + +extension AFError: LocalizedError { + public var errorDescription: String? { + switch self { + case .invalidURL(let url): + return "URL is not valid: \(url)" + case .parameterEncodingFailed(let reason): + return reason.localizedDescription + case .multipartEncodingFailed(let reason): + return reason.localizedDescription + case .responseValidationFailed(let reason): + return reason.localizedDescription + case .responseSerializationFailed(let reason): + return reason.localizedDescription + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var localizedDescription: String { + switch self { + case .missingURL: + return "URL request to encode was missing a URL" + case .jsonEncodingFailed(let error): + return "JSON could not be encoded because of error:\n\(error.localizedDescription)" + case .propertyListEncodingFailed(let error): + return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var localizedDescription: String { + switch self { + case .bodyPartURLInvalid(let url): + return "The URL provided is not a file URL: \(url)" + case .bodyPartFilenameInvalid(let url): + return "The URL provided does not have a valid filename: \(url)" + case .bodyPartFileNotReachable(let url): + return "The URL provided is not reachable: \(url)" + case .bodyPartFileNotReachableWithError(let url, let error): + return ( + "The system returned an error while checking the provided URL for " + + "reachability.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartFileIsDirectory(let url): + return "The URL provided is a directory: \(url)" + case .bodyPartFileSizeNotAvailable(let url): + return "Could not fetch the file size from the provided URL: \(url)" + case .bodyPartFileSizeQueryFailedWithError(let url, let error): + return ( + "The system returned an error while attempting to fetch the file size from the " + + "provided URL.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartInputStreamCreationFailed(let url): + return "Failed to create an InputStream for the provided URL: \(url)" + case .outputStreamCreationFailed(let url): + return "Failed to create an OutputStream for URL: \(url)" + case .outputStreamFileAlreadyExists(let url): + return "A file already exists at the provided URL: \(url)" + case .outputStreamURLInvalid(let url): + return "The provided OutputStream URL is invalid: \(url)" + case .outputStreamWriteFailed(let error): + return "OutputStream write failed with error: \(error)" + case .inputStreamReadFailed(let error): + return "InputStream read failed with error: \(error)" + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var localizedDescription: String { + switch self { + case .inputDataNil: + return "Response could not be serialized, input data was nil." + case .inputDataNilOrZeroLength: + return "Response could not be serialized, input data was nil or zero length." + case .inputFileNil: + return "Response could not be serialized, input file was nil." + case .inputFileReadFailed(let url): + return "Response could not be serialized, input file could not be read: \(url)." + case .stringSerializationFailed(let encoding): + return "String could not be serialized with encoding: \(encoding)." + case .jsonSerializationFailed(let error): + return "JSON could not be serialized because of error:\n\(error.localizedDescription)" + case .propertyListSerializationFailed(let error): + return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.ResponseValidationFailureReason { + var localizedDescription: String { + switch self { + case .dataFileNil: + return "Response could not be validated, data file was nil." + case .dataFileReadFailed(let url): + return "Response could not be validated, data file could not be read: \(url)." + case .missingContentType(let types): + return ( + "Response Content-Type was missing and acceptable content types " + + "(\(types.joined(separator: ","))) do not match \"*/*\"." + ) + case .unacceptableContentType(let acceptableTypes, let responseType): + return ( + "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + + "\(acceptableTypes.joined(separator: ","))." + ) + case .unacceptableStatusCode(let code): + return "Response status code was unacceptable: \(code)." + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift new file mode 100644 index 000000000000..20c3672fbaf2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift @@ -0,0 +1,465 @@ +// +// Alamofire.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct +/// URL requests. +public protocol URLConvertible { + /// Returns a URL that conforms to RFC 2396 or throws an `Error`. + /// + /// - throws: An `Error` if the type cannot be converted to a `URL`. + /// + /// - returns: A URL or throws an `Error`. + func asURL() throws -> URL +} + +extension String: URLConvertible { + /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. + /// + /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } + return url + } +} + +extension URL: URLConvertible { + /// Returns self. + public func asURL() throws -> URL { return self } +} + +extension URLComponents: URLConvertible { + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. + /// + /// - throws: An `AFError.invalidURL` if `url` is `nil`. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = url else { throw AFError.invalidURL(url: self) } + return url + } +} + +// MARK: - + +/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. +public protocol URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + /// + /// - throws: An `Error` if the underlying `URLRequest` is `nil`. + /// + /// - returns: A URL request. + func asURLRequest() throws -> URLRequest +} + +extension URLRequestConvertible { + /// The URL request. + public var urlRequest: URLRequest? { return try? asURLRequest() } +} + +extension URLRequest: URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + public func asURLRequest() throws -> URLRequest { return self } +} + +// MARK: - + +extension URLRequest { + /// Creates an instance with the specified `method`, `urlString` and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The new `URLRequest` instance. + public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { + let url = try url.asURL() + + self.init(url: url) + + httpMethod = method.rawValue + + if let headers = headers { + for (headerField, headerValue) in headers { + setValue(headerValue, forHTTPHeaderField: headerField) + } + } + } + + func adapt(using adapter: RequestAdapter?) throws -> URLRequest { + guard let adapter = adapter else { return self } + return try adapter.adapt(self) + } +} + +// MARK: - Data Request + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding` and `headers`. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest +{ + return SessionManager.default.request( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers + ) +} + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest`. +/// +/// - parameter urlRequest: The URL request +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + return SessionManager.default.request(urlRequest) +} + +// MARK: - Download Request + +// MARK: URL Request + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers, + to: destination + ) +} + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter urlRequest: The URL request. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(urlRequest, to: destination) +} + +// MARK: Resume Data + +/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a +/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken +/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the +/// data is written incorrectly and will always fail to resume the download. For more information about the bug and +/// possible workarounds, please refer to the following Stack Overflow post: +/// +/// - http://stackoverflow.com/a/39347461/1342462 +/// +/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` +/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional +/// information. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(resumingWith: resumeData, to: destination) +} + +// MARK: - Upload Request + +// MARK: File + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) +} + +/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(fileURL, with: urlRequest) +} + +// MARK: Data + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(data, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(data, with: urlRequest) +} + +// MARK: InputStream + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `stream`. +/// +/// - parameter stream: The stream to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(stream, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `stream`. +/// +/// - parameter urlRequest: The URL request. +/// - parameter stream: The stream to upload. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(stream, with: urlRequest) +} + +// MARK: MultipartFormData + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls +/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + to: url, + method: method, + headers: headers, + encodingCompletion: encodingCompletion + ) +} + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and +/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter urlRequest: The URL request. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + encodingCompletion: encodingCompletion + ) +} + +#if !os(watchOS) + +// MARK: - Stream Request + +// MARK: Hostname and Port + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` +/// and `port`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter hostName: The hostname of the server to connect to. +/// - parameter port: The port of the server to connect to. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return SessionManager.default.stream(withHostName: hostName, port: port) +} + +// MARK: NetService + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter netService: The net service used to identify the endpoint. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(with netService: NetService) -> StreamRequest { + return SessionManager.default.stream(with: netService) +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift new file mode 100644 index 000000000000..a54673cca618 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift @@ -0,0 +1,37 @@ +// +// DispatchQueue+Alamofire.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Dispatch +import Foundation + +extension DispatchQueue { + static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } + static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } + static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } + static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } + + func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { + asyncAfter(deadline: .now() + delay, execute: closure) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift new file mode 100644 index 000000000000..b840138ccc15 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift @@ -0,0 +1,580 @@ +// +// MultipartFormData.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +#if os(iOS) || os(watchOS) || os(tvOS) +import MobileCoreServices +#elseif os(macOS) +import CoreServices +#endif + +/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode +/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead +/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the +/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for +/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. +/// +/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well +/// and the w3 form documentation. +/// +/// - https://www.ietf.org/rfc/rfc2388.txt +/// - https://www.ietf.org/rfc/rfc2045.txt +/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 +open class MultipartFormData { + + // MARK: - Helper Types + + struct EncodingCharacters { + static let crlf = "\r\n" + } + + struct BoundaryGenerator { + enum BoundaryType { + case initial, encapsulated, final + } + + static func randomBoundary() -> String { + return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) + } + + static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { + let boundaryText: String + + switch boundaryType { + case .initial: + boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" + case .encapsulated: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" + case .final: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" + } + + return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + } + + class BodyPart { + let headers: HTTPHeaders + let bodyStream: InputStream + let bodyContentLength: UInt64 + var hasInitialBoundary = false + var hasFinalBoundary = false + + init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { + self.headers = headers + self.bodyStream = bodyStream + self.bodyContentLength = bodyContentLength + } + } + + // MARK: - Properties + + /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" + + /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. + public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } + + /// The boundary used to separate the body parts in the encoded form data. + public var boundary: String + + private var bodyParts: [BodyPart] + private var bodyPartError: AFError? + private let streamBufferSize: Int + + // MARK: - Lifecycle + + /// Creates a multipart form data object. + /// + /// - returns: The multipart form data object. + public init() { + self.boundary = BoundaryGenerator.randomBoundary() + self.bodyParts = [] + + /// + /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more + /// information, please refer to the following article: + /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html + /// + + self.streamBufferSize = 1024 + } + + // MARK: - Body Parts + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + public func append(_ data: Data, withName name: String) { + let headers = contentHeaders(withName: name) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, mimeType: String) { + let headers = contentHeaders(withName: name, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the + /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the + /// system associated MIME type. + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + public func append(_ fileURL: URL, withName name: String) { + let fileName = fileURL.lastPathComponent + let pathExtension = fileURL.pathExtension + + if !fileName.isEmpty && !pathExtension.isEmpty { + let mime = mimeType(forPathExtension: pathExtension) + append(fileURL, withName: name, fileName: fileName, mimeType: mime) + } else { + setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) + } + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) + /// - Content-Type: #{mimeType} (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. + public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + + //============================================================ + // Check 1 - is file URL? + //============================================================ + + guard fileURL.isFileURL else { + setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) + return + } + + //============================================================ + // Check 2 - is file URL reachable? + //============================================================ + + do { + let isReachable = try fileURL.checkPromisedItemIsReachable() + guard isReachable else { + setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) + return + } + } catch { + setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 3 - is file URL a directory? + //============================================================ + + var isDirectory: ObjCBool = false + let path = fileURL.path + + guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { + setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) + return + } + + //============================================================ + // Check 4 - can the file size be extracted? + //============================================================ + + let bodyContentLength: UInt64 + + do { + guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { + setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) + return + } + + bodyContentLength = fileSize.uint64Value + } + catch { + setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 5 - can a stream be created from file URL? + //============================================================ + + guard let stream = InputStream(url: fileURL) else { + setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) + return + } + + append(stream, withLength: bodyContentLength, headers: headers) + } + + /// Creates a body part from the stream and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. + public func append( + _ stream: InputStream, + withLength length: UInt64, + name: String, + fileName: String, + mimeType: String) + { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - HTTP headers + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter headers: The HTTP headers for the body part. + public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { + let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) + bodyParts.append(bodyPart) + } + + // MARK: - Data Encoding + + /// Encodes all the appended body parts into a single `Data` value. + /// + /// It is important to note that this method will load all the appended body parts into memory all at the same + /// time. This method should only be used when the encoded data will have a small memory footprint. For large data + /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. + /// + /// - throws: An `AFError` if encoding encounters an error. + /// + /// - returns: The encoded `Data` if encoding is successful. + public func encode() throws -> Data { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + var encoded = Data() + + bodyParts.first?.hasInitialBoundary = true + bodyParts.last?.hasFinalBoundary = true + + for bodyPart in bodyParts { + let encodedData = try encode(bodyPart) + encoded.append(encodedData) + } + + return encoded + } + + /// Writes the appended body parts into the given file URL. + /// + /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, + /// this approach is very memory efficient and should be used for large body part data. + /// + /// - parameter fileURL: The file URL to write the multipart form data into. + /// + /// - throws: An `AFError` if encoding encounters an error. + public func writeEncodedData(to fileURL: URL) throws { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + if FileManager.default.fileExists(atPath: fileURL.path) { + throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) + } else if !fileURL.isFileURL { + throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) + } + + guard let outputStream = OutputStream(url: fileURL, append: false) else { + throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) + } + + outputStream.open() + defer { outputStream.close() } + + self.bodyParts.first?.hasInitialBoundary = true + self.bodyParts.last?.hasFinalBoundary = true + + for bodyPart in self.bodyParts { + try write(bodyPart, to: outputStream) + } + } + + // MARK: - Private - Body Part Encoding + + private func encode(_ bodyPart: BodyPart) throws -> Data { + var encoded = Data() + + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + encoded.append(initialData) + + let headerData = encodeHeaders(for: bodyPart) + encoded.append(headerData) + + let bodyStreamData = try encodeBodyStream(for: bodyPart) + encoded.append(bodyStreamData) + + if bodyPart.hasFinalBoundary { + encoded.append(finalBoundaryData()) + } + + return encoded + } + + private func encodeHeaders(for bodyPart: BodyPart) -> Data { + var headerText = "" + + for (key, value) in bodyPart.headers { + headerText += "\(key): \(value)\(EncodingCharacters.crlf)" + } + headerText += EncodingCharacters.crlf + + return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + + private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { + let inputStream = bodyPart.bodyStream + inputStream.open() + defer { inputStream.close() } + + var encoded = Data() + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let error = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) + } + + if bytesRead > 0 { + encoded.append(buffer, count: bytesRead) + } else { + break + } + } + + return encoded + } + + // MARK: - Private - Writing Body Part to Output Stream + + private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { + try writeInitialBoundaryData(for: bodyPart, to: outputStream) + try writeHeaderData(for: bodyPart, to: outputStream) + try writeBodyStream(for: bodyPart, to: outputStream) + try writeFinalBoundaryData(for: bodyPart, to: outputStream) + } + + private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + return try write(initialData, to: outputStream) + } + + private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let headerData = encodeHeaders(for: bodyPart) + return try write(headerData, to: outputStream) + } + + private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let inputStream = bodyPart.bodyStream + + inputStream.open() + defer { inputStream.close() } + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let streamError = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) + } + + if bytesRead > 0 { + if buffer.count != bytesRead { + buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { + let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) + + if let error = outputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) + } + + bytesToWrite -= bytesWritten + + if bytesToWrite > 0 { + buffer = Array(buffer[bytesWritten.. String { + if + let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), + let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() + { + return contentType as String + } + + return "application/octet-stream" + } + + // MARK: - Private - Content Headers + + private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { + var disposition = "form-data; name=\"\(name)\"" + if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } + + var headers = ["Content-Disposition": disposition] + if let mimeType = mimeType { headers["Content-Type"] = mimeType } + + return headers + } + + // MARK: - Private - Boundary Encoding + + private func initialBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) + } + + private func encapsulatedBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) + } + + private func finalBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) + } + + // MARK: - Private - Errors + + private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { + guard bodyPartError == nil else { return } + bodyPartError = AFError.multipartEncodingFailed(reason: reason) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift new file mode 100644 index 000000000000..398ca827c2b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -0,0 +1,238 @@ +// +// NetworkReachabilityManager.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#if !os(watchOS) + +import Foundation +import SystemConfiguration + +/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and +/// WiFi network interfaces. +/// +/// Reachability can be used to determine background information about why a network operation failed, or to retry +/// network requests when a connection is established. It should not be used to prevent a user from initiating a network +/// request, as it's possible that an initial request may be required to establish reachability. +open class NetworkReachabilityManager { + /// Defines the various states of network reachability. + /// + /// - unknown: It is unknown whether the network is reachable. + /// - notReachable: The network is not reachable. + /// - reachable: The network is reachable. + public enum NetworkReachabilityStatus { + case unknown + case notReachable + case reachable(ConnectionType) + } + + /// Defines the various connection types detected by reachability flags. + /// + /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. + /// - wwan: The connection type is a WWAN connection. + public enum ConnectionType { + case ethernetOrWiFi + case wwan + } + + /// A closure executed when the network reachability status changes. The closure takes a single argument: the + /// network reachability status. + public typealias Listener = (NetworkReachabilityStatus) -> Void + + // MARK: - Properties + + /// Whether the network is currently reachable. + open var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } + + /// Whether the network is currently reachable over the WWAN interface. + open var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } + + /// Whether the network is currently reachable over Ethernet or WiFi interface. + open var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } + + /// The current network reachability status. + open var networkReachabilityStatus: NetworkReachabilityStatus { + guard let flags = self.flags else { return .unknown } + return networkReachabilityStatusForFlags(flags) + } + + /// The dispatch queue to execute the `listener` closure on. + open var listenerQueue: DispatchQueue = DispatchQueue.main + + /// A closure executed when the network reachability status changes. + open var listener: Listener? + + open var flags: SCNetworkReachabilityFlags? { + var flags = SCNetworkReachabilityFlags() + + if SCNetworkReachabilityGetFlags(reachability, &flags) { + return flags + } + + return nil + } + + private let reachability: SCNetworkReachability + open var previousFlags: SCNetworkReachabilityFlags + + // MARK: - Initialization + + /// Creates a `NetworkReachabilityManager` instance with the specified host. + /// + /// - parameter host: The host used to evaluate network reachability. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?(host: String) { + guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } + self.init(reachability: reachability) + } + + /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. + /// + /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing + /// status of the device, both IPv4 and IPv6. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?() { + var address = sockaddr_in() + address.sin_len = UInt8(MemoryLayout.size) + address.sin_family = sa_family_t(AF_INET) + + guard let reachability = withUnsafePointer(to: &address, { pointer in + return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { + return SCNetworkReachabilityCreateWithAddress(nil, $0) + } + }) else { return nil } + + self.init(reachability: reachability) + } + + private init(reachability: SCNetworkReachability) { + self.reachability = reachability + + // Set the previous flags to an unreserved value to represent unknown status + self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30) + } + + deinit { + stopListening() + } + + // MARK: - Listening + + /// Starts listening for changes in network reachability status. + /// + /// - returns: `true` if listening was started successfully, `false` otherwise. + @discardableResult + open func startListening() -> Bool { + var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) + context.info = Unmanaged.passUnretained(self).toOpaque() + + let callbackEnabled = SCNetworkReachabilitySetCallback( + reachability, + { (_, flags, info) in + let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() + reachability.notifyListener(flags) + }, + &context + ) + + let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) + + listenerQueue.async { + self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30) + + guard let flags = self.flags else { return } + + self.notifyListener(flags) + } + + return callbackEnabled && queueEnabled + } + + /// Stops listening for changes in network reachability status. + open func stopListening() { + SCNetworkReachabilitySetCallback(reachability, nil, nil) + SCNetworkReachabilitySetDispatchQueue(reachability, nil) + } + + // MARK: - Internal - Listener Notification + + func notifyListener(_ flags: SCNetworkReachabilityFlags) { + guard previousFlags != flags else { return } + previousFlags = flags + + listener?(networkReachabilityStatusForFlags(flags)) + } + + // MARK: - Internal - Network Reachability Status + + func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { + guard isNetworkReachable(with: flags) else { return .notReachable } + + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) + + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif + + return networkStatus + } + + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) + + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) + } +} + +// MARK: - + +extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} + +/// Returns whether the two network reachability status values are equal. +/// +/// - parameter lhs: The left-hand side value to compare. +/// - parameter rhs: The right-hand side value to compare. +/// +/// - returns: `true` if the two values are equal, `false` otherwise. +public func ==( + lhs: NetworkReachabilityManager.NetworkReachabilityStatus, + rhs: NetworkReachabilityManager.NetworkReachabilityStatus) + -> Bool +{ + switch (lhs, rhs) { + case (.unknown, .unknown): + return true + case (.notReachable, .notReachable): + return true + case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): + return lhsConnectionType == rhsConnectionType + default: + return false + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift new file mode 100644 index 000000000000..e1ac31bf327e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift @@ -0,0 +1,55 @@ +// +// Notifications.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Notification.Name { + /// Used as a namespace for all `URLSessionTask` related notifications. + public struct Task { + /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. + public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") + + /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. + public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") + + /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. + public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") + + /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. + public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") + } +} + +// MARK: - + +extension Notification { + /// Used as a namespace for all `Notification` user info dictionary keys. + public struct Key { + /// User info dictionary key representing the `URLSessionTask` associated with the notification. + public static let Task = "org.alamofire.notification.key.task" + + /// User info dictionary key representing the responseData associated with the notification. + public static let ResponseData = "org.alamofire.notification.key.responseData" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift new file mode 100644 index 000000000000..6195809c5db9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift @@ -0,0 +1,483 @@ +// +// ParameterEncoding.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// HTTP method definitions. +/// +/// See https://tools.ietf.org/html/rfc7231#section-4.3 +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +// MARK: - + +/// A dictionary of parameters to apply to a `URLRequest`. +public typealias Parameters = [String: Any] + +/// A type used to define how a set of parameters are applied to a `URLRequest`. +public protocol ParameterEncoding { + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. + /// + /// - returns: The encoded request. + func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest +} + +// MARK: - + +/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP +/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as +/// the HTTP body depends on the destination of the encoding. +/// +/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to +/// `application/x-www-form-urlencoded; charset=utf-8`. +/// +/// There is no published specification for how to encode collection types. By default the convention of appending +/// `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for +/// nested dictionary values (`foo[bar]=baz`) is used. Optionally, `ArrayEncoding` can be used to omit the +/// square brackets appended to array keys. +/// +/// `BoolEncoding` can be used to configure how boolean values are encoded. The default behavior is to encode +/// `true` as 1 and `false` as 0. +public struct URLEncoding: ParameterEncoding { + + // MARK: Helper Types + + /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the + /// resulting URL request. + /// + /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` + /// requests and sets as the HTTP body for requests with any other HTTP method. + /// - queryString: Sets or appends encoded query string result to existing query string. + /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. + public enum Destination { + case methodDependent, queryString, httpBody + } + + /// Configures how `Array` parameters are encoded. + /// + /// - brackets: An empty set of square brackets is appended to the key for every value. + /// This is the default behavior. + /// - noBrackets: No brackets are appended. The key is encoded as is. + public enum ArrayEncoding { + case brackets, noBrackets + + func encode(key: String) -> String { + switch self { + case .brackets: + return "\(key)[]" + case .noBrackets: + return key + } + } + } + + /// Configures how `Bool` parameters are encoded. + /// + /// - numeric: Encode `true` as `1` and `false` as `0`. This is the default behavior. + /// - literal: Encode `true` and `false` as string literals. + public enum BoolEncoding { + case numeric, literal + + func encode(value: Bool) -> String { + switch self { + case .numeric: + return value ? "1" : "0" + case .literal: + return value ? "true" : "false" + } + } + } + + // MARK: Properties + + /// Returns a default `URLEncoding` instance. + public static var `default`: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.methodDependent` destination. + public static var methodDependent: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.queryString` destination. + public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } + + /// Returns a `URLEncoding` instance with an `.httpBody` destination. + public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } + + /// The destination defining where the encoded query string is to be applied to the URL request. + public let destination: Destination + + /// The encoding to use for `Array` parameters. + public let arrayEncoding: ArrayEncoding + + /// The encoding to use for `Bool` parameters. + public let boolEncoding: BoolEncoding + + // MARK: Initialization + + /// Creates a `URLEncoding` instance using the specified destination. + /// + /// - parameter destination: The destination defining where the encoded query string is to be applied. + /// - parameter arrayEncoding: The encoding to use for `Array` parameters. + /// - parameter boolEncoding: The encoding to use for `Bool` parameters. + /// + /// - returns: The new `URLEncoding` instance. + public init(destination: Destination = .methodDependent, arrayEncoding: ArrayEncoding = .brackets, boolEncoding: BoolEncoding = .numeric) { + self.destination = destination + self.arrayEncoding = arrayEncoding + self.boolEncoding = boolEncoding + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { + guard let url = urlRequest.url else { + throw AFError.parameterEncodingFailed(reason: .missingURL) + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) + urlComponents.percentEncodedQuery = percentEncodedQuery + urlRequest.url = urlComponents.url + } + } else { + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) + } + + return urlRequest + } + + /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. + /// + /// - parameter key: The key of the query component. + /// - parameter value: The value of the query component. + /// + /// - returns: The percent-escaped, URL encoded query string components. + public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { + var components: [(String, String)] = [] + + if let dictionary = value as? [String: Any] { + for (nestedKey, value) in dictionary { + components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) + } + } else if let array = value as? [Any] { + for value in array { + components += queryComponents(fromKey: arrayEncoding.encode(key: key), value: value) + } + } else if let value = value as? NSNumber { + if value.isBool { + components.append((escape(key), escape(boolEncoding.encode(value: value.boolValue)))) + } else { + components.append((escape(key), escape("\(value)"))) + } + } else if let bool = value as? Bool { + components.append((escape(key), escape(boolEncoding.encode(value: bool)))) + } else { + components.append((escape(key), escape("\(value)"))) + } + + return components + } + + /// Returns a percent-escaped string following RFC 3986 for a query string key or value. + /// + /// RFC 3986 states that the following characters are "reserved" characters. + /// + /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + /// + /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + /// should be percent-escaped in the query string. + /// + /// - parameter string: The string to be percent-escaped. + /// + /// - returns: The percent-escaped string. + public func escape(_ string: String) -> String { + let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 + let subDelimitersToEncode = "!$&'()*+,;=" + + var allowedCharacterSet = CharacterSet.urlQueryAllowed + allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") + + var escaped = "" + + //========================================================================================================== + // + // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few + // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no + // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more + // info, please refer to: + // + // - https://github.com/Alamofire/Alamofire/issues/206 + // + //========================================================================================================== + + if #available(iOS 8.3, *) { + escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string + } else { + let batchSize = 50 + var index = string.startIndex + + while index != string.endIndex { + let startIndex = index + let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex + let range = startIndex.. String { + var components: [(String, String)] = [] + + for key in parameters.keys.sorted(by: <) { + let value = parameters[key]! + components += queryComponents(fromKey: key, value: value) + } + return components.map { "\($0)=\($1)" }.joined(separator: "&") + } + + private func encodesParametersInURL(with method: HTTPMethod) -> Bool { + switch destination { + case .queryString: + return true + case .httpBody: + return false + default: + break + } + + switch method { + case .get, .head, .delete: + return true + default: + return false + } + } +} + +// MARK: - + +/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the +/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. +public struct JSONEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a `JSONEncoding` instance with default writing options. + public static var `default`: JSONEncoding { return JSONEncoding() } + + /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. + public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } + + /// The options for writing the parameters as JSON data. + public let options: JSONSerialization.WritingOptions + + // MARK: Initialization + + /// Creates a `JSONEncoding` instance using the specified options. + /// + /// - parameter options: The options for writing the parameters as JSON data. + /// + /// - returns: The new `JSONEncoding` instance. + public init(options: JSONSerialization.WritingOptions = []) { + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: parameters, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } + + /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. + /// + /// - parameter urlRequest: The request to apply the JSON object to. + /// - parameter jsonObject: The JSON object to apply to the request. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonObject = jsonObject else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the +/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header +/// field of an encoded request is set to `application/x-plist`. +public struct PropertyListEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a default `PropertyListEncoding` instance. + public static var `default`: PropertyListEncoding { return PropertyListEncoding() } + + /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. + public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } + + /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. + public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } + + /// The property list serialization format. + public let format: PropertyListSerialization.PropertyListFormat + + /// The options for writing the parameters as plist data. + public let options: PropertyListSerialization.WriteOptions + + // MARK: Initialization + + /// Creates a `PropertyListEncoding` instance using the specified format and options. + /// + /// - parameter format: The property list serialization format. + /// - parameter options: The options for writing the parameters as plist data. + /// + /// - returns: The new `PropertyListEncoding` instance. + public init( + format: PropertyListSerialization.PropertyListFormat = .xml, + options: PropertyListSerialization.WriteOptions = 0) + { + self.format = format + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try PropertyListSerialization.data( + fromPropertyList: parameters, + format: format, + options: options + ) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +extension NSNumber { + fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift new file mode 100644 index 000000000000..2be2ce0106fa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Request.swift @@ -0,0 +1,660 @@ +// +// Request.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. +public protocol RequestAdapter { + /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. + /// + /// - parameter urlRequest: The URL request to adapt. + /// + /// - throws: An `Error` if the adaptation encounters an error. + /// + /// - returns: The adapted `URLRequest`. + func adapt(_ urlRequest: URLRequest) throws -> URLRequest +} + +// MARK: - + +/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. +public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void + +/// A type that determines whether a request should be retried after being executed by the specified session manager +/// and encountering an error. +public protocol RequestRetrier { + /// Determines whether the `Request` should be retried by calling the `completion` closure. + /// + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs + /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly + /// cleaned up after. + /// + /// - parameter manager: The session manager the request was executed on. + /// - parameter request: The request that failed due to the encountered error. + /// - parameter error: The error encountered when executing the request. + /// - parameter completion: The completion closure to be executed when retry decision has been determined. + func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) +} + +// MARK: - + +protocol TaskConvertible { + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask +} + +/// A dictionary of headers to apply to a `URLRequest`. +public typealias HTTPHeaders = [String: String] + +// MARK: - + +/// Responsible for sending a request and receiving the response and associated data from the server, as well as +/// managing its underlying `URLSessionTask`. +open class Request { + + // MARK: Helper Types + + /// A closure executed when monitoring upload or download progress of a request. + public typealias ProgressHandler = (Progress) -> Void + + enum RequestTask { + case data(TaskConvertible?, URLSessionTask?) + case download(TaskConvertible?, URLSessionTask?) + case upload(TaskConvertible?, URLSessionTask?) + case stream(TaskConvertible?, URLSessionTask?) + } + + // MARK: Properties + + /// The delegate for the underlying task. + open internal(set) var delegate: TaskDelegate { + get { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + return taskDelegate + } + set { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + taskDelegate = newValue + } + } + + /// The underlying task. + open var task: URLSessionTask? { return delegate.task } + + /// The session belonging to the underlying task. + public let session: URLSession + + /// The request sent or to be sent to the server. + open var request: URLRequest? { return task?.originalRequest } + + /// The response received from the server, if any. + open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } + + /// The number of times the request has been retried. + open internal(set) var retryCount: UInt = 0 + + let originalTask: TaskConvertible? + + var startTime: CFAbsoluteTime? + var endTime: CFAbsoluteTime? + + var validations: [() -> Void] = [] + + private var taskDelegate: TaskDelegate + private var taskDelegateLock = NSLock() + + // MARK: Lifecycle + + init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { + self.session = session + + switch requestTask { + case .data(let originalTask, let task): + taskDelegate = DataTaskDelegate(task: task) + self.originalTask = originalTask + case .download(let originalTask, let task): + taskDelegate = DownloadTaskDelegate(task: task) + self.originalTask = originalTask + case .upload(let originalTask, let task): + taskDelegate = UploadTaskDelegate(task: task) + self.originalTask = originalTask + case .stream(let originalTask, let task): + taskDelegate = TaskDelegate(task: task) + self.originalTask = originalTask + } + + delegate.error = error + delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } + } + + // MARK: Authentication + + /// Associates an HTTP Basic credential with the request. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// - parameter persistence: The URL credential persistence. `.ForSession` by default. + /// + /// - returns: The request. + @discardableResult + open func authenticate( + user: String, + password: String, + persistence: URLCredential.Persistence = .forSession) + -> Self + { + let credential = URLCredential(user: user, password: password, persistence: persistence) + return authenticate(usingCredential: credential) + } + + /// Associates a specified credential with the request. + /// + /// - parameter credential: The credential. + /// + /// - returns: The request. + @discardableResult + open func authenticate(usingCredential credential: URLCredential) -> Self { + delegate.credential = credential + return self + } + + /// Returns a base64 encoded basic authentication credential as an authorization header tuple. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// + /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. + open class func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { + guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } + + let credential = data.base64EncodedString(options: []) + + return (key: "Authorization", value: "Basic \(credential)") + } + + // MARK: State + + /// Resumes the request. + open func resume() { + guard let task = task else { delegate.queue.isSuspended = false ; return } + + if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } + + task.resume() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidResume, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Suspends the request. + open func suspend() { + guard let task = task else { return } + + task.suspend() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidSuspend, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Cancels the request. + open func cancel() { + guard let task = task else { return } + + task.cancel() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } +} + +// MARK: - CustomStringConvertible + +extension Request: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as + /// well as the response status code if a response has been received. + open var description: String { + var components: [String] = [] + + if let HTTPMethod = request?.httpMethod { + components.append(HTTPMethod) + } + + if let urlString = request?.url?.absoluteString { + components.append(urlString) + } + + if let response = response { + components.append("(\(response.statusCode))") + } + + return components.joined(separator: " ") + } +} + +// MARK: - CustomDebugStringConvertible + +extension Request: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, in the form of a cURL command. + open var debugDescription: String { + return cURLRepresentation() + } + + func cURLRepresentation() -> String { + var components = ["$ curl -v"] + + guard let request = self.request, + let url = request.url, + let host = url.host + else { + return "$ curl command could not be created" + } + + if let httpMethod = request.httpMethod, httpMethod != "GET" { + components.append("-X \(httpMethod)") + } + + if let credentialStorage = self.session.configuration.urlCredentialStorage { + let protectionSpace = URLProtectionSpace( + host: host, + port: url.port ?? 0, + protocol: url.scheme, + realm: host, + authenticationMethod: NSURLAuthenticationMethodHTTPBasic + ) + + if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { + for credential in credentials { + guard let user = credential.user, let password = credential.password else { continue } + components.append("-u \(user):\(password)") + } + } else { + if let credential = delegate.credential, let user = credential.user, let password = credential.password { + components.append("-u \(user):\(password)") + } + } + } + + if session.configuration.httpShouldSetCookies { + if + let cookieStorage = session.configuration.httpCookieStorage, + let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty + { + let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } + + #if swift(>=3.2) + components.append("-b \"\(string[.. URLSessionTask { + do { + let urlRequest = try self.urlRequest.adapt(using: adapter) + return queue.sync { session.dataTask(with: urlRequest) } + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + if let requestable = originalTask as? Requestable { return requestable.urlRequest } + + return nil + } + + /// The progress of fetching the response data from the server for the request. + open var progress: Progress { return dataDelegate.progress } + + var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } + + // MARK: Stream + + /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. + /// + /// This closure returns the bytes most recently received from the server, not including data from previous calls. + /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is + /// also important to note that the server data in any `Response` object will be `nil`. + /// + /// - parameter closure: The code to be executed periodically during the lifecycle of the request. + /// + /// - returns: The request. + @discardableResult + open func stream(closure: ((Data) -> Void)? = nil) -> Self { + dataDelegate.dataStream = closure + return self + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + dataDelegate.progressHandler = (closure, queue) + return self + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. +open class DownloadRequest: Request { + + // MARK: Helper Types + + /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the + /// destination URL. + public struct DownloadOptions: OptionSet { + /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. + public let rawValue: UInt + + /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. + public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) + + /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. + public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) + + /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. + /// + /// - parameter rawValue: The raw bitmask value for the option. + /// + /// - returns: A new log level instance. + public init(rawValue: UInt) { + self.rawValue = rawValue + } + } + + /// A closure executed once a download request has successfully completed in order to determine where to move the + /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL + /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and + /// the options defining how the file should be moved. + public typealias DownloadFileDestination = ( + _ temporaryURL: URL, + _ response: HTTPURLResponse) + -> (destinationURL: URL, options: DownloadOptions) + + enum Downloadable: TaskConvertible { + case request(URLRequest) + case resumeData(Data) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .request(urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.downloadTask(with: urlRequest) } + case let .resumeData(resumeData): + task = queue.sync { session.downloadTask(withResumeData: resumeData) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { + return urlRequest + } + + return nil + } + + /// The resume data of the underlying download task if available after a failure. + open var resumeData: Data? { return downloadDelegate.resumeData } + + /// The progress of downloading the response data from the server for the request. + open var progress: Progress { return downloadDelegate.progress } + + var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } + + // MARK: State + + /// Cancels the request. + override open func cancel() { + cancel(createResumeData: true) + } + + /// Cancels the request. + /// + /// - parameter createResumeData: Determines whether resume data is created via the underlying download task or not. + open func cancel(createResumeData: Bool) { + if createResumeData { + downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } + } else { + downloadDelegate.downloadTask.cancel() + } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task as Any] + ) + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + downloadDelegate.progressHandler = (closure, queue) + return self + } + + // MARK: Destination + + /// Creates a download file destination closure which uses the default file manager to move the temporary file to a + /// file URL in the first available directory with the specified search path directory and search path domain mask. + /// + /// - parameter directory: The search path directory. `.DocumentDirectory` by default. + /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. + /// + /// - returns: A download file destination closure. + open class func suggestedDownloadDestination( + for directory: FileManager.SearchPathDirectory = .documentDirectory, + in domain: FileManager.SearchPathDomainMask = .userDomainMask) + -> DownloadFileDestination + { + return { temporaryURL, response in + let directoryURLs = FileManager.default.urls(for: directory, in: domain) + + if !directoryURLs.isEmpty { + return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) + } + + return (temporaryURL, []) + } + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. +open class UploadRequest: DataRequest { + + // MARK: Helper Types + + enum Uploadable: TaskConvertible { + case data(Data, URLRequest) + case file(URL, URLRequest) + case stream(InputStream, URLRequest) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .data(data, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, from: data) } + case let .file(url, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } + case let .stream(_, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + guard let uploadable = originalTask as? Uploadable else { return nil } + + switch uploadable { + case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): + return urlRequest + } + } + + /// The progress of uploading the payload to the server for the upload request. + open var uploadProgress: Progress { return uploadDelegate.uploadProgress } + + var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } + + // MARK: Upload Progress + + /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to + /// the server. + /// + /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress + /// of data being read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is sent to the server. + /// + /// - returns: The request. + @discardableResult + open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + uploadDelegate.uploadProgressHandler = (closure, queue) + return self + } +} + +// MARK: - + +#if !os(watchOS) + +/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +open class StreamRequest: Request { + enum Streamable: TaskConvertible { + case stream(hostName: String, port: Int) + case netService(NetService) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + let task: URLSessionTask + + switch self { + case let .stream(hostName, port): + task = queue.sync { session.streamTask(withHostName: hostName, port: port) } + case let .netService(netService): + task = queue.sync { session.streamTask(with: netService) } + } + + return task + } + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift new file mode 100644 index 000000000000..747a471a55ba --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Response.swift @@ -0,0 +1,567 @@ +// +// Response.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to store all data associated with an non-serialized response of a data or upload request. +public struct DefaultDataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDataResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - data: The data returned by the server. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.data = data + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a data or upload request. +public struct DataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter data: The data returned by the server. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DataResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.data = data + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the server data, the response serialization result and the timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[Data]: \(data?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DataResponse { + /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result + /// value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's + /// result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let withMyError = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `DataResponse` instance containing the result of the transform. + public func mapError(_ transform: (Error) -> E) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.mapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `DataResponse` instance containing the result of the transform. + public func flatMapError(_ transform: (Error) throws -> E) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +/// Used to store all data associated with an non-serialized response of a download request. +public struct DefaultDownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDownloadResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - temporaryURL: The temporary destination URL of the data returned from the server. + /// - destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - resumeData: The resume data generated if the request was cancelled. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a download request. +public struct DownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. + /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - parameter resumeData: The resume data generated if the request was cancelled. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DownloadResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the temporary and destination URLs, the resume data, the response serialization result and the + /// timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") + output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") + output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DownloadResponse { + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this + /// instance's result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let withMyError = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `DownloadResponse` instance containing the result of the transform. + public func mapError(_ transform: (Error) -> E) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.mapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `DownloadResponse` instance containing the result of the transform. + public func flatMapError(_ transform: (Error) throws -> E) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +protocol Response { + /// The task metrics containing the request / response statistics. + var _metrics: AnyObject? { get set } + mutating func add(_ metrics: AnyObject?) +} + +extension Response { + mutating func add(_ metrics: AnyObject?) { + #if !os(watchOS) + guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } + guard let metrics = metrics as? URLSessionTaskMetrics else { return } + + _metrics = metrics + #endif + } +} + +// MARK: - + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift new file mode 100644 index 000000000000..9cc105a82057 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift @@ -0,0 +1,715 @@ +// +// ResponseSerialization.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The type in which all data response serializers must conform to in order to serialize a response. +public protocol DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DataResponseSerializer: DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - + +/// The type in which all download response serializers must conform to in order to serialize a response. +public protocol DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - Timeline + +extension Request { + var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() + let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() + let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime + + return Timeline( + requestStartTime: requestStartTime, + initialResponseTime: initialResponseTime, + requestCompletedTime: requestCompletedTime, + serializationCompletedTime: CFAbsoluteTimeGetCurrent() + ) + } +} + +// MARK: - Default + +extension DataRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var dataResponse = DefaultDataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + error: self.delegate.error, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + completionHandler(dataResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.delegate.data, + self.delegate.error + ) + + var dataResponse = DataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + result: result, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } + } + + return self + } +} + +extension DownloadRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DefaultDownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var downloadResponse = DefaultDownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + error: self.downloadDelegate.error, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + completionHandler(downloadResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data contained in the destination url. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.downloadDelegate.fileURL, + self.downloadDelegate.error + ) + + var downloadResponse = DownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + result: result, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } + } + + return self + } +} + +// MARK: - Data + +extension Request { + /// Returns a result data type that contains the response data as-is. + /// + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + return .success(validData) + } +} + +extension DataRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseData(response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseData(response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +// MARK: - String + +extension Request { + /// Returns a result string type initialized from the response data with the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseString( + encoding: String.Encoding?, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + var convertedEncoding = encoding + + if let encodingName = response?.textEncodingName as CFString?, convertedEncoding == nil { + convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( + CFStringConvertIANACharSetNameToEncoding(encodingName)) + ) + } + + let actualEncoding = convertedEncoding ?? .isoLatin1 + + if let string = String(data: validData, encoding: actualEncoding) { + return .success(string) + } else { + return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +// MARK: - JSON + +extension Request { + /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` + /// with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseJSON( + options: JSONSerialization.ReadingOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let json = try JSONSerialization.jsonObject(with: validData, options: options) + return .success(json) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +// MARK: - Property List + +extension Request { + /// Returns a plist object contained in a result type constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponsePropertyList( + options: PropertyListSerialization.ReadOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) + return .success(plist) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +/// A set of HTTP response status code that do not contain response data. +private let emptyDataStatusCodes: Set = [204, 205] diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift new file mode 100644 index 000000000000..e0928089ab73 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Result.swift @@ -0,0 +1,300 @@ +// +// Result.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to represent whether a request was successful or encountered an error. +/// +/// - success: The request and all post processing operations were successful resulting in the serialization of the +/// provided associated value. +/// +/// - failure: The request encountered an error resulting in a failure. The associated values are the original data +/// provided by the server as well as the error that caused the failure. +public enum Result { + case success(Value) + case failure(Error) + + /// Returns `true` if the result is a success, `false` otherwise. + public var isSuccess: Bool { + switch self { + case .success: + return true + case .failure: + return false + } + } + + /// Returns `true` if the result is a failure, `false` otherwise. + public var isFailure: Bool { + return !isSuccess + } + + /// Returns the associated value if the result is a success, `nil` otherwise. + public var value: Value? { + switch self { + case .success(let value): + return value + case .failure: + return nil + } + } + + /// Returns the associated error value if the result is a failure, `nil` otherwise. + public var error: Error? { + switch self { + case .success: + return nil + case .failure(let error): + return error + } + } +} + +// MARK: - CustomStringConvertible + +extension Result: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + switch self { + case .success: + return "SUCCESS" + case .failure: + return "FAILURE" + } + } +} + +// MARK: - CustomDebugStringConvertible + +extension Result: CustomDebugStringConvertible { + /// The debug textual representation used when written to an output stream, which includes whether the result was a + /// success or failure in addition to the value or error. + public var debugDescription: String { + switch self { + case .success(let value): + return "SUCCESS: \(value)" + case .failure(let error): + return "FAILURE: \(error)" + } + } +} + +// MARK: - Functional APIs + +extension Result { + /// Creates a `Result` instance from the result of a closure. + /// + /// A failure result is created when the closure throws, and a success result is created when the closure + /// succeeds without throwing an error. + /// + /// func someString() throws -> String { ... } + /// + /// let result = Result(value: { + /// return try someString() + /// }) + /// + /// // The type of result is Result + /// + /// The trailing closure syntax is also supported: + /// + /// let result = Result { try someString() } + /// + /// - parameter value: The closure to execute and create the result for. + public init(value: () throws -> Value) { + do { + self = try .success(value()) + } catch { + self = .failure(error) + } + } + + /// Returns the success value, or throws the failure error. + /// + /// let possibleString: Result = .success("success") + /// try print(possibleString.unwrap()) + /// // Prints "success" + /// + /// let noString: Result = .failure(error) + /// try print(noString.unwrap()) + /// // Throws error + public func unwrap() throws -> Value { + switch self { + case .success(let value): + return value + case .failure(let error): + throw error + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: Result = .success(Data()) + /// let possibleInt = possibleData.map { $0.count } + /// try print(possibleInt.unwrap()) + /// // Prints "0" + /// + /// let noData: Result = .failure(error) + /// let noInt = noData.map { $0.count } + /// try print(noInt.unwrap()) + /// // Throws error + /// + /// - parameter transform: A closure that takes the success value of the `Result` instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func map(_ transform: (Value) -> T) -> Result { + switch self { + case .success(let value): + return .success(transform(value)) + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func flatMap(_ transform: (Value) throws -> T) -> Result { + switch self { + case .success(let value): + do { + return try .success(transform(value)) + } catch { + return .failure(error) + } + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) throws -> Void) rethrows -> Result { + if case let .success(value) = self { try closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) throws -> Void) rethrows -> Result { + if case let .failure(error) = self { try closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () throws -> Void) rethrows -> Result { + if isSuccess { try closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () throws -> Void) rethrows -> Result { + if isFailure { try closure() } + + return self + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift new file mode 100644 index 000000000000..dea099e257ab --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift @@ -0,0 +1,307 @@ +// +// ServerTrustPolicy.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. +open class ServerTrustPolicyManager { + /// The dictionary of policies mapped to a particular host. + public let policies: [String: ServerTrustPolicy] + + /// Initializes the `ServerTrustPolicyManager` instance with the given policies. + /// + /// Since different servers and web services can have different leaf certificates, intermediate and even root + /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This + /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key + /// pinning for host3 and disabling evaluation for host4. + /// + /// - parameter policies: A dictionary of all policies mapped to a particular host. + /// + /// - returns: The new `ServerTrustPolicyManager` instance. + public init(policies: [String: ServerTrustPolicy]) { + self.policies = policies + } + + /// Returns the `ServerTrustPolicy` for the given host if applicable. + /// + /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override + /// this method and implement more complex mapping implementations such as wildcards. + /// + /// - parameter host: The host to use when searching for a matching policy. + /// + /// - returns: The server trust policy for the given host if found. + open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { + return policies[host] + } +} + +// MARK: - + +extension URLSession { + private struct AssociatedKeys { + static var managerKey = "URLSession.ServerTrustPolicyManager" + } + + var serverTrustPolicyManager: ServerTrustPolicyManager? { + get { + return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager + } + set (manager) { + objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + } + } +} + +// MARK: - ServerTrustPolicy + +/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when +/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust +/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. +/// +/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other +/// vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged +/// to route all communication over an HTTPS connection with pinning enabled. +/// +/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to +/// validate the host provided by the challenge. Applications are encouraged to always +/// validate the host in production environments to guarantee the validity of the server's +/// certificate chain. +/// +/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to +/// validate the host provided by the challenge as well as specify the revocation flags for +/// testing for revoked certificates. Apple platforms did not start testing for revoked +/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is +/// demonstrated in our TLS tests. Applications are encouraged to always validate the host +/// in production environments to guarantee the validity of the server's certificate chain. +/// +/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is +/// considered valid if one of the pinned certificates match one of the server certificates. +/// By validating both the certificate chain and host, certificate pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered +/// valid if one of the pinned public keys match one of the server certificate public keys. +/// By validating both the certificate chain and host, public key pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. +/// +/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. +public enum ServerTrustPolicy { + case performDefaultEvaluation(validateHost: Bool) + case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) + case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) + case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) + case disableEvaluation + case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) + + // MARK: - Bundle Location + + /// Returns all certificates within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `.cer` files. + /// + /// - returns: All certificates within the given bundle. + public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { + var certificates: [SecCertificate] = [] + + let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in + bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) + }.joined()) + + for path in paths { + if + let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, + let certificate = SecCertificateCreateWithData(nil, certificateData) + { + certificates.append(certificate) + } + } + + return certificates + } + + /// Returns all public keys within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `*.cer` files. + /// + /// - returns: All public keys within the given bundle. + public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for certificate in certificates(in: bundle) { + if let publicKey = publicKey(for: certificate) { + publicKeys.append(publicKey) + } + } + + return publicKeys + } + + // MARK: - Evaluation + + /// Evaluates whether the server trust is valid for the given host. + /// + /// - parameter serverTrust: The server trust to evaluate. + /// - parameter host: The host of the challenge protection space. + /// + /// - returns: Whether the server trust is valid. + public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { + var serverTrustIsValid = false + + switch self { + case let .performDefaultEvaluation(validateHost): + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .performRevokedEvaluation(validateHost, revocationFlags): + let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) + SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) + SecTrustSetAnchorCertificatesOnly(serverTrust, true) + + serverTrustIsValid = trustIsValid(serverTrust) + } else { + let serverCertificatesDataArray = certificateData(for: serverTrust) + let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) + + outerLoop: for serverCertificateData in serverCertificatesDataArray { + for pinnedCertificateData in pinnedCertificatesDataArray { + if serverCertificateData == pinnedCertificateData { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): + var certificateChainEvaluationPassed = true + + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + certificateChainEvaluationPassed = trustIsValid(serverTrust) + } + + if certificateChainEvaluationPassed { + outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { + for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { + if serverPublicKey.isEqual(pinnedPublicKey) { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case .disableEvaluation: + serverTrustIsValid = true + case let .customEvaluation(closure): + serverTrustIsValid = closure(serverTrust, host) + } + + return serverTrustIsValid + } + + // MARK: - Private - Trust Validation + + private func trustIsValid(_ trust: SecTrust) -> Bool { + var isValid = false + + var result = SecTrustResultType.invalid + let status = SecTrustEvaluate(trust, &result) + + if status == errSecSuccess { + let unspecified = SecTrustResultType.unspecified + let proceed = SecTrustResultType.proceed + + + isValid = result == unspecified || result == proceed + } + + return isValid + } + + // MARK: - Private - Certificate Data + + private func certificateData(for trust: SecTrust) -> [Data] { + var certificates: [SecCertificate] = [] + + for index in 0.. [Data] { + return certificates.map { SecCertificateCopyData($0) as Data } + } + + // MARK: - Private - Public Key Extraction + + private static func publicKeys(for trust: SecTrust) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for index in 0.. SecKey? { + var publicKey: SecKey? + + let policy = SecPolicyCreateBasicX509() + var trust: SecTrust? + let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) + + if let trust = trust, trustCreationStatus == errSecSuccess { + publicKey = SecTrustCopyPublicKey(trust) + } + + return publicKey + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift new file mode 100644 index 000000000000..4964f1eebfd7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift @@ -0,0 +1,725 @@ +// +// SessionDelegate.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for handling all delegate callbacks for the underlying session. +open class SessionDelegate: NSObject { + + // MARK: URLSessionDelegate Overrides + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. + open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. + open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. + open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? + + // MARK: URLSessionTaskDelegate Overrides + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. + open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. + open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. + open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and + /// requires the caller to call the `completionHandler`. + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. + open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. + open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? + + // MARK: URLSessionDataDelegate Overrides + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. + open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. + open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. + open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. + open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? + + // MARK: URLSessionDownloadDelegate Overrides + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. + open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. + open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. + open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + // MARK: URLSessionStreamDelegate Overrides + +#if !os(watchOS) + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskReadClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskWriteClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskBetterRouteDiscovered = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { + get { + return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void + } + set { + _streamTaskDidBecomeInputStream = newValue + } + } + + var _streamTaskReadClosed: Any? + var _streamTaskWriteClosed: Any? + var _streamTaskBetterRouteDiscovered: Any? + var _streamTaskDidBecomeInputStream: Any? + +#endif + + // MARK: Properties + + var retrier: RequestRetrier? + weak var sessionManager: SessionManager? + + var requests: [Int: Request] = [:] + private let lock = NSLock() + + /// Access the task delegate for the specified task in a thread-safe manner. + open subscript(task: URLSessionTask) -> Request? { + get { + lock.lock() ; defer { lock.unlock() } + return requests[task.taskIdentifier] + } + set { + lock.lock() ; defer { lock.unlock() } + requests[task.taskIdentifier] = newValue + } + } + + // MARK: Lifecycle + + /// Initializes the `SessionDelegate` instance. + /// + /// - returns: The new `SessionDelegate` instance. + public override init() { + super.init() + } + + // MARK: NSObject Overrides + + /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond + /// to a specified message. + /// + /// - parameter selector: A selector that identifies a message. + /// + /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. + open override func responds(to selector: Selector) -> Bool { + #if !os(macOS) + if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { + return sessionDidFinishEventsForBackgroundURLSession != nil + } + #endif + + #if !os(watchOS) + if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { + switch selector { + case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): + return streamTaskReadClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): + return streamTaskWriteClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): + return streamTaskBetterRouteDiscovered != nil + case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): + return streamTaskDidBecomeInputAndOutputStreams != nil + default: + break + } + } + #endif + + switch selector { + case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): + return sessionDidBecomeInvalidWithError != nil + case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): + return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) + case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): + return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) + case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): + return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) + default: + return type(of: self).instancesRespond(to: selector) + } + } +} + +// MARK: - URLSessionDelegate + +extension SessionDelegate: URLSessionDelegate { + /// Tells the delegate that the session has been invalidated. + /// + /// - parameter session: The session object that was invalidated. + /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. + open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { + sessionDidBecomeInvalidWithError?(session, error) + } + + /// Requests credentials from the delegate in response to a session-level authentication request from the + /// remote server. + /// + /// - parameter session: The session containing the task that requested authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard sessionDidReceiveChallengeWithCompletion == nil else { + sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) + return + } + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { + (disposition, credential) = sessionDidReceiveChallenge(session, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } + + completionHandler(disposition, credential) + } + +#if !os(macOS) + + /// Tells the delegate that all messages enqueued for a session have been delivered. + /// + /// - parameter session: The session that no longer has any outstanding requests. + open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { + sessionDidFinishEventsForBackgroundURLSession?(session) + } + +#endif +} + +// MARK: - URLSessionTaskDelegate + +extension SessionDelegate: URLSessionTaskDelegate { + /// Tells the delegate that the remote server requested an HTTP redirect. + /// + /// - parameter session: The session containing the task whose request resulted in a redirect. + /// - parameter task: The task whose request resulted in a redirect. + /// - parameter response: An object containing the server’s response to the original request. + /// - parameter request: A URL request object filled out with the new location. + /// - parameter completionHandler: A closure that your handler should call with either the value of the request + /// parameter, a modified URL request object, or NULL to refuse the redirect and + /// return the body of the redirect response. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + guard taskWillPerformHTTPRedirectionWithCompletion == nil else { + taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) + return + } + + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + /// Requests credentials from the delegate in response to an authentication request from the remote server. + /// + /// - parameter session: The session containing the task whose request requires authentication. + /// - parameter task: The task whose request requires authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard taskDidReceiveChallengeWithCompletion == nil else { + taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) + return + } + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + let result = taskDidReceiveChallenge(session, task, challenge) + completionHandler(result.0, result.1) + } else if let delegate = self[task]?.delegate { + delegate.urlSession( + session, + task: task, + didReceive: challenge, + completionHandler: completionHandler + ) + } else { + urlSession(session, didReceive: challenge, completionHandler: completionHandler) + } + } + + /// Tells the delegate when a task requires a new request body stream to send to the remote server. + /// + /// - parameter session: The session containing the task that needs a new body stream. + /// - parameter task: The task that needs a new body stream. + /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + guard taskNeedNewBodyStreamWithCompletion == nil else { + taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) + return + } + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + completionHandler(taskNeedNewBodyStream(session, task)) + } else if let delegate = self[task]?.delegate { + delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) + } + } + + /// Periodically informs the delegate of the progress of sending body content to the server. + /// + /// - parameter session: The session containing the data task. + /// - parameter task: The data task. + /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. + /// - parameter totalBytesSent: The total number of bytes sent so far. + /// - parameter totalBytesExpectedToSend: The expected length of the body data. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { + delegate.URLSession( + session, + task: task, + didSendBodyData: bytesSent, + totalBytesSent: totalBytesSent, + totalBytesExpectedToSend: totalBytesExpectedToSend + ) + } + } + +#if !os(watchOS) + + /// Tells the delegate that the session finished collecting metrics for the task. + /// + /// - parameter session: The session collecting the metrics. + /// - parameter task: The task whose metrics have been collected. + /// - parameter metrics: The collected metrics. + @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) + @objc(URLSession:task:didFinishCollectingMetrics:) + open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { + self[task]?.delegate.metrics = metrics + } + +#endif + + /// Tells the delegate that the task finished transferring data. + /// + /// - parameter session: The session containing the task whose request finished transferring data. + /// - parameter task: The task whose request finished transferring data. + /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. + open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + /// Executed after it is determined that the request is not going to be retried + let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in + guard let strongSelf = self else { return } + + strongSelf.taskDidComplete?(session, task, error) + + strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) + + var userInfo: [String: Any] = [Notification.Key.Task: task] + + if let data = (strongSelf[task]?.delegate as? DataTaskDelegate)?.data { + userInfo[Notification.Key.ResponseData] = data + } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidComplete, + object: strongSelf, + userInfo: userInfo + ) + + strongSelf[task] = nil + } + + guard let request = self[task], let sessionManager = sessionManager else { + completeTask(session, task, error) + return + } + + // Run all validations on the request before checking if an error occurred + request.validations.forEach { $0() } + + // Determine whether an error has occurred + var error: Error? = error + + if request.delegate.error != nil { + error = request.delegate.error + } + + /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request + /// should be retried. Otherwise, complete the task by notifying the task delegate. + if let retrier = retrier, let error = error { + retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in + guard shouldRetry else { completeTask(session, task, error) ; return } + + DispatchQueue.utility.after(timeDelay) { [weak self] in + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false + + if retrySucceeded, let task = request.task { + strongSelf[task] = request + return + } else { + completeTask(session, task, error) + } + } + } + } else { + completeTask(session, task, error) + } + } +} + +// MARK: - URLSessionDataDelegate + +extension SessionDelegate: URLSessionDataDelegate { + /// Tells the delegate that the data task received the initial reply (headers) from the server. + /// + /// - parameter session: The session containing the data task that received an initial reply. + /// - parameter dataTask: The data task that received an initial reply. + /// - parameter response: A URL response object populated with headers. + /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a + /// constant to indicate whether the transfer should continue as a data task or + /// should become a download task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + guard dataTaskDidReceiveResponseWithCompletion == nil else { + dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) + return + } + + var disposition: URLSession.ResponseDisposition = .allow + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + /// Tells the delegate that the data task was changed to a download task. + /// + /// - parameter session: The session containing the task that was replaced by a download task. + /// - parameter dataTask: The data task that was replaced by a download task. + /// - parameter downloadTask: The new download task that replaced the data task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { + dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) + } else { + self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) + } + } + + /// Tells the delegate that the data task has received some of the expected data. + /// + /// - parameter session: The session containing the data task that provided data. + /// - parameter dataTask: The data task that provided data. + /// - parameter data: A data object containing the transferred data. + open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession(session, dataTask: dataTask, didReceive: data) + } + } + + /// Asks the delegate whether the data (or upload) task should store the response in the cache. + /// + /// - parameter session: The session containing the data (or upload) task. + /// - parameter dataTask: The data (or upload) task. + /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current + /// caching policy and the values of certain received headers, such as the Pragma + /// and Cache-Control headers. + /// - parameter completionHandler: A block that your handler must call, providing either the original proposed + /// response, a modified version of that response, or NULL to prevent caching the + /// response. If your delegate implements this method, it must call this completion + /// handler; otherwise, your app leaks memory. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + guard dataTaskWillCacheResponseWithCompletion == nil else { + dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) + return + } + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession( + session, + dataTask: dataTask, + willCacheResponse: proposedResponse, + completionHandler: completionHandler + ) + } else { + completionHandler(proposedResponse) + } + } +} + +// MARK: - URLSessionDownloadDelegate + +extension SessionDelegate: URLSessionDownloadDelegate { + /// Tells the delegate that a download task has finished downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that finished. + /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either + /// open the file for reading or move it to a permanent location in your app’s sandbox + /// container directory before returning from this delegate method. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { + downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) + } + } + + /// Periodically informs the delegate about the download’s progress. + /// + /// - parameter session: The session containing the download task. + /// - parameter downloadTask: The download task. + /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate + /// method was called. + /// - parameter totalBytesWritten: The total number of bytes transferred so far. + /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length + /// header. If this header was not provided, the value is + /// `NSURLSessionTransferSizeUnknown`. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didWriteData: bytesWritten, + totalBytesWritten: totalBytesWritten, + totalBytesExpectedToWrite: totalBytesExpectedToWrite + ) + } + } + + /// Tells the delegate that the download task has resumed downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. + /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the + /// existing content, then this value is zero. Otherwise, this value is an + /// integer representing the number of bytes on disk that do not need to be + /// retrieved again. + /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. + /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didResumeAtOffset: fileOffset, + expectedTotalBytes: expectedTotalBytes + ) + } + } +} + +// MARK: - URLSessionStreamDelegate + +#if !os(watchOS) + +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +extension SessionDelegate: URLSessionStreamDelegate { + /// Tells the delegate that the read side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { + streamTaskReadClosed?(session, streamTask) + } + + /// Tells the delegate that the write side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { + streamTaskWriteClosed?(session, streamTask) + } + + /// Tells the delegate that the system has determined that a better route to the host is available. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { + streamTaskBetterRouteDiscovered?(session, streamTask) + } + + /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + /// - parameter inputStream: The new input stream. + /// - parameter outputStream: The new output stream. + open func urlSession( + _ session: URLSession, + streamTask: URLSessionStreamTask, + didBecome inputStream: InputStream, + outputStream: OutputStream) + { + streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift new file mode 100644 index 000000000000..02c36a76b7b4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift @@ -0,0 +1,899 @@ +// +// SessionManager.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. +open class SessionManager { + + // MARK: - Helper Types + + /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as + /// associated values. + /// + /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with + /// streaming information. + /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding + /// error. + public enum MultipartFormDataEncodingResult { + case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) + case failure(Error) + } + + // MARK: - Properties + + /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use + /// directly for any ad hoc requests. + public static let `default`: SessionManager = { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders + + return SessionManager(configuration: configuration) + }() + + /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. + public static let defaultHTTPHeaders: HTTPHeaders = { + // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 + let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" + + // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + + // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 + // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` + let userAgent: String = { + if let info = Bundle.main.infoDictionary { + let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" + let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" + let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" + let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" + + let osNameVersion: String = { + let version = ProcessInfo.processInfo.operatingSystemVersion + let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" + + let osName: String = { + #if os(iOS) + return "iOS" + #elseif os(watchOS) + return "watchOS" + #elseif os(tvOS) + return "tvOS" + #elseif os(macOS) + return "OS X" + #elseif os(Linux) + return "Linux" + #else + return "Unknown" + #endif + }() + + return "\(osName) \(versionString)" + }() + + let alamofireVersion: String = { + guard + let afInfo = Bundle(for: SessionManager.self).infoDictionary, + let build = afInfo["CFBundleShortVersionString"] + else { return "Unknown" } + + return "Alamofire/\(build)" + }() + + return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" + } + + return "Alamofire" + }() + + return [ + "Accept-Encoding": acceptEncoding, + "Accept-Language": acceptLanguage, + "User-Agent": userAgent + ] + }() + + /// Default memory threshold used when encoding `MultipartFormData` in bytes. + public static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 + + /// The underlying session. + public let session: URLSession + + /// The session delegate handling all the task and session delegate callbacks. + public let delegate: SessionDelegate + + /// Whether to start requests immediately after being constructed. `true` by default. + open var startRequestsImmediately: Bool = true + + /// The request adapter called each time a new request is created. + open var adapter: RequestAdapter? + + /// The request retrier called each time a request encounters an error to determine whether to retry the request. + open var retrier: RequestRetrier? { + get { return delegate.retrier } + set { delegate.retrier = newValue } + } + + /// The background completion handler closure provided by the UIApplicationDelegate + /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background + /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation + /// will automatically call the handler. + /// + /// If you need to handle your own events before the handler is called, then you need to override the + /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. + /// + /// `nil` by default. + open var backgroundCompletionHandler: (() -> Void)? + + let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) + + // MARK: - Lifecycle + + /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter configuration: The configuration used to construct the managed session. + /// `URLSessionConfiguration.default` by default. + /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by + /// default. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance. + public init( + configuration: URLSessionConfiguration = URLSessionConfiguration.default, + delegate: SessionDelegate = SessionDelegate(), + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + self.delegate = delegate + self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter session: The URL session. + /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. + public init?( + session: URLSession, + delegate: SessionDelegate, + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + guard delegate === session.delegate else { return nil } + + self.delegate = delegate + self.session = session + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { + session.serverTrustPolicyManager = serverTrustPolicyManager + + delegate.sessionManager = self + + delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in + guard let strongSelf = self else { return } + DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } + } + } + + deinit { + session.invalidateAndCancel() + } + + // MARK: - Data Request + + /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` + /// and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest + { + var originalRequest: URLRequest? + + do { + originalRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) + return request(encodedURLRequest) + } catch { + return request(originalRequest, failedWith: error) + } + } + + /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + var originalRequest: URLRequest? + + do { + originalRequest = try urlRequest.asURLRequest() + let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) + + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + let request = DataRequest(session: session, requestTask: .data(originalTask, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return request(originalRequest, failedWith: error) + } + } + + // MARK: Private - Request Implementation + + private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { + var requestTask: Request.RequestTask = .data(nil, nil) + + if let urlRequest = urlRequest { + let originalTask = DataRequest.Requestable(urlRequest: urlRequest) + requestTask = .data(originalTask, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: request, with: underlyingError) + } else { + if startRequestsImmediately { request.resume() } + } + + return request + } + + // MARK: - Download Request + + // MARK: URL Request + + /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, + /// `headers` and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) + return download(encodedURLRequest, to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save + /// them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try urlRequest.asURLRequest() + return download(.request(urlRequest), to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + // MARK: Resume Data + + /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve + /// the contents of the original request and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken + /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the + /// data is written incorrectly and will always fail to resume the download. For more information about the bug and + /// possible workarounds, please refer to the following Stack Overflow post: + /// + /// - http://stackoverflow.com/a/39347461/1342462 + /// + /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` + /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for + /// additional information. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + return download(.resumeData(resumeData), to: destination) + } + + // MARK: Private - Download Implementation + + private func download( + _ downloadable: DownloadRequest.Downloadable, + to destination: DownloadRequest.DownloadFileDestination?) + -> DownloadRequest + { + do { + let task = try downloadable.task(session: session, adapter: adapter, queue: queue) + let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) + + download.downloadDelegate.destination = destination + + delegate[task] = download + + if startRequestsImmediately { download.resume() } + + return download + } catch { + return download(downloadable, to: destination, failedWith: error) + } + } + + private func download( + _ downloadable: DownloadRequest.Downloadable?, + to destination: DownloadRequest.DownloadFileDestination?, + failedWith error: Error) + -> DownloadRequest + { + var downloadTask: Request.RequestTask = .download(nil, nil) + + if let downloadable = downloadable { + downloadTask = .download(downloadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + + let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) + download.downloadDelegate.destination = destination + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: download, with: underlyingError) + } else { + if startRequestsImmediately { download.resume() } + } + + return download + } + + // MARK: - Upload Request + + // MARK: File + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(fileURL, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.file(fileURL, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: Data + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(data, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.data(data, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: InputStream + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(stream, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.stream(stream, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: MultipartFormData + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `url`, `method` and `headers`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + queue: DispatchQueue? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + + return upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + queue: queue, + encodingCompletion: encodingCompletion + ) + } catch { + (queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) } + } + } + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `urlRequest`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter urlRequest: The URL request. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + queue: DispatchQueue? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + DispatchQueue.global(qos: .utility).async { + let formData = MultipartFormData() + multipartFormData(formData) + + var tempFileURL: URL? + + do { + var urlRequestWithContentType = try urlRequest.asURLRequest() + urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") + + let isBackgroundSession = self.session.configuration.identifier != nil + + if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { + let data = try formData.encode() + + let encodingResult = MultipartFormDataEncodingResult.success( + request: self.upload(data, with: urlRequestWithContentType), + streamingFromDisk: false, + streamFileURL: nil + ) + + (queue ?? DispatchQueue.main).async { encodingCompletion?(encodingResult) } + } else { + let fileManager = FileManager.default + let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) + let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") + let fileName = UUID().uuidString + let fileURL = directoryURL.appendingPathComponent(fileName) + + tempFileURL = fileURL + + var directoryError: Error? + + // Create directory inside serial queue to ensure two threads don't do this in parallel + self.queue.sync { + do { + try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) + } catch { + directoryError = error + } + } + + if let directoryError = directoryError { throw directoryError } + + try formData.writeEncodedData(to: fileURL) + + let upload = self.upload(fileURL, with: urlRequestWithContentType) + + // Cleanup the temp file once the upload is complete + upload.delegate.queue.addOperation { + do { + try FileManager.default.removeItem(at: fileURL) + } catch { + // No-op + } + } + + (queue ?? DispatchQueue.main).async { + let encodingResult = MultipartFormDataEncodingResult.success( + request: upload, + streamingFromDisk: true, + streamFileURL: fileURL + ) + + encodingCompletion?(encodingResult) + } + } + } catch { + // Cleanup the temp file in the event that the multipart form data encoding failed + if let tempFileURL = tempFileURL { + do { + try FileManager.default.removeItem(at: tempFileURL) + } catch { + // No-op + } + } + + (queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) } + } + } + } + + // MARK: Private - Upload Implementation + + private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { + do { + let task = try uploadable.task(session: session, adapter: adapter, queue: queue) + let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) + + if case let .stream(inputStream, _) = uploadable { + upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } + } + + delegate[task] = upload + + if startRequestsImmediately { upload.resume() } + + return upload + } catch { + return upload(uploadable, failedWith: error) + } + } + + private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { + var uploadTask: Request.RequestTask = .upload(nil, nil) + + if let uploadable = uploadable { + uploadTask = .upload(uploadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: upload, with: underlyingError) + } else { + if startRequestsImmediately { upload.resume() } + } + + return upload + } + +#if !os(watchOS) + + // MARK: - Stream Request + + // MARK: Hostname and Port + + /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter hostName: The hostname of the server to connect to. + /// - parameter port: The port of the server to connect to. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return stream(.stream(hostName: hostName, port: port)) + } + + // MARK: NetService + + /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter netService: The net service used to identify the endpoint. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(with netService: NetService) -> StreamRequest { + return stream(.netService(netService)) + } + + // MARK: Private - Stream Implementation + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { + do { + let task = try streamable.task(session: session, adapter: adapter, queue: queue) + let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return stream(failedWith: error) + } + } + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(failedWith error: Error) -> StreamRequest { + let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) + if startRequestsImmediately { stream.resume() } + return stream + } + +#endif + + // MARK: - Internal - Retry Request + + func retry(_ request: Request) -> Bool { + guard let originalTask = request.originalTask else { return false } + + do { + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + + if let originalTask = request.task { + delegate[originalTask] = nil // removes the old request to avoid endless growth + } + + request.delegate.task = task // resets all task delegate data + + request.retryCount += 1 + request.startTime = CFAbsoluteTimeGetCurrent() + request.endTime = nil + + task.resume() + + return true + } catch { + request.delegate.error = error.underlyingAdaptError ?? error + return false + } + } + + private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { + DispatchQueue.utility.async { [weak self] in + guard let strongSelf = self else { return } + + retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in + guard let strongSelf = self else { return } + + guard shouldRetry else { + if strongSelf.startRequestsImmediately { request.resume() } + return + } + + DispatchQueue.utility.after(timeDelay) { + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.retry(request) + + if retrySucceeded, let task = request.task { + strongSelf.delegate[task] = request + } else { + if strongSelf.startRequestsImmediately { request.resume() } + } + } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift new file mode 100644 index 000000000000..5705737e49d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift @@ -0,0 +1,466 @@ +// +// TaskDelegate.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as +/// executing all operations attached to the serial operation queue upon task completion. +open class TaskDelegate: NSObject { + + // MARK: Properties + + /// The serial operation queue used to execute all operations after the task completes. + public let queue: OperationQueue + + /// The data returned by the server. + public var data: Data? { return nil } + + /// The error generated throughout the lifecyle of the task. + public var error: Error? + + var task: URLSessionTask? { + set { + taskLock.lock(); defer { taskLock.unlock() } + _task = newValue + } + get { + taskLock.lock(); defer { taskLock.unlock() } + return _task + } + } + + var initialResponseTime: CFAbsoluteTime? + var credential: URLCredential? + var metrics: AnyObject? // URLSessionTaskMetrics + + private var _task: URLSessionTask? { + didSet { reset() } + } + + private let taskLock = NSLock() + + // MARK: Lifecycle + + init(task: URLSessionTask?) { + _task = task + + self.queue = { + let operationQueue = OperationQueue() + + operationQueue.maxConcurrentOperationCount = 1 + operationQueue.isSuspended = true + operationQueue.qualityOfService = .utility + + return operationQueue + }() + } + + func reset() { + error = nil + initialResponseTime = nil + } + + // MARK: URLSessionTaskDelegate + + var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? + + @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + @objc(URLSession:task:didReceiveChallenge:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } + + @objc(URLSession:task:needNewBodyStream:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + var bodyStream: InputStream? + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + bodyStream = taskNeedNewBodyStream(session, task) + } + + completionHandler(bodyStream) + } + + @objc(URLSession:task:didCompleteWithError:) + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + if let taskDidCompleteWithError = taskDidCompleteWithError { + taskDidCompleteWithError(session, task, error) + } else { + if let error = error { + if self.error == nil { self.error = error } + + if + let downloadDelegate = self as? DownloadTaskDelegate, + let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data + { + downloadDelegate.resumeData = resumeData + } + } + + queue.isSuspended = false + } + } +} + +// MARK: - + +class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { + + // MARK: Properties + + var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } + + override var data: Data? { + if dataStream != nil { + return nil + } else { + return mutableData + } + } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var dataStream: ((_ data: Data) -> Void)? + + private var totalBytesReceived: Int64 = 0 + private var mutableData: Data + + private var expectedContentLength: Int64? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + mutableData = Data() + progress = Progress(totalUnitCount: 0) + + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + totalBytesReceived = 0 + mutableData = Data() + expectedContentLength = nil + } + + // MARK: URLSessionDataDelegate + + var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + var disposition: URLSession.ResponseDisposition = .allow + + expectedContentLength = response.expectedContentLength + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) + } + + func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else { + if let dataStream = dataStream { + dataStream(data) + } else { + mutableData.append(data) + } + + let bytesReceived = Int64(data.count) + totalBytesReceived += bytesReceived + let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown + + progress.totalUnitCount = totalBytesExpected + progress.completedUnitCount = totalBytesReceived + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + var cachedResponse: CachedURLResponse? = proposedResponse + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) + } + + completionHandler(cachedResponse) + } +} + +// MARK: - + +class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { + + // MARK: Properties + + var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var resumeData: Data? + override var data: Data? { return resumeData } + + var destination: DownloadRequest.DownloadFileDestination? + + var temporaryURL: URL? + var destinationURL: URL? + + var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + progress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + resumeData = nil + } + + // MARK: URLSessionDownloadDelegate + + var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? + var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + temporaryURL = location + + guard + let destination = destination, + let response = downloadTask.response as? HTTPURLResponse + else { return } + + let result = destination(location, response) + let destinationURL = result.destinationURL + let options = result.options + + self.destinationURL = destinationURL + + do { + if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { + try FileManager.default.removeItem(at: destinationURL) + } + + if options.contains(.createIntermediateDirectories) { + let directory = destinationURL.deletingLastPathComponent() + try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) + } + + try FileManager.default.moveItem(at: location, to: destinationURL) + } catch { + self.error = error + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData( + session, + downloadTask, + bytesWritten, + totalBytesWritten, + totalBytesExpectedToWrite + ) + } else { + progress.totalUnitCount = totalBytesExpectedToWrite + progress.completedUnitCount = totalBytesWritten + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else { + progress.totalUnitCount = expectedTotalBytes + progress.completedUnitCount = fileOffset + } + } +} + +// MARK: - + +class UploadTaskDelegate: DataTaskDelegate { + + // MARK: Properties + + var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } + + var uploadProgress: Progress + var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + uploadProgress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + uploadProgress = Progress(totalUnitCount: 0) + } + + // MARK: URLSessionTaskDelegate + + var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + func URLSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else { + uploadProgress.totalUnitCount = totalBytesExpectedToSend + uploadProgress.completedUnitCount = totalBytesSent + + if let uploadProgressHandler = uploadProgressHandler { + uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift new file mode 100644 index 000000000000..596c1bdc41f9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift @@ -0,0 +1,136 @@ +// +// Timeline.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. +public struct Timeline { + /// The time the request was initialized. + public let requestStartTime: CFAbsoluteTime + + /// The time the first bytes were received from or sent to the server. + public let initialResponseTime: CFAbsoluteTime + + /// The time when the request was completed. + public let requestCompletedTime: CFAbsoluteTime + + /// The time when the response serialization was completed. + public let serializationCompletedTime: CFAbsoluteTime + + /// The time interval in seconds from the time the request started to the initial response from the server. + public let latency: TimeInterval + + /// The time interval in seconds from the time the request started to the time the request completed. + public let requestDuration: TimeInterval + + /// The time interval in seconds from the time the request completed to the time response serialization completed. + public let serializationDuration: TimeInterval + + /// The time interval in seconds from the time the request started to the time response serialization completed. + public let totalDuration: TimeInterval + + /// Creates a new `Timeline` instance with the specified request times. + /// + /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. + /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. + /// Defaults to `0.0`. + /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. + /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults + /// to `0.0`. + /// + /// - returns: The new `Timeline` instance. + public init( + requestStartTime: CFAbsoluteTime = 0.0, + initialResponseTime: CFAbsoluteTime = 0.0, + requestCompletedTime: CFAbsoluteTime = 0.0, + serializationCompletedTime: CFAbsoluteTime = 0.0) + { + self.requestStartTime = requestStartTime + self.initialResponseTime = initialResponseTime + self.requestCompletedTime = requestCompletedTime + self.serializationCompletedTime = serializationCompletedTime + + self.latency = initialResponseTime - requestStartTime + self.requestDuration = requestCompletedTime - requestStartTime + self.serializationDuration = serializationCompletedTime - requestCompletedTime + self.totalDuration = serializationCompletedTime - requestStartTime + } +} + +// MARK: - CustomStringConvertible + +extension Timeline: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the latency, the request + /// duration and the total duration. + public var description: String { + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} + +// MARK: - CustomDebugStringConvertible + +extension Timeline: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes the request start time, the + /// initial response time, the request completed time, the serialization completed time, the latency, the request + /// duration and the total duration. + public var debugDescription: String { + let requestStartTime = String(format: "%.3f", self.requestStartTime) + let initialResponseTime = String(format: "%.3f", self.initialResponseTime) + let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) + let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Request Start Time\": " + requestStartTime, + "\"Initial Response Time\": " + initialResponseTime, + "\"Request Completed Time\": " + requestCompletedTime, + "\"Serialization Completed Time\": " + serializationCompletedTime, + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift new file mode 100644 index 000000000000..59e0bbb2b0e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift @@ -0,0 +1,321 @@ +// +// Validation.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Request { + + // MARK: Helper Types + + fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason + + /// Used to represent whether validation was successful or encountered an error resulting in a failure. + /// + /// - success: The validation was successful. + /// - failure: The validation failed encountering the provided error. + public enum ValidationResult { + case success + case failure(Error) + } + + fileprivate struct MIMEType { + let type: String + let subtype: String + + var isWildcard: Bool { return type == "*" && subtype == "*" } + + init?(_ string: String) { + let components: [String] = { + let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) + + #if swift(>=3.2) + let split = stripped[..<(stripped.range(of: ";")?.lowerBound ?? stripped.endIndex)] + #else + let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) + #endif + + return split.components(separatedBy: "/") + }() + + if let type = components.first, let subtype = components.last { + self.type = type + self.subtype = subtype + } else { + return nil + } + } + + func matches(_ mime: MIMEType) -> Bool { + switch (type, subtype) { + case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): + return true + default: + return false + } + } + } + + // MARK: Properties + + fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } + + fileprivate var acceptableContentTypes: [String] { + if let accept = request?.value(forHTTPHeaderField: "Accept") { + return accept.components(separatedBy: ",") + } + + return ["*/*"] + } + + // MARK: Status Code + + fileprivate func validate( + statusCode acceptableStatusCodes: S, + response: HTTPURLResponse) + -> ValidationResult + where S.Iterator.Element == Int + { + if acceptableStatusCodes.contains(response.statusCode) { + return .success + } else { + let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) + return .failure(AFError.responseValidationFailed(reason: reason)) + } + } + + // MARK: Content Type + + fileprivate func validate( + contentType acceptableContentTypes: S, + response: HTTPURLResponse, + data: Data?) + -> ValidationResult + where S.Iterator.Element == String + { + guard let data = data, data.count > 0 else { return .success } + + guard + let responseContentType = response.mimeType, + let responseMIMEType = MIMEType(responseContentType) + else { + for contentType in acceptableContentTypes { + if let mimeType = MIMEType(contentType), mimeType.isWildcard { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } + + for contentType in acceptableContentTypes { + if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .unacceptableContentType( + acceptableContentTypes: Array(acceptableContentTypes), + responseContentType: responseContentType + ) + + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } +} + +// MARK: - + +extension DataRequest { + /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the + /// request was valid. + public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(self.request, response, self.delegate.data) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, data in + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + let contentTypes = { [unowned self] in + self.acceptableContentTypes + } + return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes()) + } +} + +// MARK: - + +extension DownloadRequest { + /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a + /// destination URL, and returns whether the request was valid. + public typealias Validation = ( + _ request: URLRequest?, + _ response: HTTPURLResponse, + _ temporaryURL: URL?, + _ destinationURL: URL?) + -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + let request = self.request + let temporaryURL = self.downloadDelegate.temporaryURL + let destinationURL = self.downloadDelegate.destinationURL + + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(request, response, temporaryURL, destinationURL) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, _, _ in + let fileURL = self.downloadDelegate.fileURL + + guard let validFileURL = fileURL else { + return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) + } + + do { + let data = try Data(contentsOf: validFileURL) + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } catch { + return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) + } + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + let contentTypes = { [unowned self] in + self.acceptableContentTypes + } + return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes()) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json new file mode 100644 index 000000000000..bd27355c1ec0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -0,0 +1,23 @@ +{ + "name": "PetstoreClient", + "platforms": { + "ios": "9.0", + "osx": "10.11", + "tvos": "9.0" + }, + "version": "1.0.0", + "source": { + "git": "git@github.com:OpenAPITools/openapi-generator.git", + "tag": "v1.0.0" + }, + "authors": "", + "license": "Proprietary", + "homepage": "https://github.com/openapitools/openapi-generator", + "summary": "PetstoreClient", + "source_files": "PetstoreClient/Classes/**/*.swift", + "dependencies": { + "Alamofire": [ + "~> 4.9.0" + ] + } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock new file mode 100644 index 000000000000..ec15c4176b83 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Manifest.lock @@ -0,0 +1,23 @@ +PODS: + - Alamofire (4.9.0) + - PetstoreClient (1.0.0): + - Alamofire (~> 4.9.0) + +DEPENDENCIES: + - PetstoreClient (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + +EXTERNAL SOURCES: + PetstoreClient: + :path: "../" + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + PetstoreClient: e5c71b862a32097342e341f7088805bbfc033a3e + +PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d + +COCOAPODS: 1.6.1 diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..656584d5feee --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,1358 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 00020DC43A4750034730E499473769DD /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88A2B15E13C750A143B6E5D75B3EF08A /* Capitalization.swift */; }; + 012AD29BA655B831F2BE3F50ECB3BB85 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 089B2FA1773BD330AB52EF68B8C80090 /* AnotherFakeAPI.swift */; }; + 030881D9CABF4692C54FBFA6EECC2120 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA8498C6CE23C7D39CB4064A7D3C23E1 /* JSONEncodingHelper.swift */; }; + 0376FA9CA4578351B19BF40B86DAF6C8 /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5DB595A95DED4373F5C07D3F42CE2FD /* StringBooleanMap.swift */; }; + 059D92B7BBFBEC53E9A3B6E11C5C3B3A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = CCC6858C85690F7AFEA7F6542EE9A69A /* Response.swift */; }; + 06908794B0BD0AD1C3328AD8BC4B82B6 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 153232F938AACFEEA39854060E3474F9 /* UserAPI.swift */; }; + 08E8DE6A3DE3C4AACE22E6FC79A780B5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3677DD1DD5DA7B4FD4A71A12902EB1FF /* FileSchemaTestClass.swift */; }; + 09DCE775C28AEE3A523DDA9A9D485EBD /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EB0E56BEED9117DC5F2C7AF6582AB9C2 /* Foundation.framework */; }; + 0A39AF55285A3A4F7CBABB6D822FA4A3 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1C15C076B531E2E7744C358418A0C0B5 /* Alamofire.swift */; }; + 0AB631DF2E9BC76B8736C9EFF6191C0B /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0BB6E533AD607BA63514CA234EC13B7C /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FDDE05FE69A89680803CCE1D0DDD1BC /* ClassModel.swift */; }; + 0F31785CFEFE0D75C731D380DA0B448A /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1C676BF112685E2AF7EC6D0E50897D13 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EB0E56BEED9117DC5F2C7AF6582AB9C2 /* Foundation.framework */; }; + 1D29D2ACADF961F69D32B06FA6A09E28 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = B06639F7A76DB8A9D0D0E41CDD7A6684 /* Notifications.swift */; }; + 23F07945B38A4B2E16A37448381E0728 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B98D91A23E6414F7AF9797FDA6CDE301 /* FakeClassnameTags123API.swift */; }; + 2903713D6C0E8861C1C225BBE2005553 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8B87E7F72022E18968F7E2884190864 /* Client.swift */; }; + 2CABDAFCB4D1AAFD4466F7B334075350 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3836ABD376ED2AA0133D2BAD057084A8 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 345CE6549CCB11C35AB61D1C95ADB09E /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C6E73F71067053DDD4DD9F74AA71B8E /* CatAllOf.swift */; }; + 355C18EEC82624A06A6CC93965258E33 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D59E1AD3CC394A93392FF3DC8CF2961 /* Request.swift */; }; + 35691EF5F336C91F9446841E240A546E /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD03ACAF8CC392DA908F3ACB71558AF5 /* Alamofire.framework */; }; + 39CB87943FDF18297E1B55D71759E6F0 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92C52F4995CB5F6F58D97D24A9714C82 /* HasOnlyReadOnly.swift */; }; + 3B2E7969FD3611446E0C3428B6FD506E /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 20EB7CD037B7A541D39B47B96C87D3BB /* User.swift */; }; + 3BD1DAFE1F3E6C9E4EB0F2099B6D6FA2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EB0E56BEED9117DC5F2C7AF6582AB9C2 /* Foundation.framework */; }; + 3D0DF4B3FD3DBE3E87FC471D5098B08C /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3906E6EA8C3F2D343170E909DB10D598 /* ApiResponse.swift */; }; + 3E0749AF6C51BCF0E4A41CF1D6A76FED /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFF7F7716086D54E6308EE52C8227B87 /* DispatchQueue+Alamofire.swift */; }; + 41B161B3DF73F631EB37EBC84E989A86 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3772CF80ABE43A1C8B98C26806814C03 /* StoreAPI.swift */; }; + 43E11CFB9D9D75B04BD1C3710122FEDC /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = BEF884C644D97FF181378FD4B0BEE949 /* CodableHelper.swift */; }; + 45C8A9D978B277C6D772171CBC9D00A2 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55BD21CB9821EDFA7774D5BF62F1447C /* EnumClass.swift */; }; + 4C67C04C2DEA0EC6A77990134EFC44F0 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = C754B2060CD998899F4CDCEFBA8CBECA /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 515561C8235B83BE66FDAFB598982F1A /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72401B0640F79CE5D0D95808F3809EAD /* Dog.swift */; }; + 518CCCA0F4D22FF969EBC3E3077FCC92 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2C77186D6C808BF3DF45437777838E5 /* MapTest.swift */; }; + 52BB72DA85ECC5DF65DB17DC7FE78794 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4A16AB1E07D9C345D25EAA6D65AFB7D /* Pet.swift */; }; + 568163D7220FA2ACE76E2A089ED97367 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = 817EF1FA2F48683ECFBC85626DD432E2 /* TypeHolderDefault.swift */; }; + 5C270500727A5736EEBC6E2B5545122F /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28821B55DAEFB6A4294C4E45B43C7189 /* List.swift */; }; + 60B6C2A003864AAD3A426448152F67BE /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32DB5272AD01ECD0B09A86818A7754C4 /* Timeline.swift */; }; + 616E91DF676728E98777E4C2221F30FF /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F4F7045EE429F75182B88C370E5BF6B /* OuterEnum.swift */; }; + 65D4CBC83D44D1079503E162E56EB1FC /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E4A82321F917DE99EA9ED0A4144F8D /* Return.swift */; }; + 6B598CD6C3665D587BD8EDE6202EA593 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EB0E56BEED9117DC5F2C7AF6582AB9C2 /* Foundation.framework */; }; + 6C9EBD7E61FF56596714B6E4AD520FC8 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5BA3CDA675544F94288511FF6B9A95C /* ArrayOfNumberOnly.swift */; }; + 6EFD003458AE7F689DEA720A2030C261 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B03859BDC36782899379E222720A297 /* ResponseSerialization.swift */; }; + 700D3D95AF9520CB227846DFD943A2DA /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D01BA8472F25D39F718F71557EDC8DD /* ParameterEncoding.swift */; }; + 7038EA9A3B5C95A704774228807F5BA5 /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F38D962B7C2FCDF7409552EE9E8C179 /* EnumTest.swift */; }; + 73AB05789A4982944AF68DBD013E3EB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5460AD0F6241621B45A17AB23A8E5B7 /* NetworkReachabilityManager.swift */; }; + 76C734AAD021F98862B409EED92BF7D9 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0DE2B0929020E3EB62D72BCE6C283C4A /* Models.swift */; }; + 772911DA6E33D1CBBC30131B7C8BDBB3 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = BE16989701DCA0B781F86A093D7C5E22 /* Alamofire-dummy.m */; }; + 77E8F0EB9FFBE2E3EB0C77095C644606 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75C759635F88377BD7E2DEDE04C23C62 /* TaskDelegate.swift */; }; + 793AD3096164E125123B8D52AB5A9C22 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE9405B96DD389E966703C925771AE55 /* APIHelper.swift */; }; + 7E3538A6992A38276764936A9733493D /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D5A0E300C04A6DF88D620788FE38780 /* AFError.swift */; }; + 8012A57CFFC574F745FBA46D335BBA6F /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */; }; + 82855B7090157FE1AD95290494B727D1 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF775468F874E6C4B902D12CAACC0E3 /* APIs.swift */; }; + 8D2A6A90A6DDAF75EA52D471258545CC /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4453BE339B79900FDC53E34FE5589CB /* ServerTrustPolicy.swift */; }; + 9013E87432F737C0EBC7E8F2CCAD38BD /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9A840A90776C4F3557DA50E60D43461 /* Name.swift */; }; + 939C0EDFC1A0E1371F8B4C08A8ED35FB /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = E68F2B0ADDEF9CCD4DDE5F0B6DBFB8EA /* AdditionalPropertiesClass.swift */; }; + 93F8F669E4B04B4DB531D251706A500E /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5ADA544DF1F872830B177489DD976D01 /* OuterComposite.swift */; }; + 962EFB8F73E4755A382781A0985D65F7 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBCED4E7B2ED8CD7B003737E8500B966 /* SpecialModelName.swift */; }; + 9E4EAB317A51EDDEB0F989FAFE98FF2C /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 22171F3CD54600483DE4B4FF7CA42C92 /* Order.swift */; }; + 9E6C948768C510831A7E51DACDADF113 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = A0F2DC364EA3C24C587CAC4E7F2CACE6 /* File.swift */; }; + A1EC41966B261DCE460BCDE5124A1DBE /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F640F61D5BEE8132009BAEAA65B587A4 /* SessionDelegate.swift */; }; + A3A401A337A4033FDD4A3394D1F6DC1B /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 23FFF870A0F3262D972AF2BE98E98138 /* TypeHolderExample.swift */; }; + A3BC5451845657493232AC0525864F5A /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5E55CD80321500D34FB83EFB4EFE1B1 /* ArrayOfArrayOfNumberOnly.swift */; }; + A5DA5B46FB2ACACFD536CFA4773F72EB /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 792A29ED78AA102548A11FE803EBA726 /* AnimalFarm.swift */; }; + A78CA9C83C384A1BC74AB5AE5E11B9C6 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679BA825A029EC81F394535E7D9659AF /* DogAllOf.swift */; }; + A7D6F30DD00FE0799E3226CAD9B4F0F8 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6CD835DD6D842734F41B52C7DD76912 /* ReadOnlyFirst.swift */; }; + AA56769D8733D3F3E7976742D5ABA998 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33115EC2A5164913C68F8BD170389EEE /* Validation.swift */; }; + AACBCD94F445251BFB8EF281B06070FC /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */; }; + AE8E12A37981E08C499422F0D7DB3562 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = B4C8BF21BF7235F0CAFCEF0A0BE6F346 /* PetstoreClient-dummy.m */; }; + AEA829AB1A8AF2AD077A808AED6B178A /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFCE3D7EDCA41F256D471B40BBFD3FCE /* MultipartFormData.swift */; }; + B09502FF56FD28B439A446079AA44828 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 67BB3E8F1A01B496D370968537953FBC /* NumberOnly.swift */; }; + B6F6E4CC26451E91B59FAE0F6841DC1F /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 15A825CFEBAE606149BF0047C9F5B209 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C213B705CDEE5ABB1DD45D2D7C399916 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8300E68C77CC2ED6253C2D484EBA225 /* Model200Response.swift */; }; + C47592022591B4355678CD336729BCFD /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8632E8244954DC5394C9F221CDA12310 /* FormatTest.swift */; }; + C617ABA269C12A01EE8FB2B48E2EE24E /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = C69D6F2D2B19627D7A73D8F815F56BBA /* Animal.swift */; }; + C625241EED7F5ABFA3421D1D2F33B9A7 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8FB3702E62314B602C9C852FEC5CE0D0 /* PetAPI.swift */; }; + D0DD0433ABCBA1390C9D519BB8AF31B0 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED376BFA75520EB1CC8120AC95A2E285 /* ArrayTest.swift */; }; + D3FA0AA634AAEA99AB3FABC36BB4958C /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D7E25E371731FAE44F46A9F392CB5D5 /* SessionManager.swift */; }; + D6766263F6808C3555974C9090704382 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBE9E546637EAC1DDD7E9C12BA7BF345 /* Extensions.swift */; }; + E238DCD8EEAA785F12BC409CBC9FFEB2 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB1E2D32BAA3BD9844DB191DDADBCF12 /* Configuration.swift */; }; + EB0DD8CEA1A69867A30267439C970440 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD807F155301ECA538A2C1C296E1186D /* Result.swift */; }; + ED805B7A7AFAE3166128F815B88FF4C9 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBFF7DE6C567908623AE0BCD2F3A3857 /* Tag.swift */; }; + F19C4993AFB23C230522A94EDC95D0AE /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 514BDF609598FE35A5525ED6A181A1A8 /* JSONEncodableEncoding.swift */; }; + F60E9EC2AB3CE86877D7ED2FEB8C6352 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD1ED5E98426A54EB45C305EE40C983E /* Category.swift */; }; + FBA30FAE70E2ABBD40E4DAC76BA02AED /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0718B8E646D897336A3ECCC5B9090E53 /* AlamofireImplementations.swift */; }; + FBE98F05475A9917F6D17BE065FEF26B /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7BC3FD15E2040B5431F44C865823CCE /* Cat.swift */; }; + FDA5017C03A4F8778D62CB4317B41830 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0F580409071DCE59A5124FF9E82BFB /* EnumArrays.swift */; }; + FF88BA5F972D79C65C8A0A55F1CE0652 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17D5784904C828E658DF5CEA4EF788AA /* FakeAPI.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 20B39FDE827AD3DF13AE317B5E936361 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3383968E74B5371B20BB519B170DC7FD; + remoteInfo = Alamofire; + }; + 5D76C10F5893692E171BC309A834B39D /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3383968E74B5371B20BB519B170DC7FD; + remoteInfo = Alamofire; + }; + AFC558F1633DAC5C557E46CBB263C91E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 014B234AEDAF6EC680B4B670020FC6E9; + remoteInfo = PetstoreClient; + }; + FA1A8E2F3FE2899A723889F94EACA0E5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6CC172B84D895FFAF079AB5AA2CBFA6E; + remoteInfo = "Pods-SwaggerClient"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 04439F9CD02EAF4B3E540DBCEC9EA5A6 /* Name.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Name.md; path = docs/Name.md; sourceTree = ""; }; + 0663474ACA37520625211A9E29325B1A /* ArrayTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayTest.md; path = docs/ArrayTest.md; sourceTree = ""; }; + 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 0718B8E646D897336A3ECCC5B9090E53 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift; sourceTree = ""; }; + 089B2FA1773BD330AB52EF68B8C80090 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; + 0A4CE8D126B31FEC4F59711D8376AC5F /* User.md */ = {isa = PBXFileReference; includeInIndex = 1; name = User.md; path = docs/User.md; sourceTree = ""; }; + 0D01BA8472F25D39F718F71557EDC8DD /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 0DE2B0929020E3EB62D72BCE6C283C4A /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/OpenAPIs/Models.swift; sourceTree = ""; }; + 12CFBC4CD7ACA7011491663F90C67FF6 /* StoreAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = StoreAPI.md; path = docs/StoreAPI.md; sourceTree = ""; }; + 153232F938AACFEEA39854060E3474F9 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 15A825CFEBAE606149BF0047C9F5B209 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; + 17D5784904C828E658DF5CEA4EF788AA /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + 1C15C076B531E2E7744C358418A0C0B5 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + 1F294BB7B28A9A6C885F7B64CBEF8443 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PetstoreClient.modulemap; sourceTree = ""; }; + 20EB7CD037B7A541D39B47B96C87D3BB /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + 22171F3CD54600483DE4B4FF7CA42C92 /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 22E224873CA034BCFD7B0AE231A85146 /* PetAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = PetAPI.md; path = docs/PetAPI.md; sourceTree = ""; }; + 23FFF870A0F3262D972AF2BE98E98138 /* TypeHolderExample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; + 27578F75ADA7E233FE419BF675250D04 /* TypeHolderDefault.md */ = {isa = PBXFileReference; includeInIndex = 1; name = TypeHolderDefault.md; path = docs/TypeHolderDefault.md; sourceTree = ""; }; + 28821B55DAEFB6A4294C4E45B43C7189 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 2B05E36DA6DC2AEF31D2C707F891F13C /* Capitalization.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Capitalization.md; path = docs/Capitalization.md; sourceTree = ""; }; + 2E7DDA3730731B94AF27E5CA45625575 /* Model200Response.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Model200Response.md; path = docs/Model200Response.md; sourceTree = ""; }; + 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; + 2F38D962B7C2FCDF7409552EE9E8C179 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 31ED5C3525921534592BF796A9C159CF /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; + 32DB5272AD01ECD0B09A86818A7754C4 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + 33115EC2A5164913C68F8BD170389EEE /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 3557A28606F4FEFE5FF30989436A4FF2 /* MixedPropertiesAndAdditionalPropertiesClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = MixedPropertiesAndAdditionalPropertiesClass.md; path = docs/MixedPropertiesAndAdditionalPropertiesClass.md; sourceTree = ""; }; + 3677DD1DD5DA7B4FD4A71A12902EB1FF /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; + 3772CF80ABE43A1C8B98C26806814C03 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + 3836ABD376ED2AA0133D2BAD057084A8 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 3906E6EA8C3F2D343170E909DB10D598 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 3D7E25E371731FAE44F46A9F392CB5D5 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 3FF775468F874E6C4B902D12CAACC0E3 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; + 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; + 4BC259C4FDD151785EAB4C9816561400 /* Animal.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Animal.md; path = docs/Animal.md; sourceTree = ""; }; + 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; + 4DC5DC2F9BCEFA797895B33C16D2B17E /* Pods-SwaggerClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-Info.plist"; sourceTree = ""; }; + 4F249C32C93DD1A7204802FC37895B5D /* Return.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Return.md; path = docs/Return.md; sourceTree = ""; }; + 4F652B81B77453471CD91E7CE335DD64 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Alamofire.modulemap; sourceTree = ""; }; + 4FA198DABCDFA1B65FD0ECB5909B1E67 /* ApiResponse.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ApiResponse.md; path = docs/ApiResponse.md; sourceTree = ""; }; + 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; + 514BDF609598FE35A5525ED6A181A1A8 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodableEncoding.swift; path = PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift; sourceTree = ""; }; + 5325403E6DEEFE98D5F986007376B8CF /* FileSchemaTestClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FileSchemaTestClass.md; path = docs/FileSchemaTestClass.md; sourceTree = ""; }; + 55BD21CB9821EDFA7774D5BF62F1447C /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 58958D8BF88758686FC4807824BB6119 /* OuterComposite.md */ = {isa = PBXFileReference; includeInIndex = 1; name = OuterComposite.md; path = docs/OuterComposite.md; sourceTree = ""; }; + 58B41BC62A3BC0B256C157232C133465 /* DogAllOf.md */ = {isa = PBXFileReference; includeInIndex = 1; name = DogAllOf.md; path = docs/DogAllOf.md; sourceTree = ""; }; + 5ACC5320A57F68BD14E44D7BCAD0568D /* ReadOnlyFirst.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ReadOnlyFirst.md; path = docs/ReadOnlyFirst.md; sourceTree = ""; }; + 5ADA544DF1F872830B177489DD976D01 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 5B5C5D70BB1678D0B0F2B09085740561 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + 5F4F7045EE429F75182B88C370E5BF6B /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + 60734197F65F663D2DD26AEBF6213FBB /* AnotherFakeAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AnotherFakeAPI.md; path = docs/AnotherFakeAPI.md; sourceTree = ""; }; + 618C90E6044C36C76F3590183ED38CB2 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + 637137BD1D26949B2D3D0AC4E7920421 /* Category.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Category.md; path = docs/Category.md; sourceTree = ""; }; + 66492E1963B233D5714ADBD39D100676 /* ArrayOfArrayOfNumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayOfArrayOfNumberOnly.md; path = docs/ArrayOfArrayOfNumberOnly.md; sourceTree = ""; }; + 679BA825A029EC81F394535E7D9659AF /* DogAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; + 67BB3E8F1A01B496D370968537953FBC /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + 6F47323ACFBEA80C53357E0C388D0E2D /* PetstoreClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "PetstoreClient-Info.plist"; sourceTree = ""; }; + 71358FB3ED39E943406F45ACCDACA01F /* EnumClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumClass.md; path = docs/EnumClass.md; sourceTree = ""; }; + 72401B0640F79CE5D0D95808F3809EAD /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + 727A1A9E6AD1839E9FC8F0AD288C09D7 /* StringBooleanMap.md */ = {isa = PBXFileReference; includeInIndex = 1; name = StringBooleanMap.md; path = docs/StringBooleanMap.md; sourceTree = ""; }; + 729855D9EC40248C3CC1D640DE20C997 /* PetstoreClient.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = PetstoreClient.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 7545CF55BE345EA7C318A64E7BFB1C70 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + 75C759635F88377BD7E2DEDE04C23C62 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + 792A29ED78AA102548A11FE803EBA726 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 7A32170042F951AE49896CBDDC2E7E8A /* CatAllOf.md */ = {isa = PBXFileReference; includeInIndex = 1; name = CatAllOf.md; path = docs/CatAllOf.md; sourceTree = ""; }; + 7B03859BDC36782899379E222720A297 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + 7E8622C681C084B791773E335FA776B9 /* Cat.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Cat.md; path = docs/Cat.md; sourceTree = ""; }; + 817EF1FA2F48683ECFBC85626DD432E2 /* TypeHolderDefault.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; + 8632E8244954DC5394C9F221CDA12310 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 88A2B15E13C750A143B6E5D75B3EF08A /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + 8C6E73F71067053DDD4DD9F74AA71B8E /* CatAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; + 8D5A0E300C04A6DF88D620788FE38780 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; + 8FB3702E62314B602C9C852FEC5CE0D0 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 901441DA8E39EF973EBE8D69C2CDADE7 /* Pods-SwaggerClientTests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-Info.plist"; sourceTree = ""; }; + 92C52F4995CB5F6F58D97D24A9714C82 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 9448B03916DFC494CD68A614565A98B8 /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; + 94C9B18D927BCE2DBC85C868385CD0DC /* MapTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = MapTest.md; path = docs/MapTest.md; sourceTree = ""; }; + 951102FA2D54D54F57AB43F3898A804E /* Pet.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Pet.md; path = docs/Pet.md; sourceTree = ""; }; + 96AC98D0CCFA778066DE3211DF4A612B /* Alamofire-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Alamofire-Info.plist"; sourceTree = ""; }; + 96FB30FE91CE11061D85EA6BDBE094E3 /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + 9A6C4CED509D8701C458FCF9F7112D6E /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 9B6003DFE8913662F0CBE3C8AB6BF079 /* AdditionalPropertiesClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AdditionalPropertiesClass.md; path = docs/AdditionalPropertiesClass.md; sourceTree = ""; }; + 9D59E1AD3CC394A93392FF3DC8CF2961 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 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; }; + 9FDDE05FE69A89680803CCE1D0DDD1BC /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + A0F2DC364EA3C24C587CAC4E7F2CACE6 /* File.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + A0F6B1DBF2B95867B02CA909027E6CA1 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + A2B53D4EE4458330882CB18DA789EB2C /* Tag.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Tag.md; path = docs/Tag.md; sourceTree = ""; }; + A48DFE63F7A3B54CA683DC3A18D4F013 /* EnumArrays.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumArrays.md; path = docs/EnumArrays.md; sourceTree = ""; }; + A6CD835DD6D842734F41B52C7DD76912 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + A921EAFEFCF3702C415A14A85AD33CA5 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + AFA7A7162F97A757E4763382AF0A37A5 /* HasOnlyReadOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = HasOnlyReadOnly.md; path = docs/HasOnlyReadOnly.md; sourceTree = ""; }; + AFF7F7716086D54E6308EE52C8227B87 /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + B06639F7A76DB8A9D0D0E41CDD7A6684 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; + B075721274485FCD049ED26FCAF19040 /* Client.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Client.md; path = docs/Client.md; sourceTree = ""; }; + B2DB18088B850357CD707077683B52AD /* File.md */ = {isa = PBXFileReference; includeInIndex = 1; name = File.md; path = docs/File.md; sourceTree = ""; }; + B4C8BF21BF7235F0CAFCEF0A0BE6F346 /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + B5049D245471AD411FABB9F1AFCC3640 /* TypeHolderExample.md */ = {isa = PBXFileReference; includeInIndex = 1; name = TypeHolderExample.md; path = docs/TypeHolderExample.md; sourceTree = ""; }; + B5BA3CDA675544F94288511FF6B9A95C /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + B5E55CD80321500D34FB83EFB4EFE1B1 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + B62D0F5045D0C460A66547BC6573E9AD /* OuterEnum.md */ = {isa = PBXFileReference; includeInIndex = 1; name = OuterEnum.md; path = docs/OuterEnum.md; sourceTree = ""; }; + B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; + B98D91A23E6414F7AF9797FDA6CDE301 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; + BA8498C6CE23C7D39CB4064A7D3C23E1 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodingHelper.swift; path = PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift; sourceTree = ""; }; + BACC7B6084A20F85B87D5D8CE45D9B2D /* SpecialModelName.md */ = {isa = PBXFileReference; includeInIndex = 1; name = SpecialModelName.md; path = docs/SpecialModelName.md; sourceTree = ""; }; + BBE656A24894D09F52A6A5DD556EE6E9 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + BE16989701DCA0B781F86A093D7C5E22 /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + BE9405B96DD389E966703C925771AE55 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/OpenAPIs/APIHelper.swift; sourceTree = ""; }; + BEF884C644D97FF181378FD4B0BEE949 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodableHelper.swift; path = PetstoreClient/Classes/OpenAPIs/CodableHelper.swift; sourceTree = ""; }; + BFCE3D7EDCA41F256D471B40BBFD3FCE /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + C2C77186D6C808BF3DF45437777838E5 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + C4453BE339B79900FDC53E34FE5589CB /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + C5DB595A95DED4373F5C07D3F42CE2FD /* StringBooleanMap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; + C69D6F2D2B19627D7A73D8F815F56BBA /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + C754B2060CD998899F4CDCEFBA8CBECA /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + C7BC9D7D5D14F73B0AA9505317F78B81 /* UserAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = UserAPI.md; path = docs/UserAPI.md; sourceTree = ""; }; + CCC6858C85690F7AFEA7F6542EE9A69A /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + CD03ACAF8CC392DA908F3ACB71558AF5 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + CD1ED5E98426A54EB45C305EE40C983E /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + CDD2BF41E57383D03ED6FE46857749F0 /* ArrayOfNumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayOfNumberOnly.md; path = docs/ArrayOfNumberOnly.md; sourceTree = ""; }; + D01ADEDF5E44D58ACB8ED1AED7BF7615 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; + D1364C96E01989778FFAFDA5E4F88C1B /* AnimalFarm.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AnimalFarm.md; path = docs/AnimalFarm.md; sourceTree = ""; }; + D1A6BA19B108998DF7350B40C83BFC47 /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + D46742F1F99243487DCC614C75C1413C /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; + D4A16AB1E07D9C345D25EAA6D65AFB7D /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + D52A73EE9B54C37128A536FC390D5EB8 /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; + D5519F42E98E0AB5F8D4EABFC2378552 /* FakeAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FakeAPI.md; path = docs/FakeAPI.md; sourceTree = ""; }; + D60CA6A9D0CCD77FEC2C9DBB0EE13FA4 /* NumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = NumberOnly.md; path = docs/NumberOnly.md; sourceTree = ""; }; + D6E1BAA8EEFE9F5BCEA8E3B9E9FDC427 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D7BC3FD15E2040B5431F44C865823CCE /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + D87D78CA89682ED11EEC8AC29F47C45D /* FakeClassnameTags123API.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FakeClassnameTags123API.md; path = docs/FakeClassnameTags123API.md; sourceTree = ""; }; + DB1E2D32BAA3BD9844DB191DDADBCF12 /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/OpenAPIs/Configuration.swift; sourceTree = ""; }; + DBCED4E7B2ED8CD7B003737E8500B966 /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + DD807F155301ECA538A2C1C296E1186D /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + DF3D111A192664C5E1E84DAAF5B62D53 /* Order.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Order.md; path = docs/Order.md; sourceTree = ""; }; + DF65595F7AD2991DF64DF985C4695033 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + E68F2B0ADDEF9CCD4DDE5F0B6DBFB8EA /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + E8300E68C77CC2ED6253C2D484EBA225 /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + EA8063C6A81DB1729871C85C5E3202A1 /* List.md */ = {isa = PBXFileReference; includeInIndex = 1; name = List.md; path = docs/List.md; sourceTree = ""; }; + EB0E56BEED9117DC5F2C7AF6582AB9C2 /* 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; }; + EBFF7DE6C567908623AE0BCD2F3A3857 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + ED376BFA75520EB1CC8120AC95A2E285 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + F2301C552DA30E664E889DB6147B0DD7 /* EnumTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumTest.md; path = docs/EnumTest.md; sourceTree = ""; }; + F5460AD0F6241621B45A17AB23A8E5B7 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + F640F61D5BEE8132009BAEAA65B587A4 /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; + F8B87E7F72022E18968F7E2884190864 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + F8E4A82321F917DE99EA9ED0A4144F8D /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + F9A840A90776C4F3557DA50E60D43461 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + FB6837ABA24B342F12F11E34BDBEFDDF /* ClassModel.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ClassModel.md; path = docs/ClassModel.md; sourceTree = ""; }; + FBC96A1C4393E17023FA61DF149438E6 /* FormatTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FormatTest.md; path = docs/FormatTest.md; sourceTree = ""; }; + FBE9E546637EAC1DDD7E9C12BA7BF345 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/OpenAPIs/Extensions.swift; sourceTree = ""; }; + FE0F580409071DCE59A5124FF9E82BFB /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + FEE4CB22965AE4F1B84A1573C068DE50 /* Dog.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Dog.md; path = docs/Dog.md; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 03039E780407C611A7B87769DDA406E5 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 09DCE775C28AEE3A523DDA9A9D485EBD /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 0C46B78575669218123DF0F491A2EC1C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 35691EF5F336C91F9446841E240A546E /* Alamofire.framework in Frameworks */, + 1C676BF112685E2AF7EC6D0E50897D13 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D4EC17B7E6732812B49C04E19E9C0EF3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B598CD6C3665D587BD8EDE6202EA593 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F1626ADC3A7EC435D2722B3173355D36 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3BD1DAFE1F3E6C9E4EB0F2099B6D6FA2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0ED469A71233C185DA54A94B4F90C573 /* Models */ = { + isa = PBXGroup; + children = ( + E68F2B0ADDEF9CCD4DDE5F0B6DBFB8EA /* AdditionalPropertiesClass.swift */, + C69D6F2D2B19627D7A73D8F815F56BBA /* Animal.swift */, + 792A29ED78AA102548A11FE803EBA726 /* AnimalFarm.swift */, + 3906E6EA8C3F2D343170E909DB10D598 /* ApiResponse.swift */, + B5E55CD80321500D34FB83EFB4EFE1B1 /* ArrayOfArrayOfNumberOnly.swift */, + B5BA3CDA675544F94288511FF6B9A95C /* ArrayOfNumberOnly.swift */, + ED376BFA75520EB1CC8120AC95A2E285 /* ArrayTest.swift */, + 88A2B15E13C750A143B6E5D75B3EF08A /* Capitalization.swift */, + D7BC3FD15E2040B5431F44C865823CCE /* Cat.swift */, + 8C6E73F71067053DDD4DD9F74AA71B8E /* CatAllOf.swift */, + CD1ED5E98426A54EB45C305EE40C983E /* Category.swift */, + 9FDDE05FE69A89680803CCE1D0DDD1BC /* ClassModel.swift */, + F8B87E7F72022E18968F7E2884190864 /* Client.swift */, + 72401B0640F79CE5D0D95808F3809EAD /* Dog.swift */, + 679BA825A029EC81F394535E7D9659AF /* DogAllOf.swift */, + FE0F580409071DCE59A5124FF9E82BFB /* EnumArrays.swift */, + 55BD21CB9821EDFA7774D5BF62F1447C /* EnumClass.swift */, + 2F38D962B7C2FCDF7409552EE9E8C179 /* EnumTest.swift */, + A0F2DC364EA3C24C587CAC4E7F2CACE6 /* File.swift */, + 3677DD1DD5DA7B4FD4A71A12902EB1FF /* FileSchemaTestClass.swift */, + 8632E8244954DC5394C9F221CDA12310 /* FormatTest.swift */, + 92C52F4995CB5F6F58D97D24A9714C82 /* HasOnlyReadOnly.swift */, + 28821B55DAEFB6A4294C4E45B43C7189 /* List.swift */, + C2C77186D6C808BF3DF45437777838E5 /* MapTest.swift */, + 3836ABD376ED2AA0133D2BAD057084A8 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + E8300E68C77CC2ED6253C2D484EBA225 /* Model200Response.swift */, + F9A840A90776C4F3557DA50E60D43461 /* Name.swift */, + 67BB3E8F1A01B496D370968537953FBC /* NumberOnly.swift */, + 22171F3CD54600483DE4B4FF7CA42C92 /* Order.swift */, + 5ADA544DF1F872830B177489DD976D01 /* OuterComposite.swift */, + 5F4F7045EE429F75182B88C370E5BF6B /* OuterEnum.swift */, + D4A16AB1E07D9C345D25EAA6D65AFB7D /* Pet.swift */, + A6CD835DD6D842734F41B52C7DD76912 /* ReadOnlyFirst.swift */, + F8E4A82321F917DE99EA9ED0A4144F8D /* Return.swift */, + DBCED4E7B2ED8CD7B003737E8500B966 /* SpecialModelName.swift */, + C5DB595A95DED4373F5C07D3F42CE2FD /* StringBooleanMap.swift */, + EBFF7DE6C567908623AE0BCD2F3A3857 /* Tag.swift */, + 817EF1FA2F48683ECFBC85626DD432E2 /* TypeHolderDefault.swift */, + 23FFF870A0F3262D972AF2BE98E98138 /* TypeHolderExample.swift */, + 20EB7CD037B7A541D39B47B96C87D3BB /* User.swift */, + ); + name = Models; + path = PetstoreClient/Classes/OpenAPIs/Models; + sourceTree = ""; + }; + 1C8221FE0071BDA2D0C5DE07B7736E88 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 33028780CD913FF16EA9A16F3FC66D2B /* PetstoreClient */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 1E609BB01CDC050D96D2080D93E7DF1A /* Pod */ = { + isa = PBXGroup; + children = ( + 9B6003DFE8913662F0CBE3C8AB6BF079 /* AdditionalPropertiesClass.md */, + 4BC259C4FDD151785EAB4C9816561400 /* Animal.md */, + D1364C96E01989778FFAFDA5E4F88C1B /* AnimalFarm.md */, + 60734197F65F663D2DD26AEBF6213FBB /* AnotherFakeAPI.md */, + 4FA198DABCDFA1B65FD0ECB5909B1E67 /* ApiResponse.md */, + 66492E1963B233D5714ADBD39D100676 /* ArrayOfArrayOfNumberOnly.md */, + CDD2BF41E57383D03ED6FE46857749F0 /* ArrayOfNumberOnly.md */, + 0663474ACA37520625211A9E29325B1A /* ArrayTest.md */, + 2B05E36DA6DC2AEF31D2C707F891F13C /* Capitalization.md */, + 7E8622C681C084B791773E335FA776B9 /* Cat.md */, + 7A32170042F951AE49896CBDDC2E7E8A /* CatAllOf.md */, + 637137BD1D26949B2D3D0AC4E7920421 /* Category.md */, + FB6837ABA24B342F12F11E34BDBEFDDF /* ClassModel.md */, + B075721274485FCD049ED26FCAF19040 /* Client.md */, + FEE4CB22965AE4F1B84A1573C068DE50 /* Dog.md */, + 58B41BC62A3BC0B256C157232C133465 /* DogAllOf.md */, + A48DFE63F7A3B54CA683DC3A18D4F013 /* EnumArrays.md */, + 71358FB3ED39E943406F45ACCDACA01F /* EnumClass.md */, + F2301C552DA30E664E889DB6147B0DD7 /* EnumTest.md */, + D5519F42E98E0AB5F8D4EABFC2378552 /* FakeAPI.md */, + D87D78CA89682ED11EEC8AC29F47C45D /* FakeClassnameTags123API.md */, + B2DB18088B850357CD707077683B52AD /* File.md */, + 5325403E6DEEFE98D5F986007376B8CF /* FileSchemaTestClass.md */, + FBC96A1C4393E17023FA61DF149438E6 /* FormatTest.md */, + AFA7A7162F97A757E4763382AF0A37A5 /* HasOnlyReadOnly.md */, + EA8063C6A81DB1729871C85C5E3202A1 /* List.md */, + 94C9B18D927BCE2DBC85C868385CD0DC /* MapTest.md */, + 3557A28606F4FEFE5FF30989436A4FF2 /* MixedPropertiesAndAdditionalPropertiesClass.md */, + 2E7DDA3730731B94AF27E5CA45625575 /* Model200Response.md */, + 04439F9CD02EAF4B3E540DBCEC9EA5A6 /* Name.md */, + D60CA6A9D0CCD77FEC2C9DBB0EE13FA4 /* NumberOnly.md */, + DF3D111A192664C5E1E84DAAF5B62D53 /* Order.md */, + 58958D8BF88758686FC4807824BB6119 /* OuterComposite.md */, + B62D0F5045D0C460A66547BC6573E9AD /* OuterEnum.md */, + 951102FA2D54D54F57AB43F3898A804E /* Pet.md */, + 22E224873CA034BCFD7B0AE231A85146 /* PetAPI.md */, + 729855D9EC40248C3CC1D640DE20C997 /* PetstoreClient.podspec */, + 5B5C5D70BB1678D0B0F2B09085740561 /* README.md */, + 5ACC5320A57F68BD14E44D7BCAD0568D /* ReadOnlyFirst.md */, + 4F249C32C93DD1A7204802FC37895B5D /* Return.md */, + BACC7B6084A20F85B87D5D8CE45D9B2D /* SpecialModelName.md */, + 12CFBC4CD7ACA7011491663F90C67FF6 /* StoreAPI.md */, + 727A1A9E6AD1839E9FC8F0AD288C09D7 /* StringBooleanMap.md */, + A2B53D4EE4458330882CB18DA789EB2C /* Tag.md */, + 27578F75ADA7E233FE419BF675250D04 /* TypeHolderDefault.md */, + B5049D245471AD411FABB9F1AFCC3640 /* TypeHolderExample.md */, + 0A4CE8D126B31FEC4F59711D8376AC5F /* User.md */, + C7BC9D7D5D14F73B0AA9505317F78B81 /* UserAPI.md */, + ); + name = Pod; + sourceTree = ""; + }; + 27EB02841E0D43820F14F4377DE3547E /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 8244AEBEFB4AC3530215FA5CBA26673B /* Pods-SwaggerClient */, + 86B1F48A58BFA2FA26CD584937FBEED1 /* Pods-SwaggerClientTests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 33028780CD913FF16EA9A16F3FC66D2B /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + 0718B8E646D897336A3ECCC5B9090E53 /* AlamofireImplementations.swift */, + BE9405B96DD389E966703C925771AE55 /* APIHelper.swift */, + 3FF775468F874E6C4B902D12CAACC0E3 /* APIs.swift */, + BEF884C644D97FF181378FD4B0BEE949 /* CodableHelper.swift */, + DB1E2D32BAA3BD9844DB191DDADBCF12 /* Configuration.swift */, + FBE9E546637EAC1DDD7E9C12BA7BF345 /* Extensions.swift */, + 514BDF609598FE35A5525ED6A181A1A8 /* JSONEncodableEncoding.swift */, + BA8498C6CE23C7D39CB4064A7D3C23E1 /* JSONEncodingHelper.swift */, + 0DE2B0929020E3EB62D72BCE6C283C4A /* Models.swift */, + 89961DD23FFA3CD864F344F00D402FB9 /* APIs */, + 0ED469A71233C185DA54A94B4F90C573 /* Models */, + 1E609BB01CDC050D96D2080D93E7DF1A /* Pod */, + 5B6407A1BF3581D31EDF042E5AEE8C90 /* Support Files */, + ); + name = PetstoreClient; + path = ../..; + sourceTree = ""; + }; + 5B6407A1BF3581D31EDF042E5AEE8C90 /* Support Files */ = { + isa = PBXGroup; + children = ( + 1F294BB7B28A9A6C885F7B64CBEF8443 /* PetstoreClient.modulemap */, + D52A73EE9B54C37128A536FC390D5EB8 /* PetstoreClient.xcconfig */, + B4C8BF21BF7235F0CAFCEF0A0BE6F346 /* PetstoreClient-dummy.m */, + 6F47323ACFBEA80C53357E0C388D0E2D /* PetstoreClient-Info.plist */, + DF65595F7AD2991DF64DF985C4695033 /* PetstoreClient-prefix.pch */, + C754B2060CD998899F4CDCEFBA8CBECA /* PetstoreClient-umbrella.h */, + ); + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; + sourceTree = ""; + }; + 8244AEBEFB4AC3530215FA5CBA26673B /* Pods-SwaggerClient */ = { + isa = PBXGroup; + children = ( + 618C90E6044C36C76F3590183ED38CB2 /* Pods-SwaggerClient.modulemap */, + D46742F1F99243487DCC614C75C1413C /* Pods-SwaggerClient-acknowledgements.markdown */, + 96FB30FE91CE11061D85EA6BDBE094E3 /* Pods-SwaggerClient-acknowledgements.plist */, + 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */, + 9448B03916DFC494CD68A614565A98B8 /* Pods-SwaggerClient-frameworks.sh */, + 4DC5DC2F9BCEFA797895B33C16D2B17E /* Pods-SwaggerClient-Info.plist */, + 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */, + 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */, + B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */, + ); + name = "Pods-SwaggerClient"; + path = "Target Support Files/Pods-SwaggerClient"; + sourceTree = ""; + }; + 86B1F48A58BFA2FA26CD584937FBEED1 /* Pods-SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + D1A6BA19B108998DF7350B40C83BFC47 /* Pods-SwaggerClientTests.modulemap */, + D01ADEDF5E44D58ACB8ED1AED7BF7615 /* Pods-SwaggerClientTests-acknowledgements.markdown */, + 31ED5C3525921534592BF796A9C159CF /* Pods-SwaggerClientTests-acknowledgements.plist */, + 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */, + 901441DA8E39EF973EBE8D69C2CDADE7 /* Pods-SwaggerClientTests-Info.plist */, + 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */, + CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */, + 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = "Pods-SwaggerClientTests"; + path = "Target Support Files/Pods-SwaggerClientTests"; + sourceTree = ""; + }; + 89961DD23FFA3CD864F344F00D402FB9 /* APIs */ = { + isa = PBXGroup; + children = ( + 089B2FA1773BD330AB52EF68B8C80090 /* AnotherFakeAPI.swift */, + 17D5784904C828E658DF5CEA4EF788AA /* FakeAPI.swift */, + B98D91A23E6414F7AF9797FDA6CDE301 /* FakeClassnameTags123API.swift */, + 8FB3702E62314B602C9C852FEC5CE0D0 /* PetAPI.swift */, + 3772CF80ABE43A1C8B98C26806814C03 /* StoreAPI.swift */, + 153232F938AACFEEA39854060E3474F9 /* UserAPI.swift */, + ); + name = APIs; + path = PetstoreClient/Classes/OpenAPIs/APIs; + sourceTree = ""; + }; + 90FDDC7F5D24472360CA259A8D40AE98 /* Pods */ = { + isa = PBXGroup; + children = ( + ABBD6121E62B33A53CF07892A75F2030 /* Alamofire */, + ); + name = Pods; + sourceTree = ""; + }; + 9BA86B3EDA3C295EC1B9E7963803A4C5 /* Support Files */ = { + isa = PBXGroup; + children = ( + 4F652B81B77453471CD91E7CE335DD64 /* Alamofire.modulemap */, + A0F6B1DBF2B95867B02CA909027E6CA1 /* Alamofire.xcconfig */, + BE16989701DCA0B781F86A093D7C5E22 /* Alamofire-dummy.m */, + 96AC98D0CCFA778066DE3211DF4A612B /* Alamofire-Info.plist */, + 7545CF55BE345EA7C318A64E7BFB1C70 /* Alamofire-prefix.pch */, + 15A825CFEBAE606149BF0047C9F5B209 /* Alamofire-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Alamofire"; + sourceTree = ""; + }; + A4521C22EBDAA43169A2378066A85356 /* iOS */ = { + isa = PBXGroup; + children = ( + EB0E56BEED9117DC5F2C7AF6582AB9C2 /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; + ABBD6121E62B33A53CF07892A75F2030 /* Alamofire */ = { + isa = PBXGroup; + children = ( + 8D5A0E300C04A6DF88D620788FE38780 /* AFError.swift */, + 1C15C076B531E2E7744C358418A0C0B5 /* Alamofire.swift */, + AFF7F7716086D54E6308EE52C8227B87 /* DispatchQueue+Alamofire.swift */, + BFCE3D7EDCA41F256D471B40BBFD3FCE /* MultipartFormData.swift */, + F5460AD0F6241621B45A17AB23A8E5B7 /* NetworkReachabilityManager.swift */, + B06639F7A76DB8A9D0D0E41CDD7A6684 /* Notifications.swift */, + 0D01BA8472F25D39F718F71557EDC8DD /* ParameterEncoding.swift */, + 9D59E1AD3CC394A93392FF3DC8CF2961 /* Request.swift */, + CCC6858C85690F7AFEA7F6542EE9A69A /* Response.swift */, + 7B03859BDC36782899379E222720A297 /* ResponseSerialization.swift */, + DD807F155301ECA538A2C1C296E1186D /* Result.swift */, + C4453BE339B79900FDC53E34FE5589CB /* ServerTrustPolicy.swift */, + F640F61D5BEE8132009BAEAA65B587A4 /* SessionDelegate.swift */, + 3D7E25E371731FAE44F46A9F392CB5D5 /* SessionManager.swift */, + 75C759635F88377BD7E2DEDE04C23C62 /* TaskDelegate.swift */, + 32DB5272AD01ECD0B09A86818A7754C4 /* Timeline.swift */, + 33115EC2A5164913C68F8BD170389EEE /* Validation.swift */, + 9BA86B3EDA3C295EC1B9E7963803A4C5 /* Support Files */, + ); + name = Alamofire; + path = Alamofire; + sourceTree = ""; + }; + CF1408CF629C7361332E53B88F7BD30C = { + isa = PBXGroup; + children = ( + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, + 1C8221FE0071BDA2D0C5DE07B7736E88 /* Development Pods */, + EFA834D50E48CF4E37AC7A12D391AC85 /* Frameworks */, + 90FDDC7F5D24472360CA259A8D40AE98 /* Pods */, + D4BB97E11D129F9DC0B3EFD7B82F99F5 /* Products */, + 27EB02841E0D43820F14F4377DE3547E /* Targets Support Files */, + ); + sourceTree = ""; + }; + D4BB97E11D129F9DC0B3EFD7B82F99F5 /* Products */ = { + isa = PBXGroup; + children = ( + A921EAFEFCF3702C415A14A85AD33CA5 /* Alamofire.framework */, + D6E1BAA8EEFE9F5BCEA8E3B9E9FDC427 /* PetstoreClient.framework */, + 9A6C4CED509D8701C458FCF9F7112D6E /* Pods_SwaggerClient.framework */, + BBE656A24894D09F52A6A5DD556EE6E9 /* Pods_SwaggerClientTests.framework */, + ); + name = Products; + sourceTree = ""; + }; + EFA834D50E48CF4E37AC7A12D391AC85 /* Frameworks */ = { + isa = PBXGroup; + children = ( + CD03ACAF8CC392DA908F3ACB71558AF5 /* Alamofire.framework */, + A4521C22EBDAA43169A2378066A85356 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 23D70D9651451F43E7E8CC1A87B4B7E9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + B6F6E4CC26451E91B59FAE0F6841DC1F /* Alamofire-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 9A5935BD5E97C4C2ADAE50D3AE92B1B1 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0F31785CFEFE0D75C731D380DA0B448A /* Pods-SwaggerClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A5A64812E84222999005ACDF7F62E2E4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C67C04C2DEA0EC6A77990134EFC44F0 /* PetstoreClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A75A99D2E090C9BAAFA7D32A6536D24E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AB631DF2E9BC76B8736C9EFF6191C0B /* Pods-SwaggerClientTests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 014B234AEDAF6EC680B4B670020FC6E9 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 382DBE4A1A56F1CB2D9416262C3B398A /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + A5A64812E84222999005ACDF7F62E2E4 /* Headers */, + BFFCD424113053CC873EB416E81CABA8 /* Sources */, + 0C46B78575669218123DF0F491A2EC1C /* Frameworks */, + D67BC32B7DC8ED90F08BD38FAA56169D /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5DE874B58B87742561569DD4D3D1B529 /* PBXTargetDependency */, + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = D6E1BAA8EEFE9F5BCEA8E3B9E9FDC427 /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; + 3383968E74B5371B20BB519B170DC7FD /* Alamofire */ = { + isa = PBXNativeTarget; + buildConfigurationList = E87124444A44B7DB55208E7FEC21D331 /* Build configuration list for PBXNativeTarget "Alamofire" */; + buildPhases = ( + 23D70D9651451F43E7E8CC1A87B4B7E9 /* Headers */, + A1C8B029F600160149A2404C342F6E50 /* Sources */, + F1626ADC3A7EC435D2722B3173355D36 /* Frameworks */, + 28FF73341543B6F0A7DF3C20CFFEA0AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Alamofire; + productName = Alamofire; + productReference = A921EAFEFCF3702C415A14A85AD33CA5 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + 6CC172B84D895FFAF079AB5AA2CBFA6E /* Pods-SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 572D6D84C594D0A2084C64BFCC57B307 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; + buildPhases = ( + 9A5935BD5E97C4C2ADAE50D3AE92B1B1 /* Headers */, + 7666F8939D4526BEC7F64C149EF4A2C8 /* Sources */, + 03039E780407C611A7B87769DDA406E5 /* Frameworks */, + A5C180CA72BCA89C035E9BA519F5DCF4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + F234C94DB11B7BBDD1958805D4F5AB78 /* PBXTargetDependency */, + C14616AC8F7012FA96FE36A7D42D8D82 /* PBXTargetDependency */, + ); + name = "Pods-SwaggerClient"; + productName = "Pods-SwaggerClient"; + productReference = 9A6C4CED509D8701C458FCF9F7112D6E /* Pods_SwaggerClient.framework */; + productType = "com.apple.product-type.framework"; + }; + 7ECA32D1B18128C394D8D35F346BEEC7 /* Pods-SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8F09E039867007D3576FEED9032526A8 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; + buildPhases = ( + A75A99D2E090C9BAAFA7D32A6536D24E /* Headers */, + F7D9DB86AE0913CC2B294C55BFD934AD /* Sources */, + D4EC17B7E6732812B49C04E19E9C0EF3 /* Frameworks */, + C2801E627F662CD786BE9F42773CBECF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C18A6DC0C9B8408542F3D944BB6D67F4 /* PBXTargetDependency */, + ); + name = "Pods-SwaggerClientTests"; + productName = "Pods-SwaggerClientTests"; + productReference = BBE656A24894D09F52A6A5DD556EE6E9 /* Pods_SwaggerClientTests.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BFDFE7DC352907FC980B868725387E98 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; + }; + buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CF1408CF629C7361332E53B88F7BD30C; + productRefGroup = D4BB97E11D129F9DC0B3EFD7B82F99F5 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3383968E74B5371B20BB519B170DC7FD /* Alamofire */, + 014B234AEDAF6EC680B4B670020FC6E9 /* PetstoreClient */, + 6CC172B84D895FFAF079AB5AA2CBFA6E /* Pods-SwaggerClient */, + 7ECA32D1B18128C394D8D35F346BEEC7 /* Pods-SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 28FF73341543B6F0A7DF3C20CFFEA0AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A5C180CA72BCA89C035E9BA519F5DCF4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2801E627F662CD786BE9F42773CBECF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D67BC32B7DC8ED90F08BD38FAA56169D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7666F8939D4526BEC7F64C149EF4A2C8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AACBCD94F445251BFB8EF281B06070FC /* Pods-SwaggerClient-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A1C8B029F600160149A2404C342F6E50 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E3538A6992A38276764936A9733493D /* AFError.swift in Sources */, + 772911DA6E33D1CBBC30131B7C8BDBB3 /* Alamofire-dummy.m in Sources */, + 0A39AF55285A3A4F7CBABB6D822FA4A3 /* Alamofire.swift in Sources */, + 3E0749AF6C51BCF0E4A41CF1D6A76FED /* DispatchQueue+Alamofire.swift in Sources */, + AEA829AB1A8AF2AD077A808AED6B178A /* MultipartFormData.swift in Sources */, + 73AB05789A4982944AF68DBD013E3EB7 /* NetworkReachabilityManager.swift in Sources */, + 1D29D2ACADF961F69D32B06FA6A09E28 /* Notifications.swift in Sources */, + 700D3D95AF9520CB227846DFD943A2DA /* ParameterEncoding.swift in Sources */, + 355C18EEC82624A06A6CC93965258E33 /* Request.swift in Sources */, + 059D92B7BBFBEC53E9A3B6E11C5C3B3A /* Response.swift in Sources */, + 6EFD003458AE7F689DEA720A2030C261 /* ResponseSerialization.swift in Sources */, + EB0DD8CEA1A69867A30267439C970440 /* Result.swift in Sources */, + 8D2A6A90A6DDAF75EA52D471258545CC /* ServerTrustPolicy.swift in Sources */, + A1EC41966B261DCE460BCDE5124A1DBE /* SessionDelegate.swift in Sources */, + D3FA0AA634AAEA99AB3FABC36BB4958C /* SessionManager.swift in Sources */, + 77E8F0EB9FFBE2E3EB0C77095C644606 /* TaskDelegate.swift in Sources */, + 60B6C2A003864AAD3A426448152F67BE /* Timeline.swift in Sources */, + AA56769D8733D3F3E7976742D5ABA998 /* Validation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BFFCD424113053CC873EB416E81CABA8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 939C0EDFC1A0E1371F8B4C08A8ED35FB /* AdditionalPropertiesClass.swift in Sources */, + FBA30FAE70E2ABBD40E4DAC76BA02AED /* AlamofireImplementations.swift in Sources */, + C617ABA269C12A01EE8FB2B48E2EE24E /* Animal.swift in Sources */, + A5DA5B46FB2ACACFD536CFA4773F72EB /* AnimalFarm.swift in Sources */, + 012AD29BA655B831F2BE3F50ECB3BB85 /* AnotherFakeAPI.swift in Sources */, + 793AD3096164E125123B8D52AB5A9C22 /* APIHelper.swift in Sources */, + 3D0DF4B3FD3DBE3E87FC471D5098B08C /* ApiResponse.swift in Sources */, + 82855B7090157FE1AD95290494B727D1 /* APIs.swift in Sources */, + A3BC5451845657493232AC0525864F5A /* ArrayOfArrayOfNumberOnly.swift in Sources */, + 6C9EBD7E61FF56596714B6E4AD520FC8 /* ArrayOfNumberOnly.swift in Sources */, + D0DD0433ABCBA1390C9D519BB8AF31B0 /* ArrayTest.swift in Sources */, + 00020DC43A4750034730E499473769DD /* Capitalization.swift in Sources */, + FBE98F05475A9917F6D17BE065FEF26B /* Cat.swift in Sources */, + 345CE6549CCB11C35AB61D1C95ADB09E /* CatAllOf.swift in Sources */, + F60E9EC2AB3CE86877D7ED2FEB8C6352 /* Category.swift in Sources */, + 0BB6E533AD607BA63514CA234EC13B7C /* ClassModel.swift in Sources */, + 2903713D6C0E8861C1C225BBE2005553 /* Client.swift in Sources */, + 43E11CFB9D9D75B04BD1C3710122FEDC /* CodableHelper.swift in Sources */, + E238DCD8EEAA785F12BC409CBC9FFEB2 /* Configuration.swift in Sources */, + 515561C8235B83BE66FDAFB598982F1A /* Dog.swift in Sources */, + A78CA9C83C384A1BC74AB5AE5E11B9C6 /* DogAllOf.swift in Sources */, + FDA5017C03A4F8778D62CB4317B41830 /* EnumArrays.swift in Sources */, + 45C8A9D978B277C6D772171CBC9D00A2 /* EnumClass.swift in Sources */, + 7038EA9A3B5C95A704774228807F5BA5 /* EnumTest.swift in Sources */, + D6766263F6808C3555974C9090704382 /* Extensions.swift in Sources */, + FF88BA5F972D79C65C8A0A55F1CE0652 /* FakeAPI.swift in Sources */, + 23F07945B38A4B2E16A37448381E0728 /* FakeClassnameTags123API.swift in Sources */, + 9E6C948768C510831A7E51DACDADF113 /* File.swift in Sources */, + 08E8DE6A3DE3C4AACE22E6FC79A780B5 /* FileSchemaTestClass.swift in Sources */, + C47592022591B4355678CD336729BCFD /* FormatTest.swift in Sources */, + 39CB87943FDF18297E1B55D71759E6F0 /* HasOnlyReadOnly.swift in Sources */, + F19C4993AFB23C230522A94EDC95D0AE /* JSONEncodableEncoding.swift in Sources */, + 030881D9CABF4692C54FBFA6EECC2120 /* JSONEncodingHelper.swift in Sources */, + 5C270500727A5736EEBC6E2B5545122F /* List.swift in Sources */, + 518CCCA0F4D22FF969EBC3E3077FCC92 /* MapTest.swift in Sources */, + 2CABDAFCB4D1AAFD4466F7B334075350 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + C213B705CDEE5ABB1DD45D2D7C399916 /* Model200Response.swift in Sources */, + 76C734AAD021F98862B409EED92BF7D9 /* Models.swift in Sources */, + 9013E87432F737C0EBC7E8F2CCAD38BD /* Name.swift in Sources */, + B09502FF56FD28B439A446079AA44828 /* NumberOnly.swift in Sources */, + 9E4EAB317A51EDDEB0F989FAFE98FF2C /* Order.swift in Sources */, + 93F8F669E4B04B4DB531D251706A500E /* OuterComposite.swift in Sources */, + 616E91DF676728E98777E4C2221F30FF /* OuterEnum.swift in Sources */, + 52BB72DA85ECC5DF65DB17DC7FE78794 /* Pet.swift in Sources */, + C625241EED7F5ABFA3421D1D2F33B9A7 /* PetAPI.swift in Sources */, + AE8E12A37981E08C499422F0D7DB3562 /* PetstoreClient-dummy.m in Sources */, + A7D6F30DD00FE0799E3226CAD9B4F0F8 /* ReadOnlyFirst.swift in Sources */, + 65D4CBC83D44D1079503E162E56EB1FC /* Return.swift in Sources */, + 962EFB8F73E4755A382781A0985D65F7 /* SpecialModelName.swift in Sources */, + 41B161B3DF73F631EB37EBC84E989A86 /* StoreAPI.swift in Sources */, + 0376FA9CA4578351B19BF40B86DAF6C8 /* StringBooleanMap.swift in Sources */, + ED805B7A7AFAE3166128F815B88FF4C9 /* Tag.swift in Sources */, + 568163D7220FA2ACE76E2A089ED97367 /* TypeHolderDefault.swift in Sources */, + A3A401A337A4033FDD4A3394D1F6DC1B /* TypeHolderExample.swift in Sources */, + 3B2E7969FD3611446E0C3428B6FD506E /* User.swift in Sources */, + 06908794B0BD0AD1C3328AD8BC4B82B6 /* UserAPI.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F7D9DB86AE0913CC2B294C55BFD934AD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8012A57CFFC574F745FBA46D335BBA6F /* Pods-SwaggerClientTests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5DE874B58B87742561569DD4D3D1B529 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 3383968E74B5371B20BB519B170DC7FD /* Alamofire */; + targetProxy = 20B39FDE827AD3DF13AE317B5E936361 /* PBXContainerItemProxy */; + }; + C14616AC8F7012FA96FE36A7D42D8D82 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PetstoreClient; + target = 014B234AEDAF6EC680B4B670020FC6E9 /* PetstoreClient */; + targetProxy = AFC558F1633DAC5C557E46CBB263C91E /* PBXContainerItemProxy */; + }; + C18A6DC0C9B8408542F3D944BB6D67F4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Pods-SwaggerClient"; + target = 6CC172B84D895FFAF079AB5AA2CBFA6E /* Pods-SwaggerClient */; + targetProxy = FA1A8E2F3FE2899A723889F94EACA0E5 /* PBXContainerItemProxy */; + }; + F234C94DB11B7BBDD1958805D4F5AB78 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 3383968E74B5371B20BB519B170DC7FD /* Alamofire */; + targetProxy = 5D76C10F5893692E171BC309A834B39D /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 0F9DE41FC108FC05B463FCAC96ED8EF9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 21979AE1790135C30E0899E08565E57B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 2EAEE6B722B898F409C2B1C6A56C5B9B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 41268AF552E2DC6A5873C87C81174F7D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A0F6B1DBF2B95867B02CA909027E6CA1 /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Alamofire-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_MODULE_NAME = Alamofire; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.1; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 574F3585003DE50C3AF6674F2F554A8F /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D52A73EE9B54C37128A536FC390D5EB8 /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/PetstoreClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + PRODUCT_MODULE_NAME = PetstoreClient; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 63EF74233563D17636D6B6BC64BAC633 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 7A138A57D62AD3F0FEBC72142392B2CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A345BCBDE6C296957161A3E85A47A280 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A0F6B1DBF2B95867B02CA909027E6CA1 /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Alamofire-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_MODULE_NAME = Alamofire; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.1; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + B758FBEC27C09CD6E60596DDF8B1CDBB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + D69DDD32C596B1D7288985DF36FA2133 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D52A73EE9B54C37128A536FC390D5EB8 /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/PetstoreClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + PRODUCT_MODULE_NAME = PetstoreClient; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 382DBE4A1A56F1CB2D9416262C3B398A /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D69DDD32C596B1D7288985DF36FA2133 /* Debug */, + 574F3585003DE50C3AF6674F2F554A8F /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0F9DE41FC108FC05B463FCAC96ED8EF9 /* Debug */, + B758FBEC27C09CD6E60596DDF8B1CDBB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 572D6D84C594D0A2084C64BFCC57B307 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2EAEE6B722B898F409C2B1C6A56C5B9B /* Debug */, + 63EF74233563D17636D6B6BC64BAC633 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8F09E039867007D3576FEED9032526A8 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7A138A57D62AD3F0FEBC72142392B2CD /* Debug */, + 21979AE1790135C30E0899E08565E57B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E87124444A44B7DB55208E7FEC21D331 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 41268AF552E2DC6A5873C87C81174F7D /* Debug */, + A345BCBDE6C296957161A3E85A47A280 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-Info.plist new file mode 100644 index 000000000000..bb5a9ffc808b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.9.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m new file mode 100644 index 000000000000..a6c4594242e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Alamofire : NSObject +@end +@implementation PodsDummy_Alamofire +@end diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h new file mode 100644 index 000000000000..00014e3cd82a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap new file mode 100644 index 000000000000..d1f125fab6b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap @@ -0,0 +1,6 @@ +framework module Alamofire { + umbrella header "Alamofire-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig new file mode 100644 index 000000000000..12a1450811bb --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist new file mode 100644 index 000000000000..2aba7e548ba0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.7.3 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist new file mode 100644 index 000000000000..cba258550bd0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m new file mode 100644 index 000000000000..749b412f85c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PetstoreClient : NSObject +@end +@implementation PodsDummy_PetstoreClient +@end diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h new file mode 100644 index 000000000000..2a366623a36f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double PetstoreClientVersionNumber; +FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap new file mode 100644 index 000000000000..7fdfc46cf796 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap @@ -0,0 +1,6 @@ +framework module PetstoreClient { + umbrella header "PetstoreClient-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig new file mode 100644 index 000000000000..62fe7dab13d8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown new file mode 100644 index 000000000000..973d79a75d26 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown @@ -0,0 +1,26 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## Alamofire + +Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + +Generated by CocoaPods - https://cocoapods.org diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist new file mode 100644 index 000000000000..5c049b5d2a3b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist @@ -0,0 +1,58 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Alamofire + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m new file mode 100644 index 000000000000..6236440163b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClient : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClient +@end diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh new file mode 100755 index 000000000000..c0ca87ce2de1 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -0,0 +1,165 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +function on_error { + echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" +} +trap 'on_error $LINENO' ERR + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + elif [ -L "${binary}" ]; then + echo "Destination binary is symlinked..." + dirname="$(dirname "${binary}")" + binary="${dirname}/$(readlink "${binary}")" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identity + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h new file mode 100644 index 000000000000..b7da51aaf252 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig new file mode 100644 index 000000000000..b9d6266ecd14 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap new file mode 100644 index 000000000000..ef919b6c0d1f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClient { + umbrella header "Pods-SwaggerClient-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig new file mode 100644 index 000000000000..b9d6266ecd14 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown new file mode 100644 index 000000000000..102af7538517 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist new file mode 100644 index 000000000000..7acbad1eabbf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m new file mode 100644 index 000000000000..bb17fa2b80ff --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClientTests : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClientTests +@end diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh new file mode 100755 index 000000000000..08e3eaaca45a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -0,0 +1,146 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h new file mode 100644 index 000000000000..b2e4925a9e41 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig new file mode 100644 index 000000000000..b7db85d42cca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap new file mode 100644 index 000000000000..a848da7ffb30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClientTests { + umbrella header "Pods-SwaggerClientTests-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig new file mode 100644 index 000000000000..b7db85d42cca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "PetstoreClient" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..4fd31d11f51b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,533 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1A501F48219C3DC600F372F6 /* DateFormatTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1A501F47219C3DC600F372F6 /* DateFormatTests.swift */; }; + 23B2E76564651097BE2FE501 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7F98CC8B18E5FA9213F6A68D /* Pods_SwaggerClient.framework */; }; + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; + FB5CCC7EFA680BB2746B695B /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83FDC034BBA2A07AE9975250 /* Pods_SwaggerClientTests.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6D4EFB901C692C6300B96B06; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 081E9B893DEB1589CB807EA7 /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + 1A501F47219C3DC600F372F6 /* DateFormatTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DateFormatTests.swift; sourceTree = ""; }; + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + 7F98CC8B18E5FA9213F6A68D /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 83FDC034BBA2A07AE9975250 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + ACB80AC61FA8D8916D4559AA /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; + C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + E43FC34A9681D65ED44EE914 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + ED8576754DBB828CAE63EA87 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 23B2E76564651097BE2FE501 /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + FB5CCC7EFA680BB2746B695B /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 203D4495376E4EB72474B091 /* Pods */ = { + isa = PBXGroup; + children = ( + 081E9B893DEB1589CB807EA7 /* Pods-SwaggerClient.debug.xcconfig */, + ACB80AC61FA8D8916D4559AA /* Pods-SwaggerClient.release.xcconfig */, + E43FC34A9681D65ED44EE914 /* Pods-SwaggerClientTests.debug.xcconfig */, + ED8576754DBB828CAE63EA87 /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C07EC0A94AA0F86D60668B32 /* Pods.framework */, + 7F98CC8B18E5FA9213F6A68D /* Pods_SwaggerClient.framework */, + 83FDC034BBA2A07AE9975250 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6D4EFB881C692C6300B96B06 = { + isa = PBXGroup; + children = ( + 6D4EFB931C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, + 6D4EFB921C692C6300B96B06 /* Products */, + 3FABC56EC0BA84CBF4F99564 /* Frameworks */, + 203D4495376E4EB72474B091 /* Pods */, + ); + sourceTree = ""; + }; + 6D4EFB921C692C6300B96B06 /* Products */ = { + isa = PBXGroup; + children = ( + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, + 6D4EFB961C692C6300B96B06 /* ViewController.swift */, + 6D4EFB981C692C6300B96B06 /* Main.storyboard */, + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, + 6D4EFBA01C692C6300B96B06 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + 6D4EFBAB1C692C6300B96B06 /* Info.plist */, + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, + 1A501F47219C3DC600F372F6 /* DateFormatTests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + 5BC9214E8D9BA5A427A3775B /* [CP] Check Pods Manifest.lock */, + 6D4EFB8D1C692C6300B96B06 /* Sources */, + 6D4EFB8E1C692C6300B96B06 /* Frameworks */, + 6D4EFB8F1C692C6300B96B06 /* Resources */, + FDCA0F14611FE114BFEBA8BB /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + EEDC5E683F9569976B7C1192 /* [CP] Check Pods Manifest.lock */, + 6D4EFBA11C692C6300B96B06 /* Sources */, + 6D4EFBA21C692C6300B96B06 /* Frameworks */, + 6D4EFBA31C692C6300B96B06 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6D4EFB891C692C6300B96B06 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0720; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + 6D4EFB901C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + }; + 6D4EFBA41C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + TestTargetID = 6D4EFB901C692C6300B96B06; + }; + }; + }; + buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6D4EFB881C692C6300B96B06; + productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6D4EFB901C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6D4EFB8F1C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA31C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 5BC9214E8D9BA5A427A3775B /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + EEDC5E683F9569976B7C1192 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + FDCA0F14611FE114BFEBA8BB /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + ); + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6D4EFB8D1C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA11C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, + 1A501F48219C3DC600F372F6 /* DateFormatTests.swift in Sources */, + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; + targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB991C692C6300B96B06 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB9E1C692C6300B96B06 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6D4EFBAC1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6D4EFBAD1C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6D4EFBAF1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 081E9B893DEB1589CB807EA7 /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6D4EFBB01C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ACB80AC61FA8D8916D4559AA /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 6D4EFBB21C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = E43FC34A9681D65ED44EE914 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + 6D4EFBB31C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = ED8576754DBB828CAE63EA87 /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAC1C692C6300B96B06 /* Debug */, + 6D4EFBAD1C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAF1C692C6300B96B06 /* Debug */, + 6D4EFBB01C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBB21C692C6300B96B06 /* Debug */, + 6D4EFBB31C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..5ba034cec55a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..b1896774c738 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,43 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..1d060ed28827 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..bb71d00fa8ae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..8dad16b10f16 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,23 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift new file mode 100644 index 000000000000..b83a008b7921 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/DateFormatTests.swift @@ -0,0 +1,113 @@ +// +// DateFormatTests.swift +// SwaggerClientTests +// +// Created by James on 14/11/2018. +// Copyright © 2018 Swagger. All rights reserved. +// + +import Foundation +import XCTest +@testable import PetstoreClient +@testable import SwaggerClient + +class DateFormatTests: XCTestCase { + + struct DateTest: Codable { + let date: Date + } + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testEncodeToJSONAlwaysResultsInUTCEncodedDate() { + var dateComponents = DateComponents() + dateComponents.calendar = Calendar(identifier: .gregorian) + dateComponents.year = 2018 + dateComponents.month = 11 + dateComponents.day = 14 + dateComponents.hour = 11 + dateComponents.minute = 35 + dateComponents.second = 43 + dateComponents.nanosecond = 500 + + // Testing a date with a timezone of +00:00 (UTC) + dateComponents.timeZone = TimeZone(secondsFromGMT: 0) + XCTAssert(dateComponents.isValidDate) + + guard let utcDate = dateComponents.date else { + XCTFail("Couldn't get a valid date") + return + } + + var encodedDate = utcDate.encodeToJSON() as! String + XCTAssert(encodedDate.hasSuffix("Z")) + + // test with a positive timzone offset from UTC + dateComponents.timeZone = TimeZone(secondsFromGMT: 60 * 60) // +01:00 + XCTAssert(dateComponents.isValidDate) + + guard let nonUTCDate1 = dateComponents.date else { + XCTFail("Couldn't get a valid date") + return + } + + encodedDate = nonUTCDate1.encodeToJSON() as! String + XCTAssert(encodedDate.hasSuffix("Z")) + + // test with a negative timzone offset from UTC + dateComponents.timeZone = TimeZone(secondsFromGMT: -(60 * 60)) // -01:00 + XCTAssert(dateComponents.isValidDate) + + guard let nonUTCDate2 = dateComponents.date else { + XCTFail("Couldn't get a valid date") + return + } + + encodedDate = nonUTCDate2.encodeToJSON() as! String + XCTAssert(encodedDate.hasSuffix("Z")) + } + + func testCodableAlwaysResultsInUTCEncodedDate() { + let jsonData = "{\"date\":\"1970-01-01T00:00:00.000Z\"}".data(using: .utf8)! + let decodeResult = CodableHelper.decode(DateTest.self, from: jsonData) + XCTAssert(decodeResult.decodableObj != nil && decodeResult.error == nil) + + var dateComponents = DateComponents() + dateComponents.calendar = Calendar(identifier: .gregorian) + dateComponents.year = 1970 + dateComponents.month = 01 + dateComponents.day = 01 + dateComponents.hour = 00 + dateComponents.minute = 00 + dateComponents.second = 00 + + // Testing a date with a timezone of +00:00 (UTC) + dateComponents.timeZone = TimeZone(secondsFromGMT: 0) + XCTAssert(dateComponents.isValidDate) + + guard let date = dateComponents.date else { + XCTFail("Couldn't get a valid date") + return + } + + let dateTest = DateTest(date: date) + let encodeResult = CodableHelper.encode(dateTest) + XCTAssert(encodeResult.data != nil && encodeResult.error == nil) + guard let jsonString = String(data: encodeResult.data!, encoding: .utf8) else { + XCTFail("Unable to convert encoded data to string.") + return + } + + let exampleJSONString = "{\"date\":\"1970-01-01T00:00:00.000Z\"}" + XCTAssert(jsonString == exampleJSONString, "Encoded JSON String: \(jsonString) should match: \(exampleJSONString)") + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..802f84f540d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..6be5bc6d29fe --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,80 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectation(description: "testCreatePet") + let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] + 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) + + PetAPI.addPet(body: newPet) { (_, error) in + guard error == nil else { + XCTFail("error creating pet") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectation(description: "testGetPet") + + PetAPI.getPetById(petId: 1000) { (pet, error) in + guard error == nil else { + XCTFail("error retrieving pet") + return + } + + if let pet = pet { + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectation(description: "testDeletePet") + + PetAPI.deletePet(petId: 1000) { (_, error) in + guard error == nil else { + XCTFail("error deleting pet") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..fedf7fcdbbd2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,120 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" + + let testTimeout = 10.0 + + func test1PlaceOrder() { + // use explicit naming to reference the enum so that we test we don't regress on enum naming + let shipDate = Date() + let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) + let expectation = self.expectation(description: "testPlaceOrder") + + StoreAPI.placeOrder(body: order) { (order, error) in + guard error == nil else { + XCTFail("error placing order: \(error.debugDescription)") + return + } + + if let order = order { + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectation(description: "testGetOrder") + + StoreAPI.getOrderById(orderId: 1000) { (order, error) in + guard error == nil else { + XCTFail("error retrieving order: \(error.debugDescription)") + return + } + + if let order = order { + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + + expectation.fulfill() + } + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectation(description: "testDeleteOrder") + + StoreAPI.deleteOrder(orderId: "1000") { (response, error) in + guard error == nil else { + XCTFail("error deleting order") + return + } + + guard let _ = response else { + XCTFail("response is nil") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testDownloadProgress() { + let responseExpectation = self.expectation(description: "obtain response") + let progressExpectation = self.expectation(description: "obtain progress") + let requestBuilder = StoreAPI.getOrderByIdWithRequestBuilder(orderId: 1000) + + requestBuilder.onProgressReady = { (progress) in + progressExpectation.fulfill() + } + + requestBuilder.execute { (_, _) in + responseExpectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} + +private extension Date { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(_ date: Date, format: String) -> Bool { + let fmt = DateFormatter() + fmt.dateFormat = format + return fmt.string(from: self).isEqual(fmt.string(from: date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..0a1ca3902eb6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,67 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Robin Eggenkamp on 5/21/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testLogin() { + let expectation = self.expectation(description: "testLogin") + + UserAPI.loginUser(username: "swiftTester", password: "swift") { (_, error) in + guard error == nil else { + XCTFail("error logging in") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectation(description: "testLogout") + + UserAPI.logoutUser { (_, error) in + guard error == nil else { + XCTFail("error logging out") + return + } + + expectation.fulfill() + } + + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testPathParamsAreEscaped() { + // The path for this operation is /user/{userId}. In order to make a usable path, + // then we must make sure that {userId} is percent-escaped when it is substituted + // into the path. So we intentionally introduce a path with spaces. + let userRequestBuilder = UserAPI.getUserByNameWithRequestBuilder(username: "User Name With Spaces") + let urlContainsSpace = userRequestBuilder.URLString.contains(" ") + + XCTAssert(!urlContainsSpace, "Expected URL to be escaped, but it was not.") + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..bdaa6b98afdf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift4PetstoreClientTests + pom + 1.0-SNAPSHOT + Swift4 Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..180aec08bb53 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/default/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +xcodebuild clean build build-for-testing -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" && xcodebuild test-without-building -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..89e8b9f23899 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.pbxproj @@ -0,0 +1,577 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 02903CEC38DC202565BC08CB040AC4E9 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */; }; + 0462F801432CF94C7EF51D0532737A7E /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */; }; + 08D87E4FECF24910F0DA0F1D2E2D955A /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */; }; + 1143FFF06DEE01E5B0F1368AA05BE1B4 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */; }; + 122BBAE8245606CC040EEB6B9254E376 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */; }; + 12327BF7304AA897C5D2A1250B1659B7 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */; }; + 12BB95C66D63090732BB9E0379836E3C /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */; }; + 16E9A5E22B4823DE282E7F4C18A21EA8 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */; }; + 18F19872A0DFB4CC3D9C696BBCA64EFD /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */; }; + 196E9846B27D736630CCF90497696859 /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */; }; + 271D94A05C47B602A2433B9CD3D9DCDC /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */; }; + 293F4E0FBFC8297E414A3CDBB7F29A96 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */; }; + 297E365D1E4672C43C56E0AFD855FFBF /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */; }; + 2A35688C985E9CB1EB7732AC2AD46B82 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */; }; + 2DF4544D4D3D6CF7047A59FB89ED31BD /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */; }; + 3251A3722981CE46261615CFBA96A08D /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */; }; + 36734C4EB3362A114A7CB5F25EE39E6D /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */; }; + 3D8E407B1DF4FA5A5F16B64E3A285781 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */; }; + 41D8A105135868152A56E2AC475049BB /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */; }; + 42C51BC034E8B0CAA29A068F6B0DC815 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */; }; + 491676EC91BFEF95A12556888EED87B5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */; }; + 4C28BFEC5E7C8150DEFD83E09C1A1D32 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */; }; + 58F9704B295AC436D6FB98FA669E2344 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */; }; + 59C00CBB07761CAC8DCE7054E34AD5D9 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */; }; + 59C2F5495C98836BFA9E10BF5C13BC2C /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */; }; + 5ACDD7CC312167589335E9CA5998E770 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */; }; + 655AA371771C7BD72EE0AAC0C90DFFF0 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */; }; + 6600BB1500AE35A3C80F7C83F6444552 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */; }; + 6CD20EE568DDAD2304BF0C4B1A70C8DC /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */; }; + 7367A9D91D4B101F2D28AC56ED89F175 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */; }; + 82D4D0C8AD0354A700C8ACD421ABED55 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */; }; + 83A2D1863FB136C0DFC423319F4EED65 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */; }; + 92FB161BF1E57D11B116AF0292D5835C /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718FF4525C81 /* Client.swift */; }; + 97C99615237E1B662242E04F527B38B9 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */; }; + A190AF5A3988639ED4B78163D0EA3CA4 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */; }; + A196B597ADCA20BEC280660B57FF7333 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A586582C92491DF9C12D27E2CB7F0695 /* PromiseKit.framework */; }; + A438970025AE69ED407BC1E67CC6359E /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */; }; + A9F1AAF6CE029DD3B4F8AC841F0B6BC6 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */; }; + AE9D2E1DB59AF6575AC4AC6756C5A937 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */; }; + B399A1742F23330FDCA450EAB98F51F1 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */; }; + BB02FDCF1B2B0E457E1C2BF39FBB599D /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2253391845B73B8BA3680491575CC07 /* XmlItem.swift */; }; + BF7D58FBCF5E4D3F2932FCC0E62BED40 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */; }; + C15AC1CC631E96D0360EB8C15BF30452 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */; }; + C1CACABE18A7ADCE37D1CD9DC9128304 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A4315C49A /* List.swift */; }; + C2EDEB747887399B13A6DFD72A219CB2 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */; }; + C329EE55B2FCC9174ED3B128D67C5E8C /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */; }; + D3A17B7FAFA8A7A210875BBCDCC30116 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + D70EC94E346077DE1482231DD4498BED /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */; }; + DB1CE39011A741D07E187663291B5DE5 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */; }; + DB724C4F1AD5DF025B53A9A2E0A49E3D /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */; }; + DDBC3CF5E447D8D838F0FE200420EEE3 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */; }; + DEC892724574BB29BD65869374F83982 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */; }; + E2C40F0E34DB8C21A806262C72841A51 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118F057604D /* SpecialModelName.swift */; }; + E51ADEC931806B20A041303E539A8BE2 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */; }; + F02BEF9A8503B3848B045370451E85F6 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4CF550442B /* Models.swift */; }; + F21D10C71A9DE7D0467AFD23FD391D2E /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08AA65292F7 /* Return.swift */; }; + FB4A053CDCD75E48B755CC22D463A3FC /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */; }; + FECA03F0388E84AE1B22638605D8AC9F /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; + 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; + 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; + 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 386FD590658E90509C121118F057604D /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; + 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; + 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; + 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 7A6070F581E611FF44AFD40A4315C49A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; + 8699F7966F748ED026A6FB4CF550442B /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; + 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; + A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; + A2253391845B73B8BA3680491575CC07 /* XmlItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; }; + A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; + A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + A586582C92491DF9C12D27E2CB7F0695 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PromiseKit.framework; sourceTree = ""; }; + A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + A913A57E72D723632E9A718FF4525C81 /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; + B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + C81447828475F76C5CF4F08AA65292F7 /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; + ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D1990C2A394CCF025EF98A2FB828C79A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C28BFEC5E7C8150DEFD83E09C1A1D32 /* Alamofire.framework in Frameworks */, + A196B597ADCA20BEC280660B57FF7333 /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1E464C0937FE0D3A7A0FE29AF446553C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7861EE241895128F64DD787367B3022D /* Carthage */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4FBDCF1330A9AB9122780DB3FA21DE4C /* Models */ = { + isa = PBXGroup; + children = ( + 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */, + 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */, + 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */, + A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */, + 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */, + B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */, + F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */, + A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */, + 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */, + 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */, + 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */, + 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */, + A913A57E72D723632E9A718FF4525C81 /* Client.swift */, + C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */, + A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */, + 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */, + 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */, + FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */, + 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */, + 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */, + 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */, + 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */, + 7A6070F581E611FF44AFD40A4315C49A /* List.swift */, + 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */, + 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */, + 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */, + B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */, + 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */, + F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */, + C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */, + ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */, + 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */, + C81447828475F76C5CF4F08AA65292F7 /* Return.swift */, + 386FD590658E90509C121118F057604D /* SpecialModelName.swift */, + 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */, + B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */, + EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */, + 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */, + E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */, + A2253391845B73B8BA3680491575CC07 /* XmlItem.swift */, + ); + path = Models; + sourceTree = ""; + }; + 5FBA6AE5F64CD737F88B4565AC3CCD3B = { + isa = PBXGroup; + children = ( + 9B364C01750D7AA4F983B9E77B01BCC6 /* PetstoreClient */, + 1E464C0937FE0D3A7A0FE29AF446553C /* Frameworks */, + 857F0DEA1890CE66D6DAD556C55821A6 /* Products */, + ); + sourceTree = ""; + }; + 67BF3478113E6B4DF1C4E04F40BF58C4 /* OpenAPIs */ = { + isa = PBXGroup; + children = ( + 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */, + 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */, + 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */, + 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */, + 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */, + B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */, + 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */, + 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */, + 8699F7966F748ED026A6FB4CF550442B /* Models.swift */, + F956D0CCAE23BCFD1C7BDD5D47944AA5 /* APIs */, + 4FBDCF1330A9AB9122780DB3FA21DE4C /* Models */, + ); + path = OpenAPIs; + sourceTree = ""; + }; + 7861EE241895128F64DD787367B3022D /* Carthage */ = { + isa = PBXGroup; + children = ( + A012205B41CB71A62B86EECDEAFB0990 /* iOS */, + ); + name = Carthage; + path = Carthage/Build; + sourceTree = ""; + }; + 857F0DEA1890CE66D6DAD556C55821A6 /* Products */ = { + isa = PBXGroup; + children = ( + 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */, + ); + name = Products; + sourceTree = ""; + }; + 9B364C01750D7AA4F983B9E77B01BCC6 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + EF4C81BDD734856ED5023B777D35098B /* Classes */, + ); + path = PetstoreClient; + sourceTree = ""; + }; + A012205B41CB71A62B86EECDEAFB0990 /* iOS */ = { + isa = PBXGroup; + children = ( + A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */, + A586582C92491DF9C12D27E2CB7F0695 /* PromiseKit.framework */, + ); + path = iOS; + sourceTree = ""; + }; + EF4C81BDD734856ED5023B777D35098B /* Classes */ = { + isa = PBXGroup; + children = ( + 67BF3478113E6B4DF1C4E04F40BF58C4 /* OpenAPIs */, + ); + path = Classes; + sourceTree = ""; + }; + F956D0CCAE23BCFD1C7BDD5D47944AA5 /* APIs */ = { + isa = PBXGroup; + children = ( + 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */, + 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */, + B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */, + 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */, + A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */, + 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */, + ); + path = APIs; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C1282C2230015E0D204BEAEDDFB49453 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = B46EDEB1A7F0D78FE6394544C60169D1 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + E539708354CE60FE486F81EDE56D13C8 /* Sources */, + D1990C2A394CCF025EF98A2FB828C79A /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E7D276EE2369D8C455513C2E05F9AED0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1000; + }; + buildConfigurationList = ECAB17FF35111B5E14DAAC0883031714 /* Build configuration list for PBXProject "PetstoreClient" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 5FBA6AE5F64CD737F88B4565AC3CCD3B; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C1282C2230015E0D204BEAEDDFB49453 /* PetstoreClient */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + E539708354CE60FE486F81EDE56D13C8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A35688C985E9CB1EB7732AC2AD46B82 /* APIHelper.swift in Sources */, + 0462F801432CF94C7EF51D0532737A7E /* APIs.swift in Sources */, + 12327BF7304AA897C5D2A1250B1659B7 /* AdditionalPropertiesClass.swift in Sources */, + 58F9704B295AC436D6FB98FA669E2344 /* AlamofireImplementations.swift in Sources */, + 02903CEC38DC202565BC08CB040AC4E9 /* Animal.swift in Sources */, + DB1CE39011A741D07E187663291B5DE5 /* AnimalFarm.swift in Sources */, + 83A2D1863FB136C0DFC423319F4EED65 /* AnotherFakeAPI.swift in Sources */, + 97C99615237E1B662242E04F527B38B9 /* ApiResponse.swift in Sources */, + 3251A3722981CE46261615CFBA96A08D /* ArrayOfArrayOfNumberOnly.swift in Sources */, + A190AF5A3988639ED4B78163D0EA3CA4 /* ArrayOfNumberOnly.swift in Sources */, + C2EDEB747887399B13A6DFD72A219CB2 /* ArrayTest.swift in Sources */, + 7367A9D91D4B101F2D28AC56ED89F175 /* Capitalization.swift in Sources */, + 18F19872A0DFB4CC3D9C696BBCA64EFD /* Cat.swift in Sources */, + 41D8A105135868152A56E2AC475049BB /* CatAllOf.swift in Sources */, + 42C51BC034E8B0CAA29A068F6B0DC815 /* Category.swift in Sources */, + 5ACDD7CC312167589335E9CA5998E770 /* ClassModel.swift in Sources */, + 92FB161BF1E57D11B116AF0292D5835C /* Client.swift in Sources */, + 6CD20EE568DDAD2304BF0C4B1A70C8DC /* CodableHelper.swift in Sources */, + DEC892724574BB29BD65869374F83982 /* Configuration.swift in Sources */, + D70EC94E346077DE1482231DD4498BED /* Dog.swift in Sources */, + 271D94A05C47B602A2433B9CD3D9DCDC /* DogAllOf.swift in Sources */, + A438970025AE69ED407BC1E67CC6359E /* EnumArrays.swift in Sources */, + 59C00CBB07761CAC8DCE7054E34AD5D9 /* EnumClass.swift in Sources */, + 08D87E4FECF24910F0DA0F1D2E2D955A /* EnumTest.swift in Sources */, + C329EE55B2FCC9174ED3B128D67C5E8C /* Extensions.swift in Sources */, + 297E365D1E4672C43C56E0AFD855FFBF /* FakeAPI.swift in Sources */, + A9F1AAF6CE029DD3B4F8AC841F0B6BC6 /* FakeClassnameTags123API.swift in Sources */, + FECA03F0388E84AE1B22638605D8AC9F /* File.swift in Sources */, + 491676EC91BFEF95A12556888EED87B5 /* FileSchemaTestClass.swift in Sources */, + 36734C4EB3362A114A7CB5F25EE39E6D /* FormatTest.swift in Sources */, + DDBC3CF5E447D8D838F0FE200420EEE3 /* HasOnlyReadOnly.swift in Sources */, + 16E9A5E22B4823DE282E7F4C18A21EA8 /* JSONEncodableEncoding.swift in Sources */, + 12BB95C66D63090732BB9E0379836E3C /* JSONEncodingHelper.swift in Sources */, + C1CACABE18A7ADCE37D1CD9DC9128304 /* List.swift in Sources */, + 655AA371771C7BD72EE0AAC0C90DFFF0 /* MapTest.swift in Sources */, + D3A17B7FAFA8A7A210875BBCDCC30116 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 2DF4544D4D3D6CF7047A59FB89ED31BD /* Model200Response.swift in Sources */, + F02BEF9A8503B3848B045370451E85F6 /* Models.swift in Sources */, + C15AC1CC631E96D0360EB8C15BF30452 /* Name.swift in Sources */, + AE9D2E1DB59AF6575AC4AC6756C5A937 /* NumberOnly.swift in Sources */, + 59C2F5495C98836BFA9E10BF5C13BC2C /* Order.swift in Sources */, + 82D4D0C8AD0354A700C8ACD421ABED55 /* OuterComposite.swift in Sources */, + 1143FFF06DEE01E5B0F1368AA05BE1B4 /* OuterEnum.swift in Sources */, + B399A1742F23330FDCA450EAB98F51F1 /* Pet.swift in Sources */, + 3D8E407B1DF4FA5A5F16B64E3A285781 /* PetAPI.swift in Sources */, + 293F4E0FBFC8297E414A3CDBB7F29A96 /* ReadOnlyFirst.swift in Sources */, + F21D10C71A9DE7D0467AFD23FD391D2E /* Return.swift in Sources */, + E2C40F0E34DB8C21A806262C72841A51 /* SpecialModelName.swift in Sources */, + 122BBAE8245606CC040EEB6B9254E376 /* StoreAPI.swift in Sources */, + 196E9846B27D736630CCF90497696859 /* StringBooleanMap.swift in Sources */, + E51ADEC931806B20A041303E539A8BE2 /* Tag.swift in Sources */, + 6600BB1500AE35A3C80F7C83F6444552 /* TypeHolderDefault.swift in Sources */, + FB4A053CDCD75E48B755CC22D463A3FC /* TypeHolderExample.swift in Sources */, + BF7D58FBCF5E4D3F2932FCC0E62BED40 /* User.swift in Sources */, + DB724C4F1AD5DF025B53A9A2E0A49E3D /* UserAPI.swift in Sources */, + BB02FDCF1B2B0E457E1C2BF39FBB599D /* XmlItem.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3B2C02AFB91CB5C82766ED5CF21FF628 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + A9EB0A02B94C427CBACFEC7CFFC6A816 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + DD3EEB93949E9EBA4437E9CDBF4A26F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + F81D4E5FECD46E9AA6DD2C299CEBEF64 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B46EDEB1A7F0D78FE6394544C60169D1 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD3EEB93949E9EBA4437E9CDBF4A26F6 /* Debug */, + 3B2C02AFB91CB5C82766ED5CF21FF628 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; + ECAB17FF35111B5E14DAAC0883031714 /* Build configuration list for PBXProject "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9EB0A02B94C427CBACFEC7CFFC6A816 /* Debug */, + F81D4E5FECD46E9AA6DD2C299CEBEF64 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = E7D276EE2369D8C455513C2E05F9AED0 /* Project object */; +} diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme similarity index 100% rename from samples/client/petstore/swift4/unwrapRequired/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme rename to CI/samples.ci/client/petstore/swift4/promisekit/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..29843508b65b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile @@ -0,0 +1,10 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock new file mode 100644 index 000000000000..355d4c9f5f0d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Podfile.lock @@ -0,0 +1,27 @@ +PODS: + - Alamofire (4.9.0) + - PetstoreClient (1.0.0): + - Alamofire (~> 4.9.0) + - PromiseKit/CorePromise (~> 4.4.0) + - PromiseKit/CorePromise (4.4.4) + +DEPENDENCIES: + - PetstoreClient (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - PromiseKit + +EXTERNAL SOURCES: + PetstoreClient: + :path: "../" + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + PetstoreClient: 16d0f56d050fe19acef55197555f60526cf4a71b + PromiseKit: 6178219c4c7457ae90d7d8b34b7ac5eb36916519 + +PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d + +COCOAPODS: 1.6.1 diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE new file mode 100644 index 000000000000..38a301a1db8f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/README.md new file mode 100644 index 000000000000..9fdc9c738737 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/README.md @@ -0,0 +1,242 @@ +![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/master/alamofire.png) + +[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) +[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](https://alamofire.github.io/Alamofire) +[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](https://twitter.com/AlamofireSF) +[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +Alamofire is an HTTP networking library written in Swift. + +- [Features](#features) +- [Component Libraries](#component-libraries) +- [Requirements](#requirements) +- [Migration Guides](#migration-guides) +- [Communication](#communication) +- [Installation](#installation) +- [Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md) + - **Intro -** [Making a Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#making-a-request), [Response Handling](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-handling), [Response Validation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-validation), [Response Caching](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-caching) + - **HTTP -** [HTTP Methods](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-methods), [Parameter Encoding](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#parameter-encoding), [HTTP Headers](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-headers), [Authentication](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#authentication) + - **Large Data -** [Downloading Data to a File](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#downloading-data-to-a-file), [Uploading Data to a Server](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#uploading-data-to-a-server) + - **Tools -** [Statistical Metrics](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#statistical-metrics), [cURL Command Output](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#curl-command-output) +- [Advanced Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md) + - **URL Session -** [Session Manager](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-manager), [Session Delegate](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-delegate), [Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#request) + - **Routing -** [Routing Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#routing-requests), [Adapting and Retrying Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#adapting-and-retrying-requests) + - **Model Objects -** [Custom Response Serialization](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#custom-response-serialization) + - **Connection -** [Security](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#security), [Network Reachability](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#network-reachability) +- [Open Radars](#open-radars) +- [FAQ](#faq) +- [Credits](#credits) +- [Donations](#donations) +- [License](#license) + +## Features + +- [x] Chainable Request / Response Methods +- [x] URL / JSON / plist Parameter Encoding +- [x] Upload File / Data / Stream / MultipartFormData +- [x] Download File using Request or Resume Data +- [x] Authentication with URLCredential +- [x] HTTP Response Validation +- [x] Upload and Download Progress Closures with Progress +- [x] cURL Command Output +- [x] Dynamically Adapt and Retry Requests +- [x] TLS Certificate and Public Key Pinning +- [x] Network Reachability +- [x] Comprehensive Unit and Integration Test Coverage +- [x] [Complete Documentation](https://alamofire.github.io/Alamofire) + +## Component Libraries + +In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. + +- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. +- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. + +## Requirements + +- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ +- Xcode 8.3+ +- Swift 3.1+ + +## Migration Guides + +- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) +- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) +- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) + +## Communication +- If you **need help with making network requests**, use [Stack Overflow](https://stackoverflow.com/questions/tagged/alamofire) and tag `alamofire`. +- If you need to **find or understand an API**, check [our documentation](http://alamofire.github.io/Alamofire/) or [Apple's documentation for `URLSession`](https://developer.apple.com/documentation/foundation/url_loading_system), on top of which Alamofire is built. +- If you need **help with an Alamofire feature**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you'd like to **discuss Alamofire best practices**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you'd like to **discuss a feature request**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you **found a bug**, open an issue and follow the guide. The more detail the better! +- If you **want to contribute**, submit a pull request. + +## Installation + +### CocoaPods + +[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +> CocoaPods 1.7+ is required to build Alamofire 4.9+. + +To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '10.0' +use_frameworks! + +target '' do + pod 'Alamofire', '~> 4.9' +end +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +You can install Carthage with [Homebrew](https://brew.sh/) using the following command: + +```bash +$ brew install carthage +``` + +To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "Alamofire/Alamofire" ~> 4.9 +``` + +Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. + +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. + +Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +#### Swift 3 + +```swift +dependencies: [ + .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) +] +``` + +#### Swift 4 + +```swift +dependencies: [ + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") +] +``` + +### Manually + +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. + +#### Embedded Framework + +- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: + + ```bash + $ git init + ``` + +- Add Alamofire as a git [submodule](https://git-scm.com/docs/git-submodule) by running the following command: + + ```bash + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` + +- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. + + > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. + +- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. +- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. +- In the tab bar at the top of that window, open the "General" panel. +- Click on the `+` button under the "Embedded Binaries" section. +- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. + + > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. + +- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. + + > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. + +- And that's it! + + > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. + +## Open Radars + +The following radars have some effect on the current implementation of Alamofire. + +- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case +- `rdar://26870455` - Background URL Session Configurations do not work in the simulator +- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` +- [`rdar://36082113`](http://openradar.appspot.com/radar?id=4942308441063424) - `URLSessionTaskMetrics` failing to link on watchOS 3.0+ + +## Resolved Radars + +The following radars have been resolved over time after being filed against the Alamofire project. + +- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage (Resolved on 9/1/17 in Xcode 9 beta 6). + +## FAQ + +### What's the origin of the name Alamofire? + +Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. + +### What logic belongs in a Router vs. a Request Adapter? + +Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. + +The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. + +## Credits + +Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. + +### Security Disclosure + +If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. + +## Donations + +The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially stay registered as a federal non-profit organization. +Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. +Donating to the ASF will enable us to: + +- Pay our yearly legal fees to keep the non-profit in good status +- Pay for our mail servers to help us stay on top of all questions and security issues +- Potentially fund test servers to make it easier for us to test the edge cases +- Potentially fund developers to work on one of our projects full-time + +The community adoption of the ASF libraries has been amazing. +We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. +With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. +If you use any of our libraries for work, see if your employers would be interested in donating. +Any amount you can donate today to help us reach our goal would be greatly appreciated. + +[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W34WPEE74APJQ) + +## License + +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift new file mode 100644 index 000000000000..b163f6038fae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift @@ -0,0 +1,460 @@ +// +// AFError.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with +/// their own associated reasons. +/// +/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. +/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. +/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. +/// - responseValidationFailed: Returned when a `validate()` call fails. +/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. +public enum AFError: Error { + /// The underlying reason the parameter encoding error occurred. + /// + /// - missingURL: The URL request did not have a URL to encode. + /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the + /// encoding process. + /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during + /// encoding process. + public enum ParameterEncodingFailureReason { + case missingURL + case jsonEncodingFailed(error: Error) + case propertyListEncodingFailed(error: Error) + } + + /// The underlying reason the multipart encoding error occurred. + /// + /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a + /// file URL. + /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty + /// `lastPathComponent` or `pathExtension. + /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. + /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw + /// an error. + /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. + /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by + /// the system. + /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided + /// threw an error. + /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. + /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the + /// encoded data to disk. + /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file + /// already exists at the provided `fileURL`. + /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is + /// not a file URL. + /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an + /// underlying error. + /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with + /// underlying system error. + public enum MultipartEncodingFailureReason { + case bodyPartURLInvalid(url: URL) + case bodyPartFilenameInvalid(in: URL) + case bodyPartFileNotReachable(at: URL) + case bodyPartFileNotReachableWithError(atURL: URL, error: Error) + case bodyPartFileIsDirectory(at: URL) + case bodyPartFileSizeNotAvailable(at: URL) + case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) + case bodyPartInputStreamCreationFailed(for: URL) + + case outputStreamCreationFailed(for: URL) + case outputStreamFileAlreadyExists(at: URL) + case outputStreamURLInvalid(url: URL) + case outputStreamWriteFailed(error: Error) + + case inputStreamReadFailed(error: Error) + } + + /// The underlying reason the response validation error occurred. + /// + /// - dataFileNil: The data file containing the server response did not exist. + /// - dataFileReadFailed: The data file containing the server response could not be read. + /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` + /// provided did not contain wildcard type. + /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided + /// `acceptableContentTypes`. + /// - unacceptableStatusCode: The response status code was not acceptable. + public enum ResponseValidationFailureReason { + case dataFileNil + case dataFileReadFailed(at: URL) + case missingContentType(acceptableContentTypes: [String]) + case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) + case unacceptableStatusCode(code: Int) + } + + /// The underlying reason the response serialization error occurred. + /// + /// - inputDataNil: The server response contained no data. + /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. + /// - inputFileNil: The file containing the server response did not exist. + /// - inputFileReadFailed: The file containing the server response could not be read. + /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. + /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. + /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. + public enum ResponseSerializationFailureReason { + case inputDataNil + case inputDataNilOrZeroLength + case inputFileNil + case inputFileReadFailed(at: URL) + case stringSerializationFailed(encoding: String.Encoding) + case jsonSerializationFailed(error: Error) + case propertyListSerializationFailed(error: Error) + } + + case invalidURL(url: URLConvertible) + case parameterEncodingFailed(reason: ParameterEncodingFailureReason) + case multipartEncodingFailed(reason: MultipartEncodingFailureReason) + case responseValidationFailed(reason: ResponseValidationFailureReason) + case responseSerializationFailed(reason: ResponseSerializationFailureReason) +} + +// MARK: - Adapt Error + +struct AdaptError: Error { + let error: Error +} + +extension Error { + var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } +} + +// MARK: - Error Booleans + +extension AFError { + /// Returns whether the AFError is an invalid URL error. + public var isInvalidURLError: Bool { + if case .invalidURL = self { return true } + return false + } + + /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will + /// contain the associated value. + public var isParameterEncodingError: Bool { + if case .parameterEncodingFailed = self { return true } + return false + } + + /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties + /// will contain the associated values. + public var isMultipartEncodingError: Bool { + if case .multipartEncodingFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, + /// `responseContentType`, and `responseCode` properties will contain the associated values. + public var isResponseValidationError: Bool { + if case .responseValidationFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and + /// `underlyingError` properties will contain the associated values. + public var isResponseSerializationError: Bool { + if case .responseSerializationFailed = self { return true } + return false + } +} + +// MARK: - Convenience Properties + +extension AFError { + /// The `URLConvertible` associated with the error. + public var urlConvertible: URLConvertible? { + switch self { + case .invalidURL(let url): + return url + default: + return nil + } + } + + /// The `URL` associated with the error. + public var url: URL? { + switch self { + case .multipartEncodingFailed(let reason): + return reason.url + default: + return nil + } + } + + /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, + /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. + public var underlyingError: Error? { + switch self { + case .parameterEncodingFailed(let reason): + return reason.underlyingError + case .multipartEncodingFailed(let reason): + return reason.underlyingError + case .responseSerializationFailed(let reason): + return reason.underlyingError + default: + return nil + } + } + + /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. + public var acceptableContentTypes: [String]? { + switch self { + case .responseValidationFailed(let reason): + return reason.acceptableContentTypes + default: + return nil + } + } + + /// The response `Content-Type` of a `.responseValidationFailed` error. + public var responseContentType: String? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseContentType + default: + return nil + } + } + + /// The response code of a `.responseValidationFailed` error. + public var responseCode: Int? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseCode + default: + return nil + } + } + + /// The `String.Encoding` associated with a failed `.stringResponse()` call. + public var failedStringEncoding: String.Encoding? { + switch self { + case .responseSerializationFailed(let reason): + return reason.failedStringEncoding + default: + return nil + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var underlyingError: Error? { + switch self { + case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var url: URL? { + switch self { + case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), + .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), + .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), + .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), + .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): + return url + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), + .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.ResponseValidationFailureReason { + var acceptableContentTypes: [String]? { + switch self { + case .missingContentType(let types), .unacceptableContentType(let types, _): + return types + default: + return nil + } + } + + var responseContentType: String? { + switch self { + case .unacceptableContentType(_, let responseType): + return responseType + default: + return nil + } + } + + var responseCode: Int? { + switch self { + case .unacceptableStatusCode(let code): + return code + default: + return nil + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var failedStringEncoding: String.Encoding? { + switch self { + case .stringSerializationFailed(let encoding): + return encoding + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): + return error + default: + return nil + } + } +} + +// MARK: - Error Descriptions + +extension AFError: LocalizedError { + public var errorDescription: String? { + switch self { + case .invalidURL(let url): + return "URL is not valid: \(url)" + case .parameterEncodingFailed(let reason): + return reason.localizedDescription + case .multipartEncodingFailed(let reason): + return reason.localizedDescription + case .responseValidationFailed(let reason): + return reason.localizedDescription + case .responseSerializationFailed(let reason): + return reason.localizedDescription + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var localizedDescription: String { + switch self { + case .missingURL: + return "URL request to encode was missing a URL" + case .jsonEncodingFailed(let error): + return "JSON could not be encoded because of error:\n\(error.localizedDescription)" + case .propertyListEncodingFailed(let error): + return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var localizedDescription: String { + switch self { + case .bodyPartURLInvalid(let url): + return "The URL provided is not a file URL: \(url)" + case .bodyPartFilenameInvalid(let url): + return "The URL provided does not have a valid filename: \(url)" + case .bodyPartFileNotReachable(let url): + return "The URL provided is not reachable: \(url)" + case .bodyPartFileNotReachableWithError(let url, let error): + return ( + "The system returned an error while checking the provided URL for " + + "reachability.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartFileIsDirectory(let url): + return "The URL provided is a directory: \(url)" + case .bodyPartFileSizeNotAvailable(let url): + return "Could not fetch the file size from the provided URL: \(url)" + case .bodyPartFileSizeQueryFailedWithError(let url, let error): + return ( + "The system returned an error while attempting to fetch the file size from the " + + "provided URL.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartInputStreamCreationFailed(let url): + return "Failed to create an InputStream for the provided URL: \(url)" + case .outputStreamCreationFailed(let url): + return "Failed to create an OutputStream for URL: \(url)" + case .outputStreamFileAlreadyExists(let url): + return "A file already exists at the provided URL: \(url)" + case .outputStreamURLInvalid(let url): + return "The provided OutputStream URL is invalid: \(url)" + case .outputStreamWriteFailed(let error): + return "OutputStream write failed with error: \(error)" + case .inputStreamReadFailed(let error): + return "InputStream read failed with error: \(error)" + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var localizedDescription: String { + switch self { + case .inputDataNil: + return "Response could not be serialized, input data was nil." + case .inputDataNilOrZeroLength: + return "Response could not be serialized, input data was nil or zero length." + case .inputFileNil: + return "Response could not be serialized, input file was nil." + case .inputFileReadFailed(let url): + return "Response could not be serialized, input file could not be read: \(url)." + case .stringSerializationFailed(let encoding): + return "String could not be serialized with encoding: \(encoding)." + case .jsonSerializationFailed(let error): + return "JSON could not be serialized because of error:\n\(error.localizedDescription)" + case .propertyListSerializationFailed(let error): + return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.ResponseValidationFailureReason { + var localizedDescription: String { + switch self { + case .dataFileNil: + return "Response could not be validated, data file was nil." + case .dataFileReadFailed(let url): + return "Response could not be validated, data file could not be read: \(url)." + case .missingContentType(let types): + return ( + "Response Content-Type was missing and acceptable content types " + + "(\(types.joined(separator: ","))) do not match \"*/*\"." + ) + case .unacceptableContentType(let acceptableTypes, let responseType): + return ( + "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + + "\(acceptableTypes.joined(separator: ","))." + ) + case .unacceptableStatusCode(let code): + return "Response status code was unacceptable: \(code)." + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift new file mode 100644 index 000000000000..20c3672fbaf2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift @@ -0,0 +1,465 @@ +// +// Alamofire.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct +/// URL requests. +public protocol URLConvertible { + /// Returns a URL that conforms to RFC 2396 or throws an `Error`. + /// + /// - throws: An `Error` if the type cannot be converted to a `URL`. + /// + /// - returns: A URL or throws an `Error`. + func asURL() throws -> URL +} + +extension String: URLConvertible { + /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. + /// + /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } + return url + } +} + +extension URL: URLConvertible { + /// Returns self. + public func asURL() throws -> URL { return self } +} + +extension URLComponents: URLConvertible { + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. + /// + /// - throws: An `AFError.invalidURL` if `url` is `nil`. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = url else { throw AFError.invalidURL(url: self) } + return url + } +} + +// MARK: - + +/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. +public protocol URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + /// + /// - throws: An `Error` if the underlying `URLRequest` is `nil`. + /// + /// - returns: A URL request. + func asURLRequest() throws -> URLRequest +} + +extension URLRequestConvertible { + /// The URL request. + public var urlRequest: URLRequest? { return try? asURLRequest() } +} + +extension URLRequest: URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + public func asURLRequest() throws -> URLRequest { return self } +} + +// MARK: - + +extension URLRequest { + /// Creates an instance with the specified `method`, `urlString` and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The new `URLRequest` instance. + public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { + let url = try url.asURL() + + self.init(url: url) + + httpMethod = method.rawValue + + if let headers = headers { + for (headerField, headerValue) in headers { + setValue(headerValue, forHTTPHeaderField: headerField) + } + } + } + + func adapt(using adapter: RequestAdapter?) throws -> URLRequest { + guard let adapter = adapter else { return self } + return try adapter.adapt(self) + } +} + +// MARK: - Data Request + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding` and `headers`. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest +{ + return SessionManager.default.request( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers + ) +} + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest`. +/// +/// - parameter urlRequest: The URL request +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + return SessionManager.default.request(urlRequest) +} + +// MARK: - Download Request + +// MARK: URL Request + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers, + to: destination + ) +} + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter urlRequest: The URL request. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(urlRequest, to: destination) +} + +// MARK: Resume Data + +/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a +/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken +/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the +/// data is written incorrectly and will always fail to resume the download. For more information about the bug and +/// possible workarounds, please refer to the following Stack Overflow post: +/// +/// - http://stackoverflow.com/a/39347461/1342462 +/// +/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` +/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional +/// information. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(resumingWith: resumeData, to: destination) +} + +// MARK: - Upload Request + +// MARK: File + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) +} + +/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(fileURL, with: urlRequest) +} + +// MARK: Data + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(data, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(data, with: urlRequest) +} + +// MARK: InputStream + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `stream`. +/// +/// - parameter stream: The stream to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(stream, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `stream`. +/// +/// - parameter urlRequest: The URL request. +/// - parameter stream: The stream to upload. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(stream, with: urlRequest) +} + +// MARK: MultipartFormData + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls +/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + to: url, + method: method, + headers: headers, + encodingCompletion: encodingCompletion + ) +} + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and +/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter urlRequest: The URL request. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + encodingCompletion: encodingCompletion + ) +} + +#if !os(watchOS) + +// MARK: - Stream Request + +// MARK: Hostname and Port + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` +/// and `port`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter hostName: The hostname of the server to connect to. +/// - parameter port: The port of the server to connect to. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return SessionManager.default.stream(withHostName: hostName, port: port) +} + +// MARK: NetService + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter netService: The net service used to identify the endpoint. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(with netService: NetService) -> StreamRequest { + return SessionManager.default.stream(with: netService) +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift new file mode 100644 index 000000000000..a54673cca618 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift @@ -0,0 +1,37 @@ +// +// DispatchQueue+Alamofire.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Dispatch +import Foundation + +extension DispatchQueue { + static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } + static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } + static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } + static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } + + func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { + asyncAfter(deadline: .now() + delay, execute: closure) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift new file mode 100644 index 000000000000..b840138ccc15 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift @@ -0,0 +1,580 @@ +// +// MultipartFormData.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +#if os(iOS) || os(watchOS) || os(tvOS) +import MobileCoreServices +#elseif os(macOS) +import CoreServices +#endif + +/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode +/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead +/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the +/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for +/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. +/// +/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well +/// and the w3 form documentation. +/// +/// - https://www.ietf.org/rfc/rfc2388.txt +/// - https://www.ietf.org/rfc/rfc2045.txt +/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 +open class MultipartFormData { + + // MARK: - Helper Types + + struct EncodingCharacters { + static let crlf = "\r\n" + } + + struct BoundaryGenerator { + enum BoundaryType { + case initial, encapsulated, final + } + + static func randomBoundary() -> String { + return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) + } + + static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { + let boundaryText: String + + switch boundaryType { + case .initial: + boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" + case .encapsulated: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" + case .final: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" + } + + return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + } + + class BodyPart { + let headers: HTTPHeaders + let bodyStream: InputStream + let bodyContentLength: UInt64 + var hasInitialBoundary = false + var hasFinalBoundary = false + + init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { + self.headers = headers + self.bodyStream = bodyStream + self.bodyContentLength = bodyContentLength + } + } + + // MARK: - Properties + + /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" + + /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. + public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } + + /// The boundary used to separate the body parts in the encoded form data. + public var boundary: String + + private var bodyParts: [BodyPart] + private var bodyPartError: AFError? + private let streamBufferSize: Int + + // MARK: - Lifecycle + + /// Creates a multipart form data object. + /// + /// - returns: The multipart form data object. + public init() { + self.boundary = BoundaryGenerator.randomBoundary() + self.bodyParts = [] + + /// + /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more + /// information, please refer to the following article: + /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html + /// + + self.streamBufferSize = 1024 + } + + // MARK: - Body Parts + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + public func append(_ data: Data, withName name: String) { + let headers = contentHeaders(withName: name) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, mimeType: String) { + let headers = contentHeaders(withName: name, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the + /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the + /// system associated MIME type. + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + public func append(_ fileURL: URL, withName name: String) { + let fileName = fileURL.lastPathComponent + let pathExtension = fileURL.pathExtension + + if !fileName.isEmpty && !pathExtension.isEmpty { + let mime = mimeType(forPathExtension: pathExtension) + append(fileURL, withName: name, fileName: fileName, mimeType: mime) + } else { + setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) + } + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) + /// - Content-Type: #{mimeType} (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. + public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + + //============================================================ + // Check 1 - is file URL? + //============================================================ + + guard fileURL.isFileURL else { + setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) + return + } + + //============================================================ + // Check 2 - is file URL reachable? + //============================================================ + + do { + let isReachable = try fileURL.checkPromisedItemIsReachable() + guard isReachable else { + setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) + return + } + } catch { + setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 3 - is file URL a directory? + //============================================================ + + var isDirectory: ObjCBool = false + let path = fileURL.path + + guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { + setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) + return + } + + //============================================================ + // Check 4 - can the file size be extracted? + //============================================================ + + let bodyContentLength: UInt64 + + do { + guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { + setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) + return + } + + bodyContentLength = fileSize.uint64Value + } + catch { + setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 5 - can a stream be created from file URL? + //============================================================ + + guard let stream = InputStream(url: fileURL) else { + setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) + return + } + + append(stream, withLength: bodyContentLength, headers: headers) + } + + /// Creates a body part from the stream and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. + public func append( + _ stream: InputStream, + withLength length: UInt64, + name: String, + fileName: String, + mimeType: String) + { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - HTTP headers + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter headers: The HTTP headers for the body part. + public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { + let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) + bodyParts.append(bodyPart) + } + + // MARK: - Data Encoding + + /// Encodes all the appended body parts into a single `Data` value. + /// + /// It is important to note that this method will load all the appended body parts into memory all at the same + /// time. This method should only be used when the encoded data will have a small memory footprint. For large data + /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. + /// + /// - throws: An `AFError` if encoding encounters an error. + /// + /// - returns: The encoded `Data` if encoding is successful. + public func encode() throws -> Data { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + var encoded = Data() + + bodyParts.first?.hasInitialBoundary = true + bodyParts.last?.hasFinalBoundary = true + + for bodyPart in bodyParts { + let encodedData = try encode(bodyPart) + encoded.append(encodedData) + } + + return encoded + } + + /// Writes the appended body parts into the given file URL. + /// + /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, + /// this approach is very memory efficient and should be used for large body part data. + /// + /// - parameter fileURL: The file URL to write the multipart form data into. + /// + /// - throws: An `AFError` if encoding encounters an error. + public func writeEncodedData(to fileURL: URL) throws { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + if FileManager.default.fileExists(atPath: fileURL.path) { + throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) + } else if !fileURL.isFileURL { + throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) + } + + guard let outputStream = OutputStream(url: fileURL, append: false) else { + throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) + } + + outputStream.open() + defer { outputStream.close() } + + self.bodyParts.first?.hasInitialBoundary = true + self.bodyParts.last?.hasFinalBoundary = true + + for bodyPart in self.bodyParts { + try write(bodyPart, to: outputStream) + } + } + + // MARK: - Private - Body Part Encoding + + private func encode(_ bodyPart: BodyPart) throws -> Data { + var encoded = Data() + + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + encoded.append(initialData) + + let headerData = encodeHeaders(for: bodyPart) + encoded.append(headerData) + + let bodyStreamData = try encodeBodyStream(for: bodyPart) + encoded.append(bodyStreamData) + + if bodyPart.hasFinalBoundary { + encoded.append(finalBoundaryData()) + } + + return encoded + } + + private func encodeHeaders(for bodyPart: BodyPart) -> Data { + var headerText = "" + + for (key, value) in bodyPart.headers { + headerText += "\(key): \(value)\(EncodingCharacters.crlf)" + } + headerText += EncodingCharacters.crlf + + return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + + private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { + let inputStream = bodyPart.bodyStream + inputStream.open() + defer { inputStream.close() } + + var encoded = Data() + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let error = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) + } + + if bytesRead > 0 { + encoded.append(buffer, count: bytesRead) + } else { + break + } + } + + return encoded + } + + // MARK: - Private - Writing Body Part to Output Stream + + private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { + try writeInitialBoundaryData(for: bodyPart, to: outputStream) + try writeHeaderData(for: bodyPart, to: outputStream) + try writeBodyStream(for: bodyPart, to: outputStream) + try writeFinalBoundaryData(for: bodyPart, to: outputStream) + } + + private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + return try write(initialData, to: outputStream) + } + + private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let headerData = encodeHeaders(for: bodyPart) + return try write(headerData, to: outputStream) + } + + private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let inputStream = bodyPart.bodyStream + + inputStream.open() + defer { inputStream.close() } + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let streamError = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) + } + + if bytesRead > 0 { + if buffer.count != bytesRead { + buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { + let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) + + if let error = outputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) + } + + bytesToWrite -= bytesWritten + + if bytesToWrite > 0 { + buffer = Array(buffer[bytesWritten.. String { + if + let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), + let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() + { + return contentType as String + } + + return "application/octet-stream" + } + + // MARK: - Private - Content Headers + + private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { + var disposition = "form-data; name=\"\(name)\"" + if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } + + var headers = ["Content-Disposition": disposition] + if let mimeType = mimeType { headers["Content-Type"] = mimeType } + + return headers + } + + // MARK: - Private - Boundary Encoding + + private func initialBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) + } + + private func encapsulatedBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) + } + + private func finalBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) + } + + // MARK: - Private - Errors + + private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { + guard bodyPartError == nil else { return } + bodyPartError = AFError.multipartEncodingFailed(reason: reason) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift new file mode 100644 index 000000000000..398ca827c2b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -0,0 +1,238 @@ +// +// NetworkReachabilityManager.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#if !os(watchOS) + +import Foundation +import SystemConfiguration + +/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and +/// WiFi network interfaces. +/// +/// Reachability can be used to determine background information about why a network operation failed, or to retry +/// network requests when a connection is established. It should not be used to prevent a user from initiating a network +/// request, as it's possible that an initial request may be required to establish reachability. +open class NetworkReachabilityManager { + /// Defines the various states of network reachability. + /// + /// - unknown: It is unknown whether the network is reachable. + /// - notReachable: The network is not reachable. + /// - reachable: The network is reachable. + public enum NetworkReachabilityStatus { + case unknown + case notReachable + case reachable(ConnectionType) + } + + /// Defines the various connection types detected by reachability flags. + /// + /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. + /// - wwan: The connection type is a WWAN connection. + public enum ConnectionType { + case ethernetOrWiFi + case wwan + } + + /// A closure executed when the network reachability status changes. The closure takes a single argument: the + /// network reachability status. + public typealias Listener = (NetworkReachabilityStatus) -> Void + + // MARK: - Properties + + /// Whether the network is currently reachable. + open var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } + + /// Whether the network is currently reachable over the WWAN interface. + open var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } + + /// Whether the network is currently reachable over Ethernet or WiFi interface. + open var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } + + /// The current network reachability status. + open var networkReachabilityStatus: NetworkReachabilityStatus { + guard let flags = self.flags else { return .unknown } + return networkReachabilityStatusForFlags(flags) + } + + /// The dispatch queue to execute the `listener` closure on. + open var listenerQueue: DispatchQueue = DispatchQueue.main + + /// A closure executed when the network reachability status changes. + open var listener: Listener? + + open var flags: SCNetworkReachabilityFlags? { + var flags = SCNetworkReachabilityFlags() + + if SCNetworkReachabilityGetFlags(reachability, &flags) { + return flags + } + + return nil + } + + private let reachability: SCNetworkReachability + open var previousFlags: SCNetworkReachabilityFlags + + // MARK: - Initialization + + /// Creates a `NetworkReachabilityManager` instance with the specified host. + /// + /// - parameter host: The host used to evaluate network reachability. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?(host: String) { + guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } + self.init(reachability: reachability) + } + + /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. + /// + /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing + /// status of the device, both IPv4 and IPv6. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?() { + var address = sockaddr_in() + address.sin_len = UInt8(MemoryLayout.size) + address.sin_family = sa_family_t(AF_INET) + + guard let reachability = withUnsafePointer(to: &address, { pointer in + return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { + return SCNetworkReachabilityCreateWithAddress(nil, $0) + } + }) else { return nil } + + self.init(reachability: reachability) + } + + private init(reachability: SCNetworkReachability) { + self.reachability = reachability + + // Set the previous flags to an unreserved value to represent unknown status + self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30) + } + + deinit { + stopListening() + } + + // MARK: - Listening + + /// Starts listening for changes in network reachability status. + /// + /// - returns: `true` if listening was started successfully, `false` otherwise. + @discardableResult + open func startListening() -> Bool { + var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) + context.info = Unmanaged.passUnretained(self).toOpaque() + + let callbackEnabled = SCNetworkReachabilitySetCallback( + reachability, + { (_, flags, info) in + let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() + reachability.notifyListener(flags) + }, + &context + ) + + let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) + + listenerQueue.async { + self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30) + + guard let flags = self.flags else { return } + + self.notifyListener(flags) + } + + return callbackEnabled && queueEnabled + } + + /// Stops listening for changes in network reachability status. + open func stopListening() { + SCNetworkReachabilitySetCallback(reachability, nil, nil) + SCNetworkReachabilitySetDispatchQueue(reachability, nil) + } + + // MARK: - Internal - Listener Notification + + func notifyListener(_ flags: SCNetworkReachabilityFlags) { + guard previousFlags != flags else { return } + previousFlags = flags + + listener?(networkReachabilityStatusForFlags(flags)) + } + + // MARK: - Internal - Network Reachability Status + + func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { + guard isNetworkReachable(with: flags) else { return .notReachable } + + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) + + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif + + return networkStatus + } + + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) + + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) + } +} + +// MARK: - + +extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} + +/// Returns whether the two network reachability status values are equal. +/// +/// - parameter lhs: The left-hand side value to compare. +/// - parameter rhs: The right-hand side value to compare. +/// +/// - returns: `true` if the two values are equal, `false` otherwise. +public func ==( + lhs: NetworkReachabilityManager.NetworkReachabilityStatus, + rhs: NetworkReachabilityManager.NetworkReachabilityStatus) + -> Bool +{ + switch (lhs, rhs) { + case (.unknown, .unknown): + return true + case (.notReachable, .notReachable): + return true + case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): + return lhsConnectionType == rhsConnectionType + default: + return false + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift new file mode 100644 index 000000000000..e1ac31bf327e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift @@ -0,0 +1,55 @@ +// +// Notifications.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Notification.Name { + /// Used as a namespace for all `URLSessionTask` related notifications. + public struct Task { + /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. + public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") + + /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. + public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") + + /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. + public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") + + /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. + public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") + } +} + +// MARK: - + +extension Notification { + /// Used as a namespace for all `Notification` user info dictionary keys. + public struct Key { + /// User info dictionary key representing the `URLSessionTask` associated with the notification. + public static let Task = "org.alamofire.notification.key.task" + + /// User info dictionary key representing the responseData associated with the notification. + public static let ResponseData = "org.alamofire.notification.key.responseData" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift new file mode 100644 index 000000000000..6195809c5db9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift @@ -0,0 +1,483 @@ +// +// ParameterEncoding.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// HTTP method definitions. +/// +/// See https://tools.ietf.org/html/rfc7231#section-4.3 +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +// MARK: - + +/// A dictionary of parameters to apply to a `URLRequest`. +public typealias Parameters = [String: Any] + +/// A type used to define how a set of parameters are applied to a `URLRequest`. +public protocol ParameterEncoding { + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. + /// + /// - returns: The encoded request. + func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest +} + +// MARK: - + +/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP +/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as +/// the HTTP body depends on the destination of the encoding. +/// +/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to +/// `application/x-www-form-urlencoded; charset=utf-8`. +/// +/// There is no published specification for how to encode collection types. By default the convention of appending +/// `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for +/// nested dictionary values (`foo[bar]=baz`) is used. Optionally, `ArrayEncoding` can be used to omit the +/// square brackets appended to array keys. +/// +/// `BoolEncoding` can be used to configure how boolean values are encoded. The default behavior is to encode +/// `true` as 1 and `false` as 0. +public struct URLEncoding: ParameterEncoding { + + // MARK: Helper Types + + /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the + /// resulting URL request. + /// + /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` + /// requests and sets as the HTTP body for requests with any other HTTP method. + /// - queryString: Sets or appends encoded query string result to existing query string. + /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. + public enum Destination { + case methodDependent, queryString, httpBody + } + + /// Configures how `Array` parameters are encoded. + /// + /// - brackets: An empty set of square brackets is appended to the key for every value. + /// This is the default behavior. + /// - noBrackets: No brackets are appended. The key is encoded as is. + public enum ArrayEncoding { + case brackets, noBrackets + + func encode(key: String) -> String { + switch self { + case .brackets: + return "\(key)[]" + case .noBrackets: + return key + } + } + } + + /// Configures how `Bool` parameters are encoded. + /// + /// - numeric: Encode `true` as `1` and `false` as `0`. This is the default behavior. + /// - literal: Encode `true` and `false` as string literals. + public enum BoolEncoding { + case numeric, literal + + func encode(value: Bool) -> String { + switch self { + case .numeric: + return value ? "1" : "0" + case .literal: + return value ? "true" : "false" + } + } + } + + // MARK: Properties + + /// Returns a default `URLEncoding` instance. + public static var `default`: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.methodDependent` destination. + public static var methodDependent: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.queryString` destination. + public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } + + /// Returns a `URLEncoding` instance with an `.httpBody` destination. + public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } + + /// The destination defining where the encoded query string is to be applied to the URL request. + public let destination: Destination + + /// The encoding to use for `Array` parameters. + public let arrayEncoding: ArrayEncoding + + /// The encoding to use for `Bool` parameters. + public let boolEncoding: BoolEncoding + + // MARK: Initialization + + /// Creates a `URLEncoding` instance using the specified destination. + /// + /// - parameter destination: The destination defining where the encoded query string is to be applied. + /// - parameter arrayEncoding: The encoding to use for `Array` parameters. + /// - parameter boolEncoding: The encoding to use for `Bool` parameters. + /// + /// - returns: The new `URLEncoding` instance. + public init(destination: Destination = .methodDependent, arrayEncoding: ArrayEncoding = .brackets, boolEncoding: BoolEncoding = .numeric) { + self.destination = destination + self.arrayEncoding = arrayEncoding + self.boolEncoding = boolEncoding + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { + guard let url = urlRequest.url else { + throw AFError.parameterEncodingFailed(reason: .missingURL) + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) + urlComponents.percentEncodedQuery = percentEncodedQuery + urlRequest.url = urlComponents.url + } + } else { + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) + } + + return urlRequest + } + + /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. + /// + /// - parameter key: The key of the query component. + /// - parameter value: The value of the query component. + /// + /// - returns: The percent-escaped, URL encoded query string components. + public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { + var components: [(String, String)] = [] + + if let dictionary = value as? [String: Any] { + for (nestedKey, value) in dictionary { + components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) + } + } else if let array = value as? [Any] { + for value in array { + components += queryComponents(fromKey: arrayEncoding.encode(key: key), value: value) + } + } else if let value = value as? NSNumber { + if value.isBool { + components.append((escape(key), escape(boolEncoding.encode(value: value.boolValue)))) + } else { + components.append((escape(key), escape("\(value)"))) + } + } else if let bool = value as? Bool { + components.append((escape(key), escape(boolEncoding.encode(value: bool)))) + } else { + components.append((escape(key), escape("\(value)"))) + } + + return components + } + + /// Returns a percent-escaped string following RFC 3986 for a query string key or value. + /// + /// RFC 3986 states that the following characters are "reserved" characters. + /// + /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + /// + /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + /// should be percent-escaped in the query string. + /// + /// - parameter string: The string to be percent-escaped. + /// + /// - returns: The percent-escaped string. + public func escape(_ string: String) -> String { + let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 + let subDelimitersToEncode = "!$&'()*+,;=" + + var allowedCharacterSet = CharacterSet.urlQueryAllowed + allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") + + var escaped = "" + + //========================================================================================================== + // + // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few + // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no + // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more + // info, please refer to: + // + // - https://github.com/Alamofire/Alamofire/issues/206 + // + //========================================================================================================== + + if #available(iOS 8.3, *) { + escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string + } else { + let batchSize = 50 + var index = string.startIndex + + while index != string.endIndex { + let startIndex = index + let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex + let range = startIndex.. String { + var components: [(String, String)] = [] + + for key in parameters.keys.sorted(by: <) { + let value = parameters[key]! + components += queryComponents(fromKey: key, value: value) + } + return components.map { "\($0)=\($1)" }.joined(separator: "&") + } + + private func encodesParametersInURL(with method: HTTPMethod) -> Bool { + switch destination { + case .queryString: + return true + case .httpBody: + return false + default: + break + } + + switch method { + case .get, .head, .delete: + return true + default: + return false + } + } +} + +// MARK: - + +/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the +/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. +public struct JSONEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a `JSONEncoding` instance with default writing options. + public static var `default`: JSONEncoding { return JSONEncoding() } + + /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. + public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } + + /// The options for writing the parameters as JSON data. + public let options: JSONSerialization.WritingOptions + + // MARK: Initialization + + /// Creates a `JSONEncoding` instance using the specified options. + /// + /// - parameter options: The options for writing the parameters as JSON data. + /// + /// - returns: The new `JSONEncoding` instance. + public init(options: JSONSerialization.WritingOptions = []) { + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: parameters, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } + + /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. + /// + /// - parameter urlRequest: The request to apply the JSON object to. + /// - parameter jsonObject: The JSON object to apply to the request. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonObject = jsonObject else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the +/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header +/// field of an encoded request is set to `application/x-plist`. +public struct PropertyListEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a default `PropertyListEncoding` instance. + public static var `default`: PropertyListEncoding { return PropertyListEncoding() } + + /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. + public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } + + /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. + public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } + + /// The property list serialization format. + public let format: PropertyListSerialization.PropertyListFormat + + /// The options for writing the parameters as plist data. + public let options: PropertyListSerialization.WriteOptions + + // MARK: Initialization + + /// Creates a `PropertyListEncoding` instance using the specified format and options. + /// + /// - parameter format: The property list serialization format. + /// - parameter options: The options for writing the parameters as plist data. + /// + /// - returns: The new `PropertyListEncoding` instance. + public init( + format: PropertyListSerialization.PropertyListFormat = .xml, + options: PropertyListSerialization.WriteOptions = 0) + { + self.format = format + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try PropertyListSerialization.data( + fromPropertyList: parameters, + format: format, + options: options + ) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +extension NSNumber { + fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift new file mode 100644 index 000000000000..2be2ce0106fa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Request.swift @@ -0,0 +1,660 @@ +// +// Request.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. +public protocol RequestAdapter { + /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. + /// + /// - parameter urlRequest: The URL request to adapt. + /// + /// - throws: An `Error` if the adaptation encounters an error. + /// + /// - returns: The adapted `URLRequest`. + func adapt(_ urlRequest: URLRequest) throws -> URLRequest +} + +// MARK: - + +/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. +public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void + +/// A type that determines whether a request should be retried after being executed by the specified session manager +/// and encountering an error. +public protocol RequestRetrier { + /// Determines whether the `Request` should be retried by calling the `completion` closure. + /// + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs + /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly + /// cleaned up after. + /// + /// - parameter manager: The session manager the request was executed on. + /// - parameter request: The request that failed due to the encountered error. + /// - parameter error: The error encountered when executing the request. + /// - parameter completion: The completion closure to be executed when retry decision has been determined. + func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) +} + +// MARK: - + +protocol TaskConvertible { + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask +} + +/// A dictionary of headers to apply to a `URLRequest`. +public typealias HTTPHeaders = [String: String] + +// MARK: - + +/// Responsible for sending a request and receiving the response and associated data from the server, as well as +/// managing its underlying `URLSessionTask`. +open class Request { + + // MARK: Helper Types + + /// A closure executed when monitoring upload or download progress of a request. + public typealias ProgressHandler = (Progress) -> Void + + enum RequestTask { + case data(TaskConvertible?, URLSessionTask?) + case download(TaskConvertible?, URLSessionTask?) + case upload(TaskConvertible?, URLSessionTask?) + case stream(TaskConvertible?, URLSessionTask?) + } + + // MARK: Properties + + /// The delegate for the underlying task. + open internal(set) var delegate: TaskDelegate { + get { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + return taskDelegate + } + set { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + taskDelegate = newValue + } + } + + /// The underlying task. + open var task: URLSessionTask? { return delegate.task } + + /// The session belonging to the underlying task. + public let session: URLSession + + /// The request sent or to be sent to the server. + open var request: URLRequest? { return task?.originalRequest } + + /// The response received from the server, if any. + open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } + + /// The number of times the request has been retried. + open internal(set) var retryCount: UInt = 0 + + let originalTask: TaskConvertible? + + var startTime: CFAbsoluteTime? + var endTime: CFAbsoluteTime? + + var validations: [() -> Void] = [] + + private var taskDelegate: TaskDelegate + private var taskDelegateLock = NSLock() + + // MARK: Lifecycle + + init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { + self.session = session + + switch requestTask { + case .data(let originalTask, let task): + taskDelegate = DataTaskDelegate(task: task) + self.originalTask = originalTask + case .download(let originalTask, let task): + taskDelegate = DownloadTaskDelegate(task: task) + self.originalTask = originalTask + case .upload(let originalTask, let task): + taskDelegate = UploadTaskDelegate(task: task) + self.originalTask = originalTask + case .stream(let originalTask, let task): + taskDelegate = TaskDelegate(task: task) + self.originalTask = originalTask + } + + delegate.error = error + delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } + } + + // MARK: Authentication + + /// Associates an HTTP Basic credential with the request. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// - parameter persistence: The URL credential persistence. `.ForSession` by default. + /// + /// - returns: The request. + @discardableResult + open func authenticate( + user: String, + password: String, + persistence: URLCredential.Persistence = .forSession) + -> Self + { + let credential = URLCredential(user: user, password: password, persistence: persistence) + return authenticate(usingCredential: credential) + } + + /// Associates a specified credential with the request. + /// + /// - parameter credential: The credential. + /// + /// - returns: The request. + @discardableResult + open func authenticate(usingCredential credential: URLCredential) -> Self { + delegate.credential = credential + return self + } + + /// Returns a base64 encoded basic authentication credential as an authorization header tuple. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// + /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. + open class func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { + guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } + + let credential = data.base64EncodedString(options: []) + + return (key: "Authorization", value: "Basic \(credential)") + } + + // MARK: State + + /// Resumes the request. + open func resume() { + guard let task = task else { delegate.queue.isSuspended = false ; return } + + if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } + + task.resume() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidResume, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Suspends the request. + open func suspend() { + guard let task = task else { return } + + task.suspend() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidSuspend, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Cancels the request. + open func cancel() { + guard let task = task else { return } + + task.cancel() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } +} + +// MARK: - CustomStringConvertible + +extension Request: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as + /// well as the response status code if a response has been received. + open var description: String { + var components: [String] = [] + + if let HTTPMethod = request?.httpMethod { + components.append(HTTPMethod) + } + + if let urlString = request?.url?.absoluteString { + components.append(urlString) + } + + if let response = response { + components.append("(\(response.statusCode))") + } + + return components.joined(separator: " ") + } +} + +// MARK: - CustomDebugStringConvertible + +extension Request: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, in the form of a cURL command. + open var debugDescription: String { + return cURLRepresentation() + } + + func cURLRepresentation() -> String { + var components = ["$ curl -v"] + + guard let request = self.request, + let url = request.url, + let host = url.host + else { + return "$ curl command could not be created" + } + + if let httpMethod = request.httpMethod, httpMethod != "GET" { + components.append("-X \(httpMethod)") + } + + if let credentialStorage = self.session.configuration.urlCredentialStorage { + let protectionSpace = URLProtectionSpace( + host: host, + port: url.port ?? 0, + protocol: url.scheme, + realm: host, + authenticationMethod: NSURLAuthenticationMethodHTTPBasic + ) + + if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { + for credential in credentials { + guard let user = credential.user, let password = credential.password else { continue } + components.append("-u \(user):\(password)") + } + } else { + if let credential = delegate.credential, let user = credential.user, let password = credential.password { + components.append("-u \(user):\(password)") + } + } + } + + if session.configuration.httpShouldSetCookies { + if + let cookieStorage = session.configuration.httpCookieStorage, + let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty + { + let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } + + #if swift(>=3.2) + components.append("-b \"\(string[.. URLSessionTask { + do { + let urlRequest = try self.urlRequest.adapt(using: adapter) + return queue.sync { session.dataTask(with: urlRequest) } + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + if let requestable = originalTask as? Requestable { return requestable.urlRequest } + + return nil + } + + /// The progress of fetching the response data from the server for the request. + open var progress: Progress { return dataDelegate.progress } + + var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } + + // MARK: Stream + + /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. + /// + /// This closure returns the bytes most recently received from the server, not including data from previous calls. + /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is + /// also important to note that the server data in any `Response` object will be `nil`. + /// + /// - parameter closure: The code to be executed periodically during the lifecycle of the request. + /// + /// - returns: The request. + @discardableResult + open func stream(closure: ((Data) -> Void)? = nil) -> Self { + dataDelegate.dataStream = closure + return self + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + dataDelegate.progressHandler = (closure, queue) + return self + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. +open class DownloadRequest: Request { + + // MARK: Helper Types + + /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the + /// destination URL. + public struct DownloadOptions: OptionSet { + /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. + public let rawValue: UInt + + /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. + public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) + + /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. + public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) + + /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. + /// + /// - parameter rawValue: The raw bitmask value for the option. + /// + /// - returns: A new log level instance. + public init(rawValue: UInt) { + self.rawValue = rawValue + } + } + + /// A closure executed once a download request has successfully completed in order to determine where to move the + /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL + /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and + /// the options defining how the file should be moved. + public typealias DownloadFileDestination = ( + _ temporaryURL: URL, + _ response: HTTPURLResponse) + -> (destinationURL: URL, options: DownloadOptions) + + enum Downloadable: TaskConvertible { + case request(URLRequest) + case resumeData(Data) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .request(urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.downloadTask(with: urlRequest) } + case let .resumeData(resumeData): + task = queue.sync { session.downloadTask(withResumeData: resumeData) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { + return urlRequest + } + + return nil + } + + /// The resume data of the underlying download task if available after a failure. + open var resumeData: Data? { return downloadDelegate.resumeData } + + /// The progress of downloading the response data from the server for the request. + open var progress: Progress { return downloadDelegate.progress } + + var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } + + // MARK: State + + /// Cancels the request. + override open func cancel() { + cancel(createResumeData: true) + } + + /// Cancels the request. + /// + /// - parameter createResumeData: Determines whether resume data is created via the underlying download task or not. + open func cancel(createResumeData: Bool) { + if createResumeData { + downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } + } else { + downloadDelegate.downloadTask.cancel() + } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task as Any] + ) + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + downloadDelegate.progressHandler = (closure, queue) + return self + } + + // MARK: Destination + + /// Creates a download file destination closure which uses the default file manager to move the temporary file to a + /// file URL in the first available directory with the specified search path directory and search path domain mask. + /// + /// - parameter directory: The search path directory. `.DocumentDirectory` by default. + /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. + /// + /// - returns: A download file destination closure. + open class func suggestedDownloadDestination( + for directory: FileManager.SearchPathDirectory = .documentDirectory, + in domain: FileManager.SearchPathDomainMask = .userDomainMask) + -> DownloadFileDestination + { + return { temporaryURL, response in + let directoryURLs = FileManager.default.urls(for: directory, in: domain) + + if !directoryURLs.isEmpty { + return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) + } + + return (temporaryURL, []) + } + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. +open class UploadRequest: DataRequest { + + // MARK: Helper Types + + enum Uploadable: TaskConvertible { + case data(Data, URLRequest) + case file(URL, URLRequest) + case stream(InputStream, URLRequest) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .data(data, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, from: data) } + case let .file(url, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } + case let .stream(_, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + guard let uploadable = originalTask as? Uploadable else { return nil } + + switch uploadable { + case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): + return urlRequest + } + } + + /// The progress of uploading the payload to the server for the upload request. + open var uploadProgress: Progress { return uploadDelegate.uploadProgress } + + var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } + + // MARK: Upload Progress + + /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to + /// the server. + /// + /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress + /// of data being read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is sent to the server. + /// + /// - returns: The request. + @discardableResult + open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + uploadDelegate.uploadProgressHandler = (closure, queue) + return self + } +} + +// MARK: - + +#if !os(watchOS) + +/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +open class StreamRequest: Request { + enum Streamable: TaskConvertible { + case stream(hostName: String, port: Int) + case netService(NetService) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + let task: URLSessionTask + + switch self { + case let .stream(hostName, port): + task = queue.sync { session.streamTask(withHostName: hostName, port: port) } + case let .netService(netService): + task = queue.sync { session.streamTask(with: netService) } + } + + return task + } + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift new file mode 100644 index 000000000000..747a471a55ba --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Response.swift @@ -0,0 +1,567 @@ +// +// Response.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to store all data associated with an non-serialized response of a data or upload request. +public struct DefaultDataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDataResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - data: The data returned by the server. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.data = data + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a data or upload request. +public struct DataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter data: The data returned by the server. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DataResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.data = data + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the server data, the response serialization result and the timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[Data]: \(data?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DataResponse { + /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result + /// value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's + /// result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let withMyError = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `DataResponse` instance containing the result of the transform. + public func mapError(_ transform: (Error) -> E) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.mapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `DataResponse` instance containing the result of the transform. + public func flatMapError(_ transform: (Error) throws -> E) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +/// Used to store all data associated with an non-serialized response of a download request. +public struct DefaultDownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDownloadResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - temporaryURL: The temporary destination URL of the data returned from the server. + /// - destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - resumeData: The resume data generated if the request was cancelled. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a download request. +public struct DownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. + /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - parameter resumeData: The resume data generated if the request was cancelled. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DownloadResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the temporary and destination URLs, the resume data, the response serialization result and the + /// timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") + output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") + output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DownloadResponse { + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this + /// instance's result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let withMyError = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `DownloadResponse` instance containing the result of the transform. + public func mapError(_ transform: (Error) -> E) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.mapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `DownloadResponse` instance containing the result of the transform. + public func flatMapError(_ transform: (Error) throws -> E) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +protocol Response { + /// The task metrics containing the request / response statistics. + var _metrics: AnyObject? { get set } + mutating func add(_ metrics: AnyObject?) +} + +extension Response { + mutating func add(_ metrics: AnyObject?) { + #if !os(watchOS) + guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } + guard let metrics = metrics as? URLSessionTaskMetrics else { return } + + _metrics = metrics + #endif + } +} + +// MARK: - + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift new file mode 100644 index 000000000000..9cc105a82057 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift @@ -0,0 +1,715 @@ +// +// ResponseSerialization.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The type in which all data response serializers must conform to in order to serialize a response. +public protocol DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DataResponseSerializer: DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - + +/// The type in which all download response serializers must conform to in order to serialize a response. +public protocol DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - Timeline + +extension Request { + var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() + let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() + let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime + + return Timeline( + requestStartTime: requestStartTime, + initialResponseTime: initialResponseTime, + requestCompletedTime: requestCompletedTime, + serializationCompletedTime: CFAbsoluteTimeGetCurrent() + ) + } +} + +// MARK: - Default + +extension DataRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var dataResponse = DefaultDataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + error: self.delegate.error, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + completionHandler(dataResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.delegate.data, + self.delegate.error + ) + + var dataResponse = DataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + result: result, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } + } + + return self + } +} + +extension DownloadRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DefaultDownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var downloadResponse = DefaultDownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + error: self.downloadDelegate.error, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + completionHandler(downloadResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data contained in the destination url. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.downloadDelegate.fileURL, + self.downloadDelegate.error + ) + + var downloadResponse = DownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + result: result, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } + } + + return self + } +} + +// MARK: - Data + +extension Request { + /// Returns a result data type that contains the response data as-is. + /// + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + return .success(validData) + } +} + +extension DataRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseData(response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseData(response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +// MARK: - String + +extension Request { + /// Returns a result string type initialized from the response data with the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseString( + encoding: String.Encoding?, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + var convertedEncoding = encoding + + if let encodingName = response?.textEncodingName as CFString?, convertedEncoding == nil { + convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( + CFStringConvertIANACharSetNameToEncoding(encodingName)) + ) + } + + let actualEncoding = convertedEncoding ?? .isoLatin1 + + if let string = String(data: validData, encoding: actualEncoding) { + return .success(string) + } else { + return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +// MARK: - JSON + +extension Request { + /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` + /// with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseJSON( + options: JSONSerialization.ReadingOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let json = try JSONSerialization.jsonObject(with: validData, options: options) + return .success(json) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +// MARK: - Property List + +extension Request { + /// Returns a plist object contained in a result type constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponsePropertyList( + options: PropertyListSerialization.ReadOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) + return .success(plist) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +/// A set of HTTP response status code that do not contain response data. +private let emptyDataStatusCodes: Set = [204, 205] diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift new file mode 100644 index 000000000000..e0928089ab73 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Result.swift @@ -0,0 +1,300 @@ +// +// Result.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to represent whether a request was successful or encountered an error. +/// +/// - success: The request and all post processing operations were successful resulting in the serialization of the +/// provided associated value. +/// +/// - failure: The request encountered an error resulting in a failure. The associated values are the original data +/// provided by the server as well as the error that caused the failure. +public enum Result { + case success(Value) + case failure(Error) + + /// Returns `true` if the result is a success, `false` otherwise. + public var isSuccess: Bool { + switch self { + case .success: + return true + case .failure: + return false + } + } + + /// Returns `true` if the result is a failure, `false` otherwise. + public var isFailure: Bool { + return !isSuccess + } + + /// Returns the associated value if the result is a success, `nil` otherwise. + public var value: Value? { + switch self { + case .success(let value): + return value + case .failure: + return nil + } + } + + /// Returns the associated error value if the result is a failure, `nil` otherwise. + public var error: Error? { + switch self { + case .success: + return nil + case .failure(let error): + return error + } + } +} + +// MARK: - CustomStringConvertible + +extension Result: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + switch self { + case .success: + return "SUCCESS" + case .failure: + return "FAILURE" + } + } +} + +// MARK: - CustomDebugStringConvertible + +extension Result: CustomDebugStringConvertible { + /// The debug textual representation used when written to an output stream, which includes whether the result was a + /// success or failure in addition to the value or error. + public var debugDescription: String { + switch self { + case .success(let value): + return "SUCCESS: \(value)" + case .failure(let error): + return "FAILURE: \(error)" + } + } +} + +// MARK: - Functional APIs + +extension Result { + /// Creates a `Result` instance from the result of a closure. + /// + /// A failure result is created when the closure throws, and a success result is created when the closure + /// succeeds without throwing an error. + /// + /// func someString() throws -> String { ... } + /// + /// let result = Result(value: { + /// return try someString() + /// }) + /// + /// // The type of result is Result + /// + /// The trailing closure syntax is also supported: + /// + /// let result = Result { try someString() } + /// + /// - parameter value: The closure to execute and create the result for. + public init(value: () throws -> Value) { + do { + self = try .success(value()) + } catch { + self = .failure(error) + } + } + + /// Returns the success value, or throws the failure error. + /// + /// let possibleString: Result = .success("success") + /// try print(possibleString.unwrap()) + /// // Prints "success" + /// + /// let noString: Result = .failure(error) + /// try print(noString.unwrap()) + /// // Throws error + public func unwrap() throws -> Value { + switch self { + case .success(let value): + return value + case .failure(let error): + throw error + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: Result = .success(Data()) + /// let possibleInt = possibleData.map { $0.count } + /// try print(possibleInt.unwrap()) + /// // Prints "0" + /// + /// let noData: Result = .failure(error) + /// let noInt = noData.map { $0.count } + /// try print(noInt.unwrap()) + /// // Throws error + /// + /// - parameter transform: A closure that takes the success value of the `Result` instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func map(_ transform: (Value) -> T) -> Result { + switch self { + case .success(let value): + return .success(transform(value)) + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func flatMap(_ transform: (Value) throws -> T) -> Result { + switch self { + case .success(let value): + do { + return try .success(transform(value)) + } catch { + return .failure(error) + } + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) throws -> Void) rethrows -> Result { + if case let .success(value) = self { try closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) throws -> Void) rethrows -> Result { + if case let .failure(error) = self { try closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () throws -> Void) rethrows -> Result { + if isSuccess { try closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () throws -> Void) rethrows -> Result { + if isFailure { try closure() } + + return self + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift new file mode 100644 index 000000000000..dea099e257ab --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift @@ -0,0 +1,307 @@ +// +// ServerTrustPolicy.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. +open class ServerTrustPolicyManager { + /// The dictionary of policies mapped to a particular host. + public let policies: [String: ServerTrustPolicy] + + /// Initializes the `ServerTrustPolicyManager` instance with the given policies. + /// + /// Since different servers and web services can have different leaf certificates, intermediate and even root + /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This + /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key + /// pinning for host3 and disabling evaluation for host4. + /// + /// - parameter policies: A dictionary of all policies mapped to a particular host. + /// + /// - returns: The new `ServerTrustPolicyManager` instance. + public init(policies: [String: ServerTrustPolicy]) { + self.policies = policies + } + + /// Returns the `ServerTrustPolicy` for the given host if applicable. + /// + /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override + /// this method and implement more complex mapping implementations such as wildcards. + /// + /// - parameter host: The host to use when searching for a matching policy. + /// + /// - returns: The server trust policy for the given host if found. + open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { + return policies[host] + } +} + +// MARK: - + +extension URLSession { + private struct AssociatedKeys { + static var managerKey = "URLSession.ServerTrustPolicyManager" + } + + var serverTrustPolicyManager: ServerTrustPolicyManager? { + get { + return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager + } + set (manager) { + objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + } + } +} + +// MARK: - ServerTrustPolicy + +/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when +/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust +/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. +/// +/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other +/// vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged +/// to route all communication over an HTTPS connection with pinning enabled. +/// +/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to +/// validate the host provided by the challenge. Applications are encouraged to always +/// validate the host in production environments to guarantee the validity of the server's +/// certificate chain. +/// +/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to +/// validate the host provided by the challenge as well as specify the revocation flags for +/// testing for revoked certificates. Apple platforms did not start testing for revoked +/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is +/// demonstrated in our TLS tests. Applications are encouraged to always validate the host +/// in production environments to guarantee the validity of the server's certificate chain. +/// +/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is +/// considered valid if one of the pinned certificates match one of the server certificates. +/// By validating both the certificate chain and host, certificate pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered +/// valid if one of the pinned public keys match one of the server certificate public keys. +/// By validating both the certificate chain and host, public key pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. +/// +/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. +public enum ServerTrustPolicy { + case performDefaultEvaluation(validateHost: Bool) + case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) + case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) + case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) + case disableEvaluation + case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) + + // MARK: - Bundle Location + + /// Returns all certificates within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `.cer` files. + /// + /// - returns: All certificates within the given bundle. + public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { + var certificates: [SecCertificate] = [] + + let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in + bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) + }.joined()) + + for path in paths { + if + let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, + let certificate = SecCertificateCreateWithData(nil, certificateData) + { + certificates.append(certificate) + } + } + + return certificates + } + + /// Returns all public keys within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `*.cer` files. + /// + /// - returns: All public keys within the given bundle. + public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for certificate in certificates(in: bundle) { + if let publicKey = publicKey(for: certificate) { + publicKeys.append(publicKey) + } + } + + return publicKeys + } + + // MARK: - Evaluation + + /// Evaluates whether the server trust is valid for the given host. + /// + /// - parameter serverTrust: The server trust to evaluate. + /// - parameter host: The host of the challenge protection space. + /// + /// - returns: Whether the server trust is valid. + public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { + var serverTrustIsValid = false + + switch self { + case let .performDefaultEvaluation(validateHost): + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .performRevokedEvaluation(validateHost, revocationFlags): + let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) + SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) + SecTrustSetAnchorCertificatesOnly(serverTrust, true) + + serverTrustIsValid = trustIsValid(serverTrust) + } else { + let serverCertificatesDataArray = certificateData(for: serverTrust) + let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) + + outerLoop: for serverCertificateData in serverCertificatesDataArray { + for pinnedCertificateData in pinnedCertificatesDataArray { + if serverCertificateData == pinnedCertificateData { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): + var certificateChainEvaluationPassed = true + + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + certificateChainEvaluationPassed = trustIsValid(serverTrust) + } + + if certificateChainEvaluationPassed { + outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { + for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { + if serverPublicKey.isEqual(pinnedPublicKey) { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case .disableEvaluation: + serverTrustIsValid = true + case let .customEvaluation(closure): + serverTrustIsValid = closure(serverTrust, host) + } + + return serverTrustIsValid + } + + // MARK: - Private - Trust Validation + + private func trustIsValid(_ trust: SecTrust) -> Bool { + var isValid = false + + var result = SecTrustResultType.invalid + let status = SecTrustEvaluate(trust, &result) + + if status == errSecSuccess { + let unspecified = SecTrustResultType.unspecified + let proceed = SecTrustResultType.proceed + + + isValid = result == unspecified || result == proceed + } + + return isValid + } + + // MARK: - Private - Certificate Data + + private func certificateData(for trust: SecTrust) -> [Data] { + var certificates: [SecCertificate] = [] + + for index in 0.. [Data] { + return certificates.map { SecCertificateCopyData($0) as Data } + } + + // MARK: - Private - Public Key Extraction + + private static func publicKeys(for trust: SecTrust) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for index in 0.. SecKey? { + var publicKey: SecKey? + + let policy = SecPolicyCreateBasicX509() + var trust: SecTrust? + let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) + + if let trust = trust, trustCreationStatus == errSecSuccess { + publicKey = SecTrustCopyPublicKey(trust) + } + + return publicKey + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift new file mode 100644 index 000000000000..4964f1eebfd7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift @@ -0,0 +1,725 @@ +// +// SessionDelegate.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for handling all delegate callbacks for the underlying session. +open class SessionDelegate: NSObject { + + // MARK: URLSessionDelegate Overrides + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. + open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. + open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. + open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? + + // MARK: URLSessionTaskDelegate Overrides + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. + open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. + open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. + open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and + /// requires the caller to call the `completionHandler`. + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. + open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. + open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? + + // MARK: URLSessionDataDelegate Overrides + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. + open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. + open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. + open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. + open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? + + // MARK: URLSessionDownloadDelegate Overrides + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. + open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. + open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. + open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + // MARK: URLSessionStreamDelegate Overrides + +#if !os(watchOS) + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskReadClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskWriteClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskBetterRouteDiscovered = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { + get { + return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void + } + set { + _streamTaskDidBecomeInputStream = newValue + } + } + + var _streamTaskReadClosed: Any? + var _streamTaskWriteClosed: Any? + var _streamTaskBetterRouteDiscovered: Any? + var _streamTaskDidBecomeInputStream: Any? + +#endif + + // MARK: Properties + + var retrier: RequestRetrier? + weak var sessionManager: SessionManager? + + var requests: [Int: Request] = [:] + private let lock = NSLock() + + /// Access the task delegate for the specified task in a thread-safe manner. + open subscript(task: URLSessionTask) -> Request? { + get { + lock.lock() ; defer { lock.unlock() } + return requests[task.taskIdentifier] + } + set { + lock.lock() ; defer { lock.unlock() } + requests[task.taskIdentifier] = newValue + } + } + + // MARK: Lifecycle + + /// Initializes the `SessionDelegate` instance. + /// + /// - returns: The new `SessionDelegate` instance. + public override init() { + super.init() + } + + // MARK: NSObject Overrides + + /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond + /// to a specified message. + /// + /// - parameter selector: A selector that identifies a message. + /// + /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. + open override func responds(to selector: Selector) -> Bool { + #if !os(macOS) + if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { + return sessionDidFinishEventsForBackgroundURLSession != nil + } + #endif + + #if !os(watchOS) + if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { + switch selector { + case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): + return streamTaskReadClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): + return streamTaskWriteClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): + return streamTaskBetterRouteDiscovered != nil + case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): + return streamTaskDidBecomeInputAndOutputStreams != nil + default: + break + } + } + #endif + + switch selector { + case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): + return sessionDidBecomeInvalidWithError != nil + case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): + return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) + case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): + return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) + case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): + return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) + default: + return type(of: self).instancesRespond(to: selector) + } + } +} + +// MARK: - URLSessionDelegate + +extension SessionDelegate: URLSessionDelegate { + /// Tells the delegate that the session has been invalidated. + /// + /// - parameter session: The session object that was invalidated. + /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. + open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { + sessionDidBecomeInvalidWithError?(session, error) + } + + /// Requests credentials from the delegate in response to a session-level authentication request from the + /// remote server. + /// + /// - parameter session: The session containing the task that requested authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard sessionDidReceiveChallengeWithCompletion == nil else { + sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) + return + } + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { + (disposition, credential) = sessionDidReceiveChallenge(session, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } + + completionHandler(disposition, credential) + } + +#if !os(macOS) + + /// Tells the delegate that all messages enqueued for a session have been delivered. + /// + /// - parameter session: The session that no longer has any outstanding requests. + open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { + sessionDidFinishEventsForBackgroundURLSession?(session) + } + +#endif +} + +// MARK: - URLSessionTaskDelegate + +extension SessionDelegate: URLSessionTaskDelegate { + /// Tells the delegate that the remote server requested an HTTP redirect. + /// + /// - parameter session: The session containing the task whose request resulted in a redirect. + /// - parameter task: The task whose request resulted in a redirect. + /// - parameter response: An object containing the server’s response to the original request. + /// - parameter request: A URL request object filled out with the new location. + /// - parameter completionHandler: A closure that your handler should call with either the value of the request + /// parameter, a modified URL request object, or NULL to refuse the redirect and + /// return the body of the redirect response. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + guard taskWillPerformHTTPRedirectionWithCompletion == nil else { + taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) + return + } + + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + /// Requests credentials from the delegate in response to an authentication request from the remote server. + /// + /// - parameter session: The session containing the task whose request requires authentication. + /// - parameter task: The task whose request requires authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard taskDidReceiveChallengeWithCompletion == nil else { + taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) + return + } + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + let result = taskDidReceiveChallenge(session, task, challenge) + completionHandler(result.0, result.1) + } else if let delegate = self[task]?.delegate { + delegate.urlSession( + session, + task: task, + didReceive: challenge, + completionHandler: completionHandler + ) + } else { + urlSession(session, didReceive: challenge, completionHandler: completionHandler) + } + } + + /// Tells the delegate when a task requires a new request body stream to send to the remote server. + /// + /// - parameter session: The session containing the task that needs a new body stream. + /// - parameter task: The task that needs a new body stream. + /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + guard taskNeedNewBodyStreamWithCompletion == nil else { + taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) + return + } + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + completionHandler(taskNeedNewBodyStream(session, task)) + } else if let delegate = self[task]?.delegate { + delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) + } + } + + /// Periodically informs the delegate of the progress of sending body content to the server. + /// + /// - parameter session: The session containing the data task. + /// - parameter task: The data task. + /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. + /// - parameter totalBytesSent: The total number of bytes sent so far. + /// - parameter totalBytesExpectedToSend: The expected length of the body data. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { + delegate.URLSession( + session, + task: task, + didSendBodyData: bytesSent, + totalBytesSent: totalBytesSent, + totalBytesExpectedToSend: totalBytesExpectedToSend + ) + } + } + +#if !os(watchOS) + + /// Tells the delegate that the session finished collecting metrics for the task. + /// + /// - parameter session: The session collecting the metrics. + /// - parameter task: The task whose metrics have been collected. + /// - parameter metrics: The collected metrics. + @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) + @objc(URLSession:task:didFinishCollectingMetrics:) + open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { + self[task]?.delegate.metrics = metrics + } + +#endif + + /// Tells the delegate that the task finished transferring data. + /// + /// - parameter session: The session containing the task whose request finished transferring data. + /// - parameter task: The task whose request finished transferring data. + /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. + open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + /// Executed after it is determined that the request is not going to be retried + let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in + guard let strongSelf = self else { return } + + strongSelf.taskDidComplete?(session, task, error) + + strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) + + var userInfo: [String: Any] = [Notification.Key.Task: task] + + if let data = (strongSelf[task]?.delegate as? DataTaskDelegate)?.data { + userInfo[Notification.Key.ResponseData] = data + } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidComplete, + object: strongSelf, + userInfo: userInfo + ) + + strongSelf[task] = nil + } + + guard let request = self[task], let sessionManager = sessionManager else { + completeTask(session, task, error) + return + } + + // Run all validations on the request before checking if an error occurred + request.validations.forEach { $0() } + + // Determine whether an error has occurred + var error: Error? = error + + if request.delegate.error != nil { + error = request.delegate.error + } + + /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request + /// should be retried. Otherwise, complete the task by notifying the task delegate. + if let retrier = retrier, let error = error { + retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in + guard shouldRetry else { completeTask(session, task, error) ; return } + + DispatchQueue.utility.after(timeDelay) { [weak self] in + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false + + if retrySucceeded, let task = request.task { + strongSelf[task] = request + return + } else { + completeTask(session, task, error) + } + } + } + } else { + completeTask(session, task, error) + } + } +} + +// MARK: - URLSessionDataDelegate + +extension SessionDelegate: URLSessionDataDelegate { + /// Tells the delegate that the data task received the initial reply (headers) from the server. + /// + /// - parameter session: The session containing the data task that received an initial reply. + /// - parameter dataTask: The data task that received an initial reply. + /// - parameter response: A URL response object populated with headers. + /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a + /// constant to indicate whether the transfer should continue as a data task or + /// should become a download task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + guard dataTaskDidReceiveResponseWithCompletion == nil else { + dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) + return + } + + var disposition: URLSession.ResponseDisposition = .allow + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + /// Tells the delegate that the data task was changed to a download task. + /// + /// - parameter session: The session containing the task that was replaced by a download task. + /// - parameter dataTask: The data task that was replaced by a download task. + /// - parameter downloadTask: The new download task that replaced the data task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { + dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) + } else { + self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) + } + } + + /// Tells the delegate that the data task has received some of the expected data. + /// + /// - parameter session: The session containing the data task that provided data. + /// - parameter dataTask: The data task that provided data. + /// - parameter data: A data object containing the transferred data. + open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession(session, dataTask: dataTask, didReceive: data) + } + } + + /// Asks the delegate whether the data (or upload) task should store the response in the cache. + /// + /// - parameter session: The session containing the data (or upload) task. + /// - parameter dataTask: The data (or upload) task. + /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current + /// caching policy and the values of certain received headers, such as the Pragma + /// and Cache-Control headers. + /// - parameter completionHandler: A block that your handler must call, providing either the original proposed + /// response, a modified version of that response, or NULL to prevent caching the + /// response. If your delegate implements this method, it must call this completion + /// handler; otherwise, your app leaks memory. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + guard dataTaskWillCacheResponseWithCompletion == nil else { + dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) + return + } + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession( + session, + dataTask: dataTask, + willCacheResponse: proposedResponse, + completionHandler: completionHandler + ) + } else { + completionHandler(proposedResponse) + } + } +} + +// MARK: - URLSessionDownloadDelegate + +extension SessionDelegate: URLSessionDownloadDelegate { + /// Tells the delegate that a download task has finished downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that finished. + /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either + /// open the file for reading or move it to a permanent location in your app’s sandbox + /// container directory before returning from this delegate method. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { + downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) + } + } + + /// Periodically informs the delegate about the download’s progress. + /// + /// - parameter session: The session containing the download task. + /// - parameter downloadTask: The download task. + /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate + /// method was called. + /// - parameter totalBytesWritten: The total number of bytes transferred so far. + /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length + /// header. If this header was not provided, the value is + /// `NSURLSessionTransferSizeUnknown`. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didWriteData: bytesWritten, + totalBytesWritten: totalBytesWritten, + totalBytesExpectedToWrite: totalBytesExpectedToWrite + ) + } + } + + /// Tells the delegate that the download task has resumed downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. + /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the + /// existing content, then this value is zero. Otherwise, this value is an + /// integer representing the number of bytes on disk that do not need to be + /// retrieved again. + /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. + /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didResumeAtOffset: fileOffset, + expectedTotalBytes: expectedTotalBytes + ) + } + } +} + +// MARK: - URLSessionStreamDelegate + +#if !os(watchOS) + +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +extension SessionDelegate: URLSessionStreamDelegate { + /// Tells the delegate that the read side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { + streamTaskReadClosed?(session, streamTask) + } + + /// Tells the delegate that the write side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { + streamTaskWriteClosed?(session, streamTask) + } + + /// Tells the delegate that the system has determined that a better route to the host is available. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { + streamTaskBetterRouteDiscovered?(session, streamTask) + } + + /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + /// - parameter inputStream: The new input stream. + /// - parameter outputStream: The new output stream. + open func urlSession( + _ session: URLSession, + streamTask: URLSessionStreamTask, + didBecome inputStream: InputStream, + outputStream: OutputStream) + { + streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift new file mode 100644 index 000000000000..02c36a76b7b4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift @@ -0,0 +1,899 @@ +// +// SessionManager.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. +open class SessionManager { + + // MARK: - Helper Types + + /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as + /// associated values. + /// + /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with + /// streaming information. + /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding + /// error. + public enum MultipartFormDataEncodingResult { + case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) + case failure(Error) + } + + // MARK: - Properties + + /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use + /// directly for any ad hoc requests. + public static let `default`: SessionManager = { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders + + return SessionManager(configuration: configuration) + }() + + /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. + public static let defaultHTTPHeaders: HTTPHeaders = { + // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 + let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" + + // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + + // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 + // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` + let userAgent: String = { + if let info = Bundle.main.infoDictionary { + let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" + let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" + let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" + let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" + + let osNameVersion: String = { + let version = ProcessInfo.processInfo.operatingSystemVersion + let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" + + let osName: String = { + #if os(iOS) + return "iOS" + #elseif os(watchOS) + return "watchOS" + #elseif os(tvOS) + return "tvOS" + #elseif os(macOS) + return "OS X" + #elseif os(Linux) + return "Linux" + #else + return "Unknown" + #endif + }() + + return "\(osName) \(versionString)" + }() + + let alamofireVersion: String = { + guard + let afInfo = Bundle(for: SessionManager.self).infoDictionary, + let build = afInfo["CFBundleShortVersionString"] + else { return "Unknown" } + + return "Alamofire/\(build)" + }() + + return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" + } + + return "Alamofire" + }() + + return [ + "Accept-Encoding": acceptEncoding, + "Accept-Language": acceptLanguage, + "User-Agent": userAgent + ] + }() + + /// Default memory threshold used when encoding `MultipartFormData` in bytes. + public static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 + + /// The underlying session. + public let session: URLSession + + /// The session delegate handling all the task and session delegate callbacks. + public let delegate: SessionDelegate + + /// Whether to start requests immediately after being constructed. `true` by default. + open var startRequestsImmediately: Bool = true + + /// The request adapter called each time a new request is created. + open var adapter: RequestAdapter? + + /// The request retrier called each time a request encounters an error to determine whether to retry the request. + open var retrier: RequestRetrier? { + get { return delegate.retrier } + set { delegate.retrier = newValue } + } + + /// The background completion handler closure provided by the UIApplicationDelegate + /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background + /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation + /// will automatically call the handler. + /// + /// If you need to handle your own events before the handler is called, then you need to override the + /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. + /// + /// `nil` by default. + open var backgroundCompletionHandler: (() -> Void)? + + let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) + + // MARK: - Lifecycle + + /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter configuration: The configuration used to construct the managed session. + /// `URLSessionConfiguration.default` by default. + /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by + /// default. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance. + public init( + configuration: URLSessionConfiguration = URLSessionConfiguration.default, + delegate: SessionDelegate = SessionDelegate(), + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + self.delegate = delegate + self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter session: The URL session. + /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. + public init?( + session: URLSession, + delegate: SessionDelegate, + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + guard delegate === session.delegate else { return nil } + + self.delegate = delegate + self.session = session + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { + session.serverTrustPolicyManager = serverTrustPolicyManager + + delegate.sessionManager = self + + delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in + guard let strongSelf = self else { return } + DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } + } + } + + deinit { + session.invalidateAndCancel() + } + + // MARK: - Data Request + + /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` + /// and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest + { + var originalRequest: URLRequest? + + do { + originalRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) + return request(encodedURLRequest) + } catch { + return request(originalRequest, failedWith: error) + } + } + + /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + var originalRequest: URLRequest? + + do { + originalRequest = try urlRequest.asURLRequest() + let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) + + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + let request = DataRequest(session: session, requestTask: .data(originalTask, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return request(originalRequest, failedWith: error) + } + } + + // MARK: Private - Request Implementation + + private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { + var requestTask: Request.RequestTask = .data(nil, nil) + + if let urlRequest = urlRequest { + let originalTask = DataRequest.Requestable(urlRequest: urlRequest) + requestTask = .data(originalTask, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: request, with: underlyingError) + } else { + if startRequestsImmediately { request.resume() } + } + + return request + } + + // MARK: - Download Request + + // MARK: URL Request + + /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, + /// `headers` and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) + return download(encodedURLRequest, to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save + /// them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try urlRequest.asURLRequest() + return download(.request(urlRequest), to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + // MARK: Resume Data + + /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve + /// the contents of the original request and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken + /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the + /// data is written incorrectly and will always fail to resume the download. For more information about the bug and + /// possible workarounds, please refer to the following Stack Overflow post: + /// + /// - http://stackoverflow.com/a/39347461/1342462 + /// + /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` + /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for + /// additional information. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + return download(.resumeData(resumeData), to: destination) + } + + // MARK: Private - Download Implementation + + private func download( + _ downloadable: DownloadRequest.Downloadable, + to destination: DownloadRequest.DownloadFileDestination?) + -> DownloadRequest + { + do { + let task = try downloadable.task(session: session, adapter: adapter, queue: queue) + let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) + + download.downloadDelegate.destination = destination + + delegate[task] = download + + if startRequestsImmediately { download.resume() } + + return download + } catch { + return download(downloadable, to: destination, failedWith: error) + } + } + + private func download( + _ downloadable: DownloadRequest.Downloadable?, + to destination: DownloadRequest.DownloadFileDestination?, + failedWith error: Error) + -> DownloadRequest + { + var downloadTask: Request.RequestTask = .download(nil, nil) + + if let downloadable = downloadable { + downloadTask = .download(downloadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + + let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) + download.downloadDelegate.destination = destination + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: download, with: underlyingError) + } else { + if startRequestsImmediately { download.resume() } + } + + return download + } + + // MARK: - Upload Request + + // MARK: File + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(fileURL, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.file(fileURL, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: Data + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(data, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.data(data, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: InputStream + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(stream, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.stream(stream, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: MultipartFormData + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `url`, `method` and `headers`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + queue: DispatchQueue? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + + return upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + queue: queue, + encodingCompletion: encodingCompletion + ) + } catch { + (queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) } + } + } + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `urlRequest`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter urlRequest: The URL request. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + queue: DispatchQueue? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + DispatchQueue.global(qos: .utility).async { + let formData = MultipartFormData() + multipartFormData(formData) + + var tempFileURL: URL? + + do { + var urlRequestWithContentType = try urlRequest.asURLRequest() + urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") + + let isBackgroundSession = self.session.configuration.identifier != nil + + if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { + let data = try formData.encode() + + let encodingResult = MultipartFormDataEncodingResult.success( + request: self.upload(data, with: urlRequestWithContentType), + streamingFromDisk: false, + streamFileURL: nil + ) + + (queue ?? DispatchQueue.main).async { encodingCompletion?(encodingResult) } + } else { + let fileManager = FileManager.default + let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) + let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") + let fileName = UUID().uuidString + let fileURL = directoryURL.appendingPathComponent(fileName) + + tempFileURL = fileURL + + var directoryError: Error? + + // Create directory inside serial queue to ensure two threads don't do this in parallel + self.queue.sync { + do { + try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) + } catch { + directoryError = error + } + } + + if let directoryError = directoryError { throw directoryError } + + try formData.writeEncodedData(to: fileURL) + + let upload = self.upload(fileURL, with: urlRequestWithContentType) + + // Cleanup the temp file once the upload is complete + upload.delegate.queue.addOperation { + do { + try FileManager.default.removeItem(at: fileURL) + } catch { + // No-op + } + } + + (queue ?? DispatchQueue.main).async { + let encodingResult = MultipartFormDataEncodingResult.success( + request: upload, + streamingFromDisk: true, + streamFileURL: fileURL + ) + + encodingCompletion?(encodingResult) + } + } + } catch { + // Cleanup the temp file in the event that the multipart form data encoding failed + if let tempFileURL = tempFileURL { + do { + try FileManager.default.removeItem(at: tempFileURL) + } catch { + // No-op + } + } + + (queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) } + } + } + } + + // MARK: Private - Upload Implementation + + private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { + do { + let task = try uploadable.task(session: session, adapter: adapter, queue: queue) + let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) + + if case let .stream(inputStream, _) = uploadable { + upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } + } + + delegate[task] = upload + + if startRequestsImmediately { upload.resume() } + + return upload + } catch { + return upload(uploadable, failedWith: error) + } + } + + private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { + var uploadTask: Request.RequestTask = .upload(nil, nil) + + if let uploadable = uploadable { + uploadTask = .upload(uploadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: upload, with: underlyingError) + } else { + if startRequestsImmediately { upload.resume() } + } + + return upload + } + +#if !os(watchOS) + + // MARK: - Stream Request + + // MARK: Hostname and Port + + /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter hostName: The hostname of the server to connect to. + /// - parameter port: The port of the server to connect to. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return stream(.stream(hostName: hostName, port: port)) + } + + // MARK: NetService + + /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter netService: The net service used to identify the endpoint. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(with netService: NetService) -> StreamRequest { + return stream(.netService(netService)) + } + + // MARK: Private - Stream Implementation + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { + do { + let task = try streamable.task(session: session, adapter: adapter, queue: queue) + let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return stream(failedWith: error) + } + } + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(failedWith error: Error) -> StreamRequest { + let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) + if startRequestsImmediately { stream.resume() } + return stream + } + +#endif + + // MARK: - Internal - Retry Request + + func retry(_ request: Request) -> Bool { + guard let originalTask = request.originalTask else { return false } + + do { + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + + if let originalTask = request.task { + delegate[originalTask] = nil // removes the old request to avoid endless growth + } + + request.delegate.task = task // resets all task delegate data + + request.retryCount += 1 + request.startTime = CFAbsoluteTimeGetCurrent() + request.endTime = nil + + task.resume() + + return true + } catch { + request.delegate.error = error.underlyingAdaptError ?? error + return false + } + } + + private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { + DispatchQueue.utility.async { [weak self] in + guard let strongSelf = self else { return } + + retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in + guard let strongSelf = self else { return } + + guard shouldRetry else { + if strongSelf.startRequestsImmediately { request.resume() } + return + } + + DispatchQueue.utility.after(timeDelay) { + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.retry(request) + + if retrySucceeded, let task = request.task { + strongSelf.delegate[task] = request + } else { + if strongSelf.startRequestsImmediately { request.resume() } + } + } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift new file mode 100644 index 000000000000..5705737e49d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift @@ -0,0 +1,466 @@ +// +// TaskDelegate.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as +/// executing all operations attached to the serial operation queue upon task completion. +open class TaskDelegate: NSObject { + + // MARK: Properties + + /// The serial operation queue used to execute all operations after the task completes. + public let queue: OperationQueue + + /// The data returned by the server. + public var data: Data? { return nil } + + /// The error generated throughout the lifecyle of the task. + public var error: Error? + + var task: URLSessionTask? { + set { + taskLock.lock(); defer { taskLock.unlock() } + _task = newValue + } + get { + taskLock.lock(); defer { taskLock.unlock() } + return _task + } + } + + var initialResponseTime: CFAbsoluteTime? + var credential: URLCredential? + var metrics: AnyObject? // URLSessionTaskMetrics + + private var _task: URLSessionTask? { + didSet { reset() } + } + + private let taskLock = NSLock() + + // MARK: Lifecycle + + init(task: URLSessionTask?) { + _task = task + + self.queue = { + let operationQueue = OperationQueue() + + operationQueue.maxConcurrentOperationCount = 1 + operationQueue.isSuspended = true + operationQueue.qualityOfService = .utility + + return operationQueue + }() + } + + func reset() { + error = nil + initialResponseTime = nil + } + + // MARK: URLSessionTaskDelegate + + var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? + + @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + @objc(URLSession:task:didReceiveChallenge:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } + + @objc(URLSession:task:needNewBodyStream:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + var bodyStream: InputStream? + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + bodyStream = taskNeedNewBodyStream(session, task) + } + + completionHandler(bodyStream) + } + + @objc(URLSession:task:didCompleteWithError:) + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + if let taskDidCompleteWithError = taskDidCompleteWithError { + taskDidCompleteWithError(session, task, error) + } else { + if let error = error { + if self.error == nil { self.error = error } + + if + let downloadDelegate = self as? DownloadTaskDelegate, + let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data + { + downloadDelegate.resumeData = resumeData + } + } + + queue.isSuspended = false + } + } +} + +// MARK: - + +class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { + + // MARK: Properties + + var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } + + override var data: Data? { + if dataStream != nil { + return nil + } else { + return mutableData + } + } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var dataStream: ((_ data: Data) -> Void)? + + private var totalBytesReceived: Int64 = 0 + private var mutableData: Data + + private var expectedContentLength: Int64? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + mutableData = Data() + progress = Progress(totalUnitCount: 0) + + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + totalBytesReceived = 0 + mutableData = Data() + expectedContentLength = nil + } + + // MARK: URLSessionDataDelegate + + var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + var disposition: URLSession.ResponseDisposition = .allow + + expectedContentLength = response.expectedContentLength + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) + } + + func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else { + if let dataStream = dataStream { + dataStream(data) + } else { + mutableData.append(data) + } + + let bytesReceived = Int64(data.count) + totalBytesReceived += bytesReceived + let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown + + progress.totalUnitCount = totalBytesExpected + progress.completedUnitCount = totalBytesReceived + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + var cachedResponse: CachedURLResponse? = proposedResponse + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) + } + + completionHandler(cachedResponse) + } +} + +// MARK: - + +class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { + + // MARK: Properties + + var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var resumeData: Data? + override var data: Data? { return resumeData } + + var destination: DownloadRequest.DownloadFileDestination? + + var temporaryURL: URL? + var destinationURL: URL? + + var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + progress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + resumeData = nil + } + + // MARK: URLSessionDownloadDelegate + + var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? + var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + temporaryURL = location + + guard + let destination = destination, + let response = downloadTask.response as? HTTPURLResponse + else { return } + + let result = destination(location, response) + let destinationURL = result.destinationURL + let options = result.options + + self.destinationURL = destinationURL + + do { + if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { + try FileManager.default.removeItem(at: destinationURL) + } + + if options.contains(.createIntermediateDirectories) { + let directory = destinationURL.deletingLastPathComponent() + try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) + } + + try FileManager.default.moveItem(at: location, to: destinationURL) + } catch { + self.error = error + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData( + session, + downloadTask, + bytesWritten, + totalBytesWritten, + totalBytesExpectedToWrite + ) + } else { + progress.totalUnitCount = totalBytesExpectedToWrite + progress.completedUnitCount = totalBytesWritten + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else { + progress.totalUnitCount = expectedTotalBytes + progress.completedUnitCount = fileOffset + } + } +} + +// MARK: - + +class UploadTaskDelegate: DataTaskDelegate { + + // MARK: Properties + + var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } + + var uploadProgress: Progress + var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + uploadProgress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + uploadProgress = Progress(totalUnitCount: 0) + } + + // MARK: URLSessionTaskDelegate + + var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + func URLSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else { + uploadProgress.totalUnitCount = totalBytesExpectedToSend + uploadProgress.completedUnitCount = totalBytesSent + + if let uploadProgressHandler = uploadProgressHandler { + uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift new file mode 100644 index 000000000000..596c1bdc41f9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift @@ -0,0 +1,136 @@ +// +// Timeline.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. +public struct Timeline { + /// The time the request was initialized. + public let requestStartTime: CFAbsoluteTime + + /// The time the first bytes were received from or sent to the server. + public let initialResponseTime: CFAbsoluteTime + + /// The time when the request was completed. + public let requestCompletedTime: CFAbsoluteTime + + /// The time when the response serialization was completed. + public let serializationCompletedTime: CFAbsoluteTime + + /// The time interval in seconds from the time the request started to the initial response from the server. + public let latency: TimeInterval + + /// The time interval in seconds from the time the request started to the time the request completed. + public let requestDuration: TimeInterval + + /// The time interval in seconds from the time the request completed to the time response serialization completed. + public let serializationDuration: TimeInterval + + /// The time interval in seconds from the time the request started to the time response serialization completed. + public let totalDuration: TimeInterval + + /// Creates a new `Timeline` instance with the specified request times. + /// + /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. + /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. + /// Defaults to `0.0`. + /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. + /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults + /// to `0.0`. + /// + /// - returns: The new `Timeline` instance. + public init( + requestStartTime: CFAbsoluteTime = 0.0, + initialResponseTime: CFAbsoluteTime = 0.0, + requestCompletedTime: CFAbsoluteTime = 0.0, + serializationCompletedTime: CFAbsoluteTime = 0.0) + { + self.requestStartTime = requestStartTime + self.initialResponseTime = initialResponseTime + self.requestCompletedTime = requestCompletedTime + self.serializationCompletedTime = serializationCompletedTime + + self.latency = initialResponseTime - requestStartTime + self.requestDuration = requestCompletedTime - requestStartTime + self.serializationDuration = serializationCompletedTime - requestCompletedTime + self.totalDuration = serializationCompletedTime - requestStartTime + } +} + +// MARK: - CustomStringConvertible + +extension Timeline: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the latency, the request + /// duration and the total duration. + public var description: String { + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} + +// MARK: - CustomDebugStringConvertible + +extension Timeline: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes the request start time, the + /// initial response time, the request completed time, the serialization completed time, the latency, the request + /// duration and the total duration. + public var debugDescription: String { + let requestStartTime = String(format: "%.3f", self.requestStartTime) + let initialResponseTime = String(format: "%.3f", self.initialResponseTime) + let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) + let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Request Start Time\": " + requestStartTime, + "\"Initial Response Time\": " + initialResponseTime, + "\"Request Completed Time\": " + requestCompletedTime, + "\"Serialization Completed Time\": " + serializationCompletedTime, + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift new file mode 100644 index 000000000000..59e0bbb2b0e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift @@ -0,0 +1,321 @@ +// +// Validation.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Request { + + // MARK: Helper Types + + fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason + + /// Used to represent whether validation was successful or encountered an error resulting in a failure. + /// + /// - success: The validation was successful. + /// - failure: The validation failed encountering the provided error. + public enum ValidationResult { + case success + case failure(Error) + } + + fileprivate struct MIMEType { + let type: String + let subtype: String + + var isWildcard: Bool { return type == "*" && subtype == "*" } + + init?(_ string: String) { + let components: [String] = { + let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) + + #if swift(>=3.2) + let split = stripped[..<(stripped.range(of: ";")?.lowerBound ?? stripped.endIndex)] + #else + let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) + #endif + + return split.components(separatedBy: "/") + }() + + if let type = components.first, let subtype = components.last { + self.type = type + self.subtype = subtype + } else { + return nil + } + } + + func matches(_ mime: MIMEType) -> Bool { + switch (type, subtype) { + case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): + return true + default: + return false + } + } + } + + // MARK: Properties + + fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } + + fileprivate var acceptableContentTypes: [String] { + if let accept = request?.value(forHTTPHeaderField: "Accept") { + return accept.components(separatedBy: ",") + } + + return ["*/*"] + } + + // MARK: Status Code + + fileprivate func validate( + statusCode acceptableStatusCodes: S, + response: HTTPURLResponse) + -> ValidationResult + where S.Iterator.Element == Int + { + if acceptableStatusCodes.contains(response.statusCode) { + return .success + } else { + let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) + return .failure(AFError.responseValidationFailed(reason: reason)) + } + } + + // MARK: Content Type + + fileprivate func validate( + contentType acceptableContentTypes: S, + response: HTTPURLResponse, + data: Data?) + -> ValidationResult + where S.Iterator.Element == String + { + guard let data = data, data.count > 0 else { return .success } + + guard + let responseContentType = response.mimeType, + let responseMIMEType = MIMEType(responseContentType) + else { + for contentType in acceptableContentTypes { + if let mimeType = MIMEType(contentType), mimeType.isWildcard { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } + + for contentType in acceptableContentTypes { + if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .unacceptableContentType( + acceptableContentTypes: Array(acceptableContentTypes), + responseContentType: responseContentType + ) + + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } +} + +// MARK: - + +extension DataRequest { + /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the + /// request was valid. + public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(self.request, response, self.delegate.data) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, data in + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + let contentTypes = { [unowned self] in + self.acceptableContentTypes + } + return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes()) + } +} + +// MARK: - + +extension DownloadRequest { + /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a + /// destination URL, and returns whether the request was valid. + public typealias Validation = ( + _ request: URLRequest?, + _ response: HTTPURLResponse, + _ temporaryURL: URL?, + _ destinationURL: URL?) + -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + let request = self.request + let temporaryURL = self.downloadDelegate.temporaryURL + let destinationURL = self.downloadDelegate.destinationURL + + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(request, response, temporaryURL, destinationURL) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, _, _ in + let fileURL = self.downloadDelegate.fileURL + + guard let validFileURL = fileURL else { + return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) + } + + do { + let data = try Data(contentsOf: validFileURL) + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } catch { + return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) + } + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + let contentTypes = { [unowned self] in + self.acceptableContentTypes + } + return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes()) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json new file mode 100644 index 000000000000..6c368e72337b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -0,0 +1,26 @@ +{ + "name": "PetstoreClient", + "platforms": { + "ios": "9.0", + "osx": "10.11", + "tvos": "9.0" + }, + "version": "1.0.0", + "source": { + "git": "git@github.com:OpenAPITools/openapi-generator.git", + "tag": "v1.0.0" + }, + "authors": "", + "license": "Proprietary", + "homepage": "https://github.com/openapitools/openapi-generator", + "summary": "PetstoreClient", + "source_files": "PetstoreClient/Classes/**/*.swift", + "dependencies": { + "PromiseKit/CorePromise": [ + "~> 4.4.0" + ], + "Alamofire": [ + "~> 4.9.0" + ] + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock new file mode 100644 index 000000000000..355d4c9f5f0d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Manifest.lock @@ -0,0 +1,27 @@ +PODS: + - Alamofire (4.9.0) + - PetstoreClient (1.0.0): + - Alamofire (~> 4.9.0) + - PromiseKit/CorePromise (~> 4.4.0) + - PromiseKit/CorePromise (4.4.4) + +DEPENDENCIES: + - PetstoreClient (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - PromiseKit + +EXTERNAL SOURCES: + PetstoreClient: + :path: "../" + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + PetstoreClient: 16d0f56d050fe19acef55197555f60526cf4a71b + PromiseKit: 6178219c4c7457ae90d7d8b34b7ac5eb36916519 + +PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d + +COCOAPODS: 1.6.1 diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..6e4730ff2e60 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,1651 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 02CB7A74792FE71D55618B1FD68A84F2 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = 92066FF1F08D20558637C2DF4F007414 /* TypeHolderDefault.swift */; }; + 059D92B7BBFBEC53E9A3B6E11C5C3B3A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01B6740A1E78009ED5880C768EDAD9DB /* Response.swift */; }; + 091CC6D7CFF9374E41B1C6CB19B0E97B /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3D9FB4070F34ECD420ACB66E1938430 /* APIs.swift */; }; + 0A39AF55285A3A4F7CBABB6D822FA4A3 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B8873E6FA376A1098653C8957A9CD8A /* Alamofire.swift */; }; + 0AB631DF2E9BC76B8736C9EFF6191C0B /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0CD12250A91D4CBC55393495F06775B2 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 706EA1E33802DC5002C4619F94BC8C99 /* JSONEncodableEncoding.swift */; }; + 0F5999FD4C7B20C99945D1766DCE1E1C /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 48D66D7CC32AD262384136A281A3F8D1 /* Alamofire.framework */; }; + 13E3586ABCE7938EB3CC6D51BAD31B42 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04FA8D90CF4B9585A67B86642BA750E /* User.swift */; }; + 17CBDD207E1B25F63A3E1823BC03B675 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D20359CE0E73D6BC8E83D987C902D2E /* Foundation.framework */; }; + 1B20892D757F702E6AE23072F5E15D04 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D20359CE0E73D6BC8E83D987C902D2E /* Foundation.framework */; }; + 1C035F0DFD555DC8249BE265F89C3071 /* PromiseKit-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4E1844EB7E5BB13D3E0EB4144A87D867 /* PromiseKit-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 1D29D2ACADF961F69D32B06FA6A09E28 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D047C054BDCF57647A210CA210568D0 /* Notifications.swift */; }; + 24406F8A6355B7BEC2B072D3B17ECD47 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 863792E6E9405D9FA494ED8635CE6C0B /* Model200Response.swift */; }; + 26DD5BC612DBFC51C9A2EC25AF219566 /* fwd.h in Headers */ = {isa = PBXBuildFile; fileRef = F0E666A2F03AB68FDC1E79B74A41E0C2 /* fwd.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 28A9B496DBCD33380CC3D4CC155F524E /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39B0696CC11BF8EA7FDEC30C719FABC2 /* Models.swift */; }; + 2CDAC18FCB90313EFA1B02A75C83E0EE /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDADBC0BB257C4A516773B0ECA96196 /* AnotherFakeAPI.swift */; }; + 2E29AA764BF206DE155112E5BC4939E8 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9B71ED5DCF22D2A22499C3DA4D41762 /* Name.swift */; }; + 317719762D81596E1DD4BC4786311DF5 /* when.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F38E2E2D4911E1D04FABA2223BD7688 /* when.m */; }; + 355C18EEC82624A06A6CC93965258E33 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C72D782FD3C5EEE8E525751B6D4DDB8 /* Request.swift */; }; + 3593A7A85BE6F92BC7BEA765C89B1076 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A5A74AC7AF5B77CA1BD76B82062D5D3 /* PetAPI.swift */; }; + 36C038AE1EFBD5D95D3B3102A737DFDE /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7295C7D32B7C8F2805DB5D2F3D732F60 /* OuterComposite.swift */; }; + 39CFC0AF6016C70C5EA5345DFE44FEB4 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */; }; + 3B14FC1EA44225994453AA123F4262D0 /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABBBF50FA7E854657BDB01185C7DE324 /* XmlItem.swift */; }; + 3BD1DAFE1F3E6C9E4EB0F2099B6D6FA2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D20359CE0E73D6BC8E83D987C902D2E /* Foundation.framework */; }; + 3E0749AF6C51BCF0E4A41CF1D6A76FED /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51A86D1C0C7700196DC16755F82D031B /* DispatchQueue+Alamofire.swift */; }; + 40AE1B240B27734094AB39EACA233A0D /* Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE73527DDD3B6ACE1DC5B450D1392B2A /* Promise.swift */; }; + 410EC2309E393CB88C39529E7CF18811 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9EC4A49FB365F7019625F4C1BBCB292 /* FakeAPI.swift */; }; + 47E148EE42FDCD51C69EA7EB322496BD /* join.swift in Sources */ = {isa = PBXBuildFile; fileRef = 057172115AF48E3DCA451233A4A640D4 /* join.swift */; }; + 4D4DCE405773A7673D0199A93FE9DE62 /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04F4D33B469C31ECB943475DBFB00CBB /* Dog.swift */; }; + 51909107FAE52A0D1C8AE11B65DE08E7 /* after.m in Sources */ = {isa = PBXBuildFile; fileRef = 7A10AF8E314E52BF5F7CD27303878027 /* after.m */; }; + 526815FE7172F8568A44A8F4D9139970 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D69622D72C7F771C350E30C30020EC /* SpecialModelName.swift */; }; + 5C5EA546013E597E3D52DD83B5C92D13 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97A2C094645F6A60D5A7F4E894EE23BD /* UserAPI.swift */; }; + 5CAA0F2AB773CCD6E62848CC02470C8E /* dispatch_promise.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A06291A67C87943DA0BB177E1BB5DC0 /* dispatch_promise.m */; }; + 60B6C2A003864AAD3A426448152F67BE /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F7C3F0D5E6C5A6A1BB66A132C7D958 /* Timeline.swift */; }; + 636C75AD8D045A1687F83CA89AF49A86 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9475C74C195567107086633A4D262E6 /* Capitalization.swift */; }; + 64B570EF5C1FF1379F8036D8FCCB63EF /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4A146F2131F799FABD6835B1CFDD347 /* StoreAPI.swift */; }; + 67D2462106E9DB4C3D16D5F521C99250 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9919E54A07648F68B8B5639C3D37053F /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + 687C2F140C3AFB4F2FA5147EF9790F1D /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 6AF9A6069796DA5834FEEAFD7221874F /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 999653E1FEB8493AD6E227418DFE96D4 /* Return.swift */; }; + 6B598CD6C3665D587BD8EDE6202EA593 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D20359CE0E73D6BC8E83D987C902D2E /* Foundation.framework */; }; + 6C2E4B236C0831BEF971D9F43E41401D /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7D20359CE0E73D6BC8E83D987C902D2E /* Foundation.framework */; }; + 6EFD003458AE7F689DEA720A2030C261 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3A009E375554819534829616F49D733C /* ResponseSerialization.swift */; }; + 6FACE6A9C43083DBB5033317AFF9AE31 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = D59752DB0583557ED0A103929DE7D1C9 /* ArrayOfNumberOnly.swift */; }; + 6FC066D0A7B565C871A65F540E37735F /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F9A53FCDA869FFF602D9C9B68A25226 /* MapTest.swift */; }; + 6FDC9E3B9907CF35FC038BD79A7DE2AC /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9A41207BF0E0F1116EFF3A7520E4F30 /* Animal.swift */; }; + 700D3D95AF9520CB227846DFD943A2DA /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45296D9EFD89DCB6A902D002A70E234F /* ParameterEncoding.swift */; }; + 726DCC0BBB21F735986DF5C9F3DCBEF6 /* PromiseKit-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 8146A56E871C702178198F216CD8B080 /* PromiseKit-dummy.m */; }; + 73AB05789A4982944AF68DBD013E3EB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72572B944808AC7C4854543BC132DFD8 /* NetworkReachabilityManager.swift */; }; + 772911DA6E33D1CBBC30131B7C8BDBB3 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 146F60360CAB9CAF5A98D361FE0762CC /* Alamofire-dummy.m */; }; + 77A253AD92BDAF5465031F9225A13F8D /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C868C2F462554B7E170F490CC96D9129 /* OuterEnum.swift */; }; + 77E8F0EB9FFBE2E3EB0C77095C644606 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2A2E212CE2309CAC426DE24D621FDC4 /* TaskDelegate.swift */; }; + 7A00D62842DD238AC0457B7743459143 /* AnyPromise.h in Headers */ = {isa = PBXBuildFile; fileRef = 7D7EC36638E4AB5C51EE2A9196D7E586 /* AnyPromise.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 7B14AABEA6084A6CAAD77F02D700A436 /* GlobalState.m in Sources */ = {isa = PBXBuildFile; fileRef = 9C7EEAA52CAEFE414144646859D19BF6 /* GlobalState.m */; }; + 7B847086909F16338E32D2290866777C /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = F06C0DAD6966724111ECC6015B132A10 /* List.swift */; }; + 7C0B7D57C5FED546B89AF6A45F276C36 /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC9640039255992199037E6E249CD4BA /* TypeHolderExample.swift */; }; + 7D3B1A7247A69E34E48CED53C5145C34 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C65DCB83B644ABFF723D9EDA2FB9E0C /* PetstoreClient-dummy.m */; }; + 7E3538A6992A38276764936A9733493D /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77A2E5CCDF5F8198ACB62180A77E07C2 /* AFError.swift */; }; + 8012A57CFFC574F745FBA46D335BBA6F /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */; }; + 8766DA6D3446770DAAF3D68E154E61BD /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62DA94E0DEA0A35F82AB7D9B8D7FA79F /* EnumTest.swift */; }; + 87D949C0631CC0CB929C69CA7D925B14 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AAB640C655ED6CF3F5D5C2314B9FB6B /* FakeClassnameTags123API.swift */; }; + 8D2A6A90A6DDAF75EA52D471258545CC /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = B55431698AE115B7B9BB79A1D53B02AF /* ServerTrustPolicy.swift */; }; + 8D53C0725D4DE490174105C56C981189 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FBAE8AD90A56C780F6620DBED839BA6 /* Pet.swift */; }; + 8F063138AEB0CBD41F723D7C8C6C9A1C /* after.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2C82B8D4ECBBD48AE25659F2AEBFED8 /* after.swift */; }; + 8FC55DB96BAADB3B12B0DAB26332E40A /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 861B9982272479ABE4C4C559BFA8B0F6 /* FileSchemaTestClass.swift */; }; + 910364E886094608091F77F9DBF1AE2E /* DispatchQueue+Promise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 848CDB5C465B1E04DF5158F07B83EE6B /* DispatchQueue+Promise.swift */; }; + 975E21814E0F788DF6A6E5DE986229E6 /* PromiseKit.h in Headers */ = {isa = PBXBuildFile; fileRef = ADA8ECE65CA8BD73FABB353F0DBAA212 /* PromiseKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 9A30D9B1EE2D5A3AC76AE389E0520352 /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11D9A9B2DA688589C27C7E886C45C6A0 /* Cat.swift */; }; + 9B72FB26EC959DD96FDBB044A9C3C525 /* join.m in Sources */ = {isa = PBXBuildFile; fileRef = 91CB8ACD285957E691D4B962FB4D995B /* join.m */; }; + 9D8C37EA1313F9BBDD200D8FCB93CCFA /* AnyPromise.m in Sources */ = {isa = PBXBuildFile; fileRef = 7FA863F5D3ACE15F4B0EB8D1E74927ED /* AnyPromise.m */; }; + 9FBC90C0E307ADB8CD2F3CF5C0D3C8EE /* Zalgo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A7DCCAD07BACD1357F077BCA314A6D /* Zalgo.swift */; }; + A1EC41966B261DCE460BCDE5124A1DBE /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9E25BFB027008543966243CC338E08E /* SessionDelegate.swift */; }; + A64FF2ED84938912BA601B01121B8E23 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9E89ABCCC57336F89BD5C8BB5B4872B /* Order.swift */; }; + AA56769D8733D3F3E7976742D5ABA998 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83D18CAC667F7E35D9B8E620072ED4D7 /* Validation.swift */; }; + ABDB6B2BD6587F48ADD190B84019CDD7 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A381312D61E3EA2806B6FAD90B3BEE94 /* PromiseKit.framework */; }; + AEA829AB1A8AF2AD077A808AED6B178A /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2ED731C536593898FB5674BF6A7DC86 /* MultipartFormData.swift */; }; + B394CD18FC054147A348F808EAC8139A /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D7E4D001368609BA573263A283441DD /* AlamofireImplementations.swift */; }; + B433389CCA40FDC6A02956C940F80112 /* State.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D9F269A5D0FA67A43F1F5D94F26D1B /* State.swift */; }; + B4A2386087F99886C5CC944C2A5B58C7 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB771F553FC5BEE61938D2B61CDA2CDF /* NumberOnly.swift */; }; + B511D9CED36E092C88AB629C511BD1E7 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 421C2470DDB7AF4A716391E4E9BA4602 /* Category.swift */; }; + B645EC01163024890ADE8D5C9EAF8EE5 /* hang.m in Sources */ = {isa = PBXBuildFile; fileRef = C42B10EE07C66F6B51BBEB51046AB299 /* hang.m */; }; + B652075D043B2D37A0B1FA649065FC3F /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5CFB3D593ECA1A24451987289C9B395 /* StringBooleanMap.swift */; }; + B67DB5083264B8C8896D3DF3F5FE2E20 /* wrap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 38E040842BCDCCB56DA8C4C1E77A905E /* wrap.swift */; }; + B6F6E4CC26451E91B59FAE0F6841DC1F /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = CD82F46EEBDF3CDC0F371A13742C7C00 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + BA93909A110EB66F7167C3B326A5D2B0 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DDE9C75E8809A86C87F1EF6BE5A7262 /* AdditionalPropertiesClass.swift */; }; + BC5A794B04B4DEA6F0473FD3E8952BDC /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54113FF25263A7207B4695B993005157 /* EnumClass.swift */; }; + BE5BBDF15A7C0C9CF88A0268815B8202 /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 683B7D10FA5B9F3523A5976092B503D2 /* JSONEncodingHelper.swift */; }; + BF0B6C073FB6099B4BB906527BFA43FD /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FB9EC1A94087BEE99F46EDC560EF076 /* ArrayOfArrayOfNumberOnly.swift */; }; + BF7C810E194570D018B13127190459E5 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAD186DA30C241B56CD1BE298604BBC5 /* AnimalFarm.swift */; }; + BFB77FC4FC5E7D0680CE25025D0F818F /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8F7E93BB98A2DE82741AB7E95364E2E3 /* FormatTest.swift */; }; + C0887203727473C7A8A9084437976426 /* when.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC9EA3D1DFE57CA229F3C7E3F3737154 /* when.swift */; }; + C1245D0FDDA57F8CEAA283B028D09D09 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = D2595AC2F6A360B57A8D3D63C239BA43 /* DogAllOf.swift */; }; + C13E3FEC49E848F2CC5794FF93065029 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0467367B175C2F0A832EF481D058A3B1 /* ApiResponse.swift */; }; + C80C11BB589CAA31898343105C285051 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6F98097E49FF48BBF52B4D577575897 /* Extensions.swift */; }; + C94A6EA921453BFA4C082DFAC9C1C7EC /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7093CCE3918A0AF33C35DE6D2D7E50B2 /* ArrayTest.swift */; }; + CE18C1FBB0A93582860FFAF71E056F6A /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39FD32A271A0C2C893B43793B933F616 /* CatAllOf.swift */; }; + D1DA04105E2DD51C51C44E841F8032E1 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29BA92EB036AC93CED81C533893913E0 /* APIHelper.swift */; }; + D3FA0AA634AAEA99AB3FABC36BB4958C /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7DF70E51226B5CFA18D8A74279984374 /* SessionManager.swift */; }; + D7EAFEBB963D9B9C8BC00951572B8571 /* AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = D06090E7502DCF820B39197445505140 /* AnyPromise.swift */; }; + DF9AFA6422C6A99873955D59EF32DFAD /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = CBA48E443F18480EDF7990B4B747C01C /* Tag.swift */; }; + E160BF1E02EA978930609C95C93EEF16 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = BA6C5985BAF3713D3B44503E95F0FB80 /* HasOnlyReadOnly.swift */; }; + E5C45F26D8419C4BE5642B1E321894DD /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C84522B99B59B341AB4C8B336ED0C5F /* Configuration.swift */; }; + EB0DD8CEA1A69867A30267439C970440 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FDF1E434780F3B9150349C6920B90CE /* Result.swift */; }; + EC94B1BA635C6723DCFC17912BE0C588 /* Promise+Properties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 005C9DFB4855B699557271A22E350181 /* Promise+Properties.swift */; }; + ED06569D6C27D747E3E98ACF2F3CF0D8 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A65F4CD1E4DF96497733DACEEE24510 /* File.swift */; }; + F1620139EC36E6F5E4A98718BC41407D /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 166F3B2D4B92170923DEDBF0DC6EA0EF /* ClassModel.swift */; }; + F3A7212660A85B8AA43AD950729FBEA4 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04534F5AA06E6782A3CA6B026100F75E /* EnumArrays.swift */; }; + F47A5B894FD1450562D373B1D33D6A61 /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0E85A5CF8B173DB33BC07D63DE81D716 /* Client.swift */; }; + F7E9E11EFB5556B4D6033CC522502126 /* Promise+AnyPromise.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BEC984F88B74ADDDFFCF4891539CC56 /* Promise+AnyPromise.swift */; }; + FB407559577B3E19CAF1D3E75D4A7AAE /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B749F866CD9E9BFD8C8EAE1DDB1EB84 /* Error.swift */; }; + FE76A7AA575836F1EE950DDFEAE2CF7B /* race.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32FDBEBEEE3527CDFB764B9D267598AB /* race.swift */; }; + FFA407C091EEE5260E0C08655A0947EB /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A625E9EFA94098A17E16D12F9166900 /* ReadOnlyFirst.swift */; }; + FFA9DEB1EEA584789F46BBD344961268 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 7083C42A5DC6552DCB8F1A1E03CCA816 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + FFEE16A611067AB36CB750E960FEC9E8 /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC69D2B8F2AE344EAA07F51A9750D0D2 /* CodableHelper.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 46A96CCA6A1D1F8D0F013D7285FE0374 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = F1D420F0D4A15B40A58DAEF987DD36C3; + remoteInfo = PetstoreClient; + }; + 546F8B9CAB0CCCB3CAA12EAFD808A106 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BB3D3DCE720C235EF143F0E12FF69CA8; + remoteInfo = PromiseKit; + }; + 8457C9F78C76721ECB8A14CE04BB0A4B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3383968E74B5371B20BB519B170DC7FD; + remoteInfo = Alamofire; + }; + CA4BC4C012806840D9DC2B2430920C98 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3383968E74B5371B20BB519B170DC7FD; + remoteInfo = Alamofire; + }; + FA1A8E2F3FE2899A723889F94EACA0E5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 231FDEAF460449DE9E4B3F7B823FD3A3; + remoteInfo = "Pods-SwaggerClient"; + }; + FA9F1AC6C8600F3A18D9309C97C11B70 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BB3D3DCE720C235EF143F0E12FF69CA8; + remoteInfo = PromiseKit; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 005C9DFB4855B699557271A22E350181 /* Promise+Properties.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+Properties.swift"; path = "Sources/Promise+Properties.swift"; sourceTree = ""; }; + 01A5C01DA27D0796FD50B4BA65BAF819 /* PromiseKit.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PromiseKit.modulemap; sourceTree = ""; }; + 01B6740A1E78009ED5880C768EDAD9DB /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + 024B6CCE54665B2B8C5A6A361996F330 /* PromiseKit.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PromiseKit.xcconfig; sourceTree = ""; }; + 0378F66031FCAEA1771BE52BF95BBF3A /* User.md */ = {isa = PBXFileReference; includeInIndex = 1; name = User.md; path = docs/User.md; sourceTree = ""; }; + 044ED8C312BDDA8A93EF9740A5D6635C /* Model200Response.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Model200Response.md; path = docs/Model200Response.md; sourceTree = ""; }; + 04534F5AA06E6782A3CA6B026100F75E /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 0467367B175C2F0A832EF481D058A3B1 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 04D69622D72C7F771C350E30C30020EC /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + 04D9F269A5D0FA67A43F1F5D94F26D1B /* State.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = State.swift; path = Sources/State.swift; sourceTree = ""; }; + 04F4D33B469C31ECB943475DBFB00CBB /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + 057172115AF48E3DCA451233A4A640D4 /* join.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = join.swift; path = Sources/join.swift; sourceTree = ""; }; + 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 07F8EFE5AA6510095D2E009863317CB9 /* Order.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Order.md; path = docs/Order.md; sourceTree = ""; }; + 09F7C3F0D5E6C5A6A1BB66A132C7D958 /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + 0E85A5CF8B173DB33BC07D63DE81D716 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 11D9A9B2DA688589C27C7E886C45C6A0 /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 146F60360CAB9CAF5A98D361FE0762CC /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + 166F3B2D4B92170923DEDBF0DC6EA0EF /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 16F3A5E2D2142E1A4325498FC5C53DA0 /* DogAllOf.md */ = {isa = PBXFileReference; includeInIndex = 1; name = DogAllOf.md; path = docs/DogAllOf.md; sourceTree = ""; }; + 192D52CF963F026FC4AE2398773BBC50 /* EnumTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumTest.md; path = docs/EnumTest.md; sourceTree = ""; }; + 1ED294369B879E2098B334C63575B7F1 /* PetAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = PetAPI.md; path = docs/PetAPI.md; sourceTree = ""; }; + 1FE541DC5CA53C88DF7EBA29B807D613 /* PetstoreClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "PetstoreClient-Info.plist"; sourceTree = ""; }; + 224E8CF92D8CEAABA9CEBF326A1F3592 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PetstoreClient.modulemap; sourceTree = ""; }; + 22770A1D5CBD0B223DC3CDB943156D32 /* Return.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Return.md; path = docs/Return.md; sourceTree = ""; }; + 25103330F23FA9F2529571F308093057 /* MapTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = MapTest.md; path = docs/MapTest.md; sourceTree = ""; }; + 262FAE23D33A5D8D25FD3174BD218D2D /* CatAllOf.md */ = {isa = PBXFileReference; includeInIndex = 1; name = CatAllOf.md; path = docs/CatAllOf.md; sourceTree = ""; }; + 29BA92EB036AC93CED81C533893913E0 /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/OpenAPIs/APIHelper.swift; sourceTree = ""; }; + 29CE11B261C3803DAC95698C526C28F5 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PromiseKit.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 2A06291A67C87943DA0BB177E1BB5DC0 /* dispatch_promise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = dispatch_promise.m; path = Sources/dispatch_promise.m; sourceTree = ""; }; + 2C65DCB83B644ABFF723D9EDA2FB9E0C /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + 2C84522B99B59B341AB4C8B336ED0C5F /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/OpenAPIs/Configuration.swift; sourceTree = ""; }; + 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; + 2F38E2E2D4911E1D04FABA2223BD7688 /* when.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = when.m; path = Sources/when.m; sourceTree = ""; }; + 31ED5C3525921534592BF796A9C159CF /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; + 32FDBEBEEE3527CDFB764B9D267598AB /* race.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = race.swift; path = Sources/race.swift; sourceTree = ""; }; + 355D469521D44A6D4EB3DA64FDE5F7C6 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + 37D607ECD2F930FE1DB14AAD3D2FA264 /* OuterEnum.md */ = {isa = PBXFileReference; includeInIndex = 1; name = OuterEnum.md; path = docs/OuterEnum.md; sourceTree = ""; }; + 38E040842BCDCCB56DA8C4C1E77A905E /* wrap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = wrap.swift; path = Sources/wrap.swift; sourceTree = ""; }; + 39B0696CC11BF8EA7FDEC30C719FABC2 /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/OpenAPIs/Models.swift; sourceTree = ""; }; + 39FD32A271A0C2C893B43793B933F616 /* CatAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; + 3A009E375554819534829616F49D733C /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + 3A5A74AC7AF5B77CA1BD76B82062D5D3 /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 3AAB640C655ED6CF3F5D5C2314B9FB6B /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; + 3B8873E6FA376A1098653C8957A9CD8A /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + 3F5E9D64C5F0D5EE4E79CAA59E04172C /* ApiResponse.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ApiResponse.md; path = docs/ApiResponse.md; sourceTree = ""; }; + 3FDF1E434780F3B9150349C6920B90CE /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + 421C2470DDB7AF4A716391E4E9BA4602 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 44CC620F46D960EF0B6F97F430F5FC1E /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 45296D9EFD89DCB6A902D002A70E234F /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 4536398A85D1D5BBB39C3849096317B8 /* UserAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = UserAPI.md; path = docs/UserAPI.md; sourceTree = ""; }; + 45BAB97CF70E7E9B8D97D643CB602EBB /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Alamofire.modulemap; sourceTree = ""; }; + 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; + 48D66D7CC32AD262384136A281A3F8D1 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; + 4CD9592220A0204D65C56DC92A81DA49 /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; + 4CE19599ABE0E7AE1F173DBA59E31076 /* Client.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Client.md; path = docs/Client.md; sourceTree = ""; }; + 4DC5DC2F9BCEFA797895B33C16D2B17E /* Pods-SwaggerClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-Info.plist"; sourceTree = ""; }; + 4E1844EB7E5BB13D3E0EB4144A87D867 /* PromiseKit-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-umbrella.h"; sourceTree = ""; }; + 4F9A53FCDA869FFF602D9C9B68A25226 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 4FB9EC1A94087BEE99F46EDC560EF076 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 4FBAE8AD90A56C780F6620DBED839BA6 /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; + 51A86D1C0C7700196DC16755F82D031B /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + 5386BBE743C361BFF3494F43FE388D82 /* Dog.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Dog.md; path = docs/Dog.md; sourceTree = ""; }; + 54113FF25263A7207B4695B993005157 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 54E07AE118C3A0E6F7D341C158295E78 /* EnumClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumClass.md; path = docs/EnumClass.md; sourceTree = ""; }; + 5FBB2BEE096BE1F26A2F82F63C2A9137 /* PetstoreClient.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = PetstoreClient.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 618C90E6044C36C76F3590183ED38CB2 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + 61A1A22EC0CE765486E1DD7D915F1B67 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 62DA94E0DEA0A35F82AB7D9B8D7FA79F /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + 64A2381235D9FBB789BE4EB25C3250C2 /* AnotherFakeAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AnotherFakeAPI.md; path = docs/AnotherFakeAPI.md; sourceTree = ""; }; + 67CAA50227E3326A9816E28A7CD74A9C /* StringBooleanMap.md */ = {isa = PBXFileReference; includeInIndex = 1; name = StringBooleanMap.md; path = docs/StringBooleanMap.md; sourceTree = ""; }; + 683B7D10FA5B9F3523A5976092B503D2 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodingHelper.swift; path = PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift; sourceTree = ""; }; + 6C72D782FD3C5EEE8E525751B6D4DDB8 /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 6D7E4D001368609BA573263A283441DD /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift; sourceTree = ""; }; + 6F0DF3F13D20C6C62978412D37A6E05B /* EnumArrays.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumArrays.md; path = docs/EnumArrays.md; sourceTree = ""; }; + 706EA1E33802DC5002C4619F94BC8C99 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodableEncoding.swift; path = PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift; sourceTree = ""; }; + 7083C42A5DC6552DCB8F1A1E03CCA816 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + 7093CCE3918A0AF33C35DE6D2D7E50B2 /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + 72572B944808AC7C4854543BC132DFD8 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + 7295C7D32B7C8F2805DB5D2F3D732F60 /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 75855F6DC341E04EB8A436C5A5516151 /* TypeHolderDefault.md */ = {isa = PBXFileReference; includeInIndex = 1; name = TypeHolderDefault.md; path = docs/TypeHolderDefault.md; sourceTree = ""; }; + 765E58692EB6F8B6798E43E94D7F4094 /* ArrayOfArrayOfNumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayOfArrayOfNumberOnly.md; path = docs/ArrayOfArrayOfNumberOnly.md; sourceTree = ""; }; + 77A2E5CCDF5F8198ACB62180A77E07C2 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; + 77E7F6EA3ADC6756C75AAB7DBB8AB130 /* Cat.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Cat.md; path = docs/Cat.md; sourceTree = ""; }; + 7A10AF8E314E52BF5F7CD27303878027 /* after.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = after.m; path = Sources/after.m; sourceTree = ""; }; + 7A625E9EFA94098A17E16D12F9166900 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 7D20359CE0E73D6BC8E83D987C902D2E /* 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; }; + 7D7EC36638E4AB5C51EE2A9196D7E586 /* AnyPromise.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = AnyPromise.h; path = Sources/AnyPromise.h; sourceTree = ""; }; + 7DF70E51226B5CFA18D8A74279984374 /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 7FA863F5D3ACE15F4B0EB8D1E74927ED /* AnyPromise.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = AnyPromise.m; path = Sources/AnyPromise.m; sourceTree = ""; }; + 8146A56E871C702178198F216CD8B080 /* PromiseKit-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PromiseKit-dummy.m"; sourceTree = ""; }; + 81B75710FF1D97F3BBA8CF87E5D7CFDB /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 83A28F36D4BF850589924CCEF888C624 /* File.md */ = {isa = PBXFileReference; includeInIndex = 1; name = File.md; path = docs/File.md; sourceTree = ""; }; + 83D18CAC667F7E35D9B8E620072ED4D7 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 848CDB5C465B1E04DF5158F07B83EE6B /* DispatchQueue+Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Promise.swift"; path = "Sources/DispatchQueue+Promise.swift"; sourceTree = ""; }; + 861B9982272479ABE4C4C559BFA8B0F6 /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; + 863792E6E9405D9FA494ED8635CE6C0B /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 876786DF3A2782A83F27AAB4DF9B7129 /* SpecialModelName.md */ = {isa = PBXFileReference; includeInIndex = 1; name = SpecialModelName.md; path = docs/SpecialModelName.md; sourceTree = ""; }; + 891AFA4406EB2D944EEA7D0DB1A042FC /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + 8A19875444C285AE928D471959E28CA2 /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + 8A65F4CD1E4DF96497733DACEEE24510 /* File.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + 8BAD70A6195E195061F133B7EA8670DA /* Name.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Name.md; path = docs/Name.md; sourceTree = ""; }; + 8BEC984F88B74ADDDFFCF4891539CC56 /* Promise+AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Promise+AnyPromise.swift"; path = "Sources/Promise+AnyPromise.swift"; sourceTree = ""; }; + 8D047C054BDCF57647A210CA210568D0 /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; + 8DDE9C75E8809A86C87F1EF6BE5A7262 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 8F7E93BB98A2DE82741AB7E95364E2E3 /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 901441DA8E39EF973EBE8D69C2CDADE7 /* Pods-SwaggerClientTests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-Info.plist"; sourceTree = ""; }; + 91CB8ACD285957E691D4B962FB4D995B /* join.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = join.m; path = Sources/join.m; sourceTree = ""; }; + 91E22058D6E4F60DC6174011E70A2252 /* StoreAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = StoreAPI.md; path = docs/StoreAPI.md; sourceTree = ""; }; + 92066FF1F08D20558637C2DF4F007414 /* TypeHolderDefault.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; + 9448B03916DFC494CD68A614565A98B8 /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; + 96FB30FE91CE11061D85EA6BDBE094E3 /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + 97A2C094645F6A60D5A7F4E894EE23BD /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 9919E54A07648F68B8B5639C3D37053F /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 999653E1FEB8493AD6E227418DFE96D4 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + 9A359A8A6EF5936FF2065AE9CBDCE44A /* ReadOnlyFirst.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ReadOnlyFirst.md; path = docs/ReadOnlyFirst.md; sourceTree = ""; }; + 9B749F866CD9E9BFD8C8EAE1DDB1EB84 /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = Sources/Error.swift; sourceTree = ""; }; + 9C7EEAA52CAEFE414144646859D19BF6 /* GlobalState.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = GlobalState.m; path = Sources/GlobalState.m; sourceTree = ""; }; + 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; }; + A15505355E41E0A84C4DBB54E6722A6D /* AdditionalPropertiesClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AdditionalPropertiesClass.md; path = docs/AdditionalPropertiesClass.md; sourceTree = ""; }; + A33BB5BD82FE354BE292BE1DE69FE51F /* HasOnlyReadOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = HasOnlyReadOnly.md; path = docs/HasOnlyReadOnly.md; sourceTree = ""; }; + A35F2B8231DE6F6D8A6EA88D06013D6E /* FakeAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FakeAPI.md; path = docs/FakeAPI.md; sourceTree = ""; }; + A381312D61E3EA2806B6FAD90B3BEE94 /* PromiseKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A3B2B506FC78CDF88268C906E6638091 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + A4A146F2131F799FABD6835B1CFDD347 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + A6F98097E49FF48BBF52B4D577575897 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/OpenAPIs/Extensions.swift; sourceTree = ""; }; + A87F3C66E22CB7E45520173CC79433C5 /* Tag.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Tag.md; path = docs/Tag.md; sourceTree = ""; }; + A9A41207BF0E0F1116EFF3A7520E4F30 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + A9B71ED5DCF22D2A22499C3DA4D41762 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + ABBBF50FA7E854657BDB01185C7DE324 /* XmlItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; }; + AC144D2DF074FA8918C17F3B8D14EE68 /* FormatTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FormatTest.md; path = docs/FormatTest.md; sourceTree = ""; }; + ADA8ECE65CA8BD73FABB353F0DBAA212 /* PromiseKit.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = PromiseKit.h; path = Sources/PromiseKit.h; sourceTree = ""; }; + ADC0280962FDFA97AD377F19BF78E755 /* PromiseKit-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "PromiseKit-Info.plist"; sourceTree = ""; }; + AE73527DDD3B6ACE1DC5B450D1392B2A /* Promise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Promise.swift; path = Sources/Promise.swift; sourceTree = ""; }; + B2A2E212CE2309CAC426DE24D621FDC4 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + B55431698AE115B7B9BB79A1D53B02AF /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; + B8EBE4324A4F4CB8BDA4FA4F6701018A /* ArrayOfNumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayOfNumberOnly.md; path = docs/ArrayOfNumberOnly.md; sourceTree = ""; }; + B9EC4A49FB365F7019625F4C1BBCB292 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + BA5EB5823D5F03F25561928D53E496FC /* Alamofire-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Alamofire-Info.plist"; sourceTree = ""; }; + BA6C5985BAF3713D3B44503E95F0FB80 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + BB59CDEC268DB47E3F70C984590CB9D5 /* FakeClassnameTags123API.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FakeClassnameTags123API.md; path = docs/FakeClassnameTags123API.md; sourceTree = ""; }; + BC9640039255992199037E6E249CD4BA /* TypeHolderExample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; + BE70D2A78B09C7BC49E8D639EB88D8E7 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C291EB8933000D10C36F66A93478AA6E /* Pet.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Pet.md; path = docs/Pet.md; sourceTree = ""; }; + C42B10EE07C66F6B51BBEB51046AB299 /* hang.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; name = hang.m; path = Sources/hang.m; sourceTree = ""; }; + C5BF10812C8B893BE942E8A61095B391 /* NumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = NumberOnly.md; path = docs/NumberOnly.md; sourceTree = ""; }; + C868C2F462554B7E170F490CC96D9129 /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + CBA48E443F18480EDF7990B4B747C01C /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + CD82F46EEBDF3CDC0F371A13742C7C00 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; + D01ADEDF5E44D58ACB8ED1AED7BF7615 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; + D04FA8D90CF4B9585A67B86642BA750E /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + D06090E7502DCF820B39197445505140 /* AnyPromise.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyPromise.swift; path = Sources/AnyPromise.swift; sourceTree = ""; }; + D0E85B45A1EC6339F7AA30F525EBDF1F /* ClassModel.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ClassModel.md; path = docs/ClassModel.md; sourceTree = ""; }; + D153E0692428B3BF93148DCD1E6BC00F /* Capitalization.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Capitalization.md; path = docs/Capitalization.md; sourceTree = ""; }; + D1A6BA19B108998DF7350B40C83BFC47 /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + D2595AC2F6A360B57A8D3D63C239BA43 /* DogAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; + D2C82B8D4ECBBD48AE25659F2AEBFED8 /* after.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = after.swift; path = Sources/after.swift; sourceTree = ""; }; + D398056DC91B13AFAA8A0A890BBD89A4 /* AnimalFarm.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AnimalFarm.md; path = docs/AnimalFarm.md; sourceTree = ""; }; + D46742F1F99243487DCC614C75C1413C /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; + D59752DB0583557ED0A103929DE7D1C9 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + D5CFB3D593ECA1A24451987289C9B395 /* StringBooleanMap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; + D616FE27C480390E3487E307807E75E9 /* Animal.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Animal.md; path = docs/Animal.md; sourceTree = ""; }; + D9475C74C195567107086633A4D262E6 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + DB771F553FC5BEE61938D2B61CDA2CDF /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + DBD5E9D6569D80DDB9F58CEB3C331F16 /* OuterComposite.md */ = {isa = PBXFileReference; includeInIndex = 1; name = OuterComposite.md; path = docs/OuterComposite.md; sourceTree = ""; }; + DCCC04D0377A09B744232406CEBA5F44 /* List.md */ = {isa = PBXFileReference; includeInIndex = 1; name = List.md; path = docs/List.md; sourceTree = ""; }; + DDDADBC0BB257C4A516773B0ECA96196 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; + E2ED731C536593898FB5674BF6A7DC86 /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + E3A91C056032AA15B2DE57D4907F5BC7 /* TypeHolderExample.md */ = {isa = PBXFileReference; includeInIndex = 1; name = TypeHolderExample.md; path = docs/TypeHolderExample.md; sourceTree = ""; }; + E9E89ABCCC57336F89BD5C8BB5B4872B /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + EAD186DA30C241B56CD1BE298604BBC5 /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + EC9EA3D1DFE57CA229F3C7E3F3737154 /* when.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = when.swift; path = Sources/when.swift; sourceTree = ""; }; + EF416EF4C4DA347F1AE75E98A274B44F /* Category.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Category.md; path = docs/Category.md; sourceTree = ""; }; + EF87097269A87532273FD5EDDEBD4381 /* PromiseKit-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PromiseKit-prefix.pch"; sourceTree = ""; }; + F06C0DAD6966724111ECC6015B132A10 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + F0E666A2F03AB68FDC1E79B74A41E0C2 /* fwd.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = fwd.h; path = Sources/fwd.h; sourceTree = ""; }; + F2117E56C19928AF73DC30FDAB4534E6 /* FileSchemaTestClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FileSchemaTestClass.md; path = docs/FileSchemaTestClass.md; sourceTree = ""; }; + F3A7DCCAD07BACD1357F077BCA314A6D /* Zalgo.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zalgo.swift; path = Sources/Zalgo.swift; sourceTree = ""; }; + F3D9FB4070F34ECD420ACB66E1938430 /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; + F86FD53F34987F63B036CD49F23452BD /* ArrayTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayTest.md; path = docs/ArrayTest.md; sourceTree = ""; }; + F9E25BFB027008543966243CC338E08E /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; + FA65E6F618E30F8EADF884CD433F2B07 /* MixedPropertiesAndAdditionalPropertiesClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = MixedPropertiesAndAdditionalPropertiesClass.md; path = docs/MixedPropertiesAndAdditionalPropertiesClass.md; sourceTree = ""; }; + FC69D2B8F2AE344EAA07F51A9750D0D2 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodableHelper.swift; path = PetstoreClient/Classes/OpenAPIs/CodableHelper.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 810ABC6D498290E21B9332A43B49C990 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 0F5999FD4C7B20C99945D1766DCE1E1C /* Alamofire.framework in Frameworks */, + 17CBDD207E1B25F63A3E1823BC03B675 /* Foundation.framework in Frameworks */, + ABDB6B2BD6587F48ADD190B84019CDD7 /* PromiseKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D4EC17B7E6732812B49C04E19E9C0EF3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B598CD6C3665D587BD8EDE6202EA593 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DBBF761421A799D7A8BD2A2A66AA2742 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6C2E4B236C0831BEF971D9F43E41401D /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F1626ADC3A7EC435D2722B3173355D36 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3BD1DAFE1F3E6C9E4EB0F2099B6D6FA2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F7179B3AD176A6A966429334C5123C54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1B20892D757F702E6AE23072F5E15D04 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 16B2EE9E2B1D8BB1D015243D60C9E749 /* Pods */ = { + isa = PBXGroup; + children = ( + B751834EF2619E4944003D0B65303DD7 /* Alamofire */, + 96FE78D4772FAD7CD22CB23A52446058 /* PromiseKit */, + ); + name = Pods; + sourceTree = ""; + }; + 17869DF432008141F7BA21237323EE4C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 48D66D7CC32AD262384136A281A3F8D1 /* Alamofire.framework */, + A381312D61E3EA2806B6FAD90B3BEE94 /* PromiseKit.framework */, + EEC4E2560D8C158B5E6D73FD3A7282F7 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + 1C8221FE0071BDA2D0C5DE07B7736E88 /* Development Pods */ = { + isa = PBXGroup; + children = ( + 826C3E3C744487BED408F658C0EE4EC1 /* PetstoreClient */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 1D4F3935E032683220CEBAF7CC10D3C2 /* Support Files */ = { + isa = PBXGroup; + children = ( + 45BAB97CF70E7E9B8D97D643CB602EBB /* Alamofire.modulemap */, + 891AFA4406EB2D944EEA7D0DB1A042FC /* Alamofire.xcconfig */, + 146F60360CAB9CAF5A98D361FE0762CC /* Alamofire-dummy.m */, + BA5EB5823D5F03F25561928D53E496FC /* Alamofire-Info.plist */, + 8A19875444C285AE928D471959E28CA2 /* Alamofire-prefix.pch */, + CD82F46EEBDF3CDC0F371A13742C7C00 /* Alamofire-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Alamofire"; + sourceTree = ""; + }; + 27EB02841E0D43820F14F4377DE3547E /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 8244AEBEFB4AC3530215FA5CBA26673B /* Pods-SwaggerClient */, + 86B1F48A58BFA2FA26CD584937FBEED1 /* Pods-SwaggerClientTests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 734399E851D5ED2BCDF59922F6113FFB /* Products */ = { + isa = PBXGroup; + children = ( + BE70D2A78B09C7BC49E8D639EB88D8E7 /* Alamofire.framework */, + 81B75710FF1D97F3BBA8CF87E5D7CFDB /* PetstoreClient.framework */, + 61A1A22EC0CE765486E1DD7D915F1B67 /* Pods_SwaggerClient.framework */, + 44CC620F46D960EF0B6F97F430F5FC1E /* Pods_SwaggerClientTests.framework */, + 29CE11B261C3803DAC95698C526C28F5 /* PromiseKit.framework */, + ); + name = Products; + sourceTree = ""; + }; + 7346ED6721AC0FFB52A2045ED09577EE /* CorePromise */ = { + isa = PBXGroup; + children = ( + 7A10AF8E314E52BF5F7CD27303878027 /* after.m */, + D2C82B8D4ECBBD48AE25659F2AEBFED8 /* after.swift */, + 7D7EC36638E4AB5C51EE2A9196D7E586 /* AnyPromise.h */, + 7FA863F5D3ACE15F4B0EB8D1E74927ED /* AnyPromise.m */, + D06090E7502DCF820B39197445505140 /* AnyPromise.swift */, + 2A06291A67C87943DA0BB177E1BB5DC0 /* dispatch_promise.m */, + 848CDB5C465B1E04DF5158F07B83EE6B /* DispatchQueue+Promise.swift */, + 9B749F866CD9E9BFD8C8EAE1DDB1EB84 /* Error.swift */, + F0E666A2F03AB68FDC1E79B74A41E0C2 /* fwd.h */, + 9C7EEAA52CAEFE414144646859D19BF6 /* GlobalState.m */, + C42B10EE07C66F6B51BBEB51046AB299 /* hang.m */, + 91CB8ACD285957E691D4B962FB4D995B /* join.m */, + 057172115AF48E3DCA451233A4A640D4 /* join.swift */, + AE73527DDD3B6ACE1DC5B450D1392B2A /* Promise.swift */, + 8BEC984F88B74ADDDFFCF4891539CC56 /* Promise+AnyPromise.swift */, + 005C9DFB4855B699557271A22E350181 /* Promise+Properties.swift */, + ADA8ECE65CA8BD73FABB353F0DBAA212 /* PromiseKit.h */, + 32FDBEBEEE3527CDFB764B9D267598AB /* race.swift */, + 04D9F269A5D0FA67A43F1F5D94F26D1B /* State.swift */, + 2F38E2E2D4911E1D04FABA2223BD7688 /* when.m */, + EC9EA3D1DFE57CA229F3C7E3F3737154 /* when.swift */, + 38E040842BCDCCB56DA8C4C1E77A905E /* wrap.swift */, + F3A7DCCAD07BACD1357F077BCA314A6D /* Zalgo.swift */, + ); + name = CorePromise; + sourceTree = ""; + }; + 8244AEBEFB4AC3530215FA5CBA26673B /* Pods-SwaggerClient */ = { + isa = PBXGroup; + children = ( + 618C90E6044C36C76F3590183ED38CB2 /* Pods-SwaggerClient.modulemap */, + D46742F1F99243487DCC614C75C1413C /* Pods-SwaggerClient-acknowledgements.markdown */, + 96FB30FE91CE11061D85EA6BDBE094E3 /* Pods-SwaggerClient-acknowledgements.plist */, + 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */, + 9448B03916DFC494CD68A614565A98B8 /* Pods-SwaggerClient-frameworks.sh */, + 4DC5DC2F9BCEFA797895B33C16D2B17E /* Pods-SwaggerClient-Info.plist */, + 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */, + 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */, + B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */, + ); + name = "Pods-SwaggerClient"; + path = "Target Support Files/Pods-SwaggerClient"; + sourceTree = ""; + }; + 826C3E3C744487BED408F658C0EE4EC1 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + 6D7E4D001368609BA573263A283441DD /* AlamofireImplementations.swift */, + 29BA92EB036AC93CED81C533893913E0 /* APIHelper.swift */, + F3D9FB4070F34ECD420ACB66E1938430 /* APIs.swift */, + FC69D2B8F2AE344EAA07F51A9750D0D2 /* CodableHelper.swift */, + 2C84522B99B59B341AB4C8B336ED0C5F /* Configuration.swift */, + A6F98097E49FF48BBF52B4D577575897 /* Extensions.swift */, + 706EA1E33802DC5002C4619F94BC8C99 /* JSONEncodableEncoding.swift */, + 683B7D10FA5B9F3523A5976092B503D2 /* JSONEncodingHelper.swift */, + 39B0696CC11BF8EA7FDEC30C719FABC2 /* Models.swift */, + D7B7EC664DDCDD9A4918BBBD9B9BDEBC /* APIs */, + C6C1467FD411D6CD7E3CEAF0BF82F331 /* Models */, + D15241360159478315C62D19BD01F576 /* Pod */, + E744BC5198F66515CCC110C0907A7EB9 /* Support Files */, + ); + name = PetstoreClient; + path = ../..; + sourceTree = ""; + }; + 86B1F48A58BFA2FA26CD584937FBEED1 /* Pods-SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + D1A6BA19B108998DF7350B40C83BFC47 /* Pods-SwaggerClientTests.modulemap */, + D01ADEDF5E44D58ACB8ED1AED7BF7615 /* Pods-SwaggerClientTests-acknowledgements.markdown */, + 31ED5C3525921534592BF796A9C159CF /* Pods-SwaggerClientTests-acknowledgements.plist */, + 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */, + 901441DA8E39EF973EBE8D69C2CDADE7 /* Pods-SwaggerClientTests-Info.plist */, + 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */, + CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */, + 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = "Pods-SwaggerClientTests"; + path = "Target Support Files/Pods-SwaggerClientTests"; + sourceTree = ""; + }; + 96FE78D4772FAD7CD22CB23A52446058 /* PromiseKit */ = { + isa = PBXGroup; + children = ( + 7346ED6721AC0FFB52A2045ED09577EE /* CorePromise */, + C21752F874F8F012DCDD69EA749D2C85 /* Support Files */, + ); + name = PromiseKit; + path = PromiseKit; + sourceTree = ""; + }; + B751834EF2619E4944003D0B65303DD7 /* Alamofire */ = { + isa = PBXGroup; + children = ( + 77A2E5CCDF5F8198ACB62180A77E07C2 /* AFError.swift */, + 3B8873E6FA376A1098653C8957A9CD8A /* Alamofire.swift */, + 51A86D1C0C7700196DC16755F82D031B /* DispatchQueue+Alamofire.swift */, + E2ED731C536593898FB5674BF6A7DC86 /* MultipartFormData.swift */, + 72572B944808AC7C4854543BC132DFD8 /* NetworkReachabilityManager.swift */, + 8D047C054BDCF57647A210CA210568D0 /* Notifications.swift */, + 45296D9EFD89DCB6A902D002A70E234F /* ParameterEncoding.swift */, + 6C72D782FD3C5EEE8E525751B6D4DDB8 /* Request.swift */, + 01B6740A1E78009ED5880C768EDAD9DB /* Response.swift */, + 3A009E375554819534829616F49D733C /* ResponseSerialization.swift */, + 3FDF1E434780F3B9150349C6920B90CE /* Result.swift */, + B55431698AE115B7B9BB79A1D53B02AF /* ServerTrustPolicy.swift */, + F9E25BFB027008543966243CC338E08E /* SessionDelegate.swift */, + 7DF70E51226B5CFA18D8A74279984374 /* SessionManager.swift */, + B2A2E212CE2309CAC426DE24D621FDC4 /* TaskDelegate.swift */, + 09F7C3F0D5E6C5A6A1BB66A132C7D958 /* Timeline.swift */, + 83D18CAC667F7E35D9B8E620072ED4D7 /* Validation.swift */, + 1D4F3935E032683220CEBAF7CC10D3C2 /* Support Files */, + ); + name = Alamofire; + path = Alamofire; + sourceTree = ""; + }; + C21752F874F8F012DCDD69EA749D2C85 /* Support Files */ = { + isa = PBXGroup; + children = ( + 01A5C01DA27D0796FD50B4BA65BAF819 /* PromiseKit.modulemap */, + 024B6CCE54665B2B8C5A6A361996F330 /* PromiseKit.xcconfig */, + 8146A56E871C702178198F216CD8B080 /* PromiseKit-dummy.m */, + ADC0280962FDFA97AD377F19BF78E755 /* PromiseKit-Info.plist */, + EF87097269A87532273FD5EDDEBD4381 /* PromiseKit-prefix.pch */, + 4E1844EB7E5BB13D3E0EB4144A87D867 /* PromiseKit-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/PromiseKit"; + sourceTree = ""; + }; + C6C1467FD411D6CD7E3CEAF0BF82F331 /* Models */ = { + isa = PBXGroup; + children = ( + 8DDE9C75E8809A86C87F1EF6BE5A7262 /* AdditionalPropertiesClass.swift */, + A9A41207BF0E0F1116EFF3A7520E4F30 /* Animal.swift */, + EAD186DA30C241B56CD1BE298604BBC5 /* AnimalFarm.swift */, + 0467367B175C2F0A832EF481D058A3B1 /* ApiResponse.swift */, + 4FB9EC1A94087BEE99F46EDC560EF076 /* ArrayOfArrayOfNumberOnly.swift */, + D59752DB0583557ED0A103929DE7D1C9 /* ArrayOfNumberOnly.swift */, + 7093CCE3918A0AF33C35DE6D2D7E50B2 /* ArrayTest.swift */, + D9475C74C195567107086633A4D262E6 /* Capitalization.swift */, + 11D9A9B2DA688589C27C7E886C45C6A0 /* Cat.swift */, + 39FD32A271A0C2C893B43793B933F616 /* CatAllOf.swift */, + 421C2470DDB7AF4A716391E4E9BA4602 /* Category.swift */, + 166F3B2D4B92170923DEDBF0DC6EA0EF /* ClassModel.swift */, + 0E85A5CF8B173DB33BC07D63DE81D716 /* Client.swift */, + 04F4D33B469C31ECB943475DBFB00CBB /* Dog.swift */, + D2595AC2F6A360B57A8D3D63C239BA43 /* DogAllOf.swift */, + 04534F5AA06E6782A3CA6B026100F75E /* EnumArrays.swift */, + 54113FF25263A7207B4695B993005157 /* EnumClass.swift */, + 62DA94E0DEA0A35F82AB7D9B8D7FA79F /* EnumTest.swift */, + 8A65F4CD1E4DF96497733DACEEE24510 /* File.swift */, + 861B9982272479ABE4C4C559BFA8B0F6 /* FileSchemaTestClass.swift */, + 8F7E93BB98A2DE82741AB7E95364E2E3 /* FormatTest.swift */, + BA6C5985BAF3713D3B44503E95F0FB80 /* HasOnlyReadOnly.swift */, + F06C0DAD6966724111ECC6015B132A10 /* List.swift */, + 4F9A53FCDA869FFF602D9C9B68A25226 /* MapTest.swift */, + 9919E54A07648F68B8B5639C3D37053F /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 863792E6E9405D9FA494ED8635CE6C0B /* Model200Response.swift */, + A9B71ED5DCF22D2A22499C3DA4D41762 /* Name.swift */, + DB771F553FC5BEE61938D2B61CDA2CDF /* NumberOnly.swift */, + E9E89ABCCC57336F89BD5C8BB5B4872B /* Order.swift */, + 7295C7D32B7C8F2805DB5D2F3D732F60 /* OuterComposite.swift */, + C868C2F462554B7E170F490CC96D9129 /* OuterEnum.swift */, + 4FBAE8AD90A56C780F6620DBED839BA6 /* Pet.swift */, + 7A625E9EFA94098A17E16D12F9166900 /* ReadOnlyFirst.swift */, + 999653E1FEB8493AD6E227418DFE96D4 /* Return.swift */, + 04D69622D72C7F771C350E30C30020EC /* SpecialModelName.swift */, + D5CFB3D593ECA1A24451987289C9B395 /* StringBooleanMap.swift */, + CBA48E443F18480EDF7990B4B747C01C /* Tag.swift */, + 92066FF1F08D20558637C2DF4F007414 /* TypeHolderDefault.swift */, + BC9640039255992199037E6E249CD4BA /* TypeHolderExample.swift */, + D04FA8D90CF4B9585A67B86642BA750E /* User.swift */, + ABBBF50FA7E854657BDB01185C7DE324 /* XmlItem.swift */, + ); + name = Models; + path = PetstoreClient/Classes/OpenAPIs/Models; + sourceTree = ""; + }; + CF1408CF629C7361332E53B88F7BD30C = { + isa = PBXGroup; + children = ( + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, + 1C8221FE0071BDA2D0C5DE07B7736E88 /* Development Pods */, + 17869DF432008141F7BA21237323EE4C /* Frameworks */, + 16B2EE9E2B1D8BB1D015243D60C9E749 /* Pods */, + 734399E851D5ED2BCDF59922F6113FFB /* Products */, + 27EB02841E0D43820F14F4377DE3547E /* Targets Support Files */, + ); + sourceTree = ""; + }; + D15241360159478315C62D19BD01F576 /* Pod */ = { + isa = PBXGroup; + children = ( + A15505355E41E0A84C4DBB54E6722A6D /* AdditionalPropertiesClass.md */, + D616FE27C480390E3487E307807E75E9 /* Animal.md */, + D398056DC91B13AFAA8A0A890BBD89A4 /* AnimalFarm.md */, + 64A2381235D9FBB789BE4EB25C3250C2 /* AnotherFakeAPI.md */, + 3F5E9D64C5F0D5EE4E79CAA59E04172C /* ApiResponse.md */, + 765E58692EB6F8B6798E43E94D7F4094 /* ArrayOfArrayOfNumberOnly.md */, + B8EBE4324A4F4CB8BDA4FA4F6701018A /* ArrayOfNumberOnly.md */, + F86FD53F34987F63B036CD49F23452BD /* ArrayTest.md */, + D153E0692428B3BF93148DCD1E6BC00F /* Capitalization.md */, + 77E7F6EA3ADC6756C75AAB7DBB8AB130 /* Cat.md */, + 262FAE23D33A5D8D25FD3174BD218D2D /* CatAllOf.md */, + EF416EF4C4DA347F1AE75E98A274B44F /* Category.md */, + D0E85B45A1EC6339F7AA30F525EBDF1F /* ClassModel.md */, + 4CE19599ABE0E7AE1F173DBA59E31076 /* Client.md */, + 5386BBE743C361BFF3494F43FE388D82 /* Dog.md */, + 16F3A5E2D2142E1A4325498FC5C53DA0 /* DogAllOf.md */, + 6F0DF3F13D20C6C62978412D37A6E05B /* EnumArrays.md */, + 54E07AE118C3A0E6F7D341C158295E78 /* EnumClass.md */, + 192D52CF963F026FC4AE2398773BBC50 /* EnumTest.md */, + A35F2B8231DE6F6D8A6EA88D06013D6E /* FakeAPI.md */, + BB59CDEC268DB47E3F70C984590CB9D5 /* FakeClassnameTags123API.md */, + 83A28F36D4BF850589924CCEF888C624 /* File.md */, + F2117E56C19928AF73DC30FDAB4534E6 /* FileSchemaTestClass.md */, + AC144D2DF074FA8918C17F3B8D14EE68 /* FormatTest.md */, + A33BB5BD82FE354BE292BE1DE69FE51F /* HasOnlyReadOnly.md */, + DCCC04D0377A09B744232406CEBA5F44 /* List.md */, + 25103330F23FA9F2529571F308093057 /* MapTest.md */, + FA65E6F618E30F8EADF884CD433F2B07 /* MixedPropertiesAndAdditionalPropertiesClass.md */, + 044ED8C312BDDA8A93EF9740A5D6635C /* Model200Response.md */, + 8BAD70A6195E195061F133B7EA8670DA /* Name.md */, + C5BF10812C8B893BE942E8A61095B391 /* NumberOnly.md */, + 07F8EFE5AA6510095D2E009863317CB9 /* Order.md */, + DBD5E9D6569D80DDB9F58CEB3C331F16 /* OuterComposite.md */, + 37D607ECD2F930FE1DB14AAD3D2FA264 /* OuterEnum.md */, + C291EB8933000D10C36F66A93478AA6E /* Pet.md */, + 1ED294369B879E2098B334C63575B7F1 /* PetAPI.md */, + 5FBB2BEE096BE1F26A2F82F63C2A9137 /* PetstoreClient.podspec */, + 355D469521D44A6D4EB3DA64FDE5F7C6 /* README.md */, + 9A359A8A6EF5936FF2065AE9CBDCE44A /* ReadOnlyFirst.md */, + 22770A1D5CBD0B223DC3CDB943156D32 /* Return.md */, + 876786DF3A2782A83F27AAB4DF9B7129 /* SpecialModelName.md */, + 91E22058D6E4F60DC6174011E70A2252 /* StoreAPI.md */, + 67CAA50227E3326A9816E28A7CD74A9C /* StringBooleanMap.md */, + A87F3C66E22CB7E45520173CC79433C5 /* Tag.md */, + 75855F6DC341E04EB8A436C5A5516151 /* TypeHolderDefault.md */, + E3A91C056032AA15B2DE57D4907F5BC7 /* TypeHolderExample.md */, + 0378F66031FCAEA1771BE52BF95BBF3A /* User.md */, + 4536398A85D1D5BBB39C3849096317B8 /* UserAPI.md */, + ); + name = Pod; + sourceTree = ""; + }; + D7B7EC664DDCDD9A4918BBBD9B9BDEBC /* APIs */ = { + isa = PBXGroup; + children = ( + DDDADBC0BB257C4A516773B0ECA96196 /* AnotherFakeAPI.swift */, + B9EC4A49FB365F7019625F4C1BBCB292 /* FakeAPI.swift */, + 3AAB640C655ED6CF3F5D5C2314B9FB6B /* FakeClassnameTags123API.swift */, + 3A5A74AC7AF5B77CA1BD76B82062D5D3 /* PetAPI.swift */, + A4A146F2131F799FABD6835B1CFDD347 /* StoreAPI.swift */, + 97A2C094645F6A60D5A7F4E894EE23BD /* UserAPI.swift */, + ); + name = APIs; + path = PetstoreClient/Classes/OpenAPIs/APIs; + sourceTree = ""; + }; + E744BC5198F66515CCC110C0907A7EB9 /* Support Files */ = { + isa = PBXGroup; + children = ( + 224E8CF92D8CEAABA9CEBF326A1F3592 /* PetstoreClient.modulemap */, + 4CD9592220A0204D65C56DC92A81DA49 /* PetstoreClient.xcconfig */, + 2C65DCB83B644ABFF723D9EDA2FB9E0C /* PetstoreClient-dummy.m */, + 1FE541DC5CA53C88DF7EBA29B807D613 /* PetstoreClient-Info.plist */, + A3B2B506FC78CDF88268C906E6638091 /* PetstoreClient-prefix.pch */, + 7083C42A5DC6552DCB8F1A1E03CCA816 /* PetstoreClient-umbrella.h */, + ); + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; + sourceTree = ""; + }; + EEC4E2560D8C158B5E6D73FD3A7282F7 /* iOS */ = { + isa = PBXGroup; + children = ( + 7D20359CE0E73D6BC8E83D987C902D2E /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 23D70D9651451F43E7E8CC1A87B4B7E9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + B6F6E4CC26451E91B59FAE0F6841DC1F /* Alamofire-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3268A0F9B56A3813E4AEC25C8CD0A4D3 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 687C2F140C3AFB4F2FA5147EF9790F1D /* Pods-SwaggerClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 3F6DDD6D33EC31E5C134A39FD5A16C7F /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 7A00D62842DD238AC0457B7743459143 /* AnyPromise.h in Headers */, + 26DD5BC612DBFC51C9A2EC25AF219566 /* fwd.h in Headers */, + 1C035F0DFD555DC8249BE265F89C3071 /* PromiseKit-umbrella.h in Headers */, + 975E21814E0F788DF6A6E5DE986229E6 /* PromiseKit.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A75A99D2E090C9BAAFA7D32A6536D24E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AB631DF2E9BC76B8736C9EFF6191C0B /* Pods-SwaggerClientTests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + B77B7E691107B1EA5EE14B6E55E08D23 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + FFA9DEB1EEA584789F46BBD344961268 /* PetstoreClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 231FDEAF460449DE9E4B3F7B823FD3A3 /* Pods-SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 2191953FE475159265C17FB5EE76C4FD /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; + buildPhases = ( + 3268A0F9B56A3813E4AEC25C8CD0A4D3 /* Headers */, + 6085E5872EE87CAE6BF6A38C6034EF63 /* Sources */, + F7179B3AD176A6A966429334C5123C54 /* Frameworks */, + 5DBF8C2B793EFCFD59F448F0F6F195CB /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 104B105982370A7B9131E436EA78FECF /* PBXTargetDependency */, + BCF2E1EDC25542296AD484069283D527 /* PBXTargetDependency */, + 881BE8BEE1BCB47A20F79F7E463C2E17 /* PBXTargetDependency */, + ); + name = "Pods-SwaggerClient"; + productName = "Pods-SwaggerClient"; + productReference = 61A1A22EC0CE765486E1DD7D915F1B67 /* Pods_SwaggerClient.framework */; + productType = "com.apple.product-type.framework"; + }; + 3383968E74B5371B20BB519B170DC7FD /* Alamofire */ = { + isa = PBXNativeTarget; + buildConfigurationList = E87124444A44B7DB55208E7FEC21D331 /* Build configuration list for PBXNativeTarget "Alamofire" */; + buildPhases = ( + 23D70D9651451F43E7E8CC1A87B4B7E9 /* Headers */, + A1C8B029F600160149A2404C342F6E50 /* Sources */, + F1626ADC3A7EC435D2722B3173355D36 /* Frameworks */, + 28FF73341543B6F0A7DF3C20CFFEA0AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Alamofire; + productName = Alamofire; + productReference = BE70D2A78B09C7BC49E8D639EB88D8E7 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + 7ECA32D1B18128C394D8D35F346BEEC7 /* Pods-SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8F09E039867007D3576FEED9032526A8 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; + buildPhases = ( + A75A99D2E090C9BAAFA7D32A6536D24E /* Headers */, + F7D9DB86AE0913CC2B294C55BFD934AD /* Sources */, + D4EC17B7E6732812B49C04E19E9C0EF3 /* Frameworks */, + C2801E627F662CD786BE9F42773CBECF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C18A6DC0C9B8408542F3D944BB6D67F4 /* PBXTargetDependency */, + ); + name = "Pods-SwaggerClientTests"; + productName = "Pods-SwaggerClientTests"; + productReference = 44CC620F46D960EF0B6F97F430F5FC1E /* Pods_SwaggerClientTests.framework */; + productType = "com.apple.product-type.framework"; + }; + BB3D3DCE720C235EF143F0E12FF69CA8 /* PromiseKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3987909F169C9B57D460372E7FA7D4C2 /* Build configuration list for PBXNativeTarget "PromiseKit" */; + buildPhases = ( + 3F6DDD6D33EC31E5C134A39FD5A16C7F /* Headers */, + 4D751F3449218FB77503D67042F9D0AF /* Sources */, + DBBF761421A799D7A8BD2A2A66AA2742 /* Frameworks */, + 4D173F63C3AAD95EBBF2E67E50A776B7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PromiseKit; + productName = PromiseKit; + productReference = 29CE11B261C3803DAC95698C526C28F5 /* PromiseKit.framework */; + productType = "com.apple.product-type.framework"; + }; + F1D420F0D4A15B40A58DAEF987DD36C3 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6CA821BA53BCC09E04DDA621C18E2CD7 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + B77B7E691107B1EA5EE14B6E55E08D23 /* Headers */, + E2E80565ACA4BF140CCB71BF3BCCAC59 /* Sources */, + 810ABC6D498290E21B9332A43B49C990 /* Frameworks */, + D82B8B0EB0022FBE167BF08C8EA8B48F /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C03AB392CD24547D8AFE0D2BDE56D2D0 /* PBXTargetDependency */, + 2B474439E57C1B019F32DB682991704B /* PBXTargetDependency */, + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = 81B75710FF1D97F3BBA8CF87E5D7CFDB /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BFDFE7DC352907FC980B868725387E98 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; + }; + buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CF1408CF629C7361332E53B88F7BD30C; + productRefGroup = 734399E851D5ED2BCDF59922F6113FFB /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3383968E74B5371B20BB519B170DC7FD /* Alamofire */, + F1D420F0D4A15B40A58DAEF987DD36C3 /* PetstoreClient */, + 231FDEAF460449DE9E4B3F7B823FD3A3 /* Pods-SwaggerClient */, + 7ECA32D1B18128C394D8D35F346BEEC7 /* Pods-SwaggerClientTests */, + BB3D3DCE720C235EF143F0E12FF69CA8 /* PromiseKit */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 28FF73341543B6F0A7DF3C20CFFEA0AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4D173F63C3AAD95EBBF2E67E50A776B7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 5DBF8C2B793EFCFD59F448F0F6F195CB /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2801E627F662CD786BE9F42773CBECF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D82B8B0EB0022FBE167BF08C8EA8B48F /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4D751F3449218FB77503D67042F9D0AF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 51909107FAE52A0D1C8AE11B65DE08E7 /* after.m in Sources */, + 8F063138AEB0CBD41F723D7C8C6C9A1C /* after.swift in Sources */, + 9D8C37EA1313F9BBDD200D8FCB93CCFA /* AnyPromise.m in Sources */, + D7EAFEBB963D9B9C8BC00951572B8571 /* AnyPromise.swift in Sources */, + 5CAA0F2AB773CCD6E62848CC02470C8E /* dispatch_promise.m in Sources */, + 910364E886094608091F77F9DBF1AE2E /* DispatchQueue+Promise.swift in Sources */, + FB407559577B3E19CAF1D3E75D4A7AAE /* Error.swift in Sources */, + 7B14AABEA6084A6CAAD77F02D700A436 /* GlobalState.m in Sources */, + B645EC01163024890ADE8D5C9EAF8EE5 /* hang.m in Sources */, + 9B72FB26EC959DD96FDBB044A9C3C525 /* join.m in Sources */, + 47E148EE42FDCD51C69EA7EB322496BD /* join.swift in Sources */, + F7E9E11EFB5556B4D6033CC522502126 /* Promise+AnyPromise.swift in Sources */, + EC94B1BA635C6723DCFC17912BE0C588 /* Promise+Properties.swift in Sources */, + 40AE1B240B27734094AB39EACA233A0D /* Promise.swift in Sources */, + 726DCC0BBB21F735986DF5C9F3DCBEF6 /* PromiseKit-dummy.m in Sources */, + FE76A7AA575836F1EE950DDFEAE2CF7B /* race.swift in Sources */, + B433389CCA40FDC6A02956C940F80112 /* State.swift in Sources */, + 317719762D81596E1DD4BC4786311DF5 /* when.m in Sources */, + C0887203727473C7A8A9084437976426 /* when.swift in Sources */, + B67DB5083264B8C8896D3DF3F5FE2E20 /* wrap.swift in Sources */, + 9FBC90C0E307ADB8CD2F3CF5C0D3C8EE /* Zalgo.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6085E5872EE87CAE6BF6A38C6034EF63 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 39CFC0AF6016C70C5EA5345DFE44FEB4 /* Pods-SwaggerClient-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A1C8B029F600160149A2404C342F6E50 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E3538A6992A38276764936A9733493D /* AFError.swift in Sources */, + 772911DA6E33D1CBBC30131B7C8BDBB3 /* Alamofire-dummy.m in Sources */, + 0A39AF55285A3A4F7CBABB6D822FA4A3 /* Alamofire.swift in Sources */, + 3E0749AF6C51BCF0E4A41CF1D6A76FED /* DispatchQueue+Alamofire.swift in Sources */, + AEA829AB1A8AF2AD077A808AED6B178A /* MultipartFormData.swift in Sources */, + 73AB05789A4982944AF68DBD013E3EB7 /* NetworkReachabilityManager.swift in Sources */, + 1D29D2ACADF961F69D32B06FA6A09E28 /* Notifications.swift in Sources */, + 700D3D95AF9520CB227846DFD943A2DA /* ParameterEncoding.swift in Sources */, + 355C18EEC82624A06A6CC93965258E33 /* Request.swift in Sources */, + 059D92B7BBFBEC53E9A3B6E11C5C3B3A /* Response.swift in Sources */, + 6EFD003458AE7F689DEA720A2030C261 /* ResponseSerialization.swift in Sources */, + EB0DD8CEA1A69867A30267439C970440 /* Result.swift in Sources */, + 8D2A6A90A6DDAF75EA52D471258545CC /* ServerTrustPolicy.swift in Sources */, + A1EC41966B261DCE460BCDE5124A1DBE /* SessionDelegate.swift in Sources */, + D3FA0AA634AAEA99AB3FABC36BB4958C /* SessionManager.swift in Sources */, + 77E8F0EB9FFBE2E3EB0C77095C644606 /* TaskDelegate.swift in Sources */, + 60B6C2A003864AAD3A426448152F67BE /* Timeline.swift in Sources */, + AA56769D8733D3F3E7976742D5ABA998 /* Validation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E2E80565ACA4BF140CCB71BF3BCCAC59 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + BA93909A110EB66F7167C3B326A5D2B0 /* AdditionalPropertiesClass.swift in Sources */, + B394CD18FC054147A348F808EAC8139A /* AlamofireImplementations.swift in Sources */, + 6FDC9E3B9907CF35FC038BD79A7DE2AC /* Animal.swift in Sources */, + BF7C810E194570D018B13127190459E5 /* AnimalFarm.swift in Sources */, + 2CDAC18FCB90313EFA1B02A75C83E0EE /* AnotherFakeAPI.swift in Sources */, + D1DA04105E2DD51C51C44E841F8032E1 /* APIHelper.swift in Sources */, + C13E3FEC49E848F2CC5794FF93065029 /* ApiResponse.swift in Sources */, + 091CC6D7CFF9374E41B1C6CB19B0E97B /* APIs.swift in Sources */, + BF0B6C073FB6099B4BB906527BFA43FD /* ArrayOfArrayOfNumberOnly.swift in Sources */, + 6FACE6A9C43083DBB5033317AFF9AE31 /* ArrayOfNumberOnly.swift in Sources */, + C94A6EA921453BFA4C082DFAC9C1C7EC /* ArrayTest.swift in Sources */, + 636C75AD8D045A1687F83CA89AF49A86 /* Capitalization.swift in Sources */, + 9A30D9B1EE2D5A3AC76AE389E0520352 /* Cat.swift in Sources */, + CE18C1FBB0A93582860FFAF71E056F6A /* CatAllOf.swift in Sources */, + B511D9CED36E092C88AB629C511BD1E7 /* Category.swift in Sources */, + F1620139EC36E6F5E4A98718BC41407D /* ClassModel.swift in Sources */, + F47A5B894FD1450562D373B1D33D6A61 /* Client.swift in Sources */, + FFEE16A611067AB36CB750E960FEC9E8 /* CodableHelper.swift in Sources */, + E5C45F26D8419C4BE5642B1E321894DD /* Configuration.swift in Sources */, + 4D4DCE405773A7673D0199A93FE9DE62 /* Dog.swift in Sources */, + C1245D0FDDA57F8CEAA283B028D09D09 /* DogAllOf.swift in Sources */, + F3A7212660A85B8AA43AD950729FBEA4 /* EnumArrays.swift in Sources */, + BC5A794B04B4DEA6F0473FD3E8952BDC /* EnumClass.swift in Sources */, + 8766DA6D3446770DAAF3D68E154E61BD /* EnumTest.swift in Sources */, + C80C11BB589CAA31898343105C285051 /* Extensions.swift in Sources */, + 410EC2309E393CB88C39529E7CF18811 /* FakeAPI.swift in Sources */, + 87D949C0631CC0CB929C69CA7D925B14 /* FakeClassnameTags123API.swift in Sources */, + ED06569D6C27D747E3E98ACF2F3CF0D8 /* File.swift in Sources */, + 8FC55DB96BAADB3B12B0DAB26332E40A /* FileSchemaTestClass.swift in Sources */, + BFB77FC4FC5E7D0680CE25025D0F818F /* FormatTest.swift in Sources */, + E160BF1E02EA978930609C95C93EEF16 /* HasOnlyReadOnly.swift in Sources */, + 0CD12250A91D4CBC55393495F06775B2 /* JSONEncodableEncoding.swift in Sources */, + BE5BBDF15A7C0C9CF88A0268815B8202 /* JSONEncodingHelper.swift in Sources */, + 7B847086909F16338E32D2290866777C /* List.swift in Sources */, + 6FC066D0A7B565C871A65F540E37735F /* MapTest.swift in Sources */, + 67D2462106E9DB4C3D16D5F521C99250 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 24406F8A6355B7BEC2B072D3B17ECD47 /* Model200Response.swift in Sources */, + 28A9B496DBCD33380CC3D4CC155F524E /* Models.swift in Sources */, + 2E29AA764BF206DE155112E5BC4939E8 /* Name.swift in Sources */, + B4A2386087F99886C5CC944C2A5B58C7 /* NumberOnly.swift in Sources */, + A64FF2ED84938912BA601B01121B8E23 /* Order.swift in Sources */, + 36C038AE1EFBD5D95D3B3102A737DFDE /* OuterComposite.swift in Sources */, + 77A253AD92BDAF5465031F9225A13F8D /* OuterEnum.swift in Sources */, + 8D53C0725D4DE490174105C56C981189 /* Pet.swift in Sources */, + 3593A7A85BE6F92BC7BEA765C89B1076 /* PetAPI.swift in Sources */, + 7D3B1A7247A69E34E48CED53C5145C34 /* PetstoreClient-dummy.m in Sources */, + FFA407C091EEE5260E0C08655A0947EB /* ReadOnlyFirst.swift in Sources */, + 6AF9A6069796DA5834FEEAFD7221874F /* Return.swift in Sources */, + 526815FE7172F8568A44A8F4D9139970 /* SpecialModelName.swift in Sources */, + 64B570EF5C1FF1379F8036D8FCCB63EF /* StoreAPI.swift in Sources */, + B652075D043B2D37A0B1FA649065FC3F /* StringBooleanMap.swift in Sources */, + DF9AFA6422C6A99873955D59EF32DFAD /* Tag.swift in Sources */, + 02CB7A74792FE71D55618B1FD68A84F2 /* TypeHolderDefault.swift in Sources */, + 7C0B7D57C5FED546B89AF6A45F276C36 /* TypeHolderExample.swift in Sources */, + 13E3586ABCE7938EB3CC6D51BAD31B42 /* User.swift in Sources */, + 5C5EA546013E597E3D52DD83B5C92D13 /* UserAPI.swift in Sources */, + 3B14FC1EA44225994453AA123F4262D0 /* XmlItem.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F7D9DB86AE0913CC2B294C55BFD934AD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8012A57CFFC574F745FBA46D335BBA6F /* Pods-SwaggerClientTests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 104B105982370A7B9131E436EA78FECF /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 3383968E74B5371B20BB519B170DC7FD /* Alamofire */; + targetProxy = 8457C9F78C76721ECB8A14CE04BB0A4B /* PBXContainerItemProxy */; + }; + 2B474439E57C1B019F32DB682991704B /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PromiseKit; + target = BB3D3DCE720C235EF143F0E12FF69CA8 /* PromiseKit */; + targetProxy = FA9F1AC6C8600F3A18D9309C97C11B70 /* PBXContainerItemProxy */; + }; + 881BE8BEE1BCB47A20F79F7E463C2E17 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PromiseKit; + target = BB3D3DCE720C235EF143F0E12FF69CA8 /* PromiseKit */; + targetProxy = 546F8B9CAB0CCCB3CAA12EAFD808A106 /* PBXContainerItemProxy */; + }; + BCF2E1EDC25542296AD484069283D527 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PetstoreClient; + target = F1D420F0D4A15B40A58DAEF987DD36C3 /* PetstoreClient */; + targetProxy = 46A96CCA6A1D1F8D0F013D7285FE0374 /* PBXContainerItemProxy */; + }; + C03AB392CD24547D8AFE0D2BDE56D2D0 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 3383968E74B5371B20BB519B170DC7FD /* Alamofire */; + targetProxy = CA4BC4C012806840D9DC2B2430920C98 /* PBXContainerItemProxy */; + }; + C18A6DC0C9B8408542F3D944BB6D67F4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Pods-SwaggerClient"; + target = 231FDEAF460449DE9E4B3F7B823FD3A3 /* Pods-SwaggerClient */; + targetProxy = FA1A8E2F3FE2899A723889F94EACA0E5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 0F9DE41FC108FC05B463FCAC96ED8EF9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + 21979AE1790135C30E0899E08565E57B /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 41268AF552E2DC6A5873C87C81174F7D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 891AFA4406EB2D944EEA7D0DB1A042FC /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Alamofire-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_MODULE_NAME = Alamofire; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.1; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 553C8AFAF42C60331D9FA03EEF295F28 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 5A7FB8487CCD0B9D57F2BDB6B7A98A95 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4CD9592220A0204D65C56DC92A81DA49 /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/PetstoreClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + PRODUCT_MODULE_NAME = PetstoreClient; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 7A138A57D62AD3F0FEBC72142392B2CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A345BCBDE6C296957161A3E85A47A280 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 891AFA4406EB2D944EEA7D0DB1A042FC /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Alamofire-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_MODULE_NAME = Alamofire; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.1; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + B1EA1C390BCDF899D7871D750D72F598 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + B758FBEC27C09CD6E60596DDF8B1CDBB /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + D4426CC727889C4CB9BCE3EB60935D8B /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 024B6CCE54665B2B8C5A6A361996F330 /* PromiseKit.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PromiseKit/PromiseKit-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; + PRODUCT_MODULE_NAME = PromiseKit; + PRODUCT_NAME = PromiseKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + E57FA9A7602457E80A9F159F84427954 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4CD9592220A0204D65C56DC92A81DA49 /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/PetstoreClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + PRODUCT_MODULE_NAME = PetstoreClient; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + EE29BBD317E28565EB50045103465E23 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 024B6CCE54665B2B8C5A6A361996F330 /* PromiseKit.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PromiseKit/PromiseKit-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PromiseKit/PromiseKit-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PromiseKit/PromiseKit.modulemap"; + PRODUCT_MODULE_NAME = PromiseKit; + PRODUCT_NAME = PromiseKit; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 2191953FE475159265C17FB5EE76C4FD /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 553C8AFAF42C60331D9FA03EEF295F28 /* Debug */, + B1EA1C390BCDF899D7871D750D72F598 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3987909F169C9B57D460372E7FA7D4C2 /* Build configuration list for PBXNativeTarget "PromiseKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D4426CC727889C4CB9BCE3EB60935D8B /* Debug */, + EE29BBD317E28565EB50045103465E23 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0F9DE41FC108FC05B463FCAC96ED8EF9 /* Debug */, + B758FBEC27C09CD6E60596DDF8B1CDBB /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6CA821BA53BCC09E04DDA621C18E2CD7 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E57FA9A7602457E80A9F159F84427954 /* Debug */, + 5A7FB8487CCD0B9D57F2BDB6B7A98A95 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8F09E039867007D3576FEED9032526A8 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7A138A57D62AD3F0FEBC72142392B2CD /* Debug */, + 21979AE1790135C30E0899E08565E57B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E87124444A44B7DB55208E7FEC21D331 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 41268AF552E2DC6A5873C87C81174F7D /* Debug */, + A345BCBDE6C296957161A3E85A47A280 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/LICENSE b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/LICENSE new file mode 100644 index 000000000000..c547fa84913d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/LICENSE @@ -0,0 +1,20 @@ +Copyright 2016, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md new file mode 100644 index 000000000000..473296faa434 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/README.md @@ -0,0 +1,134 @@ +![PromiseKit](http://promisekit.org/public/img/logo-tight.png) + +![badge-pod] ![badge-languages] ![badge-pms] ![badge-platforms] [![Build Status](https://travis-ci.org/mxcl/PromiseKit.svg?branch=master)](https://travis-ci.org/mxcl/PromiseKit) + +[繁體中文](README.zh_Hant.md), [简体中文](README.zh_CN.md) + +--- + +Promises simplify asynchronous programming, freeing you up to focus on the more +important things. They are easy to learn, easy to master and result in clearer, +more readable code. Your co-workers will thank you. + +```swift +UIApplication.shared.isNetworkActivityIndicatorVisible = true + +firstly { + when(URLSession.dataTask(with: url).asImage(), CLLocationManager.promise()) +}.then { image, location -> Void in + self.imageView.image = image + self.label.text = "\(location)" +}.always { + UIApplication.shared.isNetworkActivityIndicatorVisible = false +}.catch { error in + self.show(UIAlertController(for: error), sender: self) +} +``` + +PromiseKit is a thoughtful and complete implementation of promises for any +platform with a `swiftc`, it has *excellent* Objective-C bridging and +*delightful* specializations for iOS, macOS, tvOS and watchOS. + +# Quick Start + +In your [Podfile]: + +```ruby +use_frameworks! + +target "Change Me!" do + pod "PromiseKit", "~> 4.4" +end +``` + +PromiseKit 4 supports Xcode 8.1, 8.2, 8.3 and 9.0; Swift 3.0, 3.1, 3.2 and 4.0; iOS, macOS, tvOS, watchOS, Linux and Android; CocoaPods, Carthage and SwiftPM; ([CI Matrix](https://travis-ci.org/mxcl/PromiseKit)). + +For Carthage, SwiftPM, etc., or for instructions when using older Swifts or +Xcodes see our [Installation Guide](Documentation/Installation.md). + +# Documentation + +* Handbook + * [Getting Started](Documentation/GettingStarted.md) + * [Promises: Common Patterns](Documentation/CommonPatterns.md) + * [Frequently Asked Questions](Documentation/FAQ.md) +* Manual + * [Installation Guide](Documentation/Installation.md) + * [Objective-C Guide](Documentation/ObjectiveC.md) + * [Troubleshooting](Documentation/Troubleshooting.md) (eg. solutions to common compile errors) + * [Appendix](Documentation/Appendix.md) + +If you are looking for a function’s documentation, then please note +[our sources](Sources/) are thoroughly documented. + +# Extensions + +Promises are only as useful as the asynchronous tasks they represent, thus we +have converted (almost) all of Apple’s APIs to promises. The default CocoaPod +comes with promises for UIKit and Foundation, the rest can be installed by +specifying additional subspecs in your `Podfile`, eg: + +```ruby +pod "PromiseKit/MapKit" # MKDirections().promise().then { /*…*/ } +pod "PromiseKit/CoreLocation" # CLLocationManager.promise().then { /*…*/ } +``` + +All our extensions are separate repositories at the [PromiseKit organization]. + +## Choose Your Networking Library + +Promise chains are commonly started with networking, thus we offer multiple +options: [Alamofire], [OMGHTTPURLRQ] and of course (vanilla) `NSURLSession`: + +```swift +// pod 'PromiseKit/Alamofire' +// https://github.com/PromiseKit/Alamofire +Alamofire.request("http://example.com", method: .post).responseJSON().then { json in + //… +}.catch { error in + //… +} + +// pod 'PromiseKit/OMGHTTPURLRQ' +// https://github.com/PromiseKit/OMGHTTPURLRQ +URLSession.POST("http://example.com").asDictionary().then { json in + //… +}.catch { error in + //… +} + +// pod 'PromiseKit/Foundation' +// https://github.com/PromiseKit/Foundation +URLSession.shared.dataTask(url).asDictionary().then { json in + // … +}.catch { error in + //… +} +``` + +Nobody ever got fired for using Alamofire, but at the end of the day, it’s +just a small wrapper around `NSURLSession`. OMGHTTPURLRQ supplements +`NSURLRequest` to make generating REST style requests easier, and the PromiseKit +extensions extend `NSURLSession` to make OMG usage more convenient. But since a +while now most servers accept JSON, so writing a simple API class that uses +vanilla `NSURLSession` and our promises is not hard, and gives you the most +control with the fewest black-boxes. + +The choice is yours. + +# Support + +Ask your question at our [Gitter chat channel] or on [our bug tracker]. + + +[badge-pod]: https://img.shields.io/cocoapods/v/PromiseKit.svg?label=version +[badge-pms]: https://img.shields.io/badge/supports-CocoaPods%20%7C%20Carthage%20%7C%20SwiftPM-green.svg +[badge-languages]: https://img.shields.io/badge/languages-Swift%20%7C%20ObjC-orange.svg +[badge-platforms]: https://img.shields.io/badge/platforms-macOS%20%7C%20iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20Linux-lightgrey.svg +[badge-mit]: https://img.shields.io/badge/license-MIT-blue.svg +[OMGHTTPURLRQ]: https://github.com/mxcl/OMGHTTPURLRQ +[Alamofire]: http://alamofire.org +[PromiseKit organization]: https://github.com/PromiseKit +[Gitter chat channel]: https://gitter.im/mxcl/PromiseKit +[our bug tracker]: https://github.com/mxcl/PromiseKit/issues/new +[Podfile]: https://guides.cocoapods.org/syntax/podfile.html diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h new file mode 100644 index 000000000000..756ba7b7b4d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise+Private.h @@ -0,0 +1,38 @@ +@import Foundation.NSError; +@import Foundation.NSPointerArray; + +#if TARGET_OS_IPHONE + #define NSPointerArrayMake(N) ({ \ + NSPointerArray *aa = [NSPointerArray strongObjectsPointerArray]; \ + aa.count = N; \ + aa; \ + }) +#else + static inline NSPointerArray * __nonnull NSPointerArrayMake(NSUInteger count) { + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + NSPointerArray *aa = [[NSPointerArray class] respondsToSelector:@selector(strongObjectsPointerArray)] + ? [NSPointerArray strongObjectsPointerArray] + : [NSPointerArray pointerArrayWithStrongObjects]; + #pragma clang diagnostic pop + aa.count = count; + return aa; + } +#endif + +#define IsError(o) [o isKindOfClass:[NSError class]] +#define IsPromise(o) [o isKindOfClass:[AnyPromise class]] + +#import "AnyPromise.h" + +@interface AnyPromise (Swift) +- (AnyPromise * __nonnull)__thenOn:(__nonnull dispatch_queue_t)q execute:(id __nullable (^ __nonnull)(id __nullable))body; +- (AnyPromise * __nonnull)__catchOn:(__nonnull dispatch_queue_t)q withPolicy:(PMKCatchPolicy)policy execute:(id __nullable (^ __nonnull)(id __nullable))body; +- (AnyPromise * __nonnull)__alwaysOn:(__nonnull dispatch_queue_t)q execute:(void (^ __nonnull)(void))body; +- (void)__pipe:(void(^ __nonnull)(__nullable id))body; +- (AnyPromise * __nonnull)initWithResolverBlock:(void (^ __nonnull)(PMKResolver __nonnull))resolver; +@end + +extern NSError * __nullable PMKProcessUnhandledException(id __nonnull thrown); + +@class PMKArray; diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h new file mode 100644 index 000000000000..43f8feeef017 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.h @@ -0,0 +1,295 @@ +#import +#import +#import "fwd.h" + +typedef void (^PMKResolver)(id __nullable) NS_REFINED_FOR_SWIFT; + +typedef NS_ENUM(NSInteger, PMKCatchPolicy) { + PMKCatchPolicyAllErrors, + PMKCatchPolicyAllErrorsExceptCancellation +} NS_SWIFT_NAME(CatchPolicy); + + +#if __has_include("PromiseKit-Swift.h") + #pragma clang diagnostic push + #pragma clang diagnostic ignored"-Wdocumentation" + #import "PromiseKit-Swift.h" + #pragma clang diagnostic pop +#else + // this hack because `AnyPromise` is Swift, but we add + // our own methods via the below category. This hack is + // only required while building PromiseKit since, once + // built, the generated -Swift header exists. + + __attribute__((objc_subclassing_restricted)) __attribute__((objc_runtime_name("AnyPromise"))) + @interface AnyPromise : NSObject + @property (nonatomic, readonly) BOOL resolved; + @property (nonatomic, readonly) BOOL pending; + @property (nonatomic, readonly) __nullable id value; + + (instancetype __nonnull)promiseWithResolverBlock:(void (^ __nonnull)(__nonnull PMKResolver))resolveBlock; + + (instancetype __nonnull)promiseWithValue:(__nullable id)value; + @end +#endif + + +@interface AnyPromise (obj) + +@property (nonatomic, readonly) __nullable id value; + +/** + The provided block is executed when its receiver is resolved. + + If you provide a block that takes a parameter, the value of the receiver will be passed as that parameter. + + [NSURLSession GET:url].then(^(NSData *data){ + // do something with data + }); + + @return A new promise that is resolved with the value returned from the provided block. For example: + + [NSURLSession GET:url].then(^(NSData *data){ + return data.length; + }).then(^(NSNumber *number){ + //… + }); + + @warning *Important* The block passed to `then` may take zero, one, two or three arguments, and return an object or return nothing. This flexibility is why the method signature for then is `id`, which means you will not get completion for the block parameter, and must type it yourself. It is safe to type any block syntax here, so to start with try just: `^{}`. + + @warning *Important* If an `NSError` or `NSString` is thrown inside your block, or you return an `NSError` object the next `Promise` will be rejected. See `catch` for documentation on error handling. + + @warning *Important* `then` is always executed on the main queue. + + @see thenOn + @see thenInBackground +*/ +- (AnyPromise * __nonnull (^ __nonnull)(id __nonnull))then NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed on the default queue when the receiver is fulfilled. + + This method is provided as a convenience for `thenOn`. + + @see then + @see thenOn +*/ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))thenInBackground NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed on the dispatch queue of your choice when the receiver is fulfilled. + + @see then + @see thenInBackground +*/ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))thenOn NS_REFINED_FOR_SWIFT; + +#ifndef __cplusplus +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on the main queue. + + @warning *Note* Cancellation errors are not caught. + + @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. + + @see catchWithPolicy +*/ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catch NS_REFINED_FOR_SWIFT; +#endif + +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on the global background queue. + + @warning *Note* Cancellation errors are not caught. + + @warning *Note* Since catch is a c++ keyword, this method is not available in Objective-C++ files. Instead use catchWithPolicy. + + @see catchWithPolicy + */ +- (AnyPromise * __nonnull(^ __nonnull)(id __nonnull))catchInBackground NS_REFINED_FOR_SWIFT; + + +/** + The provided block is executed when the receiver is rejected. + + Provide a block of form `^(NSError *){}` or simply `^{}`. The parameter has type `id` to give you the freedom to choose either. + + The provided block always runs on queue provided. + + @warning *Note* Cancellation errors are not caught. + + @see catchWithPolicy + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, id __nonnull))catchOn NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed when the receiver is rejected with the specified policy. + + Specify the policy with which to catch as the first parameter to your block. Either for all errors, or all errors *except* cancellation errors. + + @see catch +*/ +- (AnyPromise * __nonnull(^ __nonnull)(PMKCatchPolicy, id __nonnull))catchWithPolicy NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed when the receiver is rejected with the specified policy. + + Specify the policy with which to catch as the first parameter to your block. Either for all errors, or all errors *except* cancellation errors. + + The provided block always runs on queue provided. + + @see catch + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, PMKCatchPolicy, id __nonnull))catchOnWithPolicy NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed when the receiver is resolved. + + The provided block always runs on the main queue. + + @see alwaysOn +*/ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))always NS_REFINED_FOR_SWIFT; + +/** + The provided block is executed on the dispatch queue of your choice when the receiver is resolved. + + @see always + */ +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_queue_t __nonnull, dispatch_block_t __nonnull))alwaysOn NS_REFINED_FOR_SWIFT; + +/// @see always +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull))finally __attribute__((deprecated("Use always"))); +/// @see alwaysOn +- (AnyPromise * __nonnull(^ __nonnull)(dispatch_block_t __nonnull, dispatch_block_t __nonnull))finallyOn __attribute__((deprecated("Use always"))); + +/** + Create a new promise with an associated resolver. + + Use this method when wrapping asynchronous code that does *not* use + promises so that this code can be used in promise chains. Generally, + prefer `promiseWithResolverBlock:` as the resulting code is more elegant. + + PMKResolver resolve; + AnyPromise *promise = [[AnyPromise alloc] initWithResolver:&resolve]; + + // later + resolve(@"foo"); + + @param resolver A reference to a block pointer of PMKResolver type. + You can then call your resolver to resolve this promise. + + @return A new promise. + + @warning *Important* The resolver strongly retains the promise. + + @see promiseWithResolverBlock: +*/ +- (instancetype __nonnull)initWithResolver:(PMKResolver __strong __nonnull * __nonnull)resolver NS_REFINED_FOR_SWIFT; + +@end + + + +@interface AnyPromise (Unavailable) + +- (instancetype __nonnull)init __attribute__((unavailable("It is illegal to create an unresolvable promise."))); ++ (instancetype __nonnull)new __attribute__((unavailable("It is illegal to create an unresolvable promise."))); + +@end + + + +typedef void (^PMKAdapter)(id __nullable, NSError * __nullable) NS_REFINED_FOR_SWIFT; +typedef void (^PMKIntegerAdapter)(NSInteger, NSError * __nullable) NS_REFINED_FOR_SWIFT; +typedef void (^PMKBooleanAdapter)(BOOL, NSError * __nullable) NS_REFINED_FOR_SWIFT; + + +@interface AnyPromise (Adapters) + +/** + Create a new promise by adapting an existing asynchronous system. + + The pattern of a completion block that passes two parameters, the first + the result and the second an `NSError` object is so common that we + provide this convenience adapter to make wrapping such systems more + elegant. + + return [PMKPromise promiseWithAdapterBlock:^(PMKAdapter adapter){ + PFQuery *query = [PFQuery …]; + [query findObjectsInBackgroundWithBlock:adapter]; + }]; + + @warning *Important* If both parameters are nil, the promise fulfills, + if both are non-nil the promise rejects. This is per the convention. + + @see http://promisekit.org/sealing-your-own-promises/ + */ ++ (instancetype __nonnull)promiseWithAdapterBlock:(void (^ __nonnull)(PMKAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; + +/** + Create a new promise by adapting an existing asynchronous system. + + Adapts asynchronous systems that complete with `^(NSInteger, NSError *)`. + NSInteger will cast to enums provided the enum has been wrapped with + `NS_ENUM`. All of Apple’s enums are, so if you find one that hasn’t you + may need to make a pull-request. + + @see promiseWithAdapter + */ ++ (instancetype __nonnull)promiseWithIntegerAdapterBlock:(void (^ __nonnull)(PMKIntegerAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; + +/** + Create a new promise by adapting an existing asynchronous system. + + Adapts asynchronous systems that complete with `^(BOOL, NSError *)`. + + @see promiseWithAdapter + */ ++ (instancetype __nonnull)promiseWithBooleanAdapterBlock:(void (^ __nonnull)(PMKBooleanAdapter __nonnull adapter))block NS_REFINED_FOR_SWIFT; + +@end + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + Whenever resolving a promise you may resolve with a tuple, eg. + returning from a `then` or `catch` handler or resolving a new promise. + + Consumers of your Promise are not compelled to consume any arguments and + in fact will often only consume the first parameter. Thus ensure the + order of parameters is: from most-important to least-important. + + Currently PromiseKit limits you to THREE parameters to the manifold. +*/ +#define PMKManifold(...) __PMKManifold(__VA_ARGS__, 3, 2, 1) +#define __PMKManifold(_1, _2, _3, N, ...) __PMKArrayWithCount(N, _1, _2, _3) +extern id __nonnull __PMKArrayWithCount(NSUInteger, ...); + +#ifdef __cplusplus +} // Extern C +#endif + + +@interface AnyPromise (Deprecations) + ++ (instancetype __nonnull)new:(__nullable id)resolvers __attribute__((unavailable("See +promiseWithResolverBlock:"))); ++ (instancetype __nonnull)when:(__nullable id)promises __attribute__((unavailable("See PMKWhen()"))); ++ (instancetype __nonnull)join:(__nullable id)promises __attribute__((unavailable("See PMKJoin()"))); + +@end + + +__attribute__((unavailable("See AnyPromise"))) +@interface PMKPromise +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m new file mode 100644 index 000000000000..c0f81f4c30b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.m @@ -0,0 +1,141 @@ +#import "PMKCallVariadicBlock.m" +#import "AnyPromise+Private.h" + +extern dispatch_queue_t PMKDefaultDispatchQueue(void); + +NSString *const PMKErrorDomain = @"PMKErrorDomain"; + + +@implementation AnyPromise (objc) + +- (instancetype)initWithResolver:(PMKResolver __strong *)resolver { + return [[self class] promiseWithResolverBlock:^(PMKResolver resolve){ + *resolver = resolve; + }]; +} + +- (AnyPromise *(^)(id))then { + return ^(id block) { + return [self __thenOn:PMKDefaultDispatchQueue() execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, id))thenOn { + return ^(dispatch_queue_t queue, id block) { + return [self __thenOn:queue execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))thenInBackground { + return ^(id block) { + return [self __thenOn:dispatch_get_global_queue(0, 0) execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, id))catchOn { + return ^(dispatch_queue_t q, id block) { + return [self __catchOn:q withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catch { + return ^(id block) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(id))catchInBackground { + return ^(id block) { + return [self __catchOn:dispatch_get_global_queue(0, 0) withPolicy:PMKCatchPolicyAllErrorsExceptCancellation execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, PMKCatchPolicy, id))catchOnWithPolicy { + return ^(dispatch_queue_t q, PMKCatchPolicy policy, id block) { + return [self __catchOn:q withPolicy:policy execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(PMKCatchPolicy, id))catchWithPolicy { + return ^(PMKCatchPolicy policy, id block) { + return [self __catchOn:PMKDefaultDispatchQueue() withPolicy:policy execute:^(id obj) { + return PMKCallVariadicBlock(block, obj); + }]; + }; +} + +- (AnyPromise *(^)(dispatch_block_t))always { + return ^(dispatch_block_t block) { + return [self __alwaysOn:PMKDefaultDispatchQueue() execute:block]; + }; +} + +- (AnyPromise *(^)(dispatch_queue_t, dispatch_block_t))alwaysOn { + return ^(dispatch_queue_t queue, dispatch_block_t block) { + return [self __alwaysOn:queue execute:block]; + }; +} + +@end + + + +@implementation AnyPromise (Adapters) + ++ (instancetype)promiseWithAdapterBlock:(void (^)(PMKAdapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(id value, id error){ + resolve(error ?: value); + }); + }]; +} + ++ (instancetype)promiseWithIntegerAdapterBlock:(void (^)(PMKIntegerAdapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(NSInteger value, id error){ + if (error) { + resolve(error); + } else { + resolve(@(value)); + } + }); + }]; +} + ++ (instancetype)promiseWithBooleanAdapterBlock:(void (^)(PMKBooleanAdapter adapter))block { + return [self promiseWithResolverBlock:^(PMKResolver resolve) { + block(^(BOOL value, id error){ + if (error) { + resolve(error); + } else { + resolve(@(value)); + } + }); + }]; +} + +- (id)value { + id obj = [self valueForKey:@"__value"]; + + if ([obj isKindOfClass:[PMKArray class]]) { + return obj[0]; + } else { + return obj; + } +} + +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift new file mode 100644 index 000000000000..251659bc5827 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/AnyPromise.swift @@ -0,0 +1,278 @@ +import Foundation + +/** + AnyPromise is an Objective-C compatible promise. +*/ +@objc(AnyPromise) public class AnyPromise: NSObject { + let state: State + + /** + - Returns: A new `AnyPromise` bound to a `Promise`. + */ + required public init(_ bridge: Promise) { + state = bridge.state + } + + /// hack to ensure Swift picks the right initializer for each of the below + private init(force: Promise) { + state = force.state + } + + /** + - Returns: A new `AnyPromise` bound to a `Promise`. + */ + public convenience init(_ bridge: Promise) { + self.init(force: bridge.then(on: zalgo) { $0 }) + } + + /** + - Returns: A new `AnyPromise` bound to a `Promise`. + */ + convenience public init(_ bridge: Promise) { + self.init(force: bridge.then(on: zalgo) { $0 }) + } + + /** + - Returns: A new `AnyPromise` bound to a `Promise`. + - Note: A “void” `AnyPromise` has a value of `nil`. + */ + convenience public init(_ bridge: Promise) { + self.init(force: bridge.then(on: zalgo) { nil }) + } + + /** + Bridges an `AnyPromise` to a `Promise`. + + - Note: AnyPromises fulfilled with `PMKManifold` lose all but the first fulfillment object. + - Remark: Could not make this an initializer of `Promise` due to generics issues. + */ + public func asPromise() -> Promise { + return Promise(sealant: { resolve in + state.pipe { resolution in + switch resolution { + case .rejected: + resolve(resolution) + case .fulfilled: + let obj = (self as AnyObject).value(forKey: "value") + resolve(.fulfilled(obj)) + } + } + }) + } + + /// - See: `Promise.then()` + public func then(on q: DispatchQueue = .default, execute body: @escaping (Any?) throws -> T) -> Promise { + return asPromise().then(on: q, execute: body) + } + + /// - See: `Promise.then()` + public func then(on q: DispatchQueue = .default, execute body: @escaping (Any?) throws -> AnyPromise) -> Promise { + return asPromise().then(on: q, execute: body) + } + + /// - See: `Promise.then()` + public func then(on q: DispatchQueue = .default, execute body: @escaping (Any?) throws -> Promise) -> Promise { + return asPromise().then(on: q, execute: body) + } + + /// - See: `Promise.always()` + public func always(on q: DispatchQueue = .default, execute body: @escaping () -> Void) -> Promise { + return asPromise().always(execute: body) + } + + /// - See: `Promise.tap()` + public func tap(on q: DispatchQueue = .default, execute body: @escaping (Result) -> Void) -> Promise { + return asPromise().tap(execute: body) + } + + /// - See: `Promise.recover()` + public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> Promise) -> Promise { + return asPromise().recover(on: q, policy: policy, execute: body) + } + + /// - See: `Promise.recover()` + public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> Any?) -> Promise { + return asPromise().recover(on: q, policy: policy, execute: body) + } + + /// - See: `Promise.catch()` + public func `catch`(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) -> Void) { + state.catch(on: q, policy: policy, else: { _ in }, execute: body) + } + +// MARK: ObjC methods + + /** + A promise starts pending and eventually resolves. + - Returns: `true` if the promise has not yet resolved. + */ + @objc public var pending: Bool { + return state.get() == nil + } + + /** + A promise starts pending and eventually resolves. + - Returns: `true` if the promise has resolved. + */ + @objc public var resolved: Bool { + return !pending + } + + /** + The value of the asynchronous task this promise represents. + + A promise has `nil` value if the asynchronous task it represents has not finished. If the value is `nil` the promise is still `pending`. + + - Warning: *Note* Our Swift variant’s value property returns nil if the promise is rejected where AnyPromise will return the error object. This fits with the pattern where AnyPromise is not strictly typed and is more dynamic, but you should be aware of the distinction. + + - Note: If the AnyPromise was fulfilled with a `PMKManifold`, returns only the first fulfillment object. + + - Returns: The value with which this promise was resolved or `nil` if this promise is pending. + */ + @objc private var __value: Any? { + switch state.get() { + case nil: + return nil + case .rejected(let error, _)?: + return error + case .fulfilled(let obj)?: + return obj + } + } + + /** + Creates a resolved promise. + + When developing your own promise systems, it is occasionally useful to be able to return an already resolved promise. + + - Parameter value: The value with which to resolve this promise. Passing an `NSError` will cause the promise to be rejected, passing an AnyPromise will return a new AnyPromise bound to that promise, otherwise the promise will be fulfilled with the value passed. + + - Returns: A resolved promise. + */ + @objc public class func promiseWithValue(_ value: Any?) -> AnyPromise { + let state: State + switch value { + case let promise as AnyPromise: + state = promise.state + case let err as Error: + state = SealedState(resolution: Resolution(err)) + default: + state = SealedState(resolution: .fulfilled(value)) + } + return AnyPromise(state: state) + } + + private init(state: State) { + self.state = state + } + + /** + Create a new promise that resolves with the provided block. + + Use this method when wrapping asynchronous code that does *not* use promises so that this code can be used in promise chains. + + If `resolve` is called with an `NSError` object, the promise is rejected, otherwise the promise is fulfilled. + + Don’t use this method if you already have promises! Instead, just return your promise. + + Should you need to fulfill a promise but have no sensical value to use: your promise is a `void` promise: fulfill with `nil`. + + The block you pass is executed immediately on the calling thread. + + - Parameter block: The provided block is immediately executed, inside the block call `resolve` to resolve this promise and cause any attached handlers to execute. If you are wrapping a delegate-based system, we recommend instead to use: initWithResolver: + + - Returns: A new promise. + - Warning: Resolving a promise with `nil` fulfills it. + - SeeAlso: http://promisekit.org/sealing-your-own-promises/ + - SeeAlso: http://promisekit.org/wrapping-delegation/ + */ + @objc public class func promiseWithResolverBlock(_ body: (@escaping (Any?) -> Void) -> Void) -> AnyPromise { + return AnyPromise(sealant: { resolve in + body { obj in + makeHandler({ _ in obj }, resolve)(obj) + } + }) + } + + private init(sealant: (@escaping (Resolution) -> Void) -> Void) { + var resolve: ((Resolution) -> Void)! + state = UnsealedState(resolver: &resolve) + sealant(resolve) + } + + @objc func __thenOn(_ q: DispatchQueue, execute body: @escaping (Any?) -> Any?) -> AnyPromise { + return AnyPromise(sealant: { resolve in + state.then(on: q, else: resolve, execute: makeHandler(body, resolve)) + }) + } + + @objc func __catchOn(_ q: DispatchQueue, withPolicy policy: CatchPolicy, execute body: @escaping (Any?) -> Any?) -> AnyPromise { + return AnyPromise(sealant: { resolve in + state.catch(on: q, policy: policy, else: resolve) { err in + makeHandler(body, resolve)(err as NSError) + } + }) + } + + @objc func __alwaysOn(_ q: DispatchQueue, execute body: @escaping () -> Void) -> AnyPromise { + return AnyPromise(sealant: { resolve in + state.always(on: q) { resolution in + body() + resolve(resolution) + } + }) + } + + /** + Convert an `AnyPromise` to `Promise`. + + anyPromise.toPromise(T).then { (t: T) -> U in ... } + + - Returns: A `Promise` with the requested type. + - Throws: `CastingError.CastingAnyPromiseFailed(T)` if self's value cannot be downcasted to the given type. + */ + public func asPromise(type: T.Type) -> Promise { + return self.then(on: zalgo) { (value: Any?) -> T in + if let value = value as? T { + return value + } + throw PMKError.castError(type) + } + } + + /// used by PMKWhen and PMKJoin + @objc func __pipe(_ body: @escaping (Any?) -> Void) { + state.pipe { resolution in + switch resolution { + case .rejected(let error, let token): + token.consumed = true // when and join will create a new parent error that is unconsumed + body(error as NSError) + case .fulfilled(let value): + body(value) + } + } + } +} + +extension AnyPromise { + /** + - Returns: A description of the state of this promise. + */ + override public var description: String { + return "AnyPromise: \(state)" + } +} + +private func makeHandler(_ body: @escaping (Any?) -> Any?, _ resolve: @escaping (Resolution) -> Void) -> (Any?) -> Void { + return { obj in + let obj = body(obj) + switch obj { + case let err as Error: + resolve(Resolution(err)) + case let promise as AnyPromise: + promise.state.pipe(resolve) + default: + resolve(.fulfilled(obj)) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/DispatchQueue+Promise.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/DispatchQueue+Promise.swift new file mode 100644 index 000000000000..2c912129e2bf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/DispatchQueue+Promise.swift @@ -0,0 +1,53 @@ +import Dispatch + +extension DispatchQueue { + /** + Submits a block for asynchronous execution on a dispatch queue. + + DispatchQueue.global().promise { + try md5(input) + }.then { md5 in + //… + } + + - Parameter body: The closure that resolves this promise. + - Returns: A new promise resolved by the result of the provided closure. + + - SeeAlso: `DispatchQueue.async(group:qos:flags:execute:)` + - SeeAlso: `dispatch_promise()` + - SeeAlso: `dispatch_promise_on()` + */ + public final func promise(group: DispatchGroup? = nil, qos: DispatchQoS = .default, flags: DispatchWorkItemFlags = [], execute body: @escaping () throws -> T) -> Promise { + + return Promise(sealant: { resolve in + async(group: group, qos: qos, flags: flags) { + do { + resolve(.fulfilled(try body())) + } catch { + resolve(Resolution(error)) + } + } + }) + } + + /// Unavailable due to Swift compiler issues + @available(*, unavailable) + public final func promise(group: DispatchGroup? = nil, qos: DispatchQoS = .default, flags: DispatchWorkItemFlags = [], execute body: () throws -> Promise) -> Promise { fatalError() } + + /** + The default queue for all handlers. + + Defaults to `DispatchQueue.main`. + + - SeeAlso: `PMKDefaultDispatchQueue()` + - SeeAlso: `PMKSetDefaultDispatchQueue()` + */ + class public final var `default`: DispatchQueue { + get { + return __PMKDefaultDispatchQueue() + } + set { + __PMKSetDefaultDispatchQueue(newValue) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift new file mode 100644 index 000000000000..0c746ce45afa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Error.swift @@ -0,0 +1,169 @@ +import Foundation + +public enum PMKError: Error { + /** + The ErrorType for a rejected `join`. + - Parameter 0: The promises passed to this `join` that did not *all* fulfill. + - Note: The array is untyped because Swift generics are fussy with enums. + */ + case join([AnyObject]) + + /** + The completionHandler with form (T?, ErrorType?) was called with (nil, nil) + This is invalid as per Cocoa/Apple calling conventions. + */ + case invalidCallingConvention + + /** + A handler returned its own promise. 99% of the time, this is likely a + programming error. It is also invalid per Promises/A+. + */ + case returnedSelf + + /** `when()` was called with a concurrency of <= 0 */ + case whenConcurrentlyZero + + /** AnyPromise.toPromise failed to cast as requested */ + case castError(Any.Type) +} + +public enum PMKURLError: Error { + /** + The URLRequest succeeded but a valid UIImage could not be decoded from + the data that was received. + */ + case invalidImageData(URLRequest, Data) + + /** + The HTTP request returned a non-200 status code. + */ + case badResponse(URLRequest, Data?, URLResponse?) + + /** + The data could not be decoded using the encoding specified by the HTTP + response headers. + */ + case stringEncoding(URLRequest, Data, URLResponse) + + /** + Usually the `URLResponse` is actually an `HTTPURLResponse`, if so you + can access it using this property. Since it is returned as an unwrapped + optional: be sure. + */ + public var NSHTTPURLResponse: Foundation.HTTPURLResponse! { + switch self { + case .invalidImageData: + return nil + case .badResponse(_, _, let rsp): + return rsp as! Foundation.HTTPURLResponse + case .stringEncoding(_, _, let rsp): + return rsp as! Foundation.HTTPURLResponse + } + } +} + +extension PMKURLError: CustomStringConvertible { + public var description: String { + switch self { + case let .badResponse(rq, data, rsp): + if let data = data, let str = String(data: data, encoding: .utf8), let rsp = rsp { + return "PromiseKit: badResponse: \(rq): \(rsp)\n\(str)" + } else { + fallthrough + } + default: + return "\(self)" + } + } +} + +public enum JSONError: Error { + /// The JSON response was different to that requested + case unexpectedRootNode(Any) +} + +//////////////////////////////////////////////////////////// Cancellation + +public protocol CancellableError: Error { + var isCancelled: Bool { get } +} + +#if !SWIFT_PACKAGE + +private struct ErrorPair: Hashable { + let domain: String + let code: Int + init(_ d: String, _ c: Int) { + domain = d; code = c + } + var hashValue: Int { + return "\(domain):\(code)".hashValue + } +} + +private func ==(lhs: ErrorPair, rhs: ErrorPair) -> Bool { + return lhs.domain == rhs.domain && lhs.code == rhs.code +} + +extension NSError { + @objc public class func cancelledError() -> NSError { + let info = [NSLocalizedDescriptionKey: "The operation was cancelled"] + return NSError(domain: PMKErrorDomain, code: PMKOperationCancelled, userInfo: info) + } + + /** + - Warning: You must call this method before any promises in your application are rejected. Failure to ensure this may lead to concurrency crashes. + - Warning: You must call this method on the main thread. Failure to do this may lead to concurrency crashes. + */ + @objc public class func registerCancelledErrorDomain(_ domain: String, code: Int) { + cancelledErrorIdentifiers.insert(ErrorPair(domain, code)) + } + + /// - Returns: true if the error represents cancellation. + @objc public var isCancelled: Bool { + return (self as Error).isCancelledError + } +} + +private var cancelledErrorIdentifiers = Set([ + ErrorPair(PMKErrorDomain, PMKOperationCancelled), + ErrorPair(NSCocoaErrorDomain, NSUserCancelledError), + ErrorPair(NSURLErrorDomain, NSURLErrorCancelled) +]) + +#endif + +extension Error { + public var isCancelledError: Bool { + if let ce = self as? CancellableError { + return ce.isCancelled + } else { + #if SWIFT_PACKAGE + return false + #else + let ne = self as NSError + return cancelledErrorIdentifiers.contains(ErrorPair(ne.domain, ne.code)) + #endif + } + } +} + +//////////////////////////////////////////////////////// Unhandled Errors +class ErrorConsumptionToken { + var consumed = false + let error: Error + + init(_ error: Error) { + self.error = error + } + + deinit { + if !consumed { +#if os(Linux) || os(Android) + PMKUnhandledErrorHandler(error) +#else + PMKUnhandledErrorHandler(error as NSError) +#endif + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/GlobalState.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/GlobalState.m new file mode 100644 index 000000000000..c156cde9480f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/GlobalState.m @@ -0,0 +1,76 @@ +#import "PromiseKit.h" + +@interface NSError (PMK) +- (BOOL)isCancelled; +@end + +static dispatch_once_t __PMKDefaultDispatchQueueToken; +static dispatch_queue_t __PMKDefaultDispatchQueue; + +dispatch_queue_t PMKDefaultDispatchQueue() { + dispatch_once(&__PMKDefaultDispatchQueueToken, ^{ + if (__PMKDefaultDispatchQueue == nil) { + __PMKDefaultDispatchQueue = dispatch_get_main_queue(); + } + }); + return __PMKDefaultDispatchQueue; +} + +void PMKSetDefaultDispatchQueue(dispatch_queue_t newDefaultQueue) { + dispatch_once(&__PMKDefaultDispatchQueueToken, ^{ + __PMKDefaultDispatchQueue = newDefaultQueue; + }); +} + + +static dispatch_once_t __PMKErrorUnhandlerToken; +static void (^__PMKErrorUnhandler)(NSError *); + +void PMKUnhandledErrorHandler(NSError *error) { + dispatch_once(&__PMKErrorUnhandlerToken, ^{ + if (__PMKErrorUnhandler == nil) { + __PMKErrorUnhandler = ^(NSError *error){ + if (!error.isCancelled) { + NSLog(@"PromiseKit: unhandled error: %@", error); + } + }; + } + }); + return __PMKErrorUnhandler(error); +} + +void PMKSetUnhandledErrorHandler(void(^newHandler)(NSError *)) { + dispatch_once(&__PMKErrorUnhandlerToken, ^{ + __PMKErrorUnhandler = newHandler; + }); +} + + +static dispatch_once_t __PMKUnhandledExceptionHandlerToken; +static NSError *(^__PMKUnhandledExceptionHandler)(id); + +NSError *PMKProcessUnhandledException(id thrown) { + + dispatch_once(&__PMKUnhandledExceptionHandlerToken, ^{ + __PMKUnhandledExceptionHandler = ^id(id reason){ + if ([reason isKindOfClass:[NSError class]]) + return reason; + if ([reason isKindOfClass:[NSString class]]) + return [NSError errorWithDomain:PMKErrorDomain code:PMKUnexpectedError userInfo:@{NSLocalizedDescriptionKey: reason}]; + return nil; + }; + }); + + id err = __PMKUnhandledExceptionHandler(thrown); + if (!err) { + NSLog(@"PromiseKit no longer catches *all* exceptions. However you can change this behavior by setting a new PMKProcessUnhandledException handler."); + @throw thrown; + } + return err; +} + +void PMKSetUnhandledExceptionHandler(NSError *(^newHandler)(id)) { + dispatch_once(&__PMKUnhandledExceptionHandlerToken, ^{ + __PMKUnhandledExceptionHandler = newHandler; + }); +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m new file mode 100644 index 000000000000..700c1b37ef7c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/NSMethodSignatureForBlock.m @@ -0,0 +1,77 @@ +#import + +struct PMKBlockLiteral { + void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock + int flags; + int reserved; + void (*invoke)(void *, ...); + struct block_descriptor { + unsigned long int reserved; // NULL + unsigned long int size; // sizeof(struct Block_literal_1) + // optional helper functions + void (*copy_helper)(void *dst, void *src); // IFF (1<<25) + void (*dispose_helper)(void *src); // IFF (1<<25) + // required ABI.2010.3.16 + const char *signature; // IFF (1<<30) + } *descriptor; + // imported variables +}; + +typedef NS_OPTIONS(NSUInteger, PMKBlockDescriptionFlags) { + PMKBlockDescriptionFlagsHasCopyDispose = (1 << 25), + PMKBlockDescriptionFlagsHasCtor = (1 << 26), // helpers have C++ code + PMKBlockDescriptionFlagsIsGlobal = (1 << 28), + PMKBlockDescriptionFlagsHasStret = (1 << 29), // IFF BLOCK_HAS_SIGNATURE + PMKBlockDescriptionFlagsHasSignature = (1 << 30) +}; + +// It appears 10.7 doesn't support quotes in method signatures. Remove them +// via @rabovik's method. See https://github.com/OliverLetterer/SLObjectiveCRuntimeAdditions/pull/2 +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 +NS_INLINE static const char * pmk_removeQuotesFromMethodSignature(const char *str){ + char *result = malloc(strlen(str) + 1); + BOOL skip = NO; + char *to = result; + char c; + while ((c = *str++)) { + if ('"' == c) { + skip = !skip; + continue; + } + if (skip) continue; + *to++ = c; + } + *to = '\0'; + return result; +} +#endif + +static NSMethodSignature *NSMethodSignatureForBlock(id block) { + if (!block) + return nil; + + struct PMKBlockLiteral *blockRef = (__bridge struct PMKBlockLiteral *)block; + PMKBlockDescriptionFlags flags = (PMKBlockDescriptionFlags)blockRef->flags; + + if (flags & PMKBlockDescriptionFlagsHasSignature) { + void *signatureLocation = blockRef->descriptor; + signatureLocation += sizeof(unsigned long int); + signatureLocation += sizeof(unsigned long int); + + if (flags & PMKBlockDescriptionFlagsHasCopyDispose) { + signatureLocation += sizeof(void(*)(void *dst, void *src)); + signatureLocation += sizeof(void (*)(void *src)); + } + + const char *signature = (*(const char **)signatureLocation); +#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED < __MAC_10_8 + signature = pmk_removeQuotesFromMethodSignature(signature); + NSMethodSignature *nsSignature = [NSMethodSignature signatureWithObjCTypes:signature]; + free((void *)signature); + + return nsSignature; +#endif + return [NSMethodSignature signatureWithObjCTypes:signature]; + } + return 0; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m new file mode 100644 index 000000000000..f89197ec04e8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PMKCallVariadicBlock.m @@ -0,0 +1,114 @@ +#import "NSMethodSignatureForBlock.m" +#import +#import +#import "AnyPromise+Private.h" +#import +#import +#import + +#ifndef PMKLog +#define PMKLog NSLog +#endif + +@interface PMKArray : NSObject { +@public + id objs[3]; + NSUInteger count; +} @end + +@implementation PMKArray + +- (id)objectAtIndexedSubscript:(NSUInteger)idx { + if (count <= idx) { + // this check is necessary due to lack of checks in `pmk_safely_call_block` + return nil; + } + return objs[idx]; +} + +@end + +id __PMKArrayWithCount(NSUInteger count, ...) { + PMKArray *this = [PMKArray new]; + this->count = count; + va_list args; + va_start(args, count); + for (NSUInteger x = 0; x < count; ++x) + this->objs[x] = va_arg(args, id); + va_end(args); + return this; +} + + +static inline id _PMKCallVariadicBlock(id frock, id result) { + NSCAssert(frock, @""); + + NSMethodSignature *sig = NSMethodSignatureForBlock(frock); + const NSUInteger nargs = sig.numberOfArguments; + const char rtype = sig.methodReturnType[0]; + + #define call_block_with_rtype(type) ({^type{ \ + switch (nargs) { \ + case 1: \ + return ((type(^)(void))frock)(); \ + case 2: { \ + const id arg = [result class] == [PMKArray class] ? result[0] : result; \ + return ((type(^)(id))frock)(arg); \ + } \ + case 3: { \ + type (^block)(id, id) = frock; \ + return [result class] == [PMKArray class] \ + ? block(result[0], result[1]) \ + : block(result, nil); \ + } \ + case 4: { \ + type (^block)(id, id, id) = frock; \ + return [result class] == [PMKArray class] \ + ? block(result[0], result[1], result[2]) \ + : block(result, nil, nil); \ + } \ + default: \ + @throw [NSException exceptionWithName:NSInvalidArgumentException reason:@"PromiseKit: The provided block’s argument count is unsupported." userInfo:nil]; \ + }}();}) + + switch (rtype) { + case 'v': + call_block_with_rtype(void); + return nil; + case '@': + return call_block_with_rtype(id) ?: nil; + case '*': { + char *str = call_block_with_rtype(char *); + return str ? @(str) : nil; + } + case 'c': return @(call_block_with_rtype(char)); + case 'i': return @(call_block_with_rtype(int)); + case 's': return @(call_block_with_rtype(short)); + case 'l': return @(call_block_with_rtype(long)); + case 'q': return @(call_block_with_rtype(long long)); + case 'C': return @(call_block_with_rtype(unsigned char)); + case 'I': return @(call_block_with_rtype(unsigned int)); + case 'S': return @(call_block_with_rtype(unsigned short)); + case 'L': return @(call_block_with_rtype(unsigned long)); + case 'Q': return @(call_block_with_rtype(unsigned long long)); + case 'f': return @(call_block_with_rtype(float)); + case 'd': return @(call_block_with_rtype(double)); + case 'B': return @(call_block_with_rtype(_Bool)); + case '^': + if (strcmp(sig.methodReturnType, "^v") == 0) { + call_block_with_rtype(void); + return nil; + } + // else fall through! + default: + @throw [NSException exceptionWithName:@"PromiseKit" reason:@"PromiseKit: Unsupported method signature." userInfo:nil]; + } +} + +static id PMKCallVariadicBlock(id frock, id result) { + @try { + return _PMKCallVariadicBlock(frock, result); + } @catch (id thrown) { + return PMKProcessUnhandledException(thrown); + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+AnyPromise.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+AnyPromise.swift new file mode 100644 index 000000000000..5d77d4c83328 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+AnyPromise.swift @@ -0,0 +1,41 @@ +import class Dispatch.DispatchQueue + +extension Promise { + /** + The provided closure executes once this promise resolves. + + - Parameter on: The queue on which the provided closure executes. + - Parameter body: The closure that is executed when this promise fulfills. + - Returns: A new promise that resolves when the `AnyPromise` returned from the provided closure resolves. For example: + + URLSession.GET(url).then { (data: NSData) -> AnyPromise in + //… + return SCNetworkReachability() + }.then { _ in + //… + } + */ + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> AnyPromise) -> Promise { + return Promise(sealant: { resolve in + state.then(on: q, else: resolve) { value in + try body(value).state.pipe(resolve) + } + }) + } + + @available(*, unavailable, message: "unwrap the promise") + public func then(on: DispatchQueue = .default, execute body: (T) throws -> AnyPromise?) -> Promise { fatalError() } +} + +/** + `firstly` can make chains more readable. +*/ +public func firstly(execute body: () throws -> AnyPromise) -> Promise { + return Promise(sealant: { resolve in + do { + try body().state.pipe(resolve) + } catch { + resolve(Resolution(error)) + } + }) +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift new file mode 100644 index 000000000000..251ea6dcb4b6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise+Properties.swift @@ -0,0 +1,57 @@ +extension Promise { + /** + - Returns: The error with which this promise was rejected; `nil` if this promise is not rejected. + */ + public var error: Error? { + switch state.get() { + case .none: + return nil + case .some(.fulfilled): + return nil + case .some(.rejected(let error, _)): + return error + } + } + + /** + - Returns: `true` if the promise has not yet resolved. + */ + public var isPending: Bool { + return state.get() == nil + } + + /** + - Returns: `true` if the promise has resolved. + */ + public var isResolved: Bool { + return !isPending + } + + /** + - Returns: `true` if the promise was fulfilled. + */ + public var isFulfilled: Bool { + return value != nil + } + + /** + - Returns: `true` if the promise was rejected. + */ + public var isRejected: Bool { + return error != nil + } + + /** + - Returns: The value with which this promise was fulfilled or `nil` if this promise is pending or rejected. + */ + public var value: T? { + switch state.get() { + case .none: + return nil + case .some(.fulfilled(let value)): + return value + case .some(.rejected): + return nil + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift new file mode 100644 index 000000000000..39cfd4ad2914 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Promise.swift @@ -0,0 +1,633 @@ +import class Dispatch.DispatchQueue +import class Foundation.NSError +import func Foundation.NSLog + +/** + A *promise* represents the future value of a (usually) asynchronous task. + + To obtain the value of a promise we call `then`. + + Promises are chainable: `then` returns a promise, you can call `then` on + that promise, which returns a promise, you can call `then` on that + promise, et cetera. + + Promises start in a pending state and *resolve* with a value to become + *fulfilled* or an `Error` to become rejected. + + - SeeAlso: [PromiseKit `then` Guide](http://promisekit.org/docs/) + */ +open class Promise { + let state: State + + /** + Create a new, pending promise. + + func fetchAvatar(user: String) -> Promise { + return Promise { fulfill, reject in + MyWebHelper.GET("\(user)/avatar") { data, err in + guard let data = data else { return reject(err) } + guard let img = UIImage(data: data) else { return reject(MyError.InvalidImage) } + guard let img.size.width > 0 else { return reject(MyError.ImageTooSmall) } + fulfill(img) + } + } + } + + - Parameter resolvers: The provided closure is called immediately on the active thread; commence your asynchronous task, calling either fulfill or reject when it completes. + - Parameter fulfill: Fulfills this promise with the provided value. + - Parameter reject: Rejects this promise with the provided error. + + - Returns: A new promise. + + - Note: If you are wrapping a delegate-based system, we recommend + to use instead: `Promise.pending()` + + - SeeAlso: http://promisekit.org/docs/sealing-promises/ + - SeeAlso: http://promisekit.org/docs/cookbook/wrapping-delegation/ + - SeeAlso: pending() + */ + required public init(resolvers: (_ fulfill: @escaping (T) -> Void, _ reject: @escaping (Error) -> Void) throws -> Void) { + var resolve: ((Resolution) -> Void)! + do { + state = UnsealedState(resolver: &resolve) + try resolvers({ resolve(.fulfilled($0)) }, { error in + #if !PMKDisableWarnings + if self.isPending { + resolve(Resolution(error)) + } else { + NSLog("PromiseKit: warning: reject called on already rejected Promise: \(error)") + } + #else + resolve(Resolution(error)) + #endif + }) + } catch { + resolve(Resolution(error)) + } + } + + /** + Create an already fulfilled promise. + + To create a resolved `Void` promise, do: `Promise(value: ())` + */ + required public init(value: T) { + state = SealedState(resolution: .fulfilled(value)) + } + + /** + Create an already rejected promise. + */ + required public init(error: Error) { + state = SealedState(resolution: Resolution(error)) + } + + /** + Careful with this, it is imperative that sealant can only be called once + or you will end up with spurious unhandled-errors due to possible double + rejections and thus immediately deallocated ErrorConsumptionTokens. + */ + init(sealant: (@escaping (Resolution) -> Void) -> Void) { + var resolve: ((Resolution) -> Void)! + state = UnsealedState(resolver: &resolve) + sealant(resolve) + } + + /** + A `typealias` for the return values of `pending()`. Simplifies declaration of properties that reference the values' containing tuple when this is necessary. For example, when working with multiple `pendingPromise(value: ())`s within the same scope, or when the promise initialization must occur outside of the caller's initialization. + + class Foo: BarDelegate { + var task: Promise.PendingTuple? + } + + - SeeAlso: pending() + */ + public typealias PendingTuple = (promise: Promise, fulfill: (T) -> Void, reject: (Error) -> Void) + + /** + Making promises that wrap asynchronous delegation systems or other larger asynchronous systems without a simple completion handler is easier with pending. + + class Foo: BarDelegate { + let (promise, fulfill, reject) = Promise.pending() + + func barDidFinishWithResult(result: Int) { + fulfill(result) + } + + func barDidError(error: NSError) { + reject(error) + } + } + + - Returns: A tuple consisting of: + 1) A promise + 2) A function that fulfills that promise + 3) A function that rejects that promise + */ + public final class func pending() -> PendingTuple { + var fulfill: ((T) -> Void)! + var reject: ((Error) -> Void)! + let promise = self.init { fulfill = $0; reject = $1 } + return (promise, fulfill, reject) + } + + /** + The provided closure is executed when this promise is resolved. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter body: The closure that is executed when this Promise is fulfilled. + - Returns: A new promise that is resolved with the value returned from the provided closure. For example: + + URLSession.GET(url).then { data -> Int in + //… + return data.length + }.then { length in + //… + } + */ + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> U) -> Promise { + return Promise { resolve in + state.then(on: q, else: resolve) { value in + resolve(.fulfilled(try body(value))) + } + } + } + + /** + The provided closure executes when this promise resolves. + + This variant of `then` allows chaining promises, the promise returned by the provided closure is resolved before the promise returned by this closure resolves. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter execute: The closure that executes when this promise fulfills. + - Returns: A new promise that resolves when the promise returned from the provided closure resolves. For example: + + URLSession.GET(url1).then { data in + return CLLocationManager.promise() + }.then { location in + //… + } + */ + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> Promise) -> Promise { + var resolve: ((Resolution) -> Void)! + let rv = Promise { resolve = $0 } + state.then(on: q, else: resolve) { value in + let promise = try body(value) + guard promise !== rv else { throw PMKError.returnedSelf } + promise.state.pipe(resolve) + } + return rv + } + + /** + The provided closure executes when this promise resolves. + + This variant of `then` allows returning a tuple of promises within provided closure. All of the returned + promises needs be fulfilled for this promise to be marked as resolved. + + - Note: At maximum 5 promises may be returned in a tuple + - Note: If *any* of the tuple-provided promises reject, the returned promise is immediately rejected with that error. + - Warning: In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. + - Parameter on: The queue to which the provided closure dispatches. + - Parameter execute: The closure that executes when this promise fulfills. + - Returns: A new promise that resolves when all promises returned from the provided closure resolve. For example: + + loginPromise.then { _ -> (Promise, Promise) + return (URLSession.GET(userUrl), URLSession.dataTask(with: avatarUrl).asImage()) + }.then { userData, avatarImage in + //… + } + */ + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise)) -> Promise<(U, V)> { + return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1) } + } + + /// This variant of `then` allows returning a tuple of promises within provided closure. + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise, Promise)) -> Promise<(U, V, X)> { + return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1, $0.2) } + } + + /// This variant of `then` allows returning a tuple of promises within provided closure. + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise, Promise, Promise)) -> Promise<(U, V, X, Y)> { + return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3) } + } + + /// This variant of `then` allows returning a tuple of promises within provided closure. + public func then(on q: DispatchQueue = .default, execute body: @escaping (T) throws -> (Promise, Promise, Promise, Promise, Promise)) -> Promise<(U, V, X, Y, Z)> { + return then(on: q, execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3, $0.4) } + } + + /// utility function to serve `then` implementations with `body` returning tuple of promises + private func then(on q: DispatchQueue, execute body: @escaping (T) throws -> V, when: @escaping (V) -> Promise) -> Promise { + return Promise { resolve in + state.then(on: q, else: resolve) { value in + let promise = try body(value) + + // since when(promise) switches to `zalgo`, we have to pipe back to `q` + when(promise).state.pipe(on: q, to: resolve) + } + } + } + + /** + The provided closure executes when this promise rejects. + + Rejecting a promise cascades: rejecting all subsequent promises (unless + recover is invoked) thus you will typically place your catch at the end + of a chain. Often utility promises will not have a catch, instead + delegating the error handling to the caller. + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter policy: The default policy does not execute your handler for cancellation errors. + - Parameter execute: The handler to execute if this promise is rejected. + - Returns: `self` + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + - Important: The promise that is returned is `self`. `catch` cannot affect the chain, in PromiseKit 3 no promise was returned to strongly imply this, however for PromiseKit 4 we started returning a promise so that you can `always` after a catch or return from a function that has an error handler. + */ + @discardableResult + public func `catch`(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) -> Void) -> Promise { + state.catch(on: q, policy: policy, else: { _ in }, execute: body) + return self + } + + /** + The provided closure executes when this promise rejects. + + Unlike `catch`, `recover` continues the chain provided the closure does not throw. Use `recover` in circumstances where recovering the chain from certain errors is a possibility. For example: + + CLLocationManager.promise().recover { error in + guard error == CLError.unknownLocation else { throw error } + return CLLocation.Chicago + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter policy: The default policy does not execute your handler for cancellation errors. + - Parameter execute: The handler to execute if this promise is rejected. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> Promise) -> Promise { + var resolve: ((Resolution) -> Void)! + let rv = Promise { resolve = $0 } + state.catch(on: q, policy: policy, else: resolve) { error in + let promise = try body(error) + guard promise !== rv else { throw PMKError.returnedSelf } + promise.state.pipe(resolve) + } + return rv + } + + /** + The provided closure executes when this promise rejects. + + Unlike `catch`, `recover` continues the chain provided the closure does not throw. Use `recover` in circumstances where recovering the chain from certain errors is a possibility. For example: + + CLLocationManager.promise().recover { error in + guard error == CLError.unknownLocation else { throw error } + return CLLocation.Chicago + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter policy: The default policy does not execute your handler for cancellation errors. + - Parameter execute: The handler to execute if this promise is rejected. + - SeeAlso: [Cancellation](http://promisekit.org/docs/) + */ + public func recover(on q: DispatchQueue = .default, policy: CatchPolicy = .allErrorsExceptCancellation, execute body: @escaping (Error) throws -> T) -> Promise { + return Promise { resolve in + state.catch(on: q, policy: policy, else: resolve) { error in + resolve(.fulfilled(try body(error))) + } + } + } + + /** + The provided closure executes when this promise resolves. + + firstly { + UIApplication.shared.networkActivityIndicatorVisible = true + }.then { + //… + }.always { + UIApplication.shared.networkActivityIndicatorVisible = false + }.catch { + //… + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter execute: The closure that executes when this promise resolves. + - Returns: A new promise, resolved with this promise’s resolution. + */ + @discardableResult + public func always(on q: DispatchQueue = .default, execute body: @escaping () -> Void) -> Promise { + state.always(on: q) { _ in + body() + } + return self + } + + /** + Allows you to “tap” into a promise chain and inspect its result. + + The function you provide cannot mutate the chain. + + URLSession.GET(/*…*/).tap { result in + print(result) + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter execute: The closure that executes when this promise resolves. + - Returns: A new promise, resolved with this promise’s resolution. + */ + @discardableResult + public func tap(on q: DispatchQueue = .default, execute body: @escaping (Result) -> Void) -> Promise { + state.always(on: q) { resolution in + body(Result(resolution)) + } + return self + } + + /** + Void promises are less prone to generics-of-doom scenarios. + - SeeAlso: when.swift contains enlightening examples of using `Promise` to simplify your code. + */ + public func asVoid() -> Promise { + return then(on: zalgo) { _ in return } + } + +// MARK: deprecations + + @available(*, unavailable, renamed: "always()") + public func finally(on: DispatchQueue = DispatchQueue.main, execute body: () -> Void) -> Promise { fatalError() } + + @available(*, unavailable, renamed: "always()") + public func ensure(on: DispatchQueue = DispatchQueue.main, execute body: () -> Void) -> Promise { fatalError() } + + @available(*, unavailable, renamed: "pending()") + public class func `defer`() -> PendingTuple { fatalError() } + + @available(*, unavailable, renamed: "pending()") + public class func `pendingPromise`() -> PendingTuple { fatalError() } + + @available(*, unavailable, message: "deprecated: use then(on: .global())") + public func thenInBackground(execute body: (T) throws -> U) -> Promise { fatalError() } + + @available(*, unavailable, renamed: "catch") + public func onError(policy: CatchPolicy = .allErrors, execute body: (Error) -> Void) { fatalError() } + + @available(*, unavailable, renamed: "catch") + public func errorOnQueue(_ on: DispatchQueue, policy: CatchPolicy = .allErrors, execute body: (Error) -> Void) { fatalError() } + + @available(*, unavailable, renamed: "catch") + public func error(policy: CatchPolicy, execute body: (Error) -> Void) { fatalError() } + + @available(*, unavailable, renamed: "catch") + public func report(policy: CatchPolicy = .allErrors, execute body: (Error) -> Void) { fatalError() } + + @available(*, unavailable, renamed: "init(value:)") + public init(_ value: T) { fatalError() } + +// MARK: disallow `Promise` + + @available(*, unavailable, message: "cannot instantiate Promise") + public init(resolvers: (_ fulfill: (T) -> Void, _ reject: (Error) -> Void) throws -> Void) { fatalError() } + + @available(*, unavailable, message: "cannot instantiate Promise") + public class func pending() -> (promise: Promise, fulfill: (T) -> Void, reject: (Error) -> Void) { fatalError() } + +// MARK: disallow returning `Error` + + @available (*, unavailable, message: "instead of returning the error; throw") + public func then(on: DispatchQueue = .default, execute body: (T) throws -> U) -> Promise { fatalError() } + + @available (*, unavailable, message: "instead of returning the error; throw") + public func recover(on: DispatchQueue = .default, execute body: (Error) throws -> T) -> Promise { fatalError() } + +// MARK: disallow returning `Promise?` + + @available(*, unavailable, message: "unwrap the promise") + public func then(on: DispatchQueue = .default, execute body: (T) throws -> Promise?) -> Promise { fatalError() } + + @available(*, unavailable, message: "unwrap the promise") + public func recover(on: DispatchQueue = .default, execute body: (Error) throws -> Promise?) -> Promise { fatalError() } +} + +extension Promise: CustomStringConvertible { + public var description: String { + return "Promise: \(state)" + } +} + +/** + Judicious use of `firstly` *may* make chains more readable. + + Compare: + + URLSession.GET(url1).then { + URLSession.GET(url2) + }.then { + URLSession.GET(url3) + } + + With: + + firstly { + URLSession.GET(url1) + }.then { + URLSession.GET(url2) + }.then { + URLSession.GET(url3) + } + */ +public func firstly(execute body: () throws -> Promise) -> Promise { + return firstly(execute: body) { $0 } +} + +/** + Judicious use of `firstly` *may* make chains more readable. + Firstly allows to return tuple of promises + + Compare: + + when(fulfilled: URLSession.GET(url1), URLSession.GET(url2)).then { + URLSession.GET(url3) + }.then { + URLSession.GET(url4) + } + + With: + + firstly { + (URLSession.GET(url1), URLSession.GET(url2)) + }.then { _, _ in + URLSession.GET(url2) + }.then { + URLSession.GET(url3) + } + + - Note: At maximum 5 promises may be returned in a tuple + - Note: If *any* of the tuple-provided promises reject, the returned promise is immediately rejected with that error. + */ +public func firstly(execute body: () throws -> (Promise, Promise)) -> Promise<(T, U)> { + return firstly(execute: body) { when(fulfilled: $0.0, $0.1) } +} + +/// Firstly allows to return tuple of promises +public func firstly(execute body: () throws -> (Promise, Promise, Promise)) -> Promise<(T, U, V)> { + return firstly(execute: body) { when(fulfilled: $0.0, $0.1, $0.2) } +} + +/// Firstly allows to return tuple of promises +public func firstly(execute body: () throws -> (Promise, Promise, Promise, Promise)) -> Promise<(T, U, V, W)> { + return firstly(execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3) } +} + +/// Firstly allows to return tuple of promises +public func firstly(execute body: () throws -> (Promise, Promise, Promise, Promise, Promise)) -> Promise<(T, U, V, W, X)> { + return firstly(execute: body) { when(fulfilled: $0.0, $0.1, $0.2, $0.3, $0.4) } +} + +/// utility function to serve `firstly` implementations with `body` returning tuple of promises +private func firstly(execute body: () throws -> V, when: (V) -> Promise) -> Promise { + do { + return when(try body()) + } catch { + return Promise(error: error) + } +} + +@available(*, unavailable, message: "instead of returning the error; throw") +public func firstly(execute body: () throws -> T) -> Promise { fatalError() } + +@available(*, unavailable, message: "use DispatchQueue.promise") +public func firstly(on: DispatchQueue, execute body: () throws -> Promise) -> Promise { fatalError() } + +/** + - SeeAlso: `DispatchQueue.promise(group:qos:flags:execute:)` + */ +@available(*, deprecated: 4.0, renamed: "DispatchQueue.promise") +public func dispatch_promise(_ on: DispatchQueue, _ body: @escaping () throws -> T) -> Promise { + return Promise(value: ()).then(on: on, execute: body) +} + +/** + The underlying resolved state of a promise. + - Remark: Same as `Resolution` but without the associated `ErrorConsumptionToken`. +*/ +public enum Result { + /// Fulfillment + case fulfilled(T) + /// Rejection + case rejected(Error) + + init(_ resolution: Resolution) { + switch resolution { + case .fulfilled(let value): + self = .fulfilled(value) + case .rejected(let error, _): + self = .rejected(error) + } + } + + /** + - Returns: `true` if the result is `fulfilled` or `false` if it is `rejected`. + */ + public var boolValue: Bool { + switch self { + case .fulfilled: + return true + case .rejected: + return false + } + } +} + +/** + An object produced by `Promise.joint()`, along with a promise to which it is bound. + + Joining with a promise via `Promise.join(_:)` will pipe the resolution of that promise to + the joint's bound promise. + + - SeeAlso: `Promise.joint()` + - SeeAlso: `Promise.join(_:)` + */ +public class PMKJoint { + fileprivate var resolve: ((Resolution) -> Void)! +} + +extension Promise { + /** + Provides a safe way to instantiate a `Promise` and resolve it later via its joint and another + promise. + + class Engine { + static func make() -> Promise { + let (enginePromise, joint) = Promise.joint() + let cylinder: Cylinder = Cylinder(explodeAction: { + + // We *could* use an IUO, but there are no guarantees about when + // this callback will be called. Having an actual promise is safe. + + enginePromise.then { engine in + engine.checkOilPressure() + } + }) + + firstly { + Ignition.default.start() + }.then { plugs in + Engine(cylinders: [cylinder], sparkPlugs: plugs) + }.join(joint) + + return enginePromise + } + } + + - Returns: A new promise and its joint. + - SeeAlso: `Promise.join(_:)` + */ + public final class func joint() -> (Promise, PMKJoint) { + let pipe = PMKJoint() + let promise = Promise(sealant: { pipe.resolve = $0 }) + return (promise, pipe) + } + + /** + Pipes the value of this promise to the promise created with the joint. + + - Parameter joint: The joint on which to join. + - SeeAlso: `Promise.joint()` + */ + public func join(_ joint: PMKJoint) { + state.pipe(joint.resolve) + } +} + +extension Promise where T: Collection { + /** + Transforms a `Promise` where `T` is a `Collection` into a `Promise<[U]>` + + URLSession.shared.dataTask(url: /*…*/).asArray().map { result in + return download(result) + }.then { images in + // images is `[UIImage]` + } + + - Parameter on: The queue to which the provided closure dispatches. + - Parameter transform: The closure that executes when this promise resolves. + - Returns: A new promise, resolved with this promise’s resolution. + */ + public func map(on: DispatchQueue = .default, transform: @escaping (T.Iterator.Element) throws -> Promise) -> Promise<[U]> { + return Promise<[U]> { resolve in + return state.then(on: zalgo, else: resolve) { tt in + when(fulfilled: try tt.map(transform)).state.pipe(resolve) + } + } + } +} + +#if swift(>=3.1) +public extension Promise where T == Void { + convenience init() { + self.init(value: ()) + } +} +#endif diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h new file mode 100644 index 000000000000..2651530cbc92 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/PromiseKit.h @@ -0,0 +1,7 @@ +#import "fwd.h" +#import "AnyPromise.h" + +#import // `FOUNDATION_EXPORT` + +FOUNDATION_EXPORT double PromiseKitVersionNumber; +FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift new file mode 100644 index 000000000000..1a87b46af439 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/State.swift @@ -0,0 +1,217 @@ +import class Dispatch.DispatchQueue +import func Foundation.NSLog + +enum Seal { + case pending(Handlers) + case resolved(Resolution) +} + +enum Resolution { + case fulfilled(T) + case rejected(Error, ErrorConsumptionToken) + + init(_ error: Error) { + self = .rejected(error, ErrorConsumptionToken(error)) + } +} + +class State { + + // would be a protocol, but you can't have typed variables of “generic” + // protocols in Swift 2. That is, I couldn’t do var state: State when + // it was a protocol. There is no work around. Update: nor Swift 3 + + func get() -> Resolution? { fatalError("Abstract Base Class") } + func get(body: @escaping (Seal) -> Void) { fatalError("Abstract Base Class") } + + final func pipe(_ body: @escaping (Resolution) -> Void) { + get { seal in + switch seal { + case .pending(let handlers): + handlers.append(body) + case .resolved(let resolution): + body(resolution) + } + } + } + + final func pipe(on q: DispatchQueue, to body: @escaping (Resolution) -> Void) { + pipe { resolution in + contain_zalgo(q) { + body(resolution) + } + } + } + + final func then(on q: DispatchQueue, else rejecter: @escaping (Resolution) -> Void, execute body: @escaping (T) throws -> Void) { + pipe { resolution in + switch resolution { + case .fulfilled(let value): + contain_zalgo(q, rejecter: rejecter) { + try body(value) + } + case .rejected(let error, let token): + rejecter(.rejected(error, token)) + } + } + } + + final func always(on q: DispatchQueue, body: @escaping (Resolution) -> Void) { + pipe { resolution in + contain_zalgo(q) { + body(resolution) + } + } + } + + final func `catch`(on q: DispatchQueue, policy: CatchPolicy, else resolve: @escaping (Resolution) -> Void, execute body: @escaping (Error) throws -> Void) { + pipe { resolution in + switch (resolution, policy) { + case (.fulfilled, _): + resolve(resolution) + case (.rejected(let error, _), .allErrorsExceptCancellation) where error.isCancelledError: + resolve(resolution) + case (let .rejected(error, token), _): + contain_zalgo(q, rejecter: resolve) { + token.consumed = true + try body(error) + } + } + } + } +} + +class UnsealedState: State { + private let barrier = DispatchQueue(label: "org.promisekit.barrier", attributes: .concurrent) + private var seal: Seal + + /** + Quick return, but will not provide the handlers array because + it could be modified while you are using it by another thread. + If you need the handlers, use the second `get` variant. + */ + override func get() -> Resolution? { + var result: Resolution? + barrier.sync { + if case .resolved(let resolution) = self.seal { + result = resolution + } + } + return result + } + + override func get(body: @escaping (Seal) -> Void) { + var sealed = false + barrier.sync { + switch self.seal { + case .resolved: + sealed = true + case .pending: + sealed = false + } + } + if !sealed { + barrier.sync(flags: .barrier) { + switch (self.seal) { + case .pending: + body(self.seal) + case .resolved: + sealed = true // welcome to race conditions + } + } + } + if sealed { + body(seal) // as much as possible we do things OUTSIDE the barrier_sync + } + } + + required init(resolver: inout ((Resolution) -> Void)!) { + seal = .pending(Handlers()) + super.init() + resolver = { resolution in + var handlers: Handlers? + self.barrier.sync(flags: .barrier) { + if case .pending(let hh) = self.seal { + self.seal = .resolved(resolution) + handlers = hh + } + } + if let handlers = handlers { + for handler in handlers { + handler(resolution) + } + } + } + } +#if !PMKDisableWarnings + deinit { + if case .pending = seal { + NSLog("PromiseKit: Pending Promise deallocated! This is usually a bug") + } + } +#endif +} + +class SealedState: State { + fileprivate let resolution: Resolution + + init(resolution: Resolution) { + self.resolution = resolution + } + + override func get() -> Resolution? { + return resolution + } + + override func get(body: @escaping (Seal) -> Void) { + body(.resolved(resolution)) + } +} + +class Handlers: Sequence { + var bodies: [(Resolution) -> Void] = [] + + func append(_ body: @escaping (Resolution) -> Void) { + bodies.append(body) + } + + func makeIterator() -> IndexingIterator<[(Resolution) -> Void]> { + return bodies.makeIterator() + } + + var count: Int { + return bodies.count + } +} + +extension Resolution: CustomStringConvertible { + var description: String { + switch self { + case .fulfilled(let value): + return "Fulfilled with value: \(value)" + case .rejected(let error): + return "Rejected with error: \(error)" + } + } +} + +extension UnsealedState: CustomStringConvertible { + var description: String { + var rv: String! + get { seal in + switch seal { + case .pending(let handlers): + rv = "Pending with \(handlers.count) handlers" + case .resolved(let resolution): + rv = "\(resolution)" + } + } + return "UnsealedState: \(rv)" + } +} + +extension SealedState: CustomStringConvertible { + var description: String { + return "SealedState: \(resolution)" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift new file mode 100644 index 000000000000..b5364fe81dce --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/Zalgo.swift @@ -0,0 +1,79 @@ +import class Dispatch.DispatchQueue +import class Foundation.Thread + +/** + `zalgo` causes your handlers to be executed as soon as their promise resolves. + + Usually all handlers are dispatched to a queue (the main queue by default); the `on:` parameter of `then` configures this. Its default value is `DispatchQueue.main`. + + - Important: `zalgo` is dangerous. + + Compare: + + var x = 0 + foo.then { + print(x) // => 1 + } + x++ + + With: + + var x = 0 + foo.then(on: zalgo) { + print(x) // => 0 or 1 + } + x++ + + In the latter case the value of `x` may be `0` or `1` depending on whether `foo` is resolved. This is a race-condition that is easily avoided by not using `zalgo`. + + - Important: you cannot control the queue that your handler executes if using `zalgo`. + + - Note: `zalgo` is provided for libraries providing promises that have good tests that prove “Unleashing Zalgo” is safe. You can also use it in your application code in situations where performance is critical, but be careful: read the essay liked below to understand the risks. + + - SeeAlso: [Designing APIs for Asynchrony](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) + - SeeAlso: `waldo` + */ +public let zalgo = DispatchQueue(label: "Zalgo") + +/** + `waldo` is dangerous. + + `waldo` is `zalgo`, unless the current queue is the main thread, in which + case we dispatch to the default background queue. + + If your block is likely to take more than a few milliseconds to execute, + then you should use waldo: 60fps means the main thread cannot hang longer + than 17 milliseconds: don’t contribute to UI lag. + + Conversely if your then block is trivial, use zalgo: GCD is not free and + for whatever reason you may already be on the main thread so just do what + you are doing quickly and pass on execution. + + It is considered good practice for asynchronous APIs to complete onto the + main thread. Apple do not always honor this, nor do other developers. + However, they *should*. In that respect waldo is a good choice if your + then is going to take some time and doesn’t interact with the UI. + + Please note (again) that generally you should not use `zalgo` or `waldo`. + The performance gains are negligible and we provide these functions only out + of a misguided sense that library code should be as optimized as possible. + If you use either without tests proving their correctness you may + unwillingly introduce horrendous, near-impossible-to-trace bugs. + + - SeeAlso: `zalgo` + */ +public let waldo = DispatchQueue(label: "Waldo") + +@inline(__always) func contain_zalgo(_ q: DispatchQueue, body: @escaping () -> Void) { + if q === zalgo || q === waldo && !Thread.isMainThread { + body() + } else { + q.async(execute: body) + } +} + +@inline(__always) func contain_zalgo(_ q: DispatchQueue, rejecter reject: @escaping (Resolution) -> Void, block: @escaping () throws -> Void) { + contain_zalgo(q) { + do { try block() } catch { reject(Resolution(error)) } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m new file mode 100644 index 000000000000..25f9966fc59e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.m @@ -0,0 +1,14 @@ +#import "AnyPromise.h" +@import Dispatch; +@import Foundation.NSDate; +@import Foundation.NSValue; + +/// @return A promise that fulfills after the specified duration. +AnyPromise *PMKAfter(NSTimeInterval duration) { + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + dispatch_time_t time = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(duration * NSEC_PER_SEC)); + dispatch_after(time, dispatch_get_global_queue(0, 0), ^{ + resolve(@(duration)); + }); + }]; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift new file mode 100644 index 000000000000..902dc4264a30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/after.swift @@ -0,0 +1,37 @@ +import struct Foundation.TimeInterval +import Dispatch + +/** + - Returns: A new promise that fulfills after the specified duration. +*/ +@available(*, deprecated: 4.3, message: "Use after(seconds:)") +public func after(interval: TimeInterval) -> Promise { + return after(seconds: interval) +} + +/** + after(.seconds(2)).then { + } + +- Returns: A new promise that fulfills after the specified duration. +*/ +public func after(seconds: TimeInterval) -> Promise { + return Promise { fulfill, _ in + let when = DispatchTime.now() + seconds + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + } +} + +/** + - Returns: A new promise that fulfills after the specified duration. +*/ +public func after(interval: DispatchTimeInterval) -> Promise { + return Promise { fulfill, _ in + let when = DispatchTime.now() + interval + #if swift(>=4.0) + DispatchQueue.global().asyncAfter(deadline: when) { fulfill(()) } + #else + DispatchQueue.global().asyncAfter(deadline: when, execute: fulfill) + #endif + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m new file mode 100644 index 000000000000..ecb89f711183 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/dispatch_promise.m @@ -0,0 +1,10 @@ +#import "AnyPromise.h" +@import Dispatch; + +AnyPromise *dispatch_promise_on(dispatch_queue_t queue, id block) { + return [AnyPromise promiseWithValue:nil].thenOn(queue, block); +} + +AnyPromise *dispatch_promise(id block) { + return dispatch_promise_on(dispatch_get_global_queue(0, 0), block); +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h new file mode 100644 index 000000000000..26f814431b7a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/fwd.h @@ -0,0 +1,240 @@ +#import +#import + +@class AnyPromise; +extern NSString * __nonnull const PMKErrorDomain; + +#define PMKFailingPromiseIndexKey @"PMKFailingPromiseIndexKey" +#define PMKJoinPromisesKey @"PMKJoinPromisesKey" + +#define PMKUnexpectedError 1l +#define PMKInvalidUsageError 3l +#define PMKAccessDeniedError 4l +#define PMKOperationCancelled 5l +#define PMKOperationFailed 8l +#define PMKTaskError 9l +#define PMKJoinError 10l + + +#ifdef __cplusplus +extern "C" { +#endif + +/** + @return A new promise that resolves after the specified duration. + + @parameter duration The duration in seconds to wait before this promise is resolve. + + For example: + + PMKAfter(1).then(^{ + //… + }); +*/ +extern AnyPromise * __nonnull PMKAfter(NSTimeInterval duration) NS_REFINED_FOR_SWIFT; + + + +/** + `when` is a mechanism for waiting more than one asynchronous task and responding when they are all complete. + + `PMKWhen` accepts varied input. If an array is passed then when those promises fulfill, when’s promise fulfills with an array of fulfillment values. If a dictionary is passed then the same occurs, but when’s promise fulfills with a dictionary of fulfillments keyed as per the input. + + Interestingly, if a single promise is passed then when waits on that single promise, and if a single non-promise object is passed then when fulfills immediately with that object. If the array or dictionary that is passed contains objects that are not promises, then these objects are considered fulfilled promises. The reason we do this is to allow a pattern know as "abstracting away asynchronicity". + + If *any* of the provided promises reject, the returned promise is immediately rejected with that promise’s rejection. The error’s `userInfo` object is supplemented with `PMKFailingPromiseIndexKey`. + + For example: + + PMKWhen(@[promise1, promise2]).then(^(NSArray *results){ + //… + }); + + @warning *Important* In the event of rejection the other promises will continue to resolve and as per any other promise will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed. In such situations use `PMKJoin`. + + @param input The input upon which to wait before resolving this promise. + + @return A promise that is resolved with either: + + 1. An array of values from the provided array of promises. + 2. The value from the provided promise. + 3. The provided non-promise object. + + @see PMKJoin + +*/ +extern AnyPromise * __nonnull PMKWhen(id __nonnull input) NS_REFINED_FOR_SWIFT; + + + +/** + Creates a new promise that resolves only when all provided promises have resolved. + + Typically, you should use `PMKWhen`. + + For example: + + PMKJoin(@[promise1, promise2]).then(^(NSArray *resultingValues){ + //… + }).catch(^(NSError *error){ + assert(error.domain == PMKErrorDomain); + assert(error.code == PMKJoinError); + + NSArray *promises = error.userInfo[PMKJoinPromisesKey]; + for (AnyPromise *promise in promises) { + if (promise.rejected) { + //… + } + } + }); + + @param promises An array of promises. + + @return A promise that thens three parameters: + + 1) An array of mixed values and errors from the resolved input. + 2) An array of values from the promises that fulfilled. + 3) An array of errors from the promises that rejected or nil if all promises fulfilled. + + @see when +*/ +AnyPromise *__nonnull PMKJoin(NSArray * __nonnull promises) NS_REFINED_FOR_SWIFT; + + + +/** + Literally hangs this thread until the promise has resolved. + + Do not use hang… unless you are testing, playing or debugging. + + If you use it in production code I will literally and honestly cry like a child. + + @return The resolved value of the promise. + + @warning T SAFE. IT IS NOT SAFE. IT IS NOT SAFE. IT IS NOT SAFE. IT IS NO +*/ +extern id __nullable PMKHang(AnyPromise * __nonnull promise); + + + +/** + Sets the unhandled exception handler. + + If an exception is thrown inside an AnyPromise handler it is caught and + this handler is executed to determine if the promise is rejected. + + The default handler rejects the promise if an NSError or an NSString is + thrown. + + The default handler in PromiseKit 1.x would reject whatever object was + thrown (including nil). + + @warning *Important* This handler is provided to allow you to customize + which exceptions cause rejection and which abort. You should either + return a fully-formed NSError object or nil. Returning nil causes the + exception to be re-thrown. + + @warning *Important* The handler is executed on an undefined queue. + + @warning *Important* This function is thread-safe, but to facilitate this + it can only be called once per application lifetime and it must be called + before any promise in the app throws an exception. Subsequent calls will + silently fail. +*/ +extern void PMKSetUnhandledExceptionHandler(NSError * __nullable (^__nonnull handler)(id __nullable)); + +/** + If an error cascades through a promise chain and is not handled by any + `catch`, the unhandled error handler is called. The default logs all + non-cancelled errors. + + This handler can only be set once, and must be set before any promises + are rejected in your application. + + PMKSetUnhandledErrorHandler({ error in + mylogf("Unhandled error: \(error)") + }) + + - Warning: *Important* The handler is executed on an undefined queue. + - Warning: *Important* Don’t use promises in your handler, or you risk an infinite error loop. +*/ +extern void PMKSetUnhandledErrorHandler(void (^__nonnull handler)(NSError * __nonnull)); + +extern void PMKUnhandledErrorHandler(NSError * __nonnull error); + +/** + Executes the provided block on a background queue. + + dispatch_promise is a convenient way to start a promise chain where the + first step needs to run synchronously on a background queue. + + dispatch_promise(^{ + return md5(input); + }).then(^(NSString *md5){ + NSLog(@"md5: %@", md5); + }); + + @param block The block to be executed in the background. Returning an `NSError` will reject the promise, everything else (including void) fulfills the promise. + + @return A promise resolved with the return value of the provided block. + + @see dispatch_async +*/ +extern AnyPromise * __nonnull dispatch_promise(id __nonnull block) NS_SWIFT_UNAVAILABLE("Use our `DispatchQueue.async` override instead"); + + + +/** + Executes the provided block on the specified background queue. + + dispatch_promise_on(myDispatchQueue, ^{ + return md5(input); + }).then(^(NSString *md5){ + NSLog(@"md5: %@", md5); + }); + + @param block The block to be executed in the background. Returning an `NSError` will reject the promise, everything else (including void) fulfills the promise. + + @return A promise resolved with the return value of the provided block. + + @see dispatch_promise +*/ +extern AnyPromise * __nonnull dispatch_promise_on(dispatch_queue_t __nonnull queue, id __nonnull block) NS_SWIFT_UNAVAILABLE("Use our `DispatchQueue.async` override instead"); + + +#define PMKJSONDeserializationOptions ((NSJSONReadingOptions)(NSJSONReadingAllowFragments | NSJSONReadingMutableContainers)) + +/** + Really we shouldn’t assume JSON for (application|text)/(x-)javascript, + really we should return a String of Javascript. However in practice + for the apps we write it *will be* JSON. Thus if you actually want + a Javascript String, use the promise variant of our category functions. +*/ +#define PMKHTTPURLResponseIsJSON(rsp) [@[@"application/json", @"text/json", @"text/javascript", @"application/x-javascript", @"application/javascript"] containsObject:[rsp MIMEType]] +#define PMKHTTPURLResponseIsImage(rsp) [@[@"image/tiff", @"image/jpeg", @"image/gif", @"image/png", @"image/ico", @"image/x-icon", @"image/bmp", @"image/x-bmp", @"image/x-xbitmap", @"image/x-win-bitmap"] containsObject:[rsp MIMEType]] +#define PMKHTTPURLResponseIsText(rsp) [[rsp MIMEType] hasPrefix:@"text/"] + +/** + The default queue for all calls to `then`, `catch` etc. is the main queue. + + By default this returns dispatch_get_main_queue() + */ +extern __nonnull dispatch_queue_t PMKDefaultDispatchQueue(void) NS_REFINED_FOR_SWIFT; + +/** + You may alter the default dispatch queue, but you may only alter it once, and you must alter it before any `then`, etc. calls are made in your app. + + The primary motivation for this function is so that your tests can operate off the main thread preventing dead-locking, or with `zalgo` to speed them up. +*/ +extern void PMKSetDefaultDispatchQueue(__nonnull dispatch_queue_t) NS_REFINED_FOR_SWIFT; + +#ifdef __cplusplus +} // Extern C +#endif + + +typedef NS_OPTIONS(NSInteger, PMKAnimationOptions) { + PMKAnimationOptionsNone = 1 << 0, + PMKAnimationOptionsAppear = 1 << 1, + PMKAnimationOptionsDisappear = 1 << 2, +}; diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m new file mode 100644 index 000000000000..1065d91f2f3b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/hang.m @@ -0,0 +1,29 @@ +#import "AnyPromise.h" +#import "AnyPromise+Private.h" +@import CoreFoundation.CFRunLoop; + +/** + Suspends the active thread waiting on the provided promise. + + @return The value of the provided promise once resolved. + */ +id PMKHang(AnyPromise *promise) { + if (promise.pending) { + static CFRunLoopSourceContext context; + + CFRunLoopRef runLoop = CFRunLoopGetCurrent(); + CFRunLoopSourceRef runLoopSource = CFRunLoopSourceCreate(NULL, 0, &context); + CFRunLoopAddSource(runLoop, runLoopSource, kCFRunLoopDefaultMode); + + promise.always(^{ + CFRunLoopStop(runLoop); + }); + while (promise.pending) { + CFRunLoopRun(); + } + CFRunLoopRemoveSource(runLoop, runLoopSource, kCFRunLoopDefaultMode); + CFRelease(runLoopSource); + } + + return promise.value; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m new file mode 100644 index 000000000000..979f092df088 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.m @@ -0,0 +1,54 @@ +@import Foundation.NSDictionary; +#import "AnyPromise+Private.h" +#import +@import Foundation.NSError; +@import Foundation.NSNull; +#import "PromiseKit.h" +#import + +/** + Waits on all provided promises. + + `PMKWhen` rejects as soon as one of the provided promises rejects. `PMKJoin` waits on all provided promises, then rejects if any of those promises rejects, otherwise it fulfills with values from the provided promises. + + - Returns: A new promise that resolves once all the provided promises resolve. +*/ +AnyPromise *PMKJoin(NSArray *promises) { + if (promises == nil) + return [AnyPromise promiseWithValue:[NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"PMKJoin(nil)"}]]; + + if (promises.count == 0) + return [AnyPromise promiseWithValue:promises]; + + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + NSPointerArray *results = NSPointerArrayMake(promises.count); + __block atomic_int countdown = promises.count; + __block BOOL rejected = NO; + + [promises enumerateObjectsUsingBlock:^(AnyPromise *promise, NSUInteger ii, BOOL *stop) { + [promise __pipe:^(id value) { + + if (IsError(value)) { + rejected = YES; + } + + //FIXME surely this isn't thread safe on multiple cores? + [results replacePointerAtIndex:ii withPointer:(__bridge void *)(value ?: [NSNull null])]; + + atomic_fetch_sub_explicit(&countdown, 1, memory_order_relaxed); + + if (countdown == 0) { + if (!rejected) { + resolve(results.allObjects); + } else { + id userInfo = @{PMKJoinPromisesKey: promises}; + id err = [NSError errorWithDomain:PMKErrorDomain code:PMKJoinError userInfo:userInfo]; + resolve(err); + } + } + }]; + + (void) stop; + }]; + }]; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift new file mode 100644 index 000000000000..a50c4665d472 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/join.swift @@ -0,0 +1,60 @@ +import Dispatch + +/** + Waits on all provided promises. + + `when` rejects as soon as one of the provided promises rejects. `join` waits on all provided promises, then rejects if any of those promises rejected, otherwise it fulfills with values from the provided promises. + + join(promise1, promise2, promise3).then { results in + //… + }.catch { error in + switch error { + case Error.Join(let promises): + //… + } + } + + - Returns: A new promise that resolves once all the provided promises resolve. + - SeeAlso: `PromiseKit.Error.join` +*/ +@available(*, deprecated: 4.0, message: "Use when(resolved:)") +public func join(_ promises: Promise...) -> Promise<[T]> { + return join(promises) +} + +/// Waits on all provided promises. +@available(*, deprecated: 4.0, message: "Use when(resolved:)") +public func join(_ promises: [Promise]) -> Promise { + return join(promises).then(on: zalgo) { (_: [Void]) in return Promise(value: ()) } +} + +/// Waits on all provided promises. +@available(*, deprecated: 4.0, message: "Use when(resolved:)") +public func join(_ promises: [Promise]) -> Promise<[T]> { + guard !promises.isEmpty else { return Promise(value: []) } + + var countdown = promises.count + let barrier = DispatchQueue(label: "org.promisekit.barrier.join", attributes: .concurrent) + var rejected = false + + return Promise { fulfill, reject in + for promise in promises { + promise.state.pipe { resolution in + barrier.sync(flags: .barrier) { + if case .rejected(_, let token) = resolution { + token.consumed = true // the parent Error.Join consumes all + rejected = true + } + countdown -= 1 + if countdown == 0 { + if rejected { + reject(PMKError.join(promises)) + } else { + fulfill(promises.map { $0.value! }) + } + } + } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift new file mode 100644 index 000000000000..9ff17005c9e3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/race.swift @@ -0,0 +1,40 @@ +/** + Resolves with the first resolving promise from a set of promises. + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: A new promise that resolves when the first promise in the provided promises resolves. + - Warning: If any of the provided promises reject, the returned promise is rejected. + - Warning: aborts if the array is empty. +*/ +public func race(promises: [Promise]) -> Promise { + guard promises.count > 0 else { + fatalError("Cannot race with an empty array of promises") + } + return _race(promises: promises) +} + +/** + Resolves with the first resolving promise from a set of promises. + + race(promise1, promise2, promise3).then { winner in + //… + } + + - Returns: A new promise that resolves when the first promise in the provided promises resolves. + - Warning: If any of the provided promises reject, the returned promise is rejected. + - Warning: aborts if the array is empty. +*/ +public func race(_ promises: Promise...) -> Promise { + return _race(promises: promises) +} + +private func _race(promises: [Promise]) -> Promise { + return Promise(sealant: { resolve in + for promise in promises { + promise.state.pipe(resolve) + } + }) +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m new file mode 100644 index 000000000000..cafb54720c98 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.m @@ -0,0 +1,100 @@ +@import Foundation.NSDictionary; +#import "AnyPromise+Private.h" +@import Foundation.NSProgress; +#import +@import Foundation.NSError; +@import Foundation.NSNull; +#import "PromiseKit.h" + +// NSProgress resources: +// * https://robots.thoughtbot.com/asynchronous-nsprogress +// * http://oleb.net/blog/2014/03/nsprogress/ +// NSProgress! Beware! +// * https://github.com/AFNetworking/AFNetworking/issues/2261 + +/** + Wait for all promises in a set to resolve. + + @note If *any* of the provided promises reject, the returned promise is immediately rejected with that error. + @warning In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed, in such situations use `when(resolved:)`. + @param promises The promises upon which to wait before the returned promise resolves. + @note PMKWhen provides NSProgress. + @return A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. +*/ +AnyPromise *PMKWhen(id promises) { + if (promises == nil) + return [AnyPromise promiseWithValue:[NSError errorWithDomain:PMKErrorDomain code:PMKInvalidUsageError userInfo:@{NSLocalizedDescriptionKey: @"PMKWhen(nil)"}]]; + + if ([promises isKindOfClass:[NSArray class]] || [promises isKindOfClass:[NSDictionary class]]) { + if ([promises count] == 0) + return [AnyPromise promiseWithValue:promises]; + } else if ([promises isKindOfClass:[AnyPromise class]]) { + promises = @[promises]; + } else { + return [AnyPromise promiseWithValue:promises]; + } + +#ifndef PMKDisableProgress + NSProgress *progress = [NSProgress progressWithTotalUnitCount:(int64_t)[promises count]]; + progress.pausable = NO; + progress.cancellable = NO; +#else + struct PMKProgress { + int completedUnitCount; + int totalUnitCount; + double fractionCompleted; + }; + __block struct PMKProgress progress; +#endif + + __block int32_t countdown = (int32_t)[promises count]; + BOOL const isdict = [promises isKindOfClass:[NSDictionary class]]; + + return [AnyPromise promiseWithResolverBlock:^(PMKResolver resolve) { + NSInteger index = 0; + + for (__strong id key in promises) { + AnyPromise *promise = isdict ? promises[key] : key; + if (!isdict) key = @(index); + + if (![promise isKindOfClass:[AnyPromise class]]) + promise = [AnyPromise promiseWithValue:promise]; + + [promise __pipe:^(id value){ + if (progress.fractionCompleted >= 1) + return; + + if (IsError(value)) { + progress.completedUnitCount = progress.totalUnitCount; + + NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:[value userInfo] ?: @{}]; + userInfo[PMKFailingPromiseIndexKey] = key; + [userInfo setObject:value forKey:NSUnderlyingErrorKey]; + id err = [[NSError alloc] initWithDomain:[value domain] code:[value code] userInfo:userInfo]; + resolve(err); + } + else if (OSAtomicDecrement32(&countdown) == 0) { + progress.completedUnitCount = progress.totalUnitCount; + + id results; + if (isdict) { + results = [NSMutableDictionary new]; + for (id key in promises) { + id promise = promises[key]; + results[key] = IsPromise(promise) ? ((AnyPromise *)promise).value : promise; + } + } else { + results = [NSMutableArray new]; + for (AnyPromise *promise in promises) { + id value = IsPromise(promise) ? (promise.value ?: [NSNull null]) : promise; + [results addObject:value]; + } + } + resolve(results); + } else { + progress.completedUnitCount++; + } + }]; + } + }]; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift new file mode 100644 index 000000000000..2e48ea4d68b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/when.swift @@ -0,0 +1,257 @@ +import Foundation +import Dispatch + +private func _when(_ promises: [Promise]) -> Promise { + let root = Promise.pending() + var countdown = promises.count + guard countdown > 0 else { + #if swift(>=4.0) + root.fulfill(()) + #else + root.fulfill() + #endif + return root.promise + } + +#if PMKDisableProgress || os(Linux) + var progress: (completedUnitCount: Int, totalUnitCount: Int) = (0, 0) +#else + let progress = Progress(totalUnitCount: Int64(promises.count)) + progress.isCancellable = false + progress.isPausable = false +#endif + + let barrier = DispatchQueue(label: "org.promisekit.barrier.when", attributes: .concurrent) + + for promise in promises { + promise.state.pipe { resolution in + barrier.sync(flags: .barrier) { + switch resolution { + case .rejected(let error, let token): + token.consumed = true + if root.promise.isPending { + progress.completedUnitCount = progress.totalUnitCount + root.reject(error) + } + case .fulfilled: + guard root.promise.isPending else { return } + progress.completedUnitCount += 1 + countdown -= 1 + if countdown == 0 { + #if swift(>=4.0) + root.fulfill(()) + #else + root.fulfill() + #endif + } + } + } + } + } + + return root.promise +} + +/** + Wait for all promises in a set to fulfill. + + For example: + + when(fulfilled: promise1, promise2).then { results in + //… + }.catch { error in + switch error { + case URLError.notConnectedToInternet: + //… + case CLError.denied: + //… + } + } + + - Note: If *any* of the provided promises reject, the returned promise is immediately rejected with that error. + - Warning: In the event of rejection the other promises will continue to resolve and, as per any other promise, will either fulfill or reject. This is the right pattern for `getter` style asynchronous tasks, but often for `setter` tasks (eg. storing data on a server), you most likely will need to wait on all tasks and then act based on which have succeeded and which have failed, in such situations use `when(resolved:)`. + - Parameter promises: The promises upon which to wait before the returned promise resolves. + - Returns: A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. + - Note: `when` provides `NSProgress`. + - SeeAlso: `when(resolved:)` +*/ +public func when(fulfilled promises: [Promise]) -> Promise<[T]> { + return _when(promises).then(on: zalgo) { promises.map { $0.value! } } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled promises: Promise...) -> Promise { + return _when(promises) +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled promises: [Promise]) -> Promise { + return _when(promises) +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: Promise, _ pv: Promise) -> Promise<(U, V)> { + return _when([pu.asVoid(), pv.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!) } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: Promise, _ pv: Promise, _ pw: Promise) -> Promise<(U, V, W)> { + return _when([pu.asVoid(), pv.asVoid(), pw.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!, pw.value!) } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: Promise, _ pv: Promise, _ pw: Promise, _ px: Promise) -> Promise<(U, V, W, X)> { + return _when([pu.asVoid(), pv.asVoid(), pw.asVoid(), px.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!, pw.value!, px.value!) } +} + +/// Wait for all promises in a set to fulfill. +public func when(fulfilled pu: Promise, _ pv: Promise, _ pw: Promise, _ px: Promise, _ py: Promise) -> Promise<(U, V, W, X, Y)> { + return _when([pu.asVoid(), pv.asVoid(), pw.asVoid(), px.asVoid(), py.asVoid()]).then(on: zalgo) { (pu.value!, pv.value!, pw.value!, px.value!, py.value!) } +} + +/** + Generate promises at a limited rate and wait for all to fulfill. + + For example: + + func downloadFile(url: URL) -> Promise { + // ... + } + + let urls: [URL] = /*…*/ + let urlGenerator = urls.makeIterator() + + let generator = AnyIterator> { + guard url = urlGenerator.next() else { + return nil + } + + return downloadFile(url) + } + + when(generator, concurrently: 3).then { datum: [Data] -> Void in + // ... + } + + - Warning: Refer to the warnings on `when(fulfilled:)` + - Parameter promiseGenerator: Generator of promises. + - Returns: A new promise that resolves when all the provided promises fulfill or one of the provided promises rejects. + - SeeAlso: `when(resolved:)` + */ + +public func when(fulfilled promiseIterator: PromiseIterator, concurrently: Int) -> Promise<[T]> where PromiseIterator.Element == Promise { + + guard concurrently > 0 else { + return Promise(error: PMKError.whenConcurrentlyZero) + } + + var generator = promiseIterator + var root = Promise<[T]>.pending() + var pendingPromises = 0 + var promises: [Promise] = [] + + let barrier = DispatchQueue(label: "org.promisekit.barrier.when", attributes: [.concurrent]) + + func dequeue() { + guard root.promise.isPending else { return } // don’t continue dequeueing if root has been rejected + + var shouldDequeue = false + barrier.sync { + shouldDequeue = pendingPromises < concurrently + } + guard shouldDequeue else { return } + + var index: Int! + var promise: Promise! + + barrier.sync(flags: .barrier) { + guard let next = generator.next() else { return } + + promise = next + index = promises.count + + pendingPromises += 1 + promises.append(next) + } + + func testDone() { + barrier.sync { + if pendingPromises == 0 { + root.fulfill(promises.flatMap { $0.value }) + } + } + } + + guard promise != nil else { + return testDone() + } + + promise.state.pipe { resolution in + barrier.sync(flags: .barrier) { + pendingPromises -= 1 + } + + switch resolution { + case .fulfilled: + dequeue() + testDone() + case .rejected(let error, let token): + token.consumed = true + root.reject(error) + } + } + + dequeue() + } + + dequeue() + + return root.promise +} + +/** + Waits on all provided promises. + + `when(fulfilled:)` rejects as soon as one of the provided promises rejects. `when(resolved:)` waits on all provided promises and **never** rejects. + + when(resolved: promise1, promise2, promise3).then { results in + for result in results where case .fulfilled(let value) { + //… + } + }.catch { error in + // invalid! Never rejects + } + + - Returns: A new promise that resolves once all the provided promises resolve. + - Warning: The returned promise can *not* be rejected. + - Note: Any promises that error are implicitly consumed, your UnhandledErrorHandler will not be called. +*/ +public func when(resolved promises: Promise...) -> Promise<[Result]> { + return when(resolved: promises) +} + +/// Waits on all provided promises. +public func when(resolved promises: [Promise]) -> Promise<[Result]> { + guard !promises.isEmpty else { return Promise(value: []) } + + var countdown = promises.count + let barrier = DispatchQueue(label: "org.promisekit.barrier.join", attributes: .concurrent) + + return Promise { fulfill, _ in + for promise in promises { + promise.state.pipe { resolution in + if case .rejected(_, let token) = resolution { + token.consumed = true // all errors are implicitly consumed + } + var done = false + barrier.sync(flags: .barrier) { + countdown -= 1 + done = countdown == 0 + } + if done { + fulfill(promises.map { Result($0.state.get()!) }) + } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift new file mode 100644 index 000000000000..48bd4b1bee07 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/PromiseKit/Sources/wrap.swift @@ -0,0 +1,79 @@ +/** + Create a new pending promise by wrapping another asynchronous system. + + This initializer is convenient when wrapping asynchronous systems that + use common patterns. For example: + + func fetchKitten() -> Promise { + return PromiseKit.wrap { resolve in + KittenFetcher.fetchWithCompletionBlock(resolve) + } + } + + - SeeAlso: Promise.init(resolvers:) +*/ +public func wrap(_ body: (@escaping (T?, Error?) -> Void) throws -> Void) -> Promise { + return Promise { fulfill, reject in + try body { obj, err in + if let err = err { + reject(err) + } else if let obj = obj { + fulfill(obj) + } else { + reject(PMKError.invalidCallingConvention) + } + } + } +} + +/// For completion-handlers that eg. provide an enum or an error. +public func wrap(_ body: (@escaping (T, Error?) -> Void) throws -> Void) -> Promise { + return Promise { fulfill, reject in + try body { obj, err in + if let err = err { + reject(err) + } else { + fulfill(obj) + } + } + } +} + +/// Some APIs unwisely invert the Cocoa standard for completion-handlers. +public func wrap(_ body: (@escaping (Error?, T?) -> Void) throws -> Void) -> Promise { + return Promise { fulfill, reject in + try body { err, obj in + if let err = err { + reject(err) + } else if let obj = obj { + fulfill(obj) + } else { + reject(PMKError.invalidCallingConvention) + } + } + } +} + +/// For completion-handlers with just an optional Error +public func wrap(_ body: (@escaping (Error?) -> Void) throws -> Void) -> Promise { + return Promise { fulfill, reject in + try body { error in + if let error = error { + reject(error) + } else { + #if swift(>=4.0) + fulfill(()) + #else + fulfill() + #endif + } + } + } +} + +/// For completions that cannot error. +public func wrap(_ body: (@escaping (T) -> Void) throws -> Void) -> Promise { + return Promise { fulfill, _ in + try body(fulfill) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-Info.plist new file mode 100644 index 000000000000..bb5a9ffc808b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.9.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m new file mode 100644 index 000000000000..a6c4594242e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Alamofire : NSObject +@end +@implementation PodsDummy_Alamofire +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h new file mode 100644 index 000000000000..00014e3cd82a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double AlamofireVersionNumber; +FOUNDATION_EXPORT const unsigned char AlamofireVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap new file mode 100644 index 000000000000..d1f125fab6b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.modulemap @@ -0,0 +1,6 @@ +framework module Alamofire { + umbrella header "Alamofire-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig new file mode 100644 index 000000000000..12a1450811bb --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Alamofire.xcconfig @@ -0,0 +1,9 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Alamofire +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/Alamofire +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist new file mode 100644 index 000000000000..2aba7e548ba0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Alamofire/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.7.3 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist new file mode 100644 index 000000000000..cba258550bd0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.0.1 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m new file mode 100644 index 000000000000..749b412f85c0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PetstoreClient : NSObject +@end +@implementation PodsDummy_PetstoreClient +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h new file mode 100644 index 000000000000..2a366623a36f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double PetstoreClientVersionNumber; +FOUNDATION_EXPORT const unsigned char PetstoreClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap new file mode 100644 index 000000000000..7fdfc46cf796 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.modulemap @@ -0,0 +1,6 @@ +framework module PetstoreClient { + umbrella header "PetstoreClient-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig new file mode 100644 index 000000000000..69e0045b3652 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PetstoreClient/PetstoreClient.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown new file mode 100644 index 000000000000..5bdac20a1776 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.markdown @@ -0,0 +1,50 @@ +# Acknowledgements +This application makes use of the following third party libraries: + +## Alamofire + +Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +## PromiseKit + +Copyright 2016, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Generated by CocoaPods - https://cocoapods.org diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist new file mode 100644 index 000000000000..315eee1ef8e7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-acknowledgements.plist @@ -0,0 +1,88 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Alamofire + Type + PSGroupSpecifier + + + FooterText + Copyright 2016, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + License + MIT + Title + PromiseKit + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m new file mode 100644 index 000000000000..6236440163b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClient : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClient +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh new file mode 100755 index 000000000000..9c68a38d70aa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh @@ -0,0 +1,167 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +function on_error { + echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" +} +trap 'on_error $LINENO' ERR + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + elif [ -L "${binary}" ]; then + echo "Destination binary is symlinked..." + dirname="$(dirname "${binary}")" + binary="${dirname}/$(readlink "${binary}")" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identity + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + + +if [[ "$CONFIGURATION" == "Debug" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" +fi +if [[ "$CONFIGURATION" == "Release" ]]; then + install_framework "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework" + install_framework "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework" +fi +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h new file mode 100644 index 000000000000..b7da51aaf252 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig new file mode 100644 index 000000000000..59f45a2a869c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Foundation" -framework "PetstoreClient" -framework "PromiseKit" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap new file mode 100644 index 000000000000..ef919b6c0d1f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClient { + umbrella header "Pods-SwaggerClient-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig new file mode 100644 index 000000000000..59f45a2a869c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig @@ -0,0 +1,11 @@ +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Foundation" -framework "PetstoreClient" -framework "PromiseKit" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist new file mode 100644 index 000000000000..2243fe6e27dc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0.0 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown new file mode 100644 index 000000000000..102af7538517 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.markdown @@ -0,0 +1,3 @@ +# Acknowledgements +This application makes use of the following third party libraries: +Generated by CocoaPods - https://cocoapods.org diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist new file mode 100644 index 000000000000..7acbad1eabbf --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-acknowledgements.plist @@ -0,0 +1,29 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m new file mode 100644 index 000000000000..bb17fa2b80ff --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_Pods_SwaggerClientTests : NSObject +@end +@implementation PodsDummy_Pods_SwaggerClientTests +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh new file mode 100755 index 000000000000..08e3eaaca45a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-frameworks.sh @@ -0,0 +1,146 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then + # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy + # frameworks to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + +COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" +SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" + +# Used as a return value for each invocation of `strip_invalid_archs` function. +STRIP_BINARY_RETVAL=0 + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +# Copies and strips a vendored framework +install_framework() +{ + if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then + local source="${BUILT_PRODUCTS_DIR}/$1" + elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then + local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" + elif [ -r "$1" ]; then + local source="$1" + fi + + local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + + if [ -L "${source}" ]; then + echo "Symlinked..." + source="$(readlink "${source}")" + fi + + # Use filter instead of exclude so missing patterns don't throw errors. + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" + + local basename + basename="$(basename -s .framework "$1")" + binary="${destination}/${basename}.framework/${basename}" + if ! [ -r "$binary" ]; then + binary="${destination}/${basename}" + fi + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then + strip_invalid_archs "$binary" + fi + + # Resign the code if required by the build settings to avoid unstable apps + code_sign_if_enabled "${destination}/$(basename "$1")" + + # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. + if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then + local swift_runtime_libs + swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) + for lib in $swift_runtime_libs; do + echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" + rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" + code_sign_if_enabled "${destination}/${lib}" + done + fi +} + +# Copies and strips a vendored dSYM +install_dsym() { + local source="$1" + if [ -r "$source" ]; then + # Copy the dSYM into a the targets temp dir. + 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}\"" + 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}" + + local basename + basename="$(basename -s .framework.dSYM "$source")" + binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}" + + # Strip invalid architectures so "fat" simulator / device frameworks work on device + if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then + strip_invalid_archs "$binary" + fi + + if [[ $STRIP_BINARY_RETVAL == 1 ]]; then + # Move the stripped file into its final destination. + 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}\"" + 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}" + else + # 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. + touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM" + fi + fi +} + +# Signs a framework with the provided identity +code_sign_if_enabled() { + if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then + # Use the current code_sign_identitiy + echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" + local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" + + if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + code_sign_cmd="$code_sign_cmd &" + fi + echo "$code_sign_cmd" + eval "$code_sign_cmd" + fi +} + +# Strip invalid architectures +strip_invalid_archs() { + binary="$1" + # Get architectures for current target binary + binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" + # Intersect them with the architectures we are building for + intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" + # If there are no archs supported by this binary then warn the user + if [[ -z "$intersected_archs" ]]; then + echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." + STRIP_BINARY_RETVAL=0 + return + fi + stripped="" + for arch in $binary_archs; do + if ! [[ "${ARCHS}" == *"$arch"* ]]; then + # Strip non-valid architectures in-place + lipo -remove "$arch" -output "$binary" "$binary" || exit 1 + stripped="$stripped $arch" + fi + done + if [[ "$stripped" ]]; then + echo "Stripped $binary of architectures:$stripped" + fi + STRIP_BINARY_RETVAL=1 +} + +if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then + wait +fi diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh new file mode 100755 index 000000000000..345301f2c5ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-resources.sh @@ -0,0 +1,118 @@ +#!/bin/sh +set -e +set -u +set -o pipefail + +if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then + # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy + # resources to, so exit 0 (signalling the script phase was successful). + exit 0 +fi + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + +RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt +> "$RESOURCES_TO_COPY" + +XCASSET_FILES=() + +# This protects against multiple targets copying the same framework dependency at the same time. The solution +# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html +RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") + +case "${TARGETED_DEVICE_FAMILY:-}" in + 1,2) + TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" + ;; + 1) + TARGET_DEVICE_ARGS="--target-device iphone" + ;; + 2) + TARGET_DEVICE_ARGS="--target-device ipad" + ;; + 3) + TARGET_DEVICE_ARGS="--target-device tv" + ;; + 4) + TARGET_DEVICE_ARGS="--target-device watch" + ;; + *) + TARGET_DEVICE_ARGS="--target-device mac" + ;; +esac + +install_resource() +{ + if [[ "$1" = /* ]] ; then + RESOURCE_PATH="$1" + else + RESOURCE_PATH="${PODS_ROOT}/$1" + fi + if [[ ! -e "$RESOURCE_PATH" ]] ; then + cat << EOM +error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. +EOM + exit 1 + fi + case $RESOURCE_PATH in + *.storyboard) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.xib) + echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true + ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} + ;; + *.framework) + echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true + rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" + ;; + *.xcdatamodel) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" + ;; + *.xcdatamodeld) + echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true + xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" + ;; + *.xcmappingmodel) + echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true + xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" + ;; + *.xcassets) + ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" + XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") + ;; + *) + echo "$RESOURCE_PATH" || true + echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" + ;; + esac +} + +mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then + mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" +fi +rm -f "$RESOURCES_TO_COPY" + +if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] +then + # Find all other xcassets (this unfortunately includes those of path pods and other targets). + OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) + while read line; do + if [[ $line != "${PODS_ROOT}*" ]]; then + XCASSET_FILES+=("$line") + fi + done <<<"$OTHER_XCASSETS" + + if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" + else + printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist" + fi +fi diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h new file mode 100644 index 000000000000..b2e4925a9e41 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-umbrella.h @@ -0,0 +1,16 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + + +FOUNDATION_EXPORT double Pods_SwaggerClientTestsVersionNumber; +FOUNDATION_EXPORT const unsigned char Pods_SwaggerClientTestsVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig new file mode 100644 index 000000000000..6750422210a2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Foundation" -framework "PetstoreClient" -framework "PromiseKit" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap new file mode 100644 index 000000000000..a848da7ffb30 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap @@ -0,0 +1,6 @@ +framework module Pods_SwaggerClientTests { + umbrella header "Pods-SwaggerClientTests-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig new file mode 100644 index 000000000000..6750422210a2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig @@ -0,0 +1,9 @@ +FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Alamofire/Alamofire.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PetstoreClient/PetstoreClient.framework/Headers" "${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit/PromiseKit.framework/Headers" +LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' +OTHER_LDFLAGS = $(inherited) -framework "Alamofire" -framework "Foundation" -framework "PetstoreClient" -framework "PromiseKit" +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_PODFILE_DIR_PATH = ${SRCROOT}/. +PODS_ROOT = ${SRCROOT}/Pods diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist new file mode 100644 index 000000000000..ee58f387beb8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.4.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-Info.plist new file mode 100644 index 000000000000..ee58f387beb8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIdentifier + ${PRODUCT_BUNDLE_IDENTIFIER} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + FMWK + CFBundleShortVersionString + 4.4.4 + CFBundleSignature + ???? + CFBundleVersion + ${CURRENT_PROJECT_VERSION} + NSPrincipalClass + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m new file mode 100644 index 000000000000..ce92451305bc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-dummy.m @@ -0,0 +1,5 @@ +#import +@interface PodsDummy_PromiseKit : NSObject +@end +@implementation PodsDummy_PromiseKit +@end diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch new file mode 100644 index 000000000000..beb2a2441835 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-prefix.pch @@ -0,0 +1,12 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h new file mode 100644 index 000000000000..35cbd7962132 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h @@ -0,0 +1,19 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "fwd.h" +#import "AnyPromise.h" +#import "PromiseKit.h" + +FOUNDATION_EXPORT double PromiseKitVersionNumber; +FOUNDATION_EXPORT const unsigned char PromiseKitVersionString[]; + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap new file mode 100644 index 000000000000..2b26033e4ab5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap @@ -0,0 +1,6 @@ +framework module PromiseKit { + umbrella header "PromiseKit-umbrella.h" + + export * + module * { export * } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig new file mode 100644 index 000000000000..329063190b51 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/Pods/Target Support Files/PromiseKit/PromiseKit.xcconfig @@ -0,0 +1,10 @@ +CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/PromiseKit +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 +OTHER_LDFLAGS = $(inherited) -framework "Foundation" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS +PODS_BUILD_DIR = ${BUILD_DIR} +PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) +PODS_ROOT = ${SRCROOT} +PODS_TARGET_SRCROOT = ${PODS_ROOT}/PromiseKit +PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} +SKIP_INSTALL = YES diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..514ec061c2af --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/project.pbxproj @@ -0,0 +1,524 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */; }; + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */; }; + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFB961C692C6300B96B06 /* ViewController.swift */; }; + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB981C692C6300B96B06 /* Main.storyboard */; }; + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */; }; + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */; }; + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */; }; + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */; }; + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */; }; + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 6D4EFB891C692C6300B96B06 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 6D4EFB901C692C6300B96B06; + remoteInfo = SwaggerClient; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwaggerClient.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6D4EFB961C692C6300B96B06 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 6D4EFB991C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6D4EFB9E1C692C6300B96B06 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 6D4EFBA01C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwaggerClientTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 6D4EFBAB1C692C6300B96B06 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PetAPITests.swift; sourceTree = ""; }; + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StoreAPITests.swift; sourceTree = ""; }; + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserAPITests.swift; sourceTree = ""; }; + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClientTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + C07EC0A94AA0F86D60668B32 /* Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SwaggerClientTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SwaggerClient.release.xcconfig"; path = "Pods/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 6D4EFB8E1C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 751C65B82F596107A3DC8ED9 /* Pods_SwaggerClient.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA21C692C6300B96B06 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 54DA06C1D70D78EC0EC72B61 /* Pods_SwaggerClientTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0CAA98BEFA303B94D3664C7D /* Pods */ = { + isa = PBXGroup; + children = ( + A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */, + FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */, + 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */, + B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + 3FABC56EC0BA84CBF4F99564 /* Frameworks */ = { + isa = PBXGroup; + children = ( + C07EC0A94AA0F86D60668B32 /* Pods.framework */, + 8F60AECFF321A25553B6A5B0 /* Pods_SwaggerClient.framework */, + F65B6638217EDDC99D103B16 /* Pods_SwaggerClientTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 6D4EFB881C692C6300B96B06 = { + isa = PBXGroup; + children = ( + 6D4EFB931C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */, + 6D4EFB921C692C6300B96B06 /* Products */, + 3FABC56EC0BA84CBF4F99564 /* Frameworks */, + 0CAA98BEFA303B94D3664C7D /* Pods */, + ); + sourceTree = ""; + }; + 6D4EFB921C692C6300B96B06 /* Products */ = { + isa = PBXGroup; + children = ( + 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */, + 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 6D4EFB931C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXGroup; + children = ( + 6D4EFB941C692C6300B96B06 /* AppDelegate.swift */, + 6D4EFB961C692C6300B96B06 /* ViewController.swift */, + 6D4EFB981C692C6300B96B06 /* Main.storyboard */, + 6D4EFB9B1C692C6300B96B06 /* Assets.xcassets */, + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */, + 6D4EFBA01C692C6300B96B06 /* Info.plist */, + ); + path = SwaggerClient; + sourceTree = ""; + }; + 6D4EFBA81C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + 6D4EFBAB1C692C6300B96B06 /* Info.plist */, + 6D4EFBB41C693BE200B96B06 /* PetAPITests.swift */, + 6D4EFBB61C693BED00B96B06 /* StoreAPITests.swift */, + 6D4EFBB81C693BFC00B96B06 /* UserAPITests.swift */, + ); + path = SwaggerClientTests; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 6D4EFB901C692C6300B96B06 /* SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */; + buildPhases = ( + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */, + 6D4EFB8D1C692C6300B96B06 /* Sources */, + 6D4EFB8E1C692C6300B96B06 /* Frameworks */, + 6D4EFB8F1C692C6300B96B06 /* Resources */, + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = SwaggerClient; + productName = SwaggerClient; + productReference = 6D4EFB911C692C6300B96B06 /* SwaggerClient.app */; + productType = "com.apple.product-type.application"; + }; + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */; + buildPhases = ( + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */, + 6D4EFBA11C692C6300B96B06 /* Sources */, + 6D4EFBA21C692C6300B96B06 /* Frameworks */, + 6D4EFBA31C692C6300B96B06 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */, + ); + name = SwaggerClientTests; + productName = SwaggerClientTests; + productReference = 6D4EFBA51C692C6300B96B06 /* SwaggerClientTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 6D4EFB891C692C6300B96B06 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0720; + LastUpgradeCheck = 0800; + ORGANIZATIONNAME = Swagger; + TargetAttributes = { + 6D4EFB901C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + }; + 6D4EFBA41C692C6300B96B06 = { + CreatedOnToolsVersion = 7.2.1; + LastSwiftMigration = 0800; + TestTargetID = 6D4EFB901C692C6300B96B06; + }; + }; + }; + buildConfigurationList = 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 6D4EFB881C692C6300B96B06; + productRefGroup = 6D4EFB921C692C6300B96B06 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 6D4EFB901C692C6300B96B06 /* SwaggerClient */, + 6D4EFBA41C692C6300B96B06 /* SwaggerClientTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 6D4EFB8F1C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB9F1C692C6300B96B06 /* LaunchScreen.storyboard in Resources */, + 6D4EFB9C1C692C6300B96B06 /* Assets.xcassets in Resources */, + 6D4EFB9A1C692C6300B96B06 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA31C692C6300B96B06 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 1F03F780DC2D9727E5E64BA9 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClient-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 4485A75250058E2D5BBDF63F /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/PetstoreClient/PetstoreClient.framework", + "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PetstoreClient.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 79FE27B09B2DD354C831BD49 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-SwaggerClientTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 6D4EFB8D1C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFB971C692C6300B96B06 /* ViewController.swift in Sources */, + 6D4EFB951C692C6300B96B06 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 6D4EFBA11C692C6300B96B06 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D4EFBB71C693BED00B96B06 /* StoreAPITests.swift in Sources */, + 6D4EFBB91C693BFC00B96B06 /* UserAPITests.swift in Sources */, + 6D4EFBB51C693BE200B96B06 /* PetAPITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 6D4EFBA71C692C6300B96B06 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 6D4EFB901C692C6300B96B06 /* SwaggerClient */; + targetProxy = 6D4EFBA61C692C6300B96B06 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 6D4EFB981C692C6300B96B06 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB991C692C6300B96B06 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 6D4EFB9D1C692C6300B96B06 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 6D4EFB9E1C692C6300B96B06 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 6D4EFBAC1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 6D4EFBAD1C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 6D4EFBAF1C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = A638467ACFB30852DEA51F7A /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 6D4EFBB01C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FC60BDC7328C2AA916F25840 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + INFOPLIST_FILE = SwaggerClient/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClient; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; + 6D4EFBB21C692C6300B96B06 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 289E8A9E9C0BB66AD190C7C6 /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Debug; + }; + 6D4EFBB31C692C6300B96B06 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B4B2BEC2ECA535C616F2F3FE /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + INFOPLIST_FILE = SwaggerClientTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.swagger.SwaggerClientTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwaggerClient.app/SwaggerClient"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 6D4EFB8C1C692C6300B96B06 /* Build configuration list for PBXProject "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAC1C692C6300B96B06 /* Debug */, + 6D4EFBAD1C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBAE1C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBAF1C692C6300B96B06 /* Debug */, + 6D4EFBB01C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 6D4EFBB11C692C6300B96B06 /* Build configuration list for PBXNativeTarget "SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6D4EFBB21C692C6300B96B06 /* Debug */, + 6D4EFBB31C692C6300B96B06 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 6D4EFB891C692C6300B96B06 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme new file mode 100644 index 000000000000..4d00ed5f92e4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcodeproj/xcshareddata/xcschemes/SwaggerClient.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..9b3fa18954f7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift new file mode 100644 index 000000000000..821a4aea705c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/AppDelegate.swift @@ -0,0 +1,43 @@ +// +// AppDelegate.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..1d060ed28827 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,93 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..2e721e1833f0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..3a2a49bad8c6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Base.lproj/Main.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Info.plist new file mode 100644 index 000000000000..bb71d00fa8ae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/Info.plist @@ -0,0 +1,59 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift new file mode 100644 index 000000000000..8dad16b10f16 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClient/ViewController.swift @@ -0,0 +1,23 @@ +// +// ViewController.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist new file mode 100644 index 000000000000..802f84f540d0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/Info.plist @@ -0,0 +1,36 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + NSAppTransportSecurity + + NSExceptionDomains + + petstore.swagger.io + + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift new file mode 100644 index 000000000000..22b2e7d605fa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/PetAPITests.swift @@ -0,0 +1,69 @@ +// +// PetAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class PetAPITests: XCTestCase { + + let testTimeout = 10.0 + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func test1CreatePet() { + let expectation = self.expectation(description: "testCreatePet") + let category = PetstoreClient.Category(id: 1234, name: "eyeColor") + let tags = [Tag(id: 1234, name: "New York"), Tag(id: 124321, name: "Jose")] + 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) + + PetAPI.addPet(body: newPet).then { + expectation.fulfill() + }.always { + // Noop for now + }.catch { _ in + XCTFail("error creating pet") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetPet() { + let expectation = self.expectation(description: "testGetPet") + PetAPI.getPetById(petId: 1000).then { pet -> Void in + XCTAssert(pet.id == 1000, "invalid id") + XCTAssert(pet.name == "Fluffy", "invalid name") + expectation.fulfill() + }.always { + // Noop for now + }.catch { _ in + XCTFail("error creating pet") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeletePet() { + let expectation = self.expectation(description: "testDeletePet") + PetAPI.deletePet(petId: 1000).then { + expectation.fulfill() + }.always { + // Noop for now + }.catch { (_) in + XCTFail("error deleting pet") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift new file mode 100644 index 000000000000..abb09214717d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/StoreAPITests.swift @@ -0,0 +1,86 @@ +// +// StoreAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class StoreAPITests: XCTestCase { + + let isoDateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" + + let testTimeout = 10.0 + + func test1PlaceOrder() { + // use explicit naming to reference the enum so that we test we don't regress on enum naming + let shipDate = Date() + let order = Order(id: 1000, petId: 1000, quantity: 10, shipDate: shipDate, status: .placed, complete: true) + let expectation = self.expectation(description: "testPlaceOrder") + StoreAPI.placeOrder(body: order).then { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + XCTAssert(order.shipDate!.isEqual(shipDate, format: self.isoDateFormat), + "Date should be idempotent") + + expectation.fulfill() + }.always { + // Noop for now + }.catch { _ in + XCTFail("error placing order") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test2GetOrder() { + let expectation = self.expectation(description: "testGetOrder") + StoreAPI.getOrderById(orderId: 1000).then { order -> Void in + XCTAssert(order.id == 1000, "invalid id") + XCTAssert(order.quantity == 10, "invalid quantity") + XCTAssert(order.status == .placed, "invalid status") + expectation.fulfill() + }.always { + // Noop for now + }.catch { _ in + XCTFail("error placing order") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func test3DeleteOrder() { + let expectation = self.expectation(description: "testDeleteOrder") + StoreAPI.deleteOrder(orderId: "1000").then { + expectation.fulfill() + }.always { + // Noop for now + }.catch { (_) in + XCTFail("error deleting order") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + +} + +private extension Date { + + /** + Returns true if the dates are equal given the format string. + + - parameter date: The date to compare to. + - parameter format: The format string to use to compare. + + - returns: true if the dates are equal, given the format string. + */ + func isEqual(_ date: Date, format: String) -> Bool { + let fmt = DateFormatter() + fmt.dateFormat = format + return fmt.string(from: self).isEqual(fmt.string(from: date)) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift new file mode 100644 index 000000000000..2fd0ff0fbb42 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/SwaggerClientTests/UserAPITests.swift @@ -0,0 +1,41 @@ +// +// UserAPITests.swift +// SwaggerClient +// +// Created by Joseph Zuromski on 2/8/16. +// Copyright © 2016 Swagger. All rights reserved. +// + +import PetstoreClient +import PromiseKit +import XCTest +@testable import SwaggerClient + +class UserAPITests: XCTestCase { + + let testTimeout = 10.0 + + func testLogin() { + let expectation = self.expectation(description: "testLogin") + UserAPI.loginUser(username: "swiftTester", password: "swift").then { _ -> Void in + expectation.fulfill() + }.always { + // Noop for now + }.catch { (_) in + XCTFail("login error") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } + + func testLogout() { + let expectation = self.expectation(description: "testLogout") + UserAPI.logoutUser().then { + expectation.fulfill() + }.always { + // Noop for now + }.catch { (_) in + XCTFail("") + } + self.waitForExpectations(timeout: testTimeout, handler: nil) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/pom.xml b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/pom.xml new file mode 100644 index 000000000000..3756c726a129 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/pom.xml @@ -0,0 +1,43 @@ + + 4.0.0 + io.swagger + Swift4PromiseKitPetstoreClientTests + pom + 1.0-SNAPSHOT + Swift4 PromiseKit Swagger Petstore Client + + + + maven-dependency-plugin + + + package + + copy-dependencies + + + ${project.build.directory} + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + xcodebuild-test + integration-test + + exec + + + ./run_xcodebuild.sh + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh new file mode 100755 index 000000000000..5de114774614 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/promisekit/SwaggerClientTests/run_xcodebuild.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +xcodebuild -workspace "SwaggerClient.xcworkspace" -scheme "SwaggerClient" test -destination "platform=iOS Simulator,name=iPhone 8,OS=13.0" | xcpretty && exit ${PIPESTATUS[0]} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..578d38a3fffb --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.pbxproj @@ -0,0 +1,605 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 02903CEC38DC202565BC08CB040AC4E9 /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */; }; + 0462F801432CF94C7EF51D0532737A7E /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */; }; + 08D87E4FECF24910F0DA0F1D2E2D955A /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */; }; + 08F5828F0C2BCF07A9E4917DBBB993AE /* AdditionalPropertiesInteger.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA2F3566156A4ABC465F201B4A1F6227 /* AdditionalPropertiesInteger.swift */; }; + 1143FFF06DEE01E5B0F1368AA05BE1B4 /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */; }; + 122BBAE8245606CC040EEB6B9254E376 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */; }; + 12327BF7304AA897C5D2A1250B1659B7 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */; }; + 12BB95C66D63090732BB9E0379836E3C /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */; }; + 16E9A5E22B4823DE282E7F4C18A21EA8 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */; }; + 18F19872A0DFB4CC3D9C696BBCA64EFD /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */; }; + 196E9846B27D736630CCF90497696859 /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */; }; + 271D94A05C47B602A2433B9CD3D9DCDC /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */; }; + 293F4E0FBFC8297E414A3CDBB7F29A96 /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */; }; + 297E365D1E4672C43C56E0AFD855FFBF /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */; }; + 2A35688C985E9CB1EB7732AC2AD46B82 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */; }; + 2DF4544D4D3D6CF7047A59FB89ED31BD /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */; }; + 3251A3722981CE46261615CFBA96A08D /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */; }; + 36734C4EB3362A114A7CB5F25EE39E6D /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */; }; + 39F9FBA1AC5C2612ECA1FF715EBFC287 /* AdditionalPropertiesString.swift in Sources */ = {isa = PBXBuildFile; fileRef = FFE215C1B526E0418ED301B15357B970 /* AdditionalPropertiesString.swift */; }; + 3D8E407B1DF4FA5A5F16B64E3A285781 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */; }; + 41D8A105135868152A56E2AC475049BB /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */; }; + 42C51BC034E8B0CAA29A068F6B0DC815 /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */; }; + 491676EC91BFEF95A12556888EED87B5 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */; }; + 4C28BFEC5E7C8150DEFD83E09C1A1D32 /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */; }; + 52B5604F986335DB69CD2B430FB83BAB /* AdditionalPropertiesAnyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5AB1037D937AADF8B4A70C96D5E5D61 /* AdditionalPropertiesAnyType.swift */; }; + 58F9704B295AC436D6FB98FA669E2344 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */; }; + 59C00CBB07761CAC8DCE7054E34AD5D9 /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */; }; + 59C2F5495C98836BFA9E10BF5C13BC2C /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */; }; + 59EAB3527305A37ED99FB210045B69EA /* AdditionalPropertiesNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E0512B3582586B4C0C598D5DB1C0D39 /* AdditionalPropertiesNumber.swift */; }; + 5ACDD7CC312167589335E9CA5998E770 /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */; }; + 655AA371771C7BD72EE0AAC0C90DFFF0 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */; }; + 6600BB1500AE35A3C80F7C83F6444552 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */; }; + 6CD20EE568DDAD2304BF0C4B1A70C8DC /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */; }; + 7367A9D91D4B101F2D28AC56ED89F175 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */; }; + 79536B981ECC24C77EB665FDAC7CA7BD /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DB3E1D94EB0566C0052331742B5012 /* RxSwift.framework */; }; + 82D4D0C8AD0354A700C8ACD421ABED55 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */; }; + 83A2D1863FB136C0DFC423319F4EED65 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */; }; + 92FB161BF1E57D11B116AF0292D5835C /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = A913A57E72D723632E9A718FF4525C81 /* Client.swift */; }; + 97C99615237E1B662242E04F527B38B9 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */; }; + 988F461F59E4E1091156840007CB3773 /* AdditionalPropertiesBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC24C01A55F644957196F9F81D10F81 /* AdditionalPropertiesBoolean.swift */; }; + A190AF5A3988639ED4B78163D0EA3CA4 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */; }; + A438970025AE69ED407BC1E67CC6359E /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */; }; + A9F1AAF6CE029DD3B4F8AC841F0B6BC6 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */; }; + AE9D2E1DB59AF6575AC4AC6756C5A937 /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */; }; + B399A1742F23330FDCA450EAB98F51F1 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */; }; + BB02FDCF1B2B0E457E1C2BF39FBB599D /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2253391845B73B8BA3680491575CC07 /* XmlItem.swift */; }; + BF7D58FBCF5E4D3F2932FCC0E62BED40 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */; }; + C15AC1CC631E96D0360EB8C15BF30452 /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */; }; + C1CACABE18A7ADCE37D1CD9DC9128304 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7A6070F581E611FF44AFD40A4315C49A /* List.swift */; }; + C2EDEB747887399B13A6DFD72A219CB2 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */; }; + C329EE55B2FCC9174ED3B128D67C5E8C /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */; }; + D3A17B7FAFA8A7A210875BBCDCC30116 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + D68F23CD4B5178493CE7AE8DFB868EAE /* AdditionalPropertiesArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4FEE553331890581C2FF366F9EA0956D /* AdditionalPropertiesArray.swift */; }; + D70EC94E346077DE1482231DD4498BED /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */; }; + DB1CE39011A741D07E187663291B5DE5 /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */; }; + DB724C4F1AD5DF025B53A9A2E0A49E3D /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */; }; + DDBC3CF5E447D8D838F0FE200420EEE3 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */; }; + DEC892724574BB29BD65869374F83982 /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */; }; + E2C40F0E34DB8C21A806262C72841A51 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 386FD590658E90509C121118F057604D /* SpecialModelName.swift */; }; + E51ADEC931806B20A041303E539A8BE2 /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */; }; + E57CD12D2F500D40B4135D0F5ECA9866 /* AdditionalPropertiesObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72FEDC94BA0E37214D360871B284BC8A /* AdditionalPropertiesObject.swift */; }; + F02BEF9A8503B3848B045370451E85F6 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8699F7966F748ED026A6FB4CF550442B /* Models.swift */; }; + F21D10C71A9DE7D0467AFD23FD391D2E /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = C81447828475F76C5CF4F08AA65292F7 /* Return.swift */; }; + FB4A053CDCD75E48B755CC22D463A3FC /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */; }; + FECA03F0388E84AE1B22638605D8AC9F /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodableHelper.swift; sourceTree = ""; }; + 0CC24C01A55F644957196F9F81D10F81 /* AdditionalPropertiesBoolean.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesBoolean.swift; sourceTree = ""; }; + 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; + 1E0512B3582586B4C0C598D5DB1C0D39 /* AdditionalPropertiesNumber.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesNumber.swift; sourceTree = ""; }; + 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Configuration.swift; sourceTree = ""; }; + 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodingHelper.swift; sourceTree = ""; }; + 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIs.swift; sourceTree = ""; }; + 386FD590658E90509C121118F057604D /* SpecialModelName.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; + 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; + 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; + 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + 4FEE553331890581C2FF366F9EA0956D /* AdditionalPropertiesArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesArray.swift; sourceTree = ""; }; + 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + 69DB3E1D94EB0566C0052331742B5012 /* RxSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RxSwift.framework; sourceTree = ""; }; + 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + 72FEDC94BA0E37214D360871B284BC8A /* AdditionalPropertiesObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesObject.swift; sourceTree = ""; }; + 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 7A6070F581E611FF44AFD40A4315C49A /* List.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireImplementations.swift; sourceTree = ""; }; + 8699F7966F748ED026A6FB4CF550442B /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIHelper.swift; sourceTree = ""; }; + 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONEncodableEncoding.swift; sourceTree = ""; }; + 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; + A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; + A2253391845B73B8BA3680491575CC07 /* XmlItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; }; + A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Alamofire.framework; sourceTree = ""; }; + A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + A913A57E72D723632E9A718FF4525C81 /* Client.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; + B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; + B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + C81447828475F76C5CF4F08AA65292F7 /* Return.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; + ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + F5AB1037D937AADF8B4A70C96D5E5D61 /* AdditionalPropertiesAnyType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesAnyType.swift; sourceTree = ""; }; + FA2F3566156A4ABC465F201B4A1F6227 /* AdditionalPropertiesInteger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesInteger.swift; sourceTree = ""; }; + FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + FFE215C1B526E0418ED301B15357B970 /* AdditionalPropertiesString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesString.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D1990C2A394CCF025EF98A2FB828C79A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 4C28BFEC5E7C8150DEFD83E09C1A1D32 /* Alamofire.framework in Frameworks */, + 79536B981ECC24C77EB665FDAC7CA7BD /* RxSwift.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1E464C0937FE0D3A7A0FE29AF446553C /* Frameworks */ = { + isa = PBXGroup; + children = ( + 7861EE241895128F64DD787367B3022D /* Carthage */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4FBDCF1330A9AB9122780DB3FA21DE4C /* Models */ = { + isa = PBXGroup; + children = ( + F5AB1037D937AADF8B4A70C96D5E5D61 /* AdditionalPropertiesAnyType.swift */, + 4FEE553331890581C2FF366F9EA0956D /* AdditionalPropertiesArray.swift */, + 0CC24C01A55F644957196F9F81D10F81 /* AdditionalPropertiesBoolean.swift */, + 396DEF3156BA0D12D0FC5C3C3AAF52C4 /* AdditionalPropertiesClass.swift */, + FA2F3566156A4ABC465F201B4A1F6227 /* AdditionalPropertiesInteger.swift */, + 1E0512B3582586B4C0C598D5DB1C0D39 /* AdditionalPropertiesNumber.swift */, + 72FEDC94BA0E37214D360871B284BC8A /* AdditionalPropertiesObject.swift */, + FFE215C1B526E0418ED301B15357B970 /* AdditionalPropertiesString.swift */, + 95568E7C35F119EB4A12B4982B3FB31F /* Animal.swift */, + 8D22BE01748F51106DE0233299A9061E /* AnimalFarm.swift */, + A8E7B833748B4F0C7CDA90C6E500B199 /* ApiResponse.swift */, + 7B1B8B838B5D9D312F2002EBAD946378 /* ArrayOfArrayOfNumberOnly.swift */, + B65BB72353DA24536A9049BEC3D234C8 /* ArrayOfNumberOnly.swift */, + F1A0379CDFC55705AE76C99867B8DB08 /* ArrayTest.swift */, + A7B38FA00A494D13F4C382A3D87FBF59 /* Capitalization.swift */, + 212AA914B7F1793A4E32C119370FB05F /* Cat.swift */, + 3AD0F94F512DFBC09F9CC79AF4BD9BFD /* CatAllOf.swift */, + 6F2985D01F8D60A4B1925C694330E6CB /* Category.swift */, + 3C30827D8EAF8EA684E7BCEA5A1E93B2 /* ClassModel.swift */, + A913A57E72D723632E9A718FF4525C81 /* Client.swift */, + C6C3E1129526A353B963EFD74ED8419C /* Dog.swift */, + A21A69C8402A60E01116ABBDEE8943DB /* DogAllOf.swift */, + 10503995D9EFD031A2EFB57603B3132E /* EnumArrays.swift */, + 4B2C97AE6ACA1E5FB88F5BAA2DB76FDC /* EnumClass.swift */, + FD60AEA646791E0EDE885DE1E680A687 /* EnumTest.swift */, + 3933D3B2A3AC4577094D0C23D1C1B266 /* File.swift */, + 4B3666552AA854DAF9C480A3354C9D7C /* FileSchemaTestClass.swift */, + 3156CE41C001C80379B84BDB435DECCB /* FormatTest.swift */, + 4C7FBC641752D2E13B15097311139DDC /* HasOnlyReadOnly.swift */, + 7A6070F581E611FF44AFD40A4315C49A /* List.swift */, + 7986861626C2B1CB49AD7000C6343270 /* MapTest.swift */, + 9AD714C7CC59BDD18DE8DF4ED40B9DA9 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + 82A2C3DC2235F0114C2B08E553F46874 /* Model200Response.swift */, + 5AD994DFAA0DA93C188A4DBA16688767 /* Name.swift */, + B8E0B16084741FCB82389F5854AC5E26 /* NumberOnly.swift */, + 27B2E9EF856E89FEAA359A3AC4A2CF5D /* Order.swift */, + F4E0AD8F60A91F72C768756002C14BF9 /* OuterComposite.swift */, + C15008AABC804EB6FB4CDAC6B871E6B0 /* OuterEnum.swift */, + ECFEB4C6C257B3BB3CEA36D10A5EDC17 /* Pet.swift */, + 6FD42727E001E799E458C2924CF813CC /* ReadOnlyFirst.swift */, + C81447828475F76C5CF4F08AA65292F7 /* Return.swift */, + 386FD590658E90509C121118F057604D /* SpecialModelName.swift */, + 47B4DEBABEFE140768CFB70B19D23029 /* StringBooleanMap.swift */, + B2896F8BFD1AA2965C8A30158F0EDA8C /* Tag.swift */, + EBC76F6D4D2AA8084B7EB50E5C15E475 /* TypeHolderDefault.swift */, + 19B65C66C97F082718DDD703F39DE1C2 /* TypeHolderExample.swift */, + E5565A447062C7B8F695F4517DB5E4A5 /* User.swift */, + A2253391845B73B8BA3680491575CC07 /* XmlItem.swift */, + ); + path = Models; + sourceTree = ""; + }; + 5FBA6AE5F64CD737F88B4565AC3CCD3B = { + isa = PBXGroup; + children = ( + 9B364C01750D7AA4F983B9E77B01BCC6 /* PetstoreClient */, + 1E464C0937FE0D3A7A0FE29AF446553C /* Frameworks */, + 857F0DEA1890CE66D6DAD556C55821A6 /* Products */, + ); + sourceTree = ""; + }; + 67BF3478113E6B4DF1C4E04F40BF58C4 /* OpenAPIs */ = { + isa = PBXGroup; + children = ( + 84A201508DF2B697D65F263189C08721 /* AlamofireImplementations.swift */, + 897716962D472FE162B723CB713AA6D3 /* APIHelper.swift */, + 37DF825B8F3BADA2B2537D17CDC48633 /* APIs.swift */, + 02A6F6BB2152ACEE1416D44AB3955243 /* CodableHelper.swift */, + 28A444949BBC254798C3B3DD14AAF2CD /* Configuration.swift */, + B8C298FC8929DCB369053F118D7DF28F /* Extensions.swift */, + 9791B840B8D6EAA35343B00FA277963A /* JSONEncodableEncoding.swift */, + 35D710108A69DD8A5297F926A66DA21F /* JSONEncodingHelper.swift */, + 8699F7966F748ED026A6FB4CF550442B /* Models.swift */, + F956D0CCAE23BCFD1C7BDD5D47944AA5 /* APIs */, + 4FBDCF1330A9AB9122780DB3FA21DE4C /* Models */, + ); + path = OpenAPIs; + sourceTree = ""; + }; + 7861EE241895128F64DD787367B3022D /* Carthage */ = { + isa = PBXGroup; + children = ( + A012205B41CB71A62B86EECDEAFB0990 /* iOS */, + ); + name = Carthage; + path = Carthage/Build; + sourceTree = ""; + }; + 857F0DEA1890CE66D6DAD556C55821A6 /* Products */ = { + isa = PBXGroup; + children = ( + 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */, + ); + name = Products; + sourceTree = ""; + }; + 9B364C01750D7AA4F983B9E77B01BCC6 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + EF4C81BDD734856ED5023B777D35098B /* Classes */, + ); + path = PetstoreClient; + sourceTree = ""; + }; + A012205B41CB71A62B86EECDEAFB0990 /* iOS */ = { + isa = PBXGroup; + children = ( + A235FA3FDFB086CC69CDE83DFC1F4BC9 /* Alamofire.framework */, + 69DB3E1D94EB0566C0052331742B5012 /* RxSwift.framework */, + ); + path = iOS; + sourceTree = ""; + }; + EF4C81BDD734856ED5023B777D35098B /* Classes */ = { + isa = PBXGroup; + children = ( + 67BF3478113E6B4DF1C4E04F40BF58C4 /* OpenAPIs */, + ); + path = Classes; + sourceTree = ""; + }; + F956D0CCAE23BCFD1C7BDD5D47944AA5 /* APIs */ = { + isa = PBXGroup; + children = ( + 9DF24D2714B9C4CF14146E88FDDC01A5 /* AnotherFakeAPI.swift */, + 6E00950725DC44436C5E238CDD2EC164 /* FakeAPI.swift */, + B42354B407EC173BEB54E0429D946F3B /* FakeClassnameTags123API.swift */, + 9A019F500E546A3292CE716AB967C673 /* PetAPI.swift */, + A53274D99BBDE1B79BF3521CD7CBC276 /* StoreAPI.swift */, + 7C8D5F382979854D47F18DB1543680FE /* UserAPI.swift */, + ); + path = APIs; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + C1282C2230015E0D204BEAEDDFB49453 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = B46EDEB1A7F0D78FE6394544C60169D1 /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + E539708354CE60FE486F81EDE56D13C8 /* Sources */, + D1990C2A394CCF025EF98A2FB828C79A /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = 164AD6EC9C4CCF634D7C45905E99E3A7 /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E7D276EE2369D8C455513C2E05F9AED0 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1000; + }; + buildConfigurationList = ECAB17FF35111B5E14DAAC0883031714 /* Build configuration list for PBXProject "PetstoreClient" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 5FBA6AE5F64CD737F88B4565AC3CCD3B; + projectDirPath = ""; + projectRoot = ""; + targets = ( + C1282C2230015E0D204BEAEDDFB49453 /* PetstoreClient */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + E539708354CE60FE486F81EDE56D13C8 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 2A35688C985E9CB1EB7732AC2AD46B82 /* APIHelper.swift in Sources */, + 0462F801432CF94C7EF51D0532737A7E /* APIs.swift in Sources */, + 52B5604F986335DB69CD2B430FB83BAB /* AdditionalPropertiesAnyType.swift in Sources */, + D68F23CD4B5178493CE7AE8DFB868EAE /* AdditionalPropertiesArray.swift in Sources */, + 988F461F59E4E1091156840007CB3773 /* AdditionalPropertiesBoolean.swift in Sources */, + 12327BF7304AA897C5D2A1250B1659B7 /* AdditionalPropertiesClass.swift in Sources */, + 08F5828F0C2BCF07A9E4917DBBB993AE /* AdditionalPropertiesInteger.swift in Sources */, + 59EAB3527305A37ED99FB210045B69EA /* AdditionalPropertiesNumber.swift in Sources */, + E57CD12D2F500D40B4135D0F5ECA9866 /* AdditionalPropertiesObject.swift in Sources */, + 39F9FBA1AC5C2612ECA1FF715EBFC287 /* AdditionalPropertiesString.swift in Sources */, + 58F9704B295AC436D6FB98FA669E2344 /* AlamofireImplementations.swift in Sources */, + 02903CEC38DC202565BC08CB040AC4E9 /* Animal.swift in Sources */, + DB1CE39011A741D07E187663291B5DE5 /* AnimalFarm.swift in Sources */, + 83A2D1863FB136C0DFC423319F4EED65 /* AnotherFakeAPI.swift in Sources */, + 97C99615237E1B662242E04F527B38B9 /* ApiResponse.swift in Sources */, + 3251A3722981CE46261615CFBA96A08D /* ArrayOfArrayOfNumberOnly.swift in Sources */, + A190AF5A3988639ED4B78163D0EA3CA4 /* ArrayOfNumberOnly.swift in Sources */, + C2EDEB747887399B13A6DFD72A219CB2 /* ArrayTest.swift in Sources */, + 7367A9D91D4B101F2D28AC56ED89F175 /* Capitalization.swift in Sources */, + 18F19872A0DFB4CC3D9C696BBCA64EFD /* Cat.swift in Sources */, + 41D8A105135868152A56E2AC475049BB /* CatAllOf.swift in Sources */, + 42C51BC034E8B0CAA29A068F6B0DC815 /* Category.swift in Sources */, + 5ACDD7CC312167589335E9CA5998E770 /* ClassModel.swift in Sources */, + 92FB161BF1E57D11B116AF0292D5835C /* Client.swift in Sources */, + 6CD20EE568DDAD2304BF0C4B1A70C8DC /* CodableHelper.swift in Sources */, + DEC892724574BB29BD65869374F83982 /* Configuration.swift in Sources */, + D70EC94E346077DE1482231DD4498BED /* Dog.swift in Sources */, + 271D94A05C47B602A2433B9CD3D9DCDC /* DogAllOf.swift in Sources */, + A438970025AE69ED407BC1E67CC6359E /* EnumArrays.swift in Sources */, + 59C00CBB07761CAC8DCE7054E34AD5D9 /* EnumClass.swift in Sources */, + 08D87E4FECF24910F0DA0F1D2E2D955A /* EnumTest.swift in Sources */, + C329EE55B2FCC9174ED3B128D67C5E8C /* Extensions.swift in Sources */, + 297E365D1E4672C43C56E0AFD855FFBF /* FakeAPI.swift in Sources */, + A9F1AAF6CE029DD3B4F8AC841F0B6BC6 /* FakeClassnameTags123API.swift in Sources */, + FECA03F0388E84AE1B22638605D8AC9F /* File.swift in Sources */, + 491676EC91BFEF95A12556888EED87B5 /* FileSchemaTestClass.swift in Sources */, + 36734C4EB3362A114A7CB5F25EE39E6D /* FormatTest.swift in Sources */, + DDBC3CF5E447D8D838F0FE200420EEE3 /* HasOnlyReadOnly.swift in Sources */, + 16E9A5E22B4823DE282E7F4C18A21EA8 /* JSONEncodableEncoding.swift in Sources */, + 12BB95C66D63090732BB9E0379836E3C /* JSONEncodingHelper.swift in Sources */, + C1CACABE18A7ADCE37D1CD9DC9128304 /* List.swift in Sources */, + 655AA371771C7BD72EE0AAC0C90DFFF0 /* MapTest.swift in Sources */, + D3A17B7FAFA8A7A210875BBCDCC30116 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 2DF4544D4D3D6CF7047A59FB89ED31BD /* Model200Response.swift in Sources */, + F02BEF9A8503B3848B045370451E85F6 /* Models.swift in Sources */, + C15AC1CC631E96D0360EB8C15BF30452 /* Name.swift in Sources */, + AE9D2E1DB59AF6575AC4AC6756C5A937 /* NumberOnly.swift in Sources */, + 59C2F5495C98836BFA9E10BF5C13BC2C /* Order.swift in Sources */, + 82D4D0C8AD0354A700C8ACD421ABED55 /* OuterComposite.swift in Sources */, + 1143FFF06DEE01E5B0F1368AA05BE1B4 /* OuterEnum.swift in Sources */, + B399A1742F23330FDCA450EAB98F51F1 /* Pet.swift in Sources */, + 3D8E407B1DF4FA5A5F16B64E3A285781 /* PetAPI.swift in Sources */, + 293F4E0FBFC8297E414A3CDBB7F29A96 /* ReadOnlyFirst.swift in Sources */, + F21D10C71A9DE7D0467AFD23FD391D2E /* Return.swift in Sources */, + E2C40F0E34DB8C21A806262C72841A51 /* SpecialModelName.swift in Sources */, + 122BBAE8245606CC040EEB6B9254E376 /* StoreAPI.swift in Sources */, + 196E9846B27D736630CCF90497696859 /* StringBooleanMap.swift in Sources */, + E51ADEC931806B20A041303E539A8BE2 /* Tag.swift in Sources */, + 6600BB1500AE35A3C80F7C83F6444552 /* TypeHolderDefault.swift in Sources */, + FB4A053CDCD75E48B755CC22D463A3FC /* TypeHolderExample.swift in Sources */, + BF7D58FBCF5E4D3F2932FCC0E62BED40 /* User.swift in Sources */, + DB724C4F1AD5DF025B53A9A2E0A49E3D /* UserAPI.swift in Sources */, + BB02FDCF1B2B0E457E1C2BF39FBB599D /* XmlItem.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 3B2C02AFB91CB5C82766ED5CF21FF628 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; + A9EB0A02B94C427CBACFEC7CFFC6A816 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "DEBUG=1", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + DD3EEB93949E9EBA4437E9CDBF4A26F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + INFOPLIST_FILE = Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + F81D4E5FECD46E9AA6DD2C299CEBEF64 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.2; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + B46EDEB1A7F0D78FE6394544C60169D1 /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DD3EEB93949E9EBA4437E9CDBF4A26F6 /* Debug */, + 3B2C02AFB91CB5C82766ED5CF21FF628 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = ""; + }; + ECAB17FF35111B5E14DAAC0883031714 /* Build configuration list for PBXProject "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A9EB0A02B94C427CBACFEC7CFFC6A816 /* Debug */, + F81D4E5FECD46E9AA6DD2C299CEBEF64 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Debug; + }; +/* End XCConfigurationList section */ + }; + rootObject = E7D276EE2369D8C455513C2E05F9AED0 /* Project object */; +} diff --git a/samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from samples/client/test/swift4/default/TestClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme b/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme new file mode 100644 index 000000000000..7802e379453b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/PetstoreClient.xcodeproj/xcshareddata/xcschemes/PetstoreClient.xcscheme @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile new file mode 100644 index 000000000000..29843508b65b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile @@ -0,0 +1,10 @@ +use_frameworks! +source 'https://github.com/CocoaPods/Specs.git' + +target 'SwaggerClient' do + pod "PetstoreClient", :path => "../" + + target 'SwaggerClientTests' do + inherit! :search_paths + end +end diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile.lock b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile.lock new file mode 100644 index 000000000000..83d09b4381da --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Podfile.lock @@ -0,0 +1,27 @@ +PODS: + - Alamofire (4.9.0) + - PetstoreClient (1.0.0): + - Alamofire (~> 4.9.0) + - RxSwift (~> 4.0) + - RxSwift (4.5.0) + +DEPENDENCIES: + - PetstoreClient (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - RxSwift + +EXTERNAL SOURCES: + PetstoreClient: + :path: "../" + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + PetstoreClient: 432f1430feb6f893260645040aa967411fea06d9 + RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575 + +PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d + +COCOAPODS: 1.6.1 diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE new file mode 100644 index 000000000000..38a301a1db8f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/README.md b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/README.md new file mode 100644 index 000000000000..9fdc9c738737 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/README.md @@ -0,0 +1,242 @@ +![Alamofire: Elegant Networking in Swift](https://raw.githubusercontent.com/Alamofire/Alamofire/master/alamofire.png) + +[![Build Status](https://travis-ci.org/Alamofire/Alamofire.svg?branch=master)](https://travis-ci.org/Alamofire/Alamofire) +[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/Alamofire.svg)](https://img.shields.io/cocoapods/v/Alamofire.svg) +[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) +[![Platform](https://img.shields.io/cocoapods/p/Alamofire.svg?style=flat)](https://alamofire.github.io/Alamofire) +[![Twitter](https://img.shields.io/badge/twitter-@AlamofireSF-blue.svg?style=flat)](https://twitter.com/AlamofireSF) +[![Gitter](https://badges.gitter.im/Alamofire/Alamofire.svg)](https://gitter.im/Alamofire/Alamofire?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) + +Alamofire is an HTTP networking library written in Swift. + +- [Features](#features) +- [Component Libraries](#component-libraries) +- [Requirements](#requirements) +- [Migration Guides](#migration-guides) +- [Communication](#communication) +- [Installation](#installation) +- [Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md) + - **Intro -** [Making a Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#making-a-request), [Response Handling](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-handling), [Response Validation](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-validation), [Response Caching](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#response-caching) + - **HTTP -** [HTTP Methods](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-methods), [Parameter Encoding](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#parameter-encoding), [HTTP Headers](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#http-headers), [Authentication](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#authentication) + - **Large Data -** [Downloading Data to a File](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#downloading-data-to-a-file), [Uploading Data to a Server](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#uploading-data-to-a-server) + - **Tools -** [Statistical Metrics](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#statistical-metrics), [cURL Command Output](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Usage.md#curl-command-output) +- [Advanced Usage](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md) + - **URL Session -** [Session Manager](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-manager), [Session Delegate](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#session-delegate), [Request](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#request) + - **Routing -** [Routing Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#routing-requests), [Adapting and Retrying Requests](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#adapting-and-retrying-requests) + - **Model Objects -** [Custom Response Serialization](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#custom-response-serialization) + - **Connection -** [Security](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#security), [Network Reachability](https://github.com/Alamofire/Alamofire/blob/master/Documentation/AdvancedUsage.md#network-reachability) +- [Open Radars](#open-radars) +- [FAQ](#faq) +- [Credits](#credits) +- [Donations](#donations) +- [License](#license) + +## Features + +- [x] Chainable Request / Response Methods +- [x] URL / JSON / plist Parameter Encoding +- [x] Upload File / Data / Stream / MultipartFormData +- [x] Download File using Request or Resume Data +- [x] Authentication with URLCredential +- [x] HTTP Response Validation +- [x] Upload and Download Progress Closures with Progress +- [x] cURL Command Output +- [x] Dynamically Adapt and Retry Requests +- [x] TLS Certificate and Public Key Pinning +- [x] Network Reachability +- [x] Comprehensive Unit and Integration Test Coverage +- [x] [Complete Documentation](https://alamofire.github.io/Alamofire) + +## Component Libraries + +In order to keep Alamofire focused specifically on core networking implementations, additional component libraries have been created by the [Alamofire Software Foundation](https://github.com/Alamofire/Foundation) to bring additional functionality to the Alamofire ecosystem. + +- [AlamofireImage](https://github.com/Alamofire/AlamofireImage) - An image library including image response serializers, `UIImage` and `UIImageView` extensions, custom image filters, an auto-purging in-memory cache and a priority-based image downloading system. +- [AlamofireNetworkActivityIndicator](https://github.com/Alamofire/AlamofireNetworkActivityIndicator) - Controls the visibility of the network activity indicator on iOS using Alamofire. It contains configurable delay timers to help mitigate flicker and can support `URLSession` instances not managed by Alamofire. + +## Requirements + +- iOS 8.0+ / macOS 10.10+ / tvOS 9.0+ / watchOS 2.0+ +- Xcode 8.3+ +- Swift 3.1+ + +## Migration Guides + +- [Alamofire 4.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%204.0%20Migration%20Guide.md) +- [Alamofire 3.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%203.0%20Migration%20Guide.md) +- [Alamofire 2.0 Migration Guide](https://github.com/Alamofire/Alamofire/blob/master/Documentation/Alamofire%202.0%20Migration%20Guide.md) + +## Communication +- If you **need help with making network requests**, use [Stack Overflow](https://stackoverflow.com/questions/tagged/alamofire) and tag `alamofire`. +- If you need to **find or understand an API**, check [our documentation](http://alamofire.github.io/Alamofire/) or [Apple's documentation for `URLSession`](https://developer.apple.com/documentation/foundation/url_loading_system), on top of which Alamofire is built. +- If you need **help with an Alamofire feature**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you'd like to **discuss Alamofire best practices**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you'd like to **discuss a feature request**, use [our forum on swift.org](https://forums.swift.org/c/related-projects/alamofire). +- If you **found a bug**, open an issue and follow the guide. The more detail the better! +- If you **want to contribute**, submit a pull request. + +## Installation + +### CocoaPods + +[CocoaPods](https://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command: + +```bash +$ gem install cocoapods +``` + +> CocoaPods 1.7+ is required to build Alamofire 4.9+. + +To integrate Alamofire into your Xcode project using CocoaPods, specify it in your `Podfile`: + +```ruby +source 'https://github.com/CocoaPods/Specs.git' +platform :ios, '10.0' +use_frameworks! + +target '' do + pod 'Alamofire', '~> 4.9' +end +``` + +Then, run the following command: + +```bash +$ pod install +``` + +### Carthage + +[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. + +You can install Carthage with [Homebrew](https://brew.sh/) using the following command: + +```bash +$ brew install carthage +``` + +To integrate Alamofire into your Xcode project using Carthage, specify it in your `Cartfile`: + +```ogdl +github "Alamofire/Alamofire" ~> 4.9 +``` + +Run `carthage update` to build the framework and drag the built `Alamofire.framework` into your Xcode project. + +### Swift Package Manager + +The [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler. It is in early development, but Alamofire does support its use on supported platforms. + +Once you have your Swift package set up, adding Alamofire as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. + +#### Swift 3 + +```swift +dependencies: [ + .Package(url: "https://github.com/Alamofire/Alamofire.git", majorVersion: 4) +] +``` + +#### Swift 4 + +```swift +dependencies: [ + .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.9.0") +] +``` + +### Manually + +If you prefer not to use any of the aforementioned dependency managers, you can integrate Alamofire into your project manually. + +#### Embedded Framework + +- Open up Terminal, `cd` into your top-level project directory, and run the following command "if" your project is not initialized as a git repository: + + ```bash + $ git init + ``` + +- Add Alamofire as a git [submodule](https://git-scm.com/docs/git-submodule) by running the following command: + + ```bash + $ git submodule add https://github.com/Alamofire/Alamofire.git + ``` + +- Open the new `Alamofire` folder, and drag the `Alamofire.xcodeproj` into the Project Navigator of your application's Xcode project. + + > It should appear nested underneath your application's blue project icon. Whether it is above or below all the other Xcode groups does not matter. + +- Select the `Alamofire.xcodeproj` in the Project Navigator and verify the deployment target matches that of your application target. +- Next, select your application project in the Project Navigator (blue project icon) to navigate to the target configuration window and select the application target under the "Targets" heading in the sidebar. +- In the tab bar at the top of that window, open the "General" panel. +- Click on the `+` button under the "Embedded Binaries" section. +- You will see two different `Alamofire.xcodeproj` folders each with two different versions of the `Alamofire.framework` nested inside a `Products` folder. + + > It does not matter which `Products` folder you choose from, but it does matter whether you choose the top or bottom `Alamofire.framework`. + +- Select the top `Alamofire.framework` for iOS and the bottom one for OS X. + + > You can verify which one you selected by inspecting the build log for your project. The build target for `Alamofire` will be listed as either `Alamofire iOS`, `Alamofire macOS`, `Alamofire tvOS` or `Alamofire watchOS`. + +- And that's it! + + > The `Alamofire.framework` is automagically added as a target dependency, linked framework and embedded framework in a copy files build phase which is all you need to build on the simulator and a device. + +## Open Radars + +The following radars have some effect on the current implementation of Alamofire. + +- [`rdar://21349340`](http://www.openradar.me/radar?id=5517037090635776) - Compiler throwing warning due to toll-free bridging issue in test case +- `rdar://26870455` - Background URL Session Configurations do not work in the simulator +- `rdar://26849668` - Some URLProtocol APIs do not properly handle `URLRequest` +- [`rdar://36082113`](http://openradar.appspot.com/radar?id=4942308441063424) - `URLSessionTaskMetrics` failing to link on watchOS 3.0+ + +## Resolved Radars + +The following radars have been resolved over time after being filed against the Alamofire project. + +- [`rdar://26761490`](http://www.openradar.me/radar?id=5010235949318144) - Swift string interpolation causing memory leak with common usage (Resolved on 9/1/17 in Xcode 9 beta 6). + +## FAQ + +### What's the origin of the name Alamofire? + +Alamofire is named after the [Alamo Fire flower](https://aggie-horticulture.tamu.edu/wildseed/alamofire.html), a hybrid variant of the Bluebonnet, the official state flower of Texas. + +### What logic belongs in a Router vs. a Request Adapter? + +Simple, static data such as paths, parameters and common headers belong in the `Router`. Dynamic data such as an `Authorization` header whose value can changed based on an authentication system belongs in a `RequestAdapter`. + +The reason the dynamic data MUST be placed into the `RequestAdapter` is to support retry operations. When a `Request` is retried, the original request is not rebuilt meaning the `Router` will not be called again. The `RequestAdapter` is called again allowing the dynamic data to be updated on the original request before retrying the `Request`. + +## Credits + +Alamofire is owned and maintained by the [Alamofire Software Foundation](http://alamofire.org). You can follow them on Twitter at [@AlamofireSF](https://twitter.com/AlamofireSF) for project updates and releases. + +### Security Disclosure + +If you believe you have identified a security vulnerability with Alamofire, you should report it as soon as possible via email to security@alamofire.org. Please do not post it to a public issue tracker. + +## Donations + +The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise money to officially stay registered as a federal non-profit organization. +Registering will allow us members to gain some legal protections and also allow us to put donations to use, tax free. +Donating to the ASF will enable us to: + +- Pay our yearly legal fees to keep the non-profit in good status +- Pay for our mail servers to help us stay on top of all questions and security issues +- Potentially fund test servers to make it easier for us to test the edge cases +- Potentially fund developers to work on one of our projects full-time + +The community adoption of the ASF libraries has been amazing. +We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. +With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. +If you use any of our libraries for work, see if your employers would be interested in donating. +Any amount you can donate today to help us reach our goal would be greatly appreciated. + +[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W34WPEE74APJQ) + +## License + +Alamofire is released under the MIT license. [See LICENSE](https://github.com/Alamofire/Alamofire/blob/master/LICENSE) for details. diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift new file mode 100644 index 000000000000..b163f6038fae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/AFError.swift @@ -0,0 +1,460 @@ +// +// AFError.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// `AFError` is the error type returned by Alamofire. It encompasses a few different types of errors, each with +/// their own associated reasons. +/// +/// - invalidURL: Returned when a `URLConvertible` type fails to create a valid `URL`. +/// - parameterEncodingFailed: Returned when a parameter encoding object throws an error during the encoding process. +/// - multipartEncodingFailed: Returned when some step in the multipart encoding process fails. +/// - responseValidationFailed: Returned when a `validate()` call fails. +/// - responseSerializationFailed: Returned when a response serializer encounters an error in the serialization process. +public enum AFError: Error { + /// The underlying reason the parameter encoding error occurred. + /// + /// - missingURL: The URL request did not have a URL to encode. + /// - jsonEncodingFailed: JSON serialization failed with an underlying system error during the + /// encoding process. + /// - propertyListEncodingFailed: Property list serialization failed with an underlying system error during + /// encoding process. + public enum ParameterEncodingFailureReason { + case missingURL + case jsonEncodingFailed(error: Error) + case propertyListEncodingFailed(error: Error) + } + + /// The underlying reason the multipart encoding error occurred. + /// + /// - bodyPartURLInvalid: The `fileURL` provided for reading an encodable body part isn't a + /// file URL. + /// - bodyPartFilenameInvalid: The filename of the `fileURL` provided has either an empty + /// `lastPathComponent` or `pathExtension. + /// - bodyPartFileNotReachable: The file at the `fileURL` provided was not reachable. + /// - bodyPartFileNotReachableWithError: Attempting to check the reachability of the `fileURL` provided threw + /// an error. + /// - bodyPartFileIsDirectory: The file at the `fileURL` provided is actually a directory. + /// - bodyPartFileSizeNotAvailable: The size of the file at the `fileURL` provided was not returned by + /// the system. + /// - bodyPartFileSizeQueryFailedWithError: The attempt to find the size of the file at the `fileURL` provided + /// threw an error. + /// - bodyPartInputStreamCreationFailed: An `InputStream` could not be created for the provided `fileURL`. + /// - outputStreamCreationFailed: An `OutputStream` could not be created when attempting to write the + /// encoded data to disk. + /// - outputStreamFileAlreadyExists: The encoded body data could not be writtent disk because a file + /// already exists at the provided `fileURL`. + /// - outputStreamURLInvalid: The `fileURL` provided for writing the encoded body data to disk is + /// not a file URL. + /// - outputStreamWriteFailed: The attempt to write the encoded body data to disk failed with an + /// underlying error. + /// - inputStreamReadFailed: The attempt to read an encoded body part `InputStream` failed with + /// underlying system error. + public enum MultipartEncodingFailureReason { + case bodyPartURLInvalid(url: URL) + case bodyPartFilenameInvalid(in: URL) + case bodyPartFileNotReachable(at: URL) + case bodyPartFileNotReachableWithError(atURL: URL, error: Error) + case bodyPartFileIsDirectory(at: URL) + case bodyPartFileSizeNotAvailable(at: URL) + case bodyPartFileSizeQueryFailedWithError(forURL: URL, error: Error) + case bodyPartInputStreamCreationFailed(for: URL) + + case outputStreamCreationFailed(for: URL) + case outputStreamFileAlreadyExists(at: URL) + case outputStreamURLInvalid(url: URL) + case outputStreamWriteFailed(error: Error) + + case inputStreamReadFailed(error: Error) + } + + /// The underlying reason the response validation error occurred. + /// + /// - dataFileNil: The data file containing the server response did not exist. + /// - dataFileReadFailed: The data file containing the server response could not be read. + /// - missingContentType: The response did not contain a `Content-Type` and the `acceptableContentTypes` + /// provided did not contain wildcard type. + /// - unacceptableContentType: The response `Content-Type` did not match any type in the provided + /// `acceptableContentTypes`. + /// - unacceptableStatusCode: The response status code was not acceptable. + public enum ResponseValidationFailureReason { + case dataFileNil + case dataFileReadFailed(at: URL) + case missingContentType(acceptableContentTypes: [String]) + case unacceptableContentType(acceptableContentTypes: [String], responseContentType: String) + case unacceptableStatusCode(code: Int) + } + + /// The underlying reason the response serialization error occurred. + /// + /// - inputDataNil: The server response contained no data. + /// - inputDataNilOrZeroLength: The server response contained no data or the data was zero length. + /// - inputFileNil: The file containing the server response did not exist. + /// - inputFileReadFailed: The file containing the server response could not be read. + /// - stringSerializationFailed: String serialization failed using the provided `String.Encoding`. + /// - jsonSerializationFailed: JSON serialization failed with an underlying system error. + /// - propertyListSerializationFailed: Property list serialization failed with an underlying system error. + public enum ResponseSerializationFailureReason { + case inputDataNil + case inputDataNilOrZeroLength + case inputFileNil + case inputFileReadFailed(at: URL) + case stringSerializationFailed(encoding: String.Encoding) + case jsonSerializationFailed(error: Error) + case propertyListSerializationFailed(error: Error) + } + + case invalidURL(url: URLConvertible) + case parameterEncodingFailed(reason: ParameterEncodingFailureReason) + case multipartEncodingFailed(reason: MultipartEncodingFailureReason) + case responseValidationFailed(reason: ResponseValidationFailureReason) + case responseSerializationFailed(reason: ResponseSerializationFailureReason) +} + +// MARK: - Adapt Error + +struct AdaptError: Error { + let error: Error +} + +extension Error { + var underlyingAdaptError: Error? { return (self as? AdaptError)?.error } +} + +// MARK: - Error Booleans + +extension AFError { + /// Returns whether the AFError is an invalid URL error. + public var isInvalidURLError: Bool { + if case .invalidURL = self { return true } + return false + } + + /// Returns whether the AFError is a parameter encoding error. When `true`, the `underlyingError` property will + /// contain the associated value. + public var isParameterEncodingError: Bool { + if case .parameterEncodingFailed = self { return true } + return false + } + + /// Returns whether the AFError is a multipart encoding error. When `true`, the `url` and `underlyingError` properties + /// will contain the associated values. + public var isMultipartEncodingError: Bool { + if case .multipartEncodingFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response validation error. When `true`, the `acceptableContentTypes`, + /// `responseContentType`, and `responseCode` properties will contain the associated values. + public var isResponseValidationError: Bool { + if case .responseValidationFailed = self { return true } + return false + } + + /// Returns whether the `AFError` is a response serialization error. When `true`, the `failedStringEncoding` and + /// `underlyingError` properties will contain the associated values. + public var isResponseSerializationError: Bool { + if case .responseSerializationFailed = self { return true } + return false + } +} + +// MARK: - Convenience Properties + +extension AFError { + /// The `URLConvertible` associated with the error. + public var urlConvertible: URLConvertible? { + switch self { + case .invalidURL(let url): + return url + default: + return nil + } + } + + /// The `URL` associated with the error. + public var url: URL? { + switch self { + case .multipartEncodingFailed(let reason): + return reason.url + default: + return nil + } + } + + /// The `Error` returned by a system framework associated with a `.parameterEncodingFailed`, + /// `.multipartEncodingFailed` or `.responseSerializationFailed` error. + public var underlyingError: Error? { + switch self { + case .parameterEncodingFailed(let reason): + return reason.underlyingError + case .multipartEncodingFailed(let reason): + return reason.underlyingError + case .responseSerializationFailed(let reason): + return reason.underlyingError + default: + return nil + } + } + + /// The acceptable `Content-Type`s of a `.responseValidationFailed` error. + public var acceptableContentTypes: [String]? { + switch self { + case .responseValidationFailed(let reason): + return reason.acceptableContentTypes + default: + return nil + } + } + + /// The response `Content-Type` of a `.responseValidationFailed` error. + public var responseContentType: String? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseContentType + default: + return nil + } + } + + /// The response code of a `.responseValidationFailed` error. + public var responseCode: Int? { + switch self { + case .responseValidationFailed(let reason): + return reason.responseCode + default: + return nil + } + } + + /// The `String.Encoding` associated with a failed `.stringResponse()` call. + public var failedStringEncoding: String.Encoding? { + switch self { + case .responseSerializationFailed(let reason): + return reason.failedStringEncoding + default: + return nil + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var underlyingError: Error? { + switch self { + case .jsonEncodingFailed(let error), .propertyListEncodingFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var url: URL? { + switch self { + case .bodyPartURLInvalid(let url), .bodyPartFilenameInvalid(let url), .bodyPartFileNotReachable(let url), + .bodyPartFileIsDirectory(let url), .bodyPartFileSizeNotAvailable(let url), + .bodyPartInputStreamCreationFailed(let url), .outputStreamCreationFailed(let url), + .outputStreamFileAlreadyExists(let url), .outputStreamURLInvalid(let url), + .bodyPartFileNotReachableWithError(let url, _), .bodyPartFileSizeQueryFailedWithError(let url, _): + return url + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .bodyPartFileNotReachableWithError(_, let error), .bodyPartFileSizeQueryFailedWithError(_, let error), + .outputStreamWriteFailed(let error), .inputStreamReadFailed(let error): + return error + default: + return nil + } + } +} + +extension AFError.ResponseValidationFailureReason { + var acceptableContentTypes: [String]? { + switch self { + case .missingContentType(let types), .unacceptableContentType(let types, _): + return types + default: + return nil + } + } + + var responseContentType: String? { + switch self { + case .unacceptableContentType(_, let responseType): + return responseType + default: + return nil + } + } + + var responseCode: Int? { + switch self { + case .unacceptableStatusCode(let code): + return code + default: + return nil + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var failedStringEncoding: String.Encoding? { + switch self { + case .stringSerializationFailed(let encoding): + return encoding + default: + return nil + } + } + + var underlyingError: Error? { + switch self { + case .jsonSerializationFailed(let error), .propertyListSerializationFailed(let error): + return error + default: + return nil + } + } +} + +// MARK: - Error Descriptions + +extension AFError: LocalizedError { + public var errorDescription: String? { + switch self { + case .invalidURL(let url): + return "URL is not valid: \(url)" + case .parameterEncodingFailed(let reason): + return reason.localizedDescription + case .multipartEncodingFailed(let reason): + return reason.localizedDescription + case .responseValidationFailed(let reason): + return reason.localizedDescription + case .responseSerializationFailed(let reason): + return reason.localizedDescription + } + } +} + +extension AFError.ParameterEncodingFailureReason { + var localizedDescription: String { + switch self { + case .missingURL: + return "URL request to encode was missing a URL" + case .jsonEncodingFailed(let error): + return "JSON could not be encoded because of error:\n\(error.localizedDescription)" + case .propertyListEncodingFailed(let error): + return "PropertyList could not be encoded because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.MultipartEncodingFailureReason { + var localizedDescription: String { + switch self { + case .bodyPartURLInvalid(let url): + return "The URL provided is not a file URL: \(url)" + case .bodyPartFilenameInvalid(let url): + return "The URL provided does not have a valid filename: \(url)" + case .bodyPartFileNotReachable(let url): + return "The URL provided is not reachable: \(url)" + case .bodyPartFileNotReachableWithError(let url, let error): + return ( + "The system returned an error while checking the provided URL for " + + "reachability.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartFileIsDirectory(let url): + return "The URL provided is a directory: \(url)" + case .bodyPartFileSizeNotAvailable(let url): + return "Could not fetch the file size from the provided URL: \(url)" + case .bodyPartFileSizeQueryFailedWithError(let url, let error): + return ( + "The system returned an error while attempting to fetch the file size from the " + + "provided URL.\nURL: \(url)\nError: \(error)" + ) + case .bodyPartInputStreamCreationFailed(let url): + return "Failed to create an InputStream for the provided URL: \(url)" + case .outputStreamCreationFailed(let url): + return "Failed to create an OutputStream for URL: \(url)" + case .outputStreamFileAlreadyExists(let url): + return "A file already exists at the provided URL: \(url)" + case .outputStreamURLInvalid(let url): + return "The provided OutputStream URL is invalid: \(url)" + case .outputStreamWriteFailed(let error): + return "OutputStream write failed with error: \(error)" + case .inputStreamReadFailed(let error): + return "InputStream read failed with error: \(error)" + } + } +} + +extension AFError.ResponseSerializationFailureReason { + var localizedDescription: String { + switch self { + case .inputDataNil: + return "Response could not be serialized, input data was nil." + case .inputDataNilOrZeroLength: + return "Response could not be serialized, input data was nil or zero length." + case .inputFileNil: + return "Response could not be serialized, input file was nil." + case .inputFileReadFailed(let url): + return "Response could not be serialized, input file could not be read: \(url)." + case .stringSerializationFailed(let encoding): + return "String could not be serialized with encoding: \(encoding)." + case .jsonSerializationFailed(let error): + return "JSON could not be serialized because of error:\n\(error.localizedDescription)" + case .propertyListSerializationFailed(let error): + return "PropertyList could not be serialized because of error:\n\(error.localizedDescription)" + } + } +} + +extension AFError.ResponseValidationFailureReason { + var localizedDescription: String { + switch self { + case .dataFileNil: + return "Response could not be validated, data file was nil." + case .dataFileReadFailed(let url): + return "Response could not be validated, data file could not be read: \(url)." + case .missingContentType(let types): + return ( + "Response Content-Type was missing and acceptable content types " + + "(\(types.joined(separator: ","))) do not match \"*/*\"." + ) + case .unacceptableContentType(let acceptableTypes, let responseType): + return ( + "Response Content-Type \"\(responseType)\" does not match any acceptable types: " + + "\(acceptableTypes.joined(separator: ","))." + ) + case .unacceptableStatusCode(let code): + return "Response status code was unacceptable: \(code)." + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift new file mode 100644 index 000000000000..20c3672fbaf2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Alamofire.swift @@ -0,0 +1,465 @@ +// +// Alamofire.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Types adopting the `URLConvertible` protocol can be used to construct URLs, which are then used to construct +/// URL requests. +public protocol URLConvertible { + /// Returns a URL that conforms to RFC 2396 or throws an `Error`. + /// + /// - throws: An `Error` if the type cannot be converted to a `URL`. + /// + /// - returns: A URL or throws an `Error`. + func asURL() throws -> URL +} + +extension String: URLConvertible { + /// Returns a URL if `self` represents a valid URL string that conforms to RFC 2396 or throws an `AFError`. + /// + /// - throws: An `AFError.invalidURL` if `self` is not a valid URL string. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = URL(string: self) else { throw AFError.invalidURL(url: self) } + return url + } +} + +extension URL: URLConvertible { + /// Returns self. + public func asURL() throws -> URL { return self } +} + +extension URLComponents: URLConvertible { + /// Returns a URL if `url` is not nil, otherwise throws an `Error`. + /// + /// - throws: An `AFError.invalidURL` if `url` is `nil`. + /// + /// - returns: A URL or throws an `AFError`. + public func asURL() throws -> URL { + guard let url = url else { throw AFError.invalidURL(url: self) } + return url + } +} + +// MARK: - + +/// Types adopting the `URLRequestConvertible` protocol can be used to construct URL requests. +public protocol URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + /// + /// - throws: An `Error` if the underlying `URLRequest` is `nil`. + /// + /// - returns: A URL request. + func asURLRequest() throws -> URLRequest +} + +extension URLRequestConvertible { + /// The URL request. + public var urlRequest: URLRequest? { return try? asURLRequest() } +} + +extension URLRequest: URLRequestConvertible { + /// Returns a URL request or throws if an `Error` was encountered. + public func asURLRequest() throws -> URLRequest { return self } +} + +// MARK: - + +extension URLRequest { + /// Creates an instance with the specified `method`, `urlString` and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The new `URLRequest` instance. + public init(url: URLConvertible, method: HTTPMethod, headers: HTTPHeaders? = nil) throws { + let url = try url.asURL() + + self.init(url: url) + + httpMethod = method.rawValue + + if let headers = headers { + for (headerField, headerValue) in headers { + setValue(headerValue, forHTTPHeaderField: headerField) + } + } + } + + func adapt(using adapter: RequestAdapter?) throws -> URLRequest { + guard let adapter = adapter else { return self } + return try adapter.adapt(self) + } +} + +// MARK: - Data Request + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding` and `headers`. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest +{ + return SessionManager.default.request( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers + ) +} + +/// Creates a `DataRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest`. +/// +/// - parameter urlRequest: The URL request +/// +/// - returns: The created `DataRequest`. +@discardableResult +public func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + return SessionManager.default.request(urlRequest) +} + +// MARK: - Download Request + +// MARK: URL Request + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of the specified `url`, +/// `method`, `parameters`, `encoding`, `headers` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.get` by default. +/// - parameter parameters: The parameters. `nil` by default. +/// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download( + url, + method: method, + parameters: parameters, + encoding: encoding, + headers: headers, + to: destination + ) +} + +/// Creates a `DownloadRequest` using the default `SessionManager` to retrieve the contents of a URL based on the +/// specified `urlRequest` and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// - parameter urlRequest: The URL request. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(urlRequest, to: destination) +} + +// MARK: Resume Data + +/// Creates a `DownloadRequest` using the default `SessionManager` from the `resumeData` produced from a +/// previous request cancellation to retrieve the contents of the original request and save them to the `destination`. +/// +/// If `destination` is not specified, the contents will remain in the temporary location determined by the +/// underlying URL session. +/// +/// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken +/// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the +/// data is written incorrectly and will always fail to resume the download. For more information about the bug and +/// possible workarounds, please refer to the following Stack Overflow post: +/// +/// - http://stackoverflow.com/a/39347461/1342462 +/// +/// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` +/// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for additional +/// information. +/// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. +/// +/// - returns: The created `DownloadRequest`. +@discardableResult +public func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest +{ + return SessionManager.default.download(resumingWith: resumeData, to: destination) +} + +// MARK: - Upload Request + +// MARK: File + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(fileURL, to: url, method: method, headers: headers) +} + +/// Creates a `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `file`. +/// +/// - parameter file: The file to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(fileURL, with: urlRequest) +} + +// MARK: Data + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(data, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `data`. +/// +/// - parameter data: The data to upload. +/// - parameter urlRequest: The URL request. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(data, with: urlRequest) +} + +// MARK: InputStream + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `url`, `method` and `headers` +/// for uploading the `stream`. +/// +/// - parameter stream: The stream to upload. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest +{ + return SessionManager.default.upload(stream, to: url, method: method, headers: headers) +} + +/// Creates an `UploadRequest` using the default `SessionManager` from the specified `urlRequest` for +/// uploading the `stream`. +/// +/// - parameter urlRequest: The URL request. +/// - parameter stream: The stream to upload. +/// +/// - returns: The created `UploadRequest`. +@discardableResult +public func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + return SessionManager.default.upload(stream, with: urlRequest) +} + +// MARK: MultipartFormData + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` with the default `SessionManager` and calls +/// `encodingCompletion` with new `UploadRequest` using the `url`, `method` and `headers`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter url: The URL. +/// - parameter method: The HTTP method. `.post` by default. +/// - parameter headers: The HTTP headers. `nil` by default. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + to: url, + method: method, + headers: headers, + encodingCompletion: encodingCompletion + ) +} + +/// Encodes `multipartFormData` using `encodingMemoryThreshold` and the default `SessionManager` and +/// calls `encodingCompletion` with new `UploadRequest` using the `urlRequest`. +/// +/// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative +/// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most +/// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to +/// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory +/// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be +/// used for larger payloads such as video content. +/// +/// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory +/// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, +/// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk +/// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding +/// technique was used. +/// +/// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. +/// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. +/// `multipartFormDataEncodingMemoryThreshold` by default. +/// - parameter urlRequest: The URL request. +/// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. +public func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + encodingCompletion: ((SessionManager.MultipartFormDataEncodingResult) -> Void)?) +{ + return SessionManager.default.upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + encodingCompletion: encodingCompletion + ) +} + +#if !os(watchOS) + +// MARK: - Stream Request + +// MARK: Hostname and Port + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `hostname` +/// and `port`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter hostName: The hostname of the server to connect to. +/// - parameter port: The port of the server to connect to. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return SessionManager.default.stream(withHostName: hostName, port: port) +} + +// MARK: NetService + +/// Creates a `StreamRequest` using the default `SessionManager` for bidirectional streaming with the `netService`. +/// +/// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. +/// +/// - parameter netService: The net service used to identify the endpoint. +/// +/// - returns: The created `StreamRequest`. +@discardableResult +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +public func stream(with netService: NetService) -> StreamRequest { + return SessionManager.default.stream(with: netService) +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift new file mode 100644 index 000000000000..a54673cca618 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/DispatchQueue+Alamofire.swift @@ -0,0 +1,37 @@ +// +// DispatchQueue+Alamofire.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Dispatch +import Foundation + +extension DispatchQueue { + static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) } + static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) } + static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) } + static var background: DispatchQueue { return DispatchQueue.global(qos: .background) } + + func after(_ delay: TimeInterval, execute closure: @escaping () -> Void) { + asyncAfter(deadline: .now() + delay, execute: closure) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift new file mode 100644 index 000000000000..b840138ccc15 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/MultipartFormData.swift @@ -0,0 +1,580 @@ +// +// MultipartFormData.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +#if os(iOS) || os(watchOS) || os(tvOS) +import MobileCoreServices +#elseif os(macOS) +import CoreServices +#endif + +/// Constructs `multipart/form-data` for uploads within an HTTP or HTTPS body. There are currently two ways to encode +/// multipart form data. The first way is to encode the data directly in memory. This is very efficient, but can lead +/// to memory issues if the dataset is too large. The second way is designed for larger datasets and will write all the +/// data to a single file on disk with all the proper boundary segmentation. The second approach MUST be used for +/// larger datasets such as video content, otherwise your app may run out of memory when trying to encode the dataset. +/// +/// For more information on `multipart/form-data` in general, please refer to the RFC-2388 and RFC-2045 specs as well +/// and the w3 form documentation. +/// +/// - https://www.ietf.org/rfc/rfc2388.txt +/// - https://www.ietf.org/rfc/rfc2045.txt +/// - https://www.w3.org/TR/html401/interact/forms.html#h-17.13 +open class MultipartFormData { + + // MARK: - Helper Types + + struct EncodingCharacters { + static let crlf = "\r\n" + } + + struct BoundaryGenerator { + enum BoundaryType { + case initial, encapsulated, final + } + + static func randomBoundary() -> String { + return String(format: "alamofire.boundary.%08x%08x", arc4random(), arc4random()) + } + + static func boundaryData(forBoundaryType boundaryType: BoundaryType, boundary: String) -> Data { + let boundaryText: String + + switch boundaryType { + case .initial: + boundaryText = "--\(boundary)\(EncodingCharacters.crlf)" + case .encapsulated: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)\(EncodingCharacters.crlf)" + case .final: + boundaryText = "\(EncodingCharacters.crlf)--\(boundary)--\(EncodingCharacters.crlf)" + } + + return boundaryText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + } + + class BodyPart { + let headers: HTTPHeaders + let bodyStream: InputStream + let bodyContentLength: UInt64 + var hasInitialBoundary = false + var hasFinalBoundary = false + + init(headers: HTTPHeaders, bodyStream: InputStream, bodyContentLength: UInt64) { + self.headers = headers + self.bodyStream = bodyStream + self.bodyContentLength = bodyContentLength + } + } + + // MARK: - Properties + + /// The `Content-Type` header value containing the boundary used to generate the `multipart/form-data`. + open lazy var contentType: String = "multipart/form-data; boundary=\(self.boundary)" + + /// The content length of all body parts used to generate the `multipart/form-data` not including the boundaries. + public var contentLength: UInt64 { return bodyParts.reduce(0) { $0 + $1.bodyContentLength } } + + /// The boundary used to separate the body parts in the encoded form data. + public var boundary: String + + private var bodyParts: [BodyPart] + private var bodyPartError: AFError? + private let streamBufferSize: Int + + // MARK: - Lifecycle + + /// Creates a multipart form data object. + /// + /// - returns: The multipart form data object. + public init() { + self.boundary = BoundaryGenerator.randomBoundary() + self.bodyParts = [] + + /// + /// The optimal read/write buffer size in bytes for input and output streams is 1024 (1KB). For more + /// information, please refer to the following article: + /// - https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Streams/Articles/ReadingInputStreams.html + /// + + self.streamBufferSize = 1024 + } + + // MARK: - Body Parts + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + public func append(_ data: Data, withName name: String) { + let headers = contentHeaders(withName: name) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data content type in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, mimeType: String) { + let headers = contentHeaders(withName: name, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the data and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter data: The data to encode into the multipart form data. + /// - parameter name: The name to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the data in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the data in the `Content-Type` HTTP header. + public func append(_ data: Data, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + let stream = InputStream(data: data) + let length = UInt64(data.count) + + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{generated filename}` (HTTP Header) + /// - `Content-Type: #{generated mimeType}` (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// The filename in the `Content-Disposition` HTTP header is generated from the last path component of the + /// `fileURL`. The `Content-Type` HTTP header MIME type is generated by mapping the `fileURL` extension to the + /// system associated MIME type. + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + public func append(_ fileURL: URL, withName name: String) { + let fileName = fileURL.lastPathComponent + let pathExtension = fileURL.pathExtension + + if !fileName.isEmpty && !pathExtension.isEmpty { + let mime = mimeType(forPathExtension: pathExtension) + append(fileURL, withName: name, fileName: fileName, mimeType: mime) + } else { + setBodyPartError(withReason: .bodyPartFilenameInvalid(in: fileURL)) + } + } + + /// Creates a body part from the file and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - Content-Disposition: form-data; name=#{name}; filename=#{filename} (HTTP Header) + /// - Content-Type: #{mimeType} (HTTP Header) + /// - Encoded file data + /// - Multipart form boundary + /// + /// - parameter fileURL: The URL of the file whose content will be encoded into the multipart form data. + /// - parameter name: The name to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the file content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the file content in the `Content-Type` HTTP header. + public func append(_ fileURL: URL, withName name: String, fileName: String, mimeType: String) { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + + //============================================================ + // Check 1 - is file URL? + //============================================================ + + guard fileURL.isFileURL else { + setBodyPartError(withReason: .bodyPartURLInvalid(url: fileURL)) + return + } + + //============================================================ + // Check 2 - is file URL reachable? + //============================================================ + + do { + let isReachable = try fileURL.checkPromisedItemIsReachable() + guard isReachable else { + setBodyPartError(withReason: .bodyPartFileNotReachable(at: fileURL)) + return + } + } catch { + setBodyPartError(withReason: .bodyPartFileNotReachableWithError(atURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 3 - is file URL a directory? + //============================================================ + + var isDirectory: ObjCBool = false + let path = fileURL.path + + guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) && !isDirectory.boolValue else { + setBodyPartError(withReason: .bodyPartFileIsDirectory(at: fileURL)) + return + } + + //============================================================ + // Check 4 - can the file size be extracted? + //============================================================ + + let bodyContentLength: UInt64 + + do { + guard let fileSize = try FileManager.default.attributesOfItem(atPath: path)[.size] as? NSNumber else { + setBodyPartError(withReason: .bodyPartFileSizeNotAvailable(at: fileURL)) + return + } + + bodyContentLength = fileSize.uint64Value + } + catch { + setBodyPartError(withReason: .bodyPartFileSizeQueryFailedWithError(forURL: fileURL, error: error)) + return + } + + //============================================================ + // Check 5 - can a stream be created from file URL? + //============================================================ + + guard let stream = InputStream(url: fileURL) else { + setBodyPartError(withReason: .bodyPartInputStreamCreationFailed(for: fileURL)) + return + } + + append(stream, withLength: bodyContentLength, headers: headers) + } + + /// Creates a body part from the stream and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - `Content-Disposition: form-data; name=#{name}; filename=#{filename}` (HTTP Header) + /// - `Content-Type: #{mimeType}` (HTTP Header) + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter name: The name to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter fileName: The filename to associate with the stream content in the `Content-Disposition` HTTP header. + /// - parameter mimeType: The MIME type to associate with the stream content in the `Content-Type` HTTP header. + public func append( + _ stream: InputStream, + withLength length: UInt64, + name: String, + fileName: String, + mimeType: String) + { + let headers = contentHeaders(withName: name, fileName: fileName, mimeType: mimeType) + append(stream, withLength: length, headers: headers) + } + + /// Creates a body part with the headers, stream and length and appends it to the multipart form data object. + /// + /// The body part data will be encoded using the following format: + /// + /// - HTTP headers + /// - Encoded stream data + /// - Multipart form boundary + /// + /// - parameter stream: The input stream to encode in the multipart form data. + /// - parameter length: The content length of the stream. + /// - parameter headers: The HTTP headers for the body part. + public func append(_ stream: InputStream, withLength length: UInt64, headers: HTTPHeaders) { + let bodyPart = BodyPart(headers: headers, bodyStream: stream, bodyContentLength: length) + bodyParts.append(bodyPart) + } + + // MARK: - Data Encoding + + /// Encodes all the appended body parts into a single `Data` value. + /// + /// It is important to note that this method will load all the appended body parts into memory all at the same + /// time. This method should only be used when the encoded data will have a small memory footprint. For large data + /// cases, please use the `writeEncodedDataToDisk(fileURL:completionHandler:)` method. + /// + /// - throws: An `AFError` if encoding encounters an error. + /// + /// - returns: The encoded `Data` if encoding is successful. + public func encode() throws -> Data { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + var encoded = Data() + + bodyParts.first?.hasInitialBoundary = true + bodyParts.last?.hasFinalBoundary = true + + for bodyPart in bodyParts { + let encodedData = try encode(bodyPart) + encoded.append(encodedData) + } + + return encoded + } + + /// Writes the appended body parts into the given file URL. + /// + /// This process is facilitated by reading and writing with input and output streams, respectively. Thus, + /// this approach is very memory efficient and should be used for large body part data. + /// + /// - parameter fileURL: The file URL to write the multipart form data into. + /// + /// - throws: An `AFError` if encoding encounters an error. + public func writeEncodedData(to fileURL: URL) throws { + if let bodyPartError = bodyPartError { + throw bodyPartError + } + + if FileManager.default.fileExists(atPath: fileURL.path) { + throw AFError.multipartEncodingFailed(reason: .outputStreamFileAlreadyExists(at: fileURL)) + } else if !fileURL.isFileURL { + throw AFError.multipartEncodingFailed(reason: .outputStreamURLInvalid(url: fileURL)) + } + + guard let outputStream = OutputStream(url: fileURL, append: false) else { + throw AFError.multipartEncodingFailed(reason: .outputStreamCreationFailed(for: fileURL)) + } + + outputStream.open() + defer { outputStream.close() } + + self.bodyParts.first?.hasInitialBoundary = true + self.bodyParts.last?.hasFinalBoundary = true + + for bodyPart in self.bodyParts { + try write(bodyPart, to: outputStream) + } + } + + // MARK: - Private - Body Part Encoding + + private func encode(_ bodyPart: BodyPart) throws -> Data { + var encoded = Data() + + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + encoded.append(initialData) + + let headerData = encodeHeaders(for: bodyPart) + encoded.append(headerData) + + let bodyStreamData = try encodeBodyStream(for: bodyPart) + encoded.append(bodyStreamData) + + if bodyPart.hasFinalBoundary { + encoded.append(finalBoundaryData()) + } + + return encoded + } + + private func encodeHeaders(for bodyPart: BodyPart) -> Data { + var headerText = "" + + for (key, value) in bodyPart.headers { + headerText += "\(key): \(value)\(EncodingCharacters.crlf)" + } + headerText += EncodingCharacters.crlf + + return headerText.data(using: String.Encoding.utf8, allowLossyConversion: false)! + } + + private func encodeBodyStream(for bodyPart: BodyPart) throws -> Data { + let inputStream = bodyPart.bodyStream + inputStream.open() + defer { inputStream.close() } + + var encoded = Data() + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let error = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: error)) + } + + if bytesRead > 0 { + encoded.append(buffer, count: bytesRead) + } else { + break + } + } + + return encoded + } + + // MARK: - Private - Writing Body Part to Output Stream + + private func write(_ bodyPart: BodyPart, to outputStream: OutputStream) throws { + try writeInitialBoundaryData(for: bodyPart, to: outputStream) + try writeHeaderData(for: bodyPart, to: outputStream) + try writeBodyStream(for: bodyPart, to: outputStream) + try writeFinalBoundaryData(for: bodyPart, to: outputStream) + } + + private func writeInitialBoundaryData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let initialData = bodyPart.hasInitialBoundary ? initialBoundaryData() : encapsulatedBoundaryData() + return try write(initialData, to: outputStream) + } + + private func writeHeaderData(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let headerData = encodeHeaders(for: bodyPart) + return try write(headerData, to: outputStream) + } + + private func writeBodyStream(for bodyPart: BodyPart, to outputStream: OutputStream) throws { + let inputStream = bodyPart.bodyStream + + inputStream.open() + defer { inputStream.close() } + + while inputStream.hasBytesAvailable { + var buffer = [UInt8](repeating: 0, count: streamBufferSize) + let bytesRead = inputStream.read(&buffer, maxLength: streamBufferSize) + + if let streamError = inputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .inputStreamReadFailed(error: streamError)) + } + + if bytesRead > 0 { + if buffer.count != bytesRead { + buffer = Array(buffer[0.. 0, outputStream.hasSpaceAvailable { + let bytesWritten = outputStream.write(buffer, maxLength: bytesToWrite) + + if let error = outputStream.streamError { + throw AFError.multipartEncodingFailed(reason: .outputStreamWriteFailed(error: error)) + } + + bytesToWrite -= bytesWritten + + if bytesToWrite > 0 { + buffer = Array(buffer[bytesWritten.. String { + if + let id = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, pathExtension as CFString, nil)?.takeRetainedValue(), + let contentType = UTTypeCopyPreferredTagWithClass(id, kUTTagClassMIMEType)?.takeRetainedValue() + { + return contentType as String + } + + return "application/octet-stream" + } + + // MARK: - Private - Content Headers + + private func contentHeaders(withName name: String, fileName: String? = nil, mimeType: String? = nil) -> [String: String] { + var disposition = "form-data; name=\"\(name)\"" + if let fileName = fileName { disposition += "; filename=\"\(fileName)\"" } + + var headers = ["Content-Disposition": disposition] + if let mimeType = mimeType { headers["Content-Type"] = mimeType } + + return headers + } + + // MARK: - Private - Boundary Encoding + + private func initialBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .initial, boundary: boundary) + } + + private func encapsulatedBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .encapsulated, boundary: boundary) + } + + private func finalBoundaryData() -> Data { + return BoundaryGenerator.boundaryData(forBoundaryType: .final, boundary: boundary) + } + + // MARK: - Private - Errors + + private func setBodyPartError(withReason reason: AFError.MultipartEncodingFailureReason) { + guard bodyPartError == nil else { return } + bodyPartError = AFError.multipartEncodingFailed(reason: reason) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift new file mode 100644 index 000000000000..398ca827c2b0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/NetworkReachabilityManager.swift @@ -0,0 +1,238 @@ +// +// NetworkReachabilityManager.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +#if !os(watchOS) + +import Foundation +import SystemConfiguration + +/// The `NetworkReachabilityManager` class listens for reachability changes of hosts and addresses for both WWAN and +/// WiFi network interfaces. +/// +/// Reachability can be used to determine background information about why a network operation failed, or to retry +/// network requests when a connection is established. It should not be used to prevent a user from initiating a network +/// request, as it's possible that an initial request may be required to establish reachability. +open class NetworkReachabilityManager { + /// Defines the various states of network reachability. + /// + /// - unknown: It is unknown whether the network is reachable. + /// - notReachable: The network is not reachable. + /// - reachable: The network is reachable. + public enum NetworkReachabilityStatus { + case unknown + case notReachable + case reachable(ConnectionType) + } + + /// Defines the various connection types detected by reachability flags. + /// + /// - ethernetOrWiFi: The connection type is either over Ethernet or WiFi. + /// - wwan: The connection type is a WWAN connection. + public enum ConnectionType { + case ethernetOrWiFi + case wwan + } + + /// A closure executed when the network reachability status changes. The closure takes a single argument: the + /// network reachability status. + public typealias Listener = (NetworkReachabilityStatus) -> Void + + // MARK: - Properties + + /// Whether the network is currently reachable. + open var isReachable: Bool { return isReachableOnWWAN || isReachableOnEthernetOrWiFi } + + /// Whether the network is currently reachable over the WWAN interface. + open var isReachableOnWWAN: Bool { return networkReachabilityStatus == .reachable(.wwan) } + + /// Whether the network is currently reachable over Ethernet or WiFi interface. + open var isReachableOnEthernetOrWiFi: Bool { return networkReachabilityStatus == .reachable(.ethernetOrWiFi) } + + /// The current network reachability status. + open var networkReachabilityStatus: NetworkReachabilityStatus { + guard let flags = self.flags else { return .unknown } + return networkReachabilityStatusForFlags(flags) + } + + /// The dispatch queue to execute the `listener` closure on. + open var listenerQueue: DispatchQueue = DispatchQueue.main + + /// A closure executed when the network reachability status changes. + open var listener: Listener? + + open var flags: SCNetworkReachabilityFlags? { + var flags = SCNetworkReachabilityFlags() + + if SCNetworkReachabilityGetFlags(reachability, &flags) { + return flags + } + + return nil + } + + private let reachability: SCNetworkReachability + open var previousFlags: SCNetworkReachabilityFlags + + // MARK: - Initialization + + /// Creates a `NetworkReachabilityManager` instance with the specified host. + /// + /// - parameter host: The host used to evaluate network reachability. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?(host: String) { + guard let reachability = SCNetworkReachabilityCreateWithName(nil, host) else { return nil } + self.init(reachability: reachability) + } + + /// Creates a `NetworkReachabilityManager` instance that monitors the address 0.0.0.0. + /// + /// Reachability treats the 0.0.0.0 address as a special token that causes it to monitor the general routing + /// status of the device, both IPv4 and IPv6. + /// + /// - returns: The new `NetworkReachabilityManager` instance. + public convenience init?() { + var address = sockaddr_in() + address.sin_len = UInt8(MemoryLayout.size) + address.sin_family = sa_family_t(AF_INET) + + guard let reachability = withUnsafePointer(to: &address, { pointer in + return pointer.withMemoryRebound(to: sockaddr.self, capacity: MemoryLayout.size) { + return SCNetworkReachabilityCreateWithAddress(nil, $0) + } + }) else { return nil } + + self.init(reachability: reachability) + } + + private init(reachability: SCNetworkReachability) { + self.reachability = reachability + + // Set the previous flags to an unreserved value to represent unknown status + self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30) + } + + deinit { + stopListening() + } + + // MARK: - Listening + + /// Starts listening for changes in network reachability status. + /// + /// - returns: `true` if listening was started successfully, `false` otherwise. + @discardableResult + open func startListening() -> Bool { + var context = SCNetworkReachabilityContext(version: 0, info: nil, retain: nil, release: nil, copyDescription: nil) + context.info = Unmanaged.passUnretained(self).toOpaque() + + let callbackEnabled = SCNetworkReachabilitySetCallback( + reachability, + { (_, flags, info) in + let reachability = Unmanaged.fromOpaque(info!).takeUnretainedValue() + reachability.notifyListener(flags) + }, + &context + ) + + let queueEnabled = SCNetworkReachabilitySetDispatchQueue(reachability, listenerQueue) + + listenerQueue.async { + self.previousFlags = SCNetworkReachabilityFlags(rawValue: 1 << 30) + + guard let flags = self.flags else { return } + + self.notifyListener(flags) + } + + return callbackEnabled && queueEnabled + } + + /// Stops listening for changes in network reachability status. + open func stopListening() { + SCNetworkReachabilitySetCallback(reachability, nil, nil) + SCNetworkReachabilitySetDispatchQueue(reachability, nil) + } + + // MARK: - Internal - Listener Notification + + func notifyListener(_ flags: SCNetworkReachabilityFlags) { + guard previousFlags != flags else { return } + previousFlags = flags + + listener?(networkReachabilityStatusForFlags(flags)) + } + + // MARK: - Internal - Network Reachability Status + + func networkReachabilityStatusForFlags(_ flags: SCNetworkReachabilityFlags) -> NetworkReachabilityStatus { + guard isNetworkReachable(with: flags) else { return .notReachable } + + var networkStatus: NetworkReachabilityStatus = .reachable(.ethernetOrWiFi) + + #if os(iOS) + if flags.contains(.isWWAN) { networkStatus = .reachable(.wwan) } + #endif + + return networkStatus + } + + func isNetworkReachable(with flags: SCNetworkReachabilityFlags) -> Bool { + let isReachable = flags.contains(.reachable) + let needsConnection = flags.contains(.connectionRequired) + let canConnectAutomatically = flags.contains(.connectionOnDemand) || flags.contains(.connectionOnTraffic) + let canConnectWithoutUserInteraction = canConnectAutomatically && !flags.contains(.interventionRequired) + + return isReachable && (!needsConnection || canConnectWithoutUserInteraction) + } +} + +// MARK: - + +extension NetworkReachabilityManager.NetworkReachabilityStatus: Equatable {} + +/// Returns whether the two network reachability status values are equal. +/// +/// - parameter lhs: The left-hand side value to compare. +/// - parameter rhs: The right-hand side value to compare. +/// +/// - returns: `true` if the two values are equal, `false` otherwise. +public func ==( + lhs: NetworkReachabilityManager.NetworkReachabilityStatus, + rhs: NetworkReachabilityManager.NetworkReachabilityStatus) + -> Bool +{ + switch (lhs, rhs) { + case (.unknown, .unknown): + return true + case (.notReachable, .notReachable): + return true + case let (.reachable(lhsConnectionType), .reachable(rhsConnectionType)): + return lhsConnectionType == rhsConnectionType + default: + return false + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift new file mode 100644 index 000000000000..e1ac31bf327e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Notifications.swift @@ -0,0 +1,55 @@ +// +// Notifications.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Notification.Name { + /// Used as a namespace for all `URLSessionTask` related notifications. + public struct Task { + /// Posted when a `URLSessionTask` is resumed. The notification `object` contains the resumed `URLSessionTask`. + public static let DidResume = Notification.Name(rawValue: "org.alamofire.notification.name.task.didResume") + + /// Posted when a `URLSessionTask` is suspended. The notification `object` contains the suspended `URLSessionTask`. + public static let DidSuspend = Notification.Name(rawValue: "org.alamofire.notification.name.task.didSuspend") + + /// Posted when a `URLSessionTask` is cancelled. The notification `object` contains the cancelled `URLSessionTask`. + public static let DidCancel = Notification.Name(rawValue: "org.alamofire.notification.name.task.didCancel") + + /// Posted when a `URLSessionTask` is completed. The notification `object` contains the completed `URLSessionTask`. + public static let DidComplete = Notification.Name(rawValue: "org.alamofire.notification.name.task.didComplete") + } +} + +// MARK: - + +extension Notification { + /// Used as a namespace for all `Notification` user info dictionary keys. + public struct Key { + /// User info dictionary key representing the `URLSessionTask` associated with the notification. + public static let Task = "org.alamofire.notification.key.task" + + /// User info dictionary key representing the responseData associated with the notification. + public static let ResponseData = "org.alamofire.notification.key.responseData" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift new file mode 100644 index 000000000000..6195809c5db9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ParameterEncoding.swift @@ -0,0 +1,483 @@ +// +// ParameterEncoding.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// HTTP method definitions. +/// +/// See https://tools.ietf.org/html/rfc7231#section-4.3 +public enum HTTPMethod: String { + case options = "OPTIONS" + case get = "GET" + case head = "HEAD" + case post = "POST" + case put = "PUT" + case patch = "PATCH" + case delete = "DELETE" + case trace = "TRACE" + case connect = "CONNECT" +} + +// MARK: - + +/// A dictionary of parameters to apply to a `URLRequest`. +public typealias Parameters = [String: Any] + +/// A type used to define how a set of parameters are applied to a `URLRequest`. +public protocol ParameterEncoding { + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `AFError.parameterEncodingFailed` error if encoding fails. + /// + /// - returns: The encoded request. + func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest +} + +// MARK: - + +/// Creates a url-encoded query string to be set as or appended to any existing URL query string or set as the HTTP +/// body of the URL request. Whether the query string is set or appended to any existing URL query string or set as +/// the HTTP body depends on the destination of the encoding. +/// +/// The `Content-Type` HTTP header field of an encoded request with HTTP body is set to +/// `application/x-www-form-urlencoded; charset=utf-8`. +/// +/// There is no published specification for how to encode collection types. By default the convention of appending +/// `[]` to the key for array values (`foo[]=1&foo[]=2`), and appending the key surrounded by square brackets for +/// nested dictionary values (`foo[bar]=baz`) is used. Optionally, `ArrayEncoding` can be used to omit the +/// square brackets appended to array keys. +/// +/// `BoolEncoding` can be used to configure how boolean values are encoded. The default behavior is to encode +/// `true` as 1 and `false` as 0. +public struct URLEncoding: ParameterEncoding { + + // MARK: Helper Types + + /// Defines whether the url-encoded query string is applied to the existing query string or HTTP body of the + /// resulting URL request. + /// + /// - methodDependent: Applies encoded query string result to existing query string for `GET`, `HEAD` and `DELETE` + /// requests and sets as the HTTP body for requests with any other HTTP method. + /// - queryString: Sets or appends encoded query string result to existing query string. + /// - httpBody: Sets encoded query string result as the HTTP body of the URL request. + public enum Destination { + case methodDependent, queryString, httpBody + } + + /// Configures how `Array` parameters are encoded. + /// + /// - brackets: An empty set of square brackets is appended to the key for every value. + /// This is the default behavior. + /// - noBrackets: No brackets are appended. The key is encoded as is. + public enum ArrayEncoding { + case brackets, noBrackets + + func encode(key: String) -> String { + switch self { + case .brackets: + return "\(key)[]" + case .noBrackets: + return key + } + } + } + + /// Configures how `Bool` parameters are encoded. + /// + /// - numeric: Encode `true` as `1` and `false` as `0`. This is the default behavior. + /// - literal: Encode `true` and `false` as string literals. + public enum BoolEncoding { + case numeric, literal + + func encode(value: Bool) -> String { + switch self { + case .numeric: + return value ? "1" : "0" + case .literal: + return value ? "true" : "false" + } + } + } + + // MARK: Properties + + /// Returns a default `URLEncoding` instance. + public static var `default`: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.methodDependent` destination. + public static var methodDependent: URLEncoding { return URLEncoding() } + + /// Returns a `URLEncoding` instance with a `.queryString` destination. + public static var queryString: URLEncoding { return URLEncoding(destination: .queryString) } + + /// Returns a `URLEncoding` instance with an `.httpBody` destination. + public static var httpBody: URLEncoding { return URLEncoding(destination: .httpBody) } + + /// The destination defining where the encoded query string is to be applied to the URL request. + public let destination: Destination + + /// The encoding to use for `Array` parameters. + public let arrayEncoding: ArrayEncoding + + /// The encoding to use for `Bool` parameters. + public let boolEncoding: BoolEncoding + + // MARK: Initialization + + /// Creates a `URLEncoding` instance using the specified destination. + /// + /// - parameter destination: The destination defining where the encoded query string is to be applied. + /// - parameter arrayEncoding: The encoding to use for `Array` parameters. + /// - parameter boolEncoding: The encoding to use for `Bool` parameters. + /// + /// - returns: The new `URLEncoding` instance. + public init(destination: Destination = .methodDependent, arrayEncoding: ArrayEncoding = .brackets, boolEncoding: BoolEncoding = .numeric) { + self.destination = destination + self.arrayEncoding = arrayEncoding + self.boolEncoding = boolEncoding + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + if let method = HTTPMethod(rawValue: urlRequest.httpMethod ?? "GET"), encodesParametersInURL(with: method) { + guard let url = urlRequest.url else { + throw AFError.parameterEncodingFailed(reason: .missingURL) + } + + if var urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false), !parameters.isEmpty { + let percentEncodedQuery = (urlComponents.percentEncodedQuery.map { $0 + "&" } ?? "") + query(parameters) + urlComponents.percentEncodedQuery = percentEncodedQuery + urlRequest.url = urlComponents.url + } + } else { + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-www-form-urlencoded; charset=utf-8", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = query(parameters).data(using: .utf8, allowLossyConversion: false) + } + + return urlRequest + } + + /// Creates percent-escaped, URL encoded query string components from the given key-value pair using recursion. + /// + /// - parameter key: The key of the query component. + /// - parameter value: The value of the query component. + /// + /// - returns: The percent-escaped, URL encoded query string components. + public func queryComponents(fromKey key: String, value: Any) -> [(String, String)] { + var components: [(String, String)] = [] + + if let dictionary = value as? [String: Any] { + for (nestedKey, value) in dictionary { + components += queryComponents(fromKey: "\(key)[\(nestedKey)]", value: value) + } + } else if let array = value as? [Any] { + for value in array { + components += queryComponents(fromKey: arrayEncoding.encode(key: key), value: value) + } + } else if let value = value as? NSNumber { + if value.isBool { + components.append((escape(key), escape(boolEncoding.encode(value: value.boolValue)))) + } else { + components.append((escape(key), escape("\(value)"))) + } + } else if let bool = value as? Bool { + components.append((escape(key), escape(boolEncoding.encode(value: bool)))) + } else { + components.append((escape(key), escape("\(value)"))) + } + + return components + } + + /// Returns a percent-escaped string following RFC 3986 for a query string key or value. + /// + /// RFC 3986 states that the following characters are "reserved" characters. + /// + /// - General Delimiters: ":", "#", "[", "]", "@", "?", "/" + /// - Sub-Delimiters: "!", "$", "&", "'", "(", ")", "*", "+", ",", ";", "=" + /// + /// In RFC 3986 - Section 3.4, it states that the "?" and "/" characters should not be escaped to allow + /// query strings to include a URL. Therefore, all "reserved" characters with the exception of "?" and "/" + /// should be percent-escaped in the query string. + /// + /// - parameter string: The string to be percent-escaped. + /// + /// - returns: The percent-escaped string. + public func escape(_ string: String) -> String { + let generalDelimitersToEncode = ":#[]@" // does not include "?" or "/" due to RFC 3986 - Section 3.4 + let subDelimitersToEncode = "!$&'()*+,;=" + + var allowedCharacterSet = CharacterSet.urlQueryAllowed + allowedCharacterSet.remove(charactersIn: "\(generalDelimitersToEncode)\(subDelimitersToEncode)") + + var escaped = "" + + //========================================================================================================== + // + // Batching is required for escaping due to an internal bug in iOS 8.1 and 8.2. Encoding more than a few + // hundred Chinese characters causes various malloc error crashes. To avoid this issue until iOS 8 is no + // longer supported, batching MUST be used for encoding. This introduces roughly a 20% overhead. For more + // info, please refer to: + // + // - https://github.com/Alamofire/Alamofire/issues/206 + // + //========================================================================================================== + + if #available(iOS 8.3, *) { + escaped = string.addingPercentEncoding(withAllowedCharacters: allowedCharacterSet) ?? string + } else { + let batchSize = 50 + var index = string.startIndex + + while index != string.endIndex { + let startIndex = index + let endIndex = string.index(index, offsetBy: batchSize, limitedBy: string.endIndex) ?? string.endIndex + let range = startIndex.. String { + var components: [(String, String)] = [] + + for key in parameters.keys.sorted(by: <) { + let value = parameters[key]! + components += queryComponents(fromKey: key, value: value) + } + return components.map { "\($0)=\($1)" }.joined(separator: "&") + } + + private func encodesParametersInURL(with method: HTTPMethod) -> Bool { + switch destination { + case .queryString: + return true + case .httpBody: + return false + default: + break + } + + switch method { + case .get, .head, .delete: + return true + default: + return false + } + } +} + +// MARK: - + +/// Uses `JSONSerialization` to create a JSON representation of the parameters object, which is set as the body of the +/// request. The `Content-Type` HTTP header field of an encoded request is set to `application/json`. +public struct JSONEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a `JSONEncoding` instance with default writing options. + public static var `default`: JSONEncoding { return JSONEncoding() } + + /// Returns a `JSONEncoding` instance with `.prettyPrinted` writing options. + public static var prettyPrinted: JSONEncoding { return JSONEncoding(options: .prettyPrinted) } + + /// The options for writing the parameters as JSON data. + public let options: JSONSerialization.WritingOptions + + // MARK: Initialization + + /// Creates a `JSONEncoding` instance using the specified options. + /// + /// - parameter options: The options for writing the parameters as JSON data. + /// + /// - returns: The new `JSONEncoding` instance. + public init(options: JSONSerialization.WritingOptions = []) { + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: parameters, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } + + /// Creates a URL request by encoding the JSON object and setting the resulting data on the HTTP body. + /// + /// - parameter urlRequest: The request to apply the JSON object to. + /// - parameter jsonObject: The JSON object to apply to the request. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, withJSONObject jsonObject: Any? = nil) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonObject = jsonObject else { return urlRequest } + + do { + let data = try JSONSerialization.data(withJSONObject: jsonObject, options: options) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .jsonEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +/// Uses `PropertyListSerialization` to create a plist representation of the parameters object, according to the +/// associated format and write options values, which is set as the body of the request. The `Content-Type` HTTP header +/// field of an encoded request is set to `application/x-plist`. +public struct PropertyListEncoding: ParameterEncoding { + + // MARK: Properties + + /// Returns a default `PropertyListEncoding` instance. + public static var `default`: PropertyListEncoding { return PropertyListEncoding() } + + /// Returns a `PropertyListEncoding` instance with xml formatting and default writing options. + public static var xml: PropertyListEncoding { return PropertyListEncoding(format: .xml) } + + /// Returns a `PropertyListEncoding` instance with binary formatting and default writing options. + public static var binary: PropertyListEncoding { return PropertyListEncoding(format: .binary) } + + /// The property list serialization format. + public let format: PropertyListSerialization.PropertyListFormat + + /// The options for writing the parameters as plist data. + public let options: PropertyListSerialization.WriteOptions + + // MARK: Initialization + + /// Creates a `PropertyListEncoding` instance using the specified format and options. + /// + /// - parameter format: The property list serialization format. + /// - parameter options: The options for writing the parameters as plist data. + /// + /// - returns: The new `PropertyListEncoding` instance. + public init( + format: PropertyListSerialization.PropertyListFormat = .xml, + options: PropertyListSerialization.WriteOptions = 0) + { + self.format = format + self.options = options + } + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let parameters = parameters else { return urlRequest } + + do { + let data = try PropertyListSerialization.data( + fromPropertyList: parameters, + format: format, + options: options + ) + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/x-plist", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = data + } catch { + throw AFError.parameterEncodingFailed(reason: .propertyListEncodingFailed(error: error)) + } + + return urlRequest + } +} + +// MARK: - + +extension NSNumber { + fileprivate var isBool: Bool { return CFBooleanGetTypeID() == CFGetTypeID(self) } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift new file mode 100644 index 000000000000..2be2ce0106fa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Request.swift @@ -0,0 +1,660 @@ +// +// Request.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// A type that can inspect and optionally adapt a `URLRequest` in some manner if necessary. +public protocol RequestAdapter { + /// Inspects and adapts the specified `URLRequest` in some manner if necessary and returns the result. + /// + /// - parameter urlRequest: The URL request to adapt. + /// + /// - throws: An `Error` if the adaptation encounters an error. + /// + /// - returns: The adapted `URLRequest`. + func adapt(_ urlRequest: URLRequest) throws -> URLRequest +} + +// MARK: - + +/// A closure executed when the `RequestRetrier` determines whether a `Request` should be retried or not. +public typealias RequestRetryCompletion = (_ shouldRetry: Bool, _ timeDelay: TimeInterval) -> Void + +/// A type that determines whether a request should be retried after being executed by the specified session manager +/// and encountering an error. +public protocol RequestRetrier { + /// Determines whether the `Request` should be retried by calling the `completion` closure. + /// + /// This operation is fully asynchronous. Any amount of time can be taken to determine whether the request needs + /// to be retried. The one requirement is that the completion closure is called to ensure the request is properly + /// cleaned up after. + /// + /// - parameter manager: The session manager the request was executed on. + /// - parameter request: The request that failed due to the encountered error. + /// - parameter error: The error encountered when executing the request. + /// - parameter completion: The completion closure to be executed when retry decision has been determined. + func should(_ manager: SessionManager, retry request: Request, with error: Error, completion: @escaping RequestRetryCompletion) +} + +// MARK: - + +protocol TaskConvertible { + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask +} + +/// A dictionary of headers to apply to a `URLRequest`. +public typealias HTTPHeaders = [String: String] + +// MARK: - + +/// Responsible for sending a request and receiving the response and associated data from the server, as well as +/// managing its underlying `URLSessionTask`. +open class Request { + + // MARK: Helper Types + + /// A closure executed when monitoring upload or download progress of a request. + public typealias ProgressHandler = (Progress) -> Void + + enum RequestTask { + case data(TaskConvertible?, URLSessionTask?) + case download(TaskConvertible?, URLSessionTask?) + case upload(TaskConvertible?, URLSessionTask?) + case stream(TaskConvertible?, URLSessionTask?) + } + + // MARK: Properties + + /// The delegate for the underlying task. + open internal(set) var delegate: TaskDelegate { + get { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + return taskDelegate + } + set { + taskDelegateLock.lock() ; defer { taskDelegateLock.unlock() } + taskDelegate = newValue + } + } + + /// The underlying task. + open var task: URLSessionTask? { return delegate.task } + + /// The session belonging to the underlying task. + public let session: URLSession + + /// The request sent or to be sent to the server. + open var request: URLRequest? { return task?.originalRequest } + + /// The response received from the server, if any. + open var response: HTTPURLResponse? { return task?.response as? HTTPURLResponse } + + /// The number of times the request has been retried. + open internal(set) var retryCount: UInt = 0 + + let originalTask: TaskConvertible? + + var startTime: CFAbsoluteTime? + var endTime: CFAbsoluteTime? + + var validations: [() -> Void] = [] + + private var taskDelegate: TaskDelegate + private var taskDelegateLock = NSLock() + + // MARK: Lifecycle + + init(session: URLSession, requestTask: RequestTask, error: Error? = nil) { + self.session = session + + switch requestTask { + case .data(let originalTask, let task): + taskDelegate = DataTaskDelegate(task: task) + self.originalTask = originalTask + case .download(let originalTask, let task): + taskDelegate = DownloadTaskDelegate(task: task) + self.originalTask = originalTask + case .upload(let originalTask, let task): + taskDelegate = UploadTaskDelegate(task: task) + self.originalTask = originalTask + case .stream(let originalTask, let task): + taskDelegate = TaskDelegate(task: task) + self.originalTask = originalTask + } + + delegate.error = error + delegate.queue.addOperation { self.endTime = CFAbsoluteTimeGetCurrent() } + } + + // MARK: Authentication + + /// Associates an HTTP Basic credential with the request. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// - parameter persistence: The URL credential persistence. `.ForSession` by default. + /// + /// - returns: The request. + @discardableResult + open func authenticate( + user: String, + password: String, + persistence: URLCredential.Persistence = .forSession) + -> Self + { + let credential = URLCredential(user: user, password: password, persistence: persistence) + return authenticate(usingCredential: credential) + } + + /// Associates a specified credential with the request. + /// + /// - parameter credential: The credential. + /// + /// - returns: The request. + @discardableResult + open func authenticate(usingCredential credential: URLCredential) -> Self { + delegate.credential = credential + return self + } + + /// Returns a base64 encoded basic authentication credential as an authorization header tuple. + /// + /// - parameter user: The user. + /// - parameter password: The password. + /// + /// - returns: A tuple with Authorization header and credential value if encoding succeeds, `nil` otherwise. + open class func authorizationHeader(user: String, password: String) -> (key: String, value: String)? { + guard let data = "\(user):\(password)".data(using: .utf8) else { return nil } + + let credential = data.base64EncodedString(options: []) + + return (key: "Authorization", value: "Basic \(credential)") + } + + // MARK: State + + /// Resumes the request. + open func resume() { + guard let task = task else { delegate.queue.isSuspended = false ; return } + + if startTime == nil { startTime = CFAbsoluteTimeGetCurrent() } + + task.resume() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidResume, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Suspends the request. + open func suspend() { + guard let task = task else { return } + + task.suspend() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidSuspend, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } + + /// Cancels the request. + open func cancel() { + guard let task = task else { return } + + task.cancel() + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task] + ) + } +} + +// MARK: - CustomStringConvertible + +extension Request: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the HTTP method and URL, as + /// well as the response status code if a response has been received. + open var description: String { + var components: [String] = [] + + if let HTTPMethod = request?.httpMethod { + components.append(HTTPMethod) + } + + if let urlString = request?.url?.absoluteString { + components.append(urlString) + } + + if let response = response { + components.append("(\(response.statusCode))") + } + + return components.joined(separator: " ") + } +} + +// MARK: - CustomDebugStringConvertible + +extension Request: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, in the form of a cURL command. + open var debugDescription: String { + return cURLRepresentation() + } + + func cURLRepresentation() -> String { + var components = ["$ curl -v"] + + guard let request = self.request, + let url = request.url, + let host = url.host + else { + return "$ curl command could not be created" + } + + if let httpMethod = request.httpMethod, httpMethod != "GET" { + components.append("-X \(httpMethod)") + } + + if let credentialStorage = self.session.configuration.urlCredentialStorage { + let protectionSpace = URLProtectionSpace( + host: host, + port: url.port ?? 0, + protocol: url.scheme, + realm: host, + authenticationMethod: NSURLAuthenticationMethodHTTPBasic + ) + + if let credentials = credentialStorage.credentials(for: protectionSpace)?.values { + for credential in credentials { + guard let user = credential.user, let password = credential.password else { continue } + components.append("-u \(user):\(password)") + } + } else { + if let credential = delegate.credential, let user = credential.user, let password = credential.password { + components.append("-u \(user):\(password)") + } + } + } + + if session.configuration.httpShouldSetCookies { + if + let cookieStorage = session.configuration.httpCookieStorage, + let cookies = cookieStorage.cookies(for: url), !cookies.isEmpty + { + let string = cookies.reduce("") { $0 + "\($1.name)=\($1.value);" } + + #if swift(>=3.2) + components.append("-b \"\(string[.. URLSessionTask { + do { + let urlRequest = try self.urlRequest.adapt(using: adapter) + return queue.sync { session.dataTask(with: urlRequest) } + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + if let requestable = originalTask as? Requestable { return requestable.urlRequest } + + return nil + } + + /// The progress of fetching the response data from the server for the request. + open var progress: Progress { return dataDelegate.progress } + + var dataDelegate: DataTaskDelegate { return delegate as! DataTaskDelegate } + + // MARK: Stream + + /// Sets a closure to be called periodically during the lifecycle of the request as data is read from the server. + /// + /// This closure returns the bytes most recently received from the server, not including data from previous calls. + /// If this closure is set, data will only be available within this closure, and will not be saved elsewhere. It is + /// also important to note that the server data in any `Response` object will be `nil`. + /// + /// - parameter closure: The code to be executed periodically during the lifecycle of the request. + /// + /// - returns: The request. + @discardableResult + open func stream(closure: ((Data) -> Void)? = nil) -> Self { + dataDelegate.dataStream = closure + return self + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + dataDelegate.progressHandler = (closure, queue) + return self + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionDownloadTask`. +open class DownloadRequest: Request { + + // MARK: Helper Types + + /// A collection of options to be executed prior to moving a downloaded file from the temporary URL to the + /// destination URL. + public struct DownloadOptions: OptionSet { + /// Returns the raw bitmask value of the option and satisfies the `RawRepresentable` protocol. + public let rawValue: UInt + + /// A `DownloadOptions` flag that creates intermediate directories for the destination URL if specified. + public static let createIntermediateDirectories = DownloadOptions(rawValue: 1 << 0) + + /// A `DownloadOptions` flag that removes a previous file from the destination URL if specified. + public static let removePreviousFile = DownloadOptions(rawValue: 1 << 1) + + /// Creates a `DownloadFileDestinationOptions` instance with the specified raw value. + /// + /// - parameter rawValue: The raw bitmask value for the option. + /// + /// - returns: A new log level instance. + public init(rawValue: UInt) { + self.rawValue = rawValue + } + } + + /// A closure executed once a download request has successfully completed in order to determine where to move the + /// temporary file written to during the download process. The closure takes two arguments: the temporary file URL + /// and the URL response, and returns a two arguments: the file URL where the temporary file should be moved and + /// the options defining how the file should be moved. + public typealias DownloadFileDestination = ( + _ temporaryURL: URL, + _ response: HTTPURLResponse) + -> (destinationURL: URL, options: DownloadOptions) + + enum Downloadable: TaskConvertible { + case request(URLRequest) + case resumeData(Data) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .request(urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.downloadTask(with: urlRequest) } + case let .resumeData(resumeData): + task = queue.sync { session.downloadTask(withResumeData: resumeData) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + if let downloadable = originalTask as? Downloadable, case let .request(urlRequest) = downloadable { + return urlRequest + } + + return nil + } + + /// The resume data of the underlying download task if available after a failure. + open var resumeData: Data? { return downloadDelegate.resumeData } + + /// The progress of downloading the response data from the server for the request. + open var progress: Progress { return downloadDelegate.progress } + + var downloadDelegate: DownloadTaskDelegate { return delegate as! DownloadTaskDelegate } + + // MARK: State + + /// Cancels the request. + override open func cancel() { + cancel(createResumeData: true) + } + + /// Cancels the request. + /// + /// - parameter createResumeData: Determines whether resume data is created via the underlying download task or not. + open func cancel(createResumeData: Bool) { + if createResumeData { + downloadDelegate.downloadTask.cancel { self.downloadDelegate.resumeData = $0 } + } else { + downloadDelegate.downloadTask.cancel() + } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidCancel, + object: self, + userInfo: [Notification.Key.Task: task as Any] + ) + } + + // MARK: Progress + + /// Sets a closure to be called periodically during the lifecycle of the `Request` as data is read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is read from the server. + /// + /// - returns: The request. + @discardableResult + open func downloadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + downloadDelegate.progressHandler = (closure, queue) + return self + } + + // MARK: Destination + + /// Creates a download file destination closure which uses the default file manager to move the temporary file to a + /// file URL in the first available directory with the specified search path directory and search path domain mask. + /// + /// - parameter directory: The search path directory. `.DocumentDirectory` by default. + /// - parameter domain: The search path domain mask. `.UserDomainMask` by default. + /// + /// - returns: A download file destination closure. + open class func suggestedDownloadDestination( + for directory: FileManager.SearchPathDirectory = .documentDirectory, + in domain: FileManager.SearchPathDomainMask = .userDomainMask) + -> DownloadFileDestination + { + return { temporaryURL, response in + let directoryURLs = FileManager.default.urls(for: directory, in: domain) + + if !directoryURLs.isEmpty { + return (directoryURLs[0].appendingPathComponent(response.suggestedFilename!), []) + } + + return (temporaryURL, []) + } + } +} + +// MARK: - + +/// Specific type of `Request` that manages an underlying `URLSessionUploadTask`. +open class UploadRequest: DataRequest { + + // MARK: Helper Types + + enum Uploadable: TaskConvertible { + case data(Data, URLRequest) + case file(URL, URLRequest) + case stream(InputStream, URLRequest) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + do { + let task: URLSessionTask + + switch self { + case let .data(data, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, from: data) } + case let .file(url, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(with: urlRequest, fromFile: url) } + case let .stream(_, urlRequest): + let urlRequest = try urlRequest.adapt(using: adapter) + task = queue.sync { session.uploadTask(withStreamedRequest: urlRequest) } + } + + return task + } catch { + throw AdaptError(error: error) + } + } + } + + // MARK: Properties + + /// The request sent or to be sent to the server. + open override var request: URLRequest? { + if let request = super.request { return request } + + guard let uploadable = originalTask as? Uploadable else { return nil } + + switch uploadable { + case .data(_, let urlRequest), .file(_, let urlRequest), .stream(_, let urlRequest): + return urlRequest + } + } + + /// The progress of uploading the payload to the server for the upload request. + open var uploadProgress: Progress { return uploadDelegate.uploadProgress } + + var uploadDelegate: UploadTaskDelegate { return delegate as! UploadTaskDelegate } + + // MARK: Upload Progress + + /// Sets a closure to be called periodically during the lifecycle of the `UploadRequest` as data is sent to + /// the server. + /// + /// After the data is sent to the server, the `progress(queue:closure:)` APIs can be used to monitor the progress + /// of data being read from the server. + /// + /// - parameter queue: The dispatch queue to execute the closure on. + /// - parameter closure: The code to be executed periodically as data is sent to the server. + /// + /// - returns: The request. + @discardableResult + open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self { + uploadDelegate.uploadProgressHandler = (closure, queue) + return self + } +} + +// MARK: - + +#if !os(watchOS) + +/// Specific type of `Request` that manages an underlying `URLSessionStreamTask`. +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +open class StreamRequest: Request { + enum Streamable: TaskConvertible { + case stream(hostName: String, port: Int) + case netService(NetService) + + func task(session: URLSession, adapter: RequestAdapter?, queue: DispatchQueue) throws -> URLSessionTask { + let task: URLSessionTask + + switch self { + case let .stream(hostName, port): + task = queue.sync { session.streamTask(withHostName: hostName, port: port) } + case let .netService(netService): + task = queue.sync { session.streamTask(with: netService) } + } + + return task + } + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift new file mode 100644 index 000000000000..747a471a55ba --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Response.swift @@ -0,0 +1,567 @@ +// +// Response.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to store all data associated with an non-serialized response of a data or upload request. +public struct DefaultDataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDataResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - data: The data returned by the server. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.data = data + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a data or upload request. +public struct DataResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The data returned by the server. + public let data: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DataResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter data: The data returned by the server. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DataResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + data: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.data = data + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DataResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the server data, the response serialization result and the timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[Data]: \(data?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DataResponse { + /// Evaluates the specified closure when the result of this `DataResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DataResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DataResponse` is a success, passing the unwrapped result + /// value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DataResponse` depending on the result of the given closure. If this instance's + /// result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: DataResponse = ... + /// let withMyError = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `DataResponse` instance containing the result of the transform. + public func mapError(_ transform: (Error) -> E) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.mapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DataResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: DataResponse = ... + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `DataResponse` instance containing the result of the transform. + public func flatMapError(_ transform: (Error) throws -> E) -> DataResponse { + var response = DataResponse( + request: request, + response: self.response, + data: data, + result: result.flatMapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +/// Used to store all data associated with an non-serialized response of a download request. +public struct DefaultDownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The error encountered while executing or validating the request. + public let error: Error? + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + var _metrics: AnyObject? + + /// Creates a `DefaultDownloadResponse` instance from the specified parameters. + /// + /// - Parameters: + /// - request: The URL request sent to the server. + /// - response: The server's response to the URL request. + /// - temporaryURL: The temporary destination URL of the data returned from the server. + /// - destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - resumeData: The resume data generated if the request was cancelled. + /// - error: The error encountered while executing or validating the request. + /// - timeline: The timeline of the complete lifecycle of the request. `Timeline()` by default. + /// - metrics: The task metrics containing the request / response statistics. `nil` by default. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + error: Error?, + timeline: Timeline = Timeline(), + metrics: AnyObject? = nil) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.error = error + self.timeline = timeline + } +} + +// MARK: - + +/// Used to store all data associated with a serialized response of a download request. +public struct DownloadResponse { + /// The URL request sent to the server. + public let request: URLRequest? + + /// The server's response to the URL request. + public let response: HTTPURLResponse? + + /// The temporary destination URL of the data returned from the server. + public let temporaryURL: URL? + + /// The final destination URL of the data returned from the server if it was moved. + public let destinationURL: URL? + + /// The resume data generated if the request was cancelled. + public let resumeData: Data? + + /// The result of response serialization. + public let result: Result + + /// The timeline of the complete lifecycle of the request. + public let timeline: Timeline + + /// Returns the associated value of the result if it is a success, `nil` otherwise. + public var value: Value? { return result.value } + + /// Returns the associated error value if the result if it is a failure, `nil` otherwise. + public var error: Error? { return result.error } + + var _metrics: AnyObject? + + /// Creates a `DownloadResponse` instance with the specified parameters derived from response serialization. + /// + /// - parameter request: The URL request sent to the server. + /// - parameter response: The server's response to the URL request. + /// - parameter temporaryURL: The temporary destination URL of the data returned from the server. + /// - parameter destinationURL: The final destination URL of the data returned from the server if it was moved. + /// - parameter resumeData: The resume data generated if the request was cancelled. + /// - parameter result: The result of response serialization. + /// - parameter timeline: The timeline of the complete lifecycle of the `Request`. Defaults to `Timeline()`. + /// + /// - returns: The new `DownloadResponse` instance. + public init( + request: URLRequest?, + response: HTTPURLResponse?, + temporaryURL: URL?, + destinationURL: URL?, + resumeData: Data?, + result: Result, + timeline: Timeline = Timeline()) + { + self.request = request + self.response = response + self.temporaryURL = temporaryURL + self.destinationURL = destinationURL + self.resumeData = resumeData + self.result = result + self.timeline = timeline + } +} + +// MARK: - + +extension DownloadResponse: CustomStringConvertible, CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + return result.debugDescription + } + + /// The debug textual representation used when written to an output stream, which includes the URL request, the URL + /// response, the temporary and destination URLs, the resume data, the response serialization result and the + /// timeline. + public var debugDescription: String { + var output: [String] = [] + + output.append(request != nil ? "[Request]: \(request!.httpMethod ?? "GET") \(request!)" : "[Request]: nil") + output.append(response != nil ? "[Response]: \(response!)" : "[Response]: nil") + output.append("[TemporaryURL]: \(temporaryURL?.path ?? "nil")") + output.append("[DestinationURL]: \(destinationURL?.path ?? "nil")") + output.append("[ResumeData]: \(resumeData?.count ?? 0) bytes") + output.append("[Result]: \(result.debugDescription)") + output.append("[Timeline]: \(timeline.debugDescription)") + + return output.joined(separator: "\n") + } +} + +// MARK: - + +extension DownloadResponse { + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleInt = possibleData.map { $0.count } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A `DownloadResponse` whose result wraps the value returned by the given closure. If this instance's + /// result is a failure, returns a response wrapping the same failure. + public func map(_ transform: (Value) -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.map(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the given closure when the result of this `DownloadResponse` is a success, passing the unwrapped + /// result value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance's result. + /// + /// - returns: A success or failure `DownloadResponse` depending on the result of the given closure. If this + /// instance's result is a failure, returns the same failure. + public func flatMap(_ transform: (Value) throws -> T) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMap(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let withMyError = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `DownloadResponse` instance containing the result of the transform. + public func mapError(_ transform: (Error) -> E) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.mapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } + + /// Evaluates the specified closure when the `DownloadResponse` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: DownloadResponse = ... + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `DownloadResponse` instance containing the result of the transform. + public func flatMapError(_ transform: (Error) throws -> E) -> DownloadResponse { + var response = DownloadResponse( + request: request, + response: self.response, + temporaryURL: temporaryURL, + destinationURL: destinationURL, + resumeData: resumeData, + result: result.flatMapError(transform), + timeline: timeline + ) + + response._metrics = _metrics + + return response + } +} + +// MARK: - + +protocol Response { + /// The task metrics containing the request / response statistics. + var _metrics: AnyObject? { get set } + mutating func add(_ metrics: AnyObject?) +} + +extension Response { + mutating func add(_ metrics: AnyObject?) { + #if !os(watchOS) + guard #available(iOS 10.0, macOS 10.12, tvOS 10.0, *) else { return } + guard let metrics = metrics as? URLSessionTaskMetrics else { return } + + _metrics = metrics + #endif + } +} + +// MARK: - + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DataResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DefaultDownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} + +@available(iOS 10.0, macOS 10.12, tvOS 10.0, *) +extension DownloadResponse: Response { +#if !os(watchOS) + /// The task metrics containing the request / response statistics. + public var metrics: URLSessionTaskMetrics? { return _metrics as? URLSessionTaskMetrics } +#endif +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift new file mode 100644 index 000000000000..9cc105a82057 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ResponseSerialization.swift @@ -0,0 +1,715 @@ +// +// ResponseSerialization.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The type in which all data response serializers must conform to in order to serialize a response. +public protocol DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DataResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DataResponseSerializer: DataResponseSerializerProtocol { + /// The type of serialized object to be created by this `DataResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, data and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - + +/// The type in which all download response serializers must conform to in order to serialize a response. +public protocol DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializerType`. + associatedtype SerializedObject + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result { get } +} + +// MARK: - + +/// A generic `DownloadResponseSerializerType` used to serialize a request, response, and data into a serialized object. +public struct DownloadResponseSerializer: DownloadResponseSerializerProtocol { + /// The type of serialized object to be created by this `DownloadResponseSerializer`. + public typealias SerializedObject = Value + + /// A closure used by response handlers that takes a request, response, url and error and returns a result. + public var serializeResponse: (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result + + /// Initializes the `ResponseSerializer` instance with the given serialize response closure. + /// + /// - parameter serializeResponse: The closure used to serialize the response. + /// + /// - returns: The new generic response serializer instance. + public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, URL?, Error?) -> Result) { + self.serializeResponse = serializeResponse + } +} + +// MARK: - Timeline + +extension Request { + var timeline: Timeline { + let requestStartTime = self.startTime ?? CFAbsoluteTimeGetCurrent() + let requestCompletedTime = self.endTime ?? CFAbsoluteTimeGetCurrent() + let initialResponseTime = self.delegate.initialResponseTime ?? requestCompletedTime + + return Timeline( + requestStartTime: requestStartTime, + initialResponseTime: initialResponseTime, + requestCompletedTime: requestCompletedTime, + serializationCompletedTime: CFAbsoluteTimeGetCurrent() + ) + } +} + +// MARK: - Default + +extension DataRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response(queue: DispatchQueue? = nil, completionHandler: @escaping (DefaultDataResponse) -> Void) -> Self { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var dataResponse = DefaultDataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + error: self.delegate.error, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + completionHandler(dataResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.delegate.data, + self.delegate.error + ) + + var dataResponse = DataResponse( + request: self.request, + response: self.response, + data: self.delegate.data, + result: result, + timeline: self.timeline + ) + + dataResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(dataResponse) } + } + + return self + } +} + +extension DownloadRequest { + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DefaultDownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + (queue ?? DispatchQueue.main).async { + var downloadResponse = DefaultDownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + error: self.downloadDelegate.error, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + completionHandler(downloadResponse) + } + } + + return self + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter queue: The queue on which the completion handler is dispatched. + /// - parameter responseSerializer: The response serializer responsible for serializing the request, response, + /// and data contained in the destination url. + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func response( + queue: DispatchQueue? = nil, + responseSerializer: T, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + delegate.queue.addOperation { + let result = responseSerializer.serializeResponse( + self.request, + self.response, + self.downloadDelegate.fileURL, + self.downloadDelegate.error + ) + + var downloadResponse = DownloadResponse( + request: self.request, + response: self.response, + temporaryURL: self.downloadDelegate.temporaryURL, + destinationURL: self.downloadDelegate.destinationURL, + resumeData: self.downloadDelegate.resumeData, + result: result, + timeline: self.timeline + ) + + downloadResponse.add(self.delegate.metrics) + + (queue ?? DispatchQueue.main).async { completionHandler(downloadResponse) } + } + + return self + } +} + +// MARK: - Data + +extension Request { + /// Returns a result data type that contains the response data as-is. + /// + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseData(response: HTTPURLResponse?, data: Data?, error: Error?) -> Result { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(Data()) } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + return .success(validData) + } +} + +extension DataRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseData(response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns the associated data as-is. + /// + /// - returns: A data response serializer. + public static func dataResponseSerializer() -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseData(response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter completionHandler: The code to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseData( + queue: DispatchQueue? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.dataResponseSerializer(), + completionHandler: completionHandler + ) + } +} + +// MARK: - String + +extension Request { + /// Returns a result string type initialized from the response data with the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseString( + encoding: String.Encoding?, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success("") } + + guard let validData = data else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNil)) + } + + var convertedEncoding = encoding + + if let encodingName = response?.textEncodingName as CFString?, convertedEncoding == nil { + convertedEncoding = String.Encoding(rawValue: CFStringConvertEncodingToNSStringEncoding( + CFStringConvertIANACharSetNameToEncoding(encodingName)) + ) + } + + let actualEncoding = convertedEncoding ?? .isoLatin1 + + if let string = String(data: validData, encoding: actualEncoding) { + return .success(string) + } else { + return .failure(AFError.responseSerializationFailed(reason: .stringSerializationFailed(encoding: actualEncoding))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DataResponseSerializer { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a result string type initialized from the response data with + /// the specified string encoding. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the server + /// response, falling back to the default HTTP default character set, ISO-8859-1. + /// + /// - returns: A string response serializer. + public static func stringResponseSerializer(encoding: String.Encoding? = nil) -> DownloadResponseSerializer { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseString(encoding: encoding, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter encoding: The string encoding. If `nil`, the string encoding will be determined from the + /// server response, falling back to the default HTTP default character set, + /// ISO-8859-1. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseString( + queue: DispatchQueue? = nil, + encoding: String.Encoding? = nil, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.stringResponseSerializer(encoding: encoding), + completionHandler: completionHandler + ) + } +} + +// MARK: - JSON + +extension Request { + /// Returns a JSON object contained in a result type constructed from the response data using `JSONSerialization` + /// with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponseJSON( + options: JSONSerialization.ReadingOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let json = try JSONSerialization.jsonObject(with: validData, options: options) + return .success(json) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns a JSON object result type constructed from the response data using + /// `JSONSerialization` with the specified reading options. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// + /// - returns: A JSON object response serializer. + public static func jsonResponseSerializer( + options: JSONSerialization.ReadingOptions = .allowFragments) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponseJSON(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responseJSON( + queue: DispatchQueue? = nil, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.jsonResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +// MARK: - Property List + +extension Request { + /// Returns a plist object contained in a result type constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter response: The response from the server. + /// - parameter data: The data returned from the server. + /// - parameter error: The error already encountered if it exists. + /// + /// - returns: The result data type. + public static func serializeResponsePropertyList( + options: PropertyListSerialization.ReadOptions, + response: HTTPURLResponse?, + data: Data?, + error: Error?) + -> Result + { + guard error == nil else { return .failure(error!) } + + if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(NSNull()) } + + guard let validData = data, validData.count > 0 else { + return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + } + + do { + let plist = try PropertyListSerialization.propertyList(from: validData, options: options, format: nil) + return .success(plist) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .propertyListSerializationFailed(error: error))) + } + } +} + +extension DataRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DataResponseSerializer + { + return DataResponseSerializer { _, response, data, error in + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DataResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DataRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +extension DownloadRequest { + /// Creates a response serializer that returns an object constructed from the response data using + /// `PropertyListSerialization` with the specified reading options. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// + /// - returns: A property list object response serializer. + public static func propertyListResponseSerializer( + options: PropertyListSerialization.ReadOptions = []) + -> DownloadResponseSerializer + { + return DownloadResponseSerializer { _, response, fileURL, error in + guard error == nil else { return .failure(error!) } + + guard let fileURL = fileURL else { + return .failure(AFError.responseSerializationFailed(reason: .inputFileNil)) + } + + do { + let data = try Data(contentsOf: fileURL) + return Request.serializeResponsePropertyList(options: options, response: response, data: data, error: error) + } catch { + return .failure(AFError.responseSerializationFailed(reason: .inputFileReadFailed(at: fileURL))) + } + } + } + + /// Adds a handler to be called once the request has finished. + /// + /// - parameter options: The property list reading options. Defaults to `[]`. + /// - parameter completionHandler: A closure to be executed once the request has finished. + /// + /// - returns: The request. + @discardableResult + public func responsePropertyList( + queue: DispatchQueue? = nil, + options: PropertyListSerialization.ReadOptions = [], + completionHandler: @escaping (DownloadResponse) -> Void) + -> Self + { + return response( + queue: queue, + responseSerializer: DownloadRequest.propertyListResponseSerializer(options: options), + completionHandler: completionHandler + ) + } +} + +/// A set of HTTP response status code that do not contain response data. +private let emptyDataStatusCodes: Set = [204, 205] diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift new file mode 100644 index 000000000000..e0928089ab73 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Result.swift @@ -0,0 +1,300 @@ +// +// Result.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Used to represent whether a request was successful or encountered an error. +/// +/// - success: The request and all post processing operations were successful resulting in the serialization of the +/// provided associated value. +/// +/// - failure: The request encountered an error resulting in a failure. The associated values are the original data +/// provided by the server as well as the error that caused the failure. +public enum Result { + case success(Value) + case failure(Error) + + /// Returns `true` if the result is a success, `false` otherwise. + public var isSuccess: Bool { + switch self { + case .success: + return true + case .failure: + return false + } + } + + /// Returns `true` if the result is a failure, `false` otherwise. + public var isFailure: Bool { + return !isSuccess + } + + /// Returns the associated value if the result is a success, `nil` otherwise. + public var value: Value? { + switch self { + case .success(let value): + return value + case .failure: + return nil + } + } + + /// Returns the associated error value if the result is a failure, `nil` otherwise. + public var error: Error? { + switch self { + case .success: + return nil + case .failure(let error): + return error + } + } +} + +// MARK: - CustomStringConvertible + +extension Result: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes whether the result was a + /// success or failure. + public var description: String { + switch self { + case .success: + return "SUCCESS" + case .failure: + return "FAILURE" + } + } +} + +// MARK: - CustomDebugStringConvertible + +extension Result: CustomDebugStringConvertible { + /// The debug textual representation used when written to an output stream, which includes whether the result was a + /// success or failure in addition to the value or error. + public var debugDescription: String { + switch self { + case .success(let value): + return "SUCCESS: \(value)" + case .failure(let error): + return "FAILURE: \(error)" + } + } +} + +// MARK: - Functional APIs + +extension Result { + /// Creates a `Result` instance from the result of a closure. + /// + /// A failure result is created when the closure throws, and a success result is created when the closure + /// succeeds without throwing an error. + /// + /// func someString() throws -> String { ... } + /// + /// let result = Result(value: { + /// return try someString() + /// }) + /// + /// // The type of result is Result + /// + /// The trailing closure syntax is also supported: + /// + /// let result = Result { try someString() } + /// + /// - parameter value: The closure to execute and create the result for. + public init(value: () throws -> Value) { + do { + self = try .success(value()) + } catch { + self = .failure(error) + } + } + + /// Returns the success value, or throws the failure error. + /// + /// let possibleString: Result = .success("success") + /// try print(possibleString.unwrap()) + /// // Prints "success" + /// + /// let noString: Result = .failure(error) + /// try print(noString.unwrap()) + /// // Throws error + public func unwrap() throws -> Value { + switch self { + case .success(let value): + return value + case .failure(let error): + throw error + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `map` method with a closure that does not throw. For example: + /// + /// let possibleData: Result = .success(Data()) + /// let possibleInt = possibleData.map { $0.count } + /// try print(possibleInt.unwrap()) + /// // Prints "0" + /// + /// let noData: Result = .failure(error) + /// let noInt = noData.map { $0.count } + /// try print(noInt.unwrap()) + /// // Throws error + /// + /// - parameter transform: A closure that takes the success value of the `Result` instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func map(_ transform: (Value) -> T) -> Result { + switch self { + case .success(let value): + return .success(transform(value)) + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `flatMap` method with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMap { + /// try JSONSerialization.jsonObject(with: $0) + /// } + /// + /// - parameter transform: A closure that takes the success value of the instance. + /// + /// - returns: A `Result` containing the result of the given closure. If this instance is a failure, returns the + /// same failure. + public func flatMap(_ transform: (Value) throws -> T) -> Result { + switch self { + case .success(let value): + do { + return try .success(transform(value)) + } catch { + return .failure(error) + } + case .failure(let error): + return .failure(error) + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `mapError` function with a closure that does not throw. For example: + /// + /// let possibleData: Result = .failure(someError) + /// let withMyError: Result = possibleData.mapError { MyError.error($0) } + /// + /// - Parameter transform: A closure that takes the error of the instance. + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func mapError(_ transform: (Error) -> T) -> Result { + switch self { + case .failure(let error): + return .failure(transform(error)) + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `flatMapError` function with a closure that may throw an error. For example: + /// + /// let possibleData: Result = .success(Data(...)) + /// let possibleObject = possibleData.flatMapError { + /// try someFailableFunction(taking: $0) + /// } + /// + /// - Parameter transform: A throwing closure that takes the error of the instance. + /// + /// - Returns: A `Result` instance containing the result of the transform. If this instance is a success, returns + /// the same instance. + public func flatMapError(_ transform: (Error) throws -> T) -> Result { + switch self { + case .failure(let error): + do { + return try .failure(transform(error)) + } catch { + return .failure(error) + } + case .success: + return self + } + } + + /// Evaluates the specified closure when the `Result` is a success, passing the unwrapped value as a parameter. + /// + /// Use the `withValue` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withValue(_ closure: (Value) throws -> Void) rethrows -> Result { + if case let .success(value) = self { try closure(value) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure, passing the unwrapped error as a parameter. + /// + /// Use the `withError` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A closure that takes the success value of this instance. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func withError(_ closure: (Error) throws -> Void) rethrows -> Result { + if case let .failure(error) = self { try closure(error) } + + return self + } + + /// Evaluates the specified closure when the `Result` is a success. + /// + /// Use the `ifSuccess` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifSuccess(_ closure: () throws -> Void) rethrows -> Result { + if isSuccess { try closure() } + + return self + } + + /// Evaluates the specified closure when the `Result` is a failure. + /// + /// Use the `ifFailure` function to evaluate the passed closure without modifying the `Result` instance. + /// + /// - Parameter closure: A `Void` closure. + /// - Returns: This `Result` instance, unmodified. + @discardableResult + public func ifFailure(_ closure: () throws -> Void) rethrows -> Result { + if isFailure { try closure() } + + return self + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift new file mode 100644 index 000000000000..dea099e257ab --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/ServerTrustPolicy.swift @@ -0,0 +1,307 @@ +// +// ServerTrustPolicy.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for managing the mapping of `ServerTrustPolicy` objects to a given host. +open class ServerTrustPolicyManager { + /// The dictionary of policies mapped to a particular host. + public let policies: [String: ServerTrustPolicy] + + /// Initializes the `ServerTrustPolicyManager` instance with the given policies. + /// + /// Since different servers and web services can have different leaf certificates, intermediate and even root + /// certficates, it is important to have the flexibility to specify evaluation policies on a per host basis. This + /// allows for scenarios such as using default evaluation for host1, certificate pinning for host2, public key + /// pinning for host3 and disabling evaluation for host4. + /// + /// - parameter policies: A dictionary of all policies mapped to a particular host. + /// + /// - returns: The new `ServerTrustPolicyManager` instance. + public init(policies: [String: ServerTrustPolicy]) { + self.policies = policies + } + + /// Returns the `ServerTrustPolicy` for the given host if applicable. + /// + /// By default, this method will return the policy that perfectly matches the given host. Subclasses could override + /// this method and implement more complex mapping implementations such as wildcards. + /// + /// - parameter host: The host to use when searching for a matching policy. + /// + /// - returns: The server trust policy for the given host if found. + open func serverTrustPolicy(forHost host: String) -> ServerTrustPolicy? { + return policies[host] + } +} + +// MARK: - + +extension URLSession { + private struct AssociatedKeys { + static var managerKey = "URLSession.ServerTrustPolicyManager" + } + + var serverTrustPolicyManager: ServerTrustPolicyManager? { + get { + return objc_getAssociatedObject(self, &AssociatedKeys.managerKey) as? ServerTrustPolicyManager + } + set (manager) { + objc_setAssociatedObject(self, &AssociatedKeys.managerKey, manager, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) + } + } +} + +// MARK: - ServerTrustPolicy + +/// The `ServerTrustPolicy` evaluates the server trust generally provided by an `NSURLAuthenticationChallenge` when +/// connecting to a server over a secure HTTPS connection. The policy configuration then evaluates the server trust +/// with a given set of criteria to determine whether the server trust is valid and the connection should be made. +/// +/// Using pinned certificates or public keys for evaluation helps prevent man-in-the-middle (MITM) attacks and other +/// vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged +/// to route all communication over an HTTPS connection with pinning enabled. +/// +/// - performDefaultEvaluation: Uses the default server trust evaluation while allowing you to control whether to +/// validate the host provided by the challenge. Applications are encouraged to always +/// validate the host in production environments to guarantee the validity of the server's +/// certificate chain. +/// +/// - performRevokedEvaluation: Uses the default and revoked server trust evaluations allowing you to control whether to +/// validate the host provided by the challenge as well as specify the revocation flags for +/// testing for revoked certificates. Apple platforms did not start testing for revoked +/// certificates automatically until iOS 10.1, macOS 10.12 and tvOS 10.1 which is +/// demonstrated in our TLS tests. Applications are encouraged to always validate the host +/// in production environments to guarantee the validity of the server's certificate chain. +/// +/// - pinCertificates: Uses the pinned certificates to validate the server trust. The server trust is +/// considered valid if one of the pinned certificates match one of the server certificates. +/// By validating both the certificate chain and host, certificate pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - pinPublicKeys: Uses the pinned public keys to validate the server trust. The server trust is considered +/// valid if one of the pinned public keys match one of the server certificate public keys. +/// By validating both the certificate chain and host, public key pinning provides a very +/// secure form of server trust validation mitigating most, if not all, MITM attacks. +/// Applications are encouraged to always validate the host and require a valid certificate +/// chain in production environments. +/// +/// - disableEvaluation: Disables all evaluation which in turn will always consider any server trust as valid. +/// +/// - customEvaluation: Uses the associated closure to evaluate the validity of the server trust. +public enum ServerTrustPolicy { + case performDefaultEvaluation(validateHost: Bool) + case performRevokedEvaluation(validateHost: Bool, revocationFlags: CFOptionFlags) + case pinCertificates(certificates: [SecCertificate], validateCertificateChain: Bool, validateHost: Bool) + case pinPublicKeys(publicKeys: [SecKey], validateCertificateChain: Bool, validateHost: Bool) + case disableEvaluation + case customEvaluation((_ serverTrust: SecTrust, _ host: String) -> Bool) + + // MARK: - Bundle Location + + /// Returns all certificates within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `.cer` files. + /// + /// - returns: All certificates within the given bundle. + public static func certificates(in bundle: Bundle = Bundle.main) -> [SecCertificate] { + var certificates: [SecCertificate] = [] + + let paths = Set([".cer", ".CER", ".crt", ".CRT", ".der", ".DER"].map { fileExtension in + bundle.paths(forResourcesOfType: fileExtension, inDirectory: nil) + }.joined()) + + for path in paths { + if + let certificateData = try? Data(contentsOf: URL(fileURLWithPath: path)) as CFData, + let certificate = SecCertificateCreateWithData(nil, certificateData) + { + certificates.append(certificate) + } + } + + return certificates + } + + /// Returns all public keys within the given bundle with a `.cer` file extension. + /// + /// - parameter bundle: The bundle to search for all `*.cer` files. + /// + /// - returns: All public keys within the given bundle. + public static func publicKeys(in bundle: Bundle = Bundle.main) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for certificate in certificates(in: bundle) { + if let publicKey = publicKey(for: certificate) { + publicKeys.append(publicKey) + } + } + + return publicKeys + } + + // MARK: - Evaluation + + /// Evaluates whether the server trust is valid for the given host. + /// + /// - parameter serverTrust: The server trust to evaluate. + /// - parameter host: The host of the challenge protection space. + /// + /// - returns: Whether the server trust is valid. + public func evaluate(_ serverTrust: SecTrust, forHost host: String) -> Bool { + var serverTrustIsValid = false + + switch self { + case let .performDefaultEvaluation(validateHost): + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .performRevokedEvaluation(validateHost, revocationFlags): + let defaultPolicy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + let revokedPolicy = SecPolicyCreateRevocation(revocationFlags) + SecTrustSetPolicies(serverTrust, [defaultPolicy, revokedPolicy] as CFTypeRef) + + serverTrustIsValid = trustIsValid(serverTrust) + case let .pinCertificates(pinnedCertificates, validateCertificateChain, validateHost): + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + SecTrustSetAnchorCertificates(serverTrust, pinnedCertificates as CFArray) + SecTrustSetAnchorCertificatesOnly(serverTrust, true) + + serverTrustIsValid = trustIsValid(serverTrust) + } else { + let serverCertificatesDataArray = certificateData(for: serverTrust) + let pinnedCertificatesDataArray = certificateData(for: pinnedCertificates) + + outerLoop: for serverCertificateData in serverCertificatesDataArray { + for pinnedCertificateData in pinnedCertificatesDataArray { + if serverCertificateData == pinnedCertificateData { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case let .pinPublicKeys(pinnedPublicKeys, validateCertificateChain, validateHost): + var certificateChainEvaluationPassed = true + + if validateCertificateChain { + let policy = SecPolicyCreateSSL(true, validateHost ? host as CFString : nil) + SecTrustSetPolicies(serverTrust, policy) + + certificateChainEvaluationPassed = trustIsValid(serverTrust) + } + + if certificateChainEvaluationPassed { + outerLoop: for serverPublicKey in ServerTrustPolicy.publicKeys(for: serverTrust) as [AnyObject] { + for pinnedPublicKey in pinnedPublicKeys as [AnyObject] { + if serverPublicKey.isEqual(pinnedPublicKey) { + serverTrustIsValid = true + break outerLoop + } + } + } + } + case .disableEvaluation: + serverTrustIsValid = true + case let .customEvaluation(closure): + serverTrustIsValid = closure(serverTrust, host) + } + + return serverTrustIsValid + } + + // MARK: - Private - Trust Validation + + private func trustIsValid(_ trust: SecTrust) -> Bool { + var isValid = false + + var result = SecTrustResultType.invalid + let status = SecTrustEvaluate(trust, &result) + + if status == errSecSuccess { + let unspecified = SecTrustResultType.unspecified + let proceed = SecTrustResultType.proceed + + + isValid = result == unspecified || result == proceed + } + + return isValid + } + + // MARK: - Private - Certificate Data + + private func certificateData(for trust: SecTrust) -> [Data] { + var certificates: [SecCertificate] = [] + + for index in 0.. [Data] { + return certificates.map { SecCertificateCopyData($0) as Data } + } + + // MARK: - Private - Public Key Extraction + + private static func publicKeys(for trust: SecTrust) -> [SecKey] { + var publicKeys: [SecKey] = [] + + for index in 0.. SecKey? { + var publicKey: SecKey? + + let policy = SecPolicyCreateBasicX509() + var trust: SecTrust? + let trustCreationStatus = SecTrustCreateWithCertificates(certificate, policy, &trust) + + if let trust = trust, trustCreationStatus == errSecSuccess { + publicKey = SecTrustCopyPublicKey(trust) + } + + return publicKey + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift new file mode 100644 index 000000000000..4964f1eebfd7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionDelegate.swift @@ -0,0 +1,725 @@ +// +// SessionDelegate.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for handling all delegate callbacks for the underlying session. +open class SessionDelegate: NSObject { + + // MARK: URLSessionDelegate Overrides + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didBecomeInvalidWithError:)`. + open var sessionDidBecomeInvalidWithError: ((URLSession, Error?) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)`. + open var sessionDidReceiveChallenge: ((URLSession, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionDelegate method `urlSession(_:didReceive:completionHandler:)` and requires the caller to call the `completionHandler`. + open var sessionDidReceiveChallengeWithCompletion: ((URLSession, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDelegate method `urlSessionDidFinishEvents(forBackgroundURLSession:)`. + open var sessionDidFinishEventsForBackgroundURLSession: ((URLSession) -> Void)? + + // MARK: URLSessionTaskDelegate Overrides + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)`. + open var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskWillPerformHTTPRedirectionWithCompletion: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest, @escaping (URLRequest?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)`. + open var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:didReceive:completionHandler:)` and + /// requires the caller to call the `completionHandler`. + open var taskDidReceiveChallengeWithCompletion: ((URLSession, URLSessionTask, URLAuthenticationChallenge, @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)`. + open var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + + /// Overrides all behavior for URLSessionTaskDelegate method `urlSession(_:task:needNewBodyStream:)` and + /// requires the caller to call the `completionHandler`. + open var taskNeedNewBodyStreamWithCompletion: ((URLSession, URLSessionTask, @escaping (InputStream?) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)`. + open var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionTaskDelegate method `urlSession(_:task:didCompleteWithError:)`. + open var taskDidComplete: ((URLSession, URLSessionTask, Error?) -> Void)? + + // MARK: URLSessionDataDelegate Overrides + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)`. + open var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskDidReceiveResponseWithCompletion: ((URLSession, URLSessionDataTask, URLResponse, @escaping (URLSession.ResponseDisposition) -> Void) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didBecome:)`. + open var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:didReceive:)`. + open var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + + /// Overrides default behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)`. + open var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + /// Overrides all behavior for URLSessionDataDelegate method `urlSession(_:dataTask:willCacheResponse:completionHandler:)` and + /// requires caller to call the `completionHandler`. + open var dataTaskWillCacheResponseWithCompletion: ((URLSession, URLSessionDataTask, CachedURLResponse, @escaping (CachedURLResponse?) -> Void) -> Void)? + + // MARK: URLSessionDownloadDelegate Overrides + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didFinishDownloadingTo:)`. + open var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:)`. + open var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + + /// Overrides default behavior for URLSessionDownloadDelegate method `urlSession(_:downloadTask:didResumeAtOffset:expectedTotalBytes:)`. + open var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + // MARK: URLSessionStreamDelegate Overrides + +#if !os(watchOS) + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:readClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskReadClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskReadClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskReadClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:writeClosedFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskWriteClosed: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskWriteClosed as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskWriteClosed = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:betterRouteDiscoveredFor:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskBetterRouteDiscovered: ((URLSession, URLSessionStreamTask) -> Void)? { + get { + return _streamTaskBetterRouteDiscovered as? (URLSession, URLSessionStreamTask) -> Void + } + set { + _streamTaskBetterRouteDiscovered = newValue + } + } + + /// Overrides default behavior for URLSessionStreamDelegate method `urlSession(_:streamTask:didBecome:outputStream:)`. + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open var streamTaskDidBecomeInputAndOutputStreams: ((URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void)? { + get { + return _streamTaskDidBecomeInputStream as? (URLSession, URLSessionStreamTask, InputStream, OutputStream) -> Void + } + set { + _streamTaskDidBecomeInputStream = newValue + } + } + + var _streamTaskReadClosed: Any? + var _streamTaskWriteClosed: Any? + var _streamTaskBetterRouteDiscovered: Any? + var _streamTaskDidBecomeInputStream: Any? + +#endif + + // MARK: Properties + + var retrier: RequestRetrier? + weak var sessionManager: SessionManager? + + var requests: [Int: Request] = [:] + private let lock = NSLock() + + /// Access the task delegate for the specified task in a thread-safe manner. + open subscript(task: URLSessionTask) -> Request? { + get { + lock.lock() ; defer { lock.unlock() } + return requests[task.taskIdentifier] + } + set { + lock.lock() ; defer { lock.unlock() } + requests[task.taskIdentifier] = newValue + } + } + + // MARK: Lifecycle + + /// Initializes the `SessionDelegate` instance. + /// + /// - returns: The new `SessionDelegate` instance. + public override init() { + super.init() + } + + // MARK: NSObject Overrides + + /// Returns a `Bool` indicating whether the `SessionDelegate` implements or inherits a method that can respond + /// to a specified message. + /// + /// - parameter selector: A selector that identifies a message. + /// + /// - returns: `true` if the receiver implements or inherits a method that can respond to selector, otherwise `false`. + open override func responds(to selector: Selector) -> Bool { + #if !os(macOS) + if selector == #selector(URLSessionDelegate.urlSessionDidFinishEvents(forBackgroundURLSession:)) { + return sessionDidFinishEventsForBackgroundURLSession != nil + } + #endif + + #if !os(watchOS) + if #available(iOS 9.0, macOS 10.11, tvOS 9.0, *) { + switch selector { + case #selector(URLSessionStreamDelegate.urlSession(_:readClosedFor:)): + return streamTaskReadClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:writeClosedFor:)): + return streamTaskWriteClosed != nil + case #selector(URLSessionStreamDelegate.urlSession(_:betterRouteDiscoveredFor:)): + return streamTaskBetterRouteDiscovered != nil + case #selector(URLSessionStreamDelegate.urlSession(_:streamTask:didBecome:outputStream:)): + return streamTaskDidBecomeInputAndOutputStreams != nil + default: + break + } + } + #endif + + switch selector { + case #selector(URLSessionDelegate.urlSession(_:didBecomeInvalidWithError:)): + return sessionDidBecomeInvalidWithError != nil + case #selector(URLSessionDelegate.urlSession(_:didReceive:completionHandler:)): + return (sessionDidReceiveChallenge != nil || sessionDidReceiveChallengeWithCompletion != nil) + case #selector(URLSessionTaskDelegate.urlSession(_:task:willPerformHTTPRedirection:newRequest:completionHandler:)): + return (taskWillPerformHTTPRedirection != nil || taskWillPerformHTTPRedirectionWithCompletion != nil) + case #selector(URLSessionDataDelegate.urlSession(_:dataTask:didReceive:completionHandler:)): + return (dataTaskDidReceiveResponse != nil || dataTaskDidReceiveResponseWithCompletion != nil) + default: + return type(of: self).instancesRespond(to: selector) + } + } +} + +// MARK: - URLSessionDelegate + +extension SessionDelegate: URLSessionDelegate { + /// Tells the delegate that the session has been invalidated. + /// + /// - parameter session: The session object that was invalidated. + /// - parameter error: The error that caused invalidation, or nil if the invalidation was explicit. + open func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?) { + sessionDidBecomeInvalidWithError?(session, error) + } + + /// Requests credentials from the delegate in response to a session-level authentication request from the + /// remote server. + /// + /// - parameter session: The session containing the task that requested authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard sessionDidReceiveChallengeWithCompletion == nil else { + sessionDidReceiveChallengeWithCompletion?(session, challenge, completionHandler) + return + } + + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let sessionDidReceiveChallenge = sessionDidReceiveChallenge { + (disposition, credential) = sessionDidReceiveChallenge(session, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } + + completionHandler(disposition, credential) + } + +#if !os(macOS) + + /// Tells the delegate that all messages enqueued for a session have been delivered. + /// + /// - parameter session: The session that no longer has any outstanding requests. + open func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) { + sessionDidFinishEventsForBackgroundURLSession?(session) + } + +#endif +} + +// MARK: - URLSessionTaskDelegate + +extension SessionDelegate: URLSessionTaskDelegate { + /// Tells the delegate that the remote server requested an HTTP redirect. + /// + /// - parameter session: The session containing the task whose request resulted in a redirect. + /// - parameter task: The task whose request resulted in a redirect. + /// - parameter response: An object containing the server’s response to the original request. + /// - parameter request: A URL request object filled out with the new location. + /// - parameter completionHandler: A closure that your handler should call with either the value of the request + /// parameter, a modified URL request object, or NULL to refuse the redirect and + /// return the body of the redirect response. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + guard taskWillPerformHTTPRedirectionWithCompletion == nil else { + taskWillPerformHTTPRedirectionWithCompletion?(session, task, response, request, completionHandler) + return + } + + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + /// Requests credentials from the delegate in response to an authentication request from the remote server. + /// + /// - parameter session: The session containing the task whose request requires authentication. + /// - parameter task: The task whose request requires authentication. + /// - parameter challenge: An object that contains the request for authentication. + /// - parameter completionHandler: A handler that your delegate method must call providing the disposition + /// and credential. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + guard taskDidReceiveChallengeWithCompletion == nil else { + taskDidReceiveChallengeWithCompletion?(session, task, challenge, completionHandler) + return + } + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + let result = taskDidReceiveChallenge(session, task, challenge) + completionHandler(result.0, result.1) + } else if let delegate = self[task]?.delegate { + delegate.urlSession( + session, + task: task, + didReceive: challenge, + completionHandler: completionHandler + ) + } else { + urlSession(session, didReceive: challenge, completionHandler: completionHandler) + } + } + + /// Tells the delegate when a task requires a new request body stream to send to the remote server. + /// + /// - parameter session: The session containing the task that needs a new body stream. + /// - parameter task: The task that needs a new body stream. + /// - parameter completionHandler: A completion handler that your delegate method should call with the new body stream. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + guard taskNeedNewBodyStreamWithCompletion == nil else { + taskNeedNewBodyStreamWithCompletion?(session, task, completionHandler) + return + } + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + completionHandler(taskNeedNewBodyStream(session, task)) + } else if let delegate = self[task]?.delegate { + delegate.urlSession(session, task: task, needNewBodyStream: completionHandler) + } + } + + /// Periodically informs the delegate of the progress of sending body content to the server. + /// + /// - parameter session: The session containing the data task. + /// - parameter task: The data task. + /// - parameter bytesSent: The number of bytes sent since the last time this delegate method was called. + /// - parameter totalBytesSent: The total number of bytes sent so far. + /// - parameter totalBytesExpectedToSend: The expected length of the body data. + open func urlSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else if let delegate = self[task]?.delegate as? UploadTaskDelegate { + delegate.URLSession( + session, + task: task, + didSendBodyData: bytesSent, + totalBytesSent: totalBytesSent, + totalBytesExpectedToSend: totalBytesExpectedToSend + ) + } + } + +#if !os(watchOS) + + /// Tells the delegate that the session finished collecting metrics for the task. + /// + /// - parameter session: The session collecting the metrics. + /// - parameter task: The task whose metrics have been collected. + /// - parameter metrics: The collected metrics. + @available(iOS 10.0, macOS 10.12, tvOS 10.0, *) + @objc(URLSession:task:didFinishCollectingMetrics:) + open func urlSession(_ session: URLSession, task: URLSessionTask, didFinishCollecting metrics: URLSessionTaskMetrics) { + self[task]?.delegate.metrics = metrics + } + +#endif + + /// Tells the delegate that the task finished transferring data. + /// + /// - parameter session: The session containing the task whose request finished transferring data. + /// - parameter task: The task whose request finished transferring data. + /// - parameter error: If an error occurred, an error object indicating how the transfer failed, otherwise nil. + open func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + /// Executed after it is determined that the request is not going to be retried + let completeTask: (URLSession, URLSessionTask, Error?) -> Void = { [weak self] session, task, error in + guard let strongSelf = self else { return } + + strongSelf.taskDidComplete?(session, task, error) + + strongSelf[task]?.delegate.urlSession(session, task: task, didCompleteWithError: error) + + var userInfo: [String: Any] = [Notification.Key.Task: task] + + if let data = (strongSelf[task]?.delegate as? DataTaskDelegate)?.data { + userInfo[Notification.Key.ResponseData] = data + } + + NotificationCenter.default.post( + name: Notification.Name.Task.DidComplete, + object: strongSelf, + userInfo: userInfo + ) + + strongSelf[task] = nil + } + + guard let request = self[task], let sessionManager = sessionManager else { + completeTask(session, task, error) + return + } + + // Run all validations on the request before checking if an error occurred + request.validations.forEach { $0() } + + // Determine whether an error has occurred + var error: Error? = error + + if request.delegate.error != nil { + error = request.delegate.error + } + + /// If an error occurred and the retrier is set, asynchronously ask the retrier if the request + /// should be retried. Otherwise, complete the task by notifying the task delegate. + if let retrier = retrier, let error = error { + retrier.should(sessionManager, retry: request, with: error) { [weak self] shouldRetry, timeDelay in + guard shouldRetry else { completeTask(session, task, error) ; return } + + DispatchQueue.utility.after(timeDelay) { [weak self] in + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.sessionManager?.retry(request) ?? false + + if retrySucceeded, let task = request.task { + strongSelf[task] = request + return + } else { + completeTask(session, task, error) + } + } + } + } else { + completeTask(session, task, error) + } + } +} + +// MARK: - URLSessionDataDelegate + +extension SessionDelegate: URLSessionDataDelegate { + /// Tells the delegate that the data task received the initial reply (headers) from the server. + /// + /// - parameter session: The session containing the data task that received an initial reply. + /// - parameter dataTask: The data task that received an initial reply. + /// - parameter response: A URL response object populated with headers. + /// - parameter completionHandler: A completion handler that your code calls to continue the transfer, passing a + /// constant to indicate whether the transfer should continue as a data task or + /// should become a download task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + guard dataTaskDidReceiveResponseWithCompletion == nil else { + dataTaskDidReceiveResponseWithCompletion?(session, dataTask, response, completionHandler) + return + } + + var disposition: URLSession.ResponseDisposition = .allow + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + /// Tells the delegate that the data task was changed to a download task. + /// + /// - parameter session: The session containing the task that was replaced by a download task. + /// - parameter dataTask: The data task that was replaced by a download task. + /// - parameter downloadTask: The new download task that replaced the data task. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + if let dataTaskDidBecomeDownloadTask = dataTaskDidBecomeDownloadTask { + dataTaskDidBecomeDownloadTask(session, dataTask, downloadTask) + } else { + self[downloadTask]?.delegate = DownloadTaskDelegate(task: downloadTask) + } + } + + /// Tells the delegate that the data task has received some of the expected data. + /// + /// - parameter session: The session containing the data task that provided data. + /// - parameter dataTask: The data task that provided data. + /// - parameter data: A data object containing the transferred data. + open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession(session, dataTask: dataTask, didReceive: data) + } + } + + /// Asks the delegate whether the data (or upload) task should store the response in the cache. + /// + /// - parameter session: The session containing the data (or upload) task. + /// - parameter dataTask: The data (or upload) task. + /// - parameter proposedResponse: The default caching behavior. This behavior is determined based on the current + /// caching policy and the values of certain received headers, such as the Pragma + /// and Cache-Control headers. + /// - parameter completionHandler: A block that your handler must call, providing either the original proposed + /// response, a modified version of that response, or NULL to prevent caching the + /// response. If your delegate implements this method, it must call this completion + /// handler; otherwise, your app leaks memory. + open func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + guard dataTaskWillCacheResponseWithCompletion == nil else { + dataTaskWillCacheResponseWithCompletion?(session, dataTask, proposedResponse, completionHandler) + return + } + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + completionHandler(dataTaskWillCacheResponse(session, dataTask, proposedResponse)) + } else if let delegate = self[dataTask]?.delegate as? DataTaskDelegate { + delegate.urlSession( + session, + dataTask: dataTask, + willCacheResponse: proposedResponse, + completionHandler: completionHandler + ) + } else { + completionHandler(proposedResponse) + } + } +} + +// MARK: - URLSessionDownloadDelegate + +extension SessionDelegate: URLSessionDownloadDelegate { + /// Tells the delegate that a download task has finished downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that finished. + /// - parameter location: A file URL for the temporary file. Because the file is temporary, you must either + /// open the file for reading or move it to a permanent location in your app’s sandbox + /// container directory before returning from this delegate method. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + if let downloadTaskDidFinishDownloadingToURL = downloadTaskDidFinishDownloadingToURL { + downloadTaskDidFinishDownloadingToURL(session, downloadTask, location) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession(session, downloadTask: downloadTask, didFinishDownloadingTo: location) + } + } + + /// Periodically informs the delegate about the download’s progress. + /// + /// - parameter session: The session containing the download task. + /// - parameter downloadTask: The download task. + /// - parameter bytesWritten: The number of bytes transferred since the last time this delegate + /// method was called. + /// - parameter totalBytesWritten: The total number of bytes transferred so far. + /// - parameter totalBytesExpectedToWrite: The expected length of the file, as provided by the Content-Length + /// header. If this header was not provided, the value is + /// `NSURLSessionTransferSizeUnknown`. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData(session, downloadTask, bytesWritten, totalBytesWritten, totalBytesExpectedToWrite) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didWriteData: bytesWritten, + totalBytesWritten: totalBytesWritten, + totalBytesExpectedToWrite: totalBytesExpectedToWrite + ) + } + } + + /// Tells the delegate that the download task has resumed downloading. + /// + /// - parameter session: The session containing the download task that finished. + /// - parameter downloadTask: The download task that resumed. See explanation in the discussion. + /// - parameter fileOffset: If the file's cache policy or last modified date prevents reuse of the + /// existing content, then this value is zero. Otherwise, this value is an + /// integer representing the number of bytes on disk that do not need to be + /// retrieved again. + /// - parameter expectedTotalBytes: The expected length of the file, as provided by the Content-Length header. + /// If this header was not provided, the value is NSURLSessionTransferSizeUnknown. + open func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else if let delegate = self[downloadTask]?.delegate as? DownloadTaskDelegate { + delegate.urlSession( + session, + downloadTask: downloadTask, + didResumeAtOffset: fileOffset, + expectedTotalBytes: expectedTotalBytes + ) + } + } +} + +// MARK: - URLSessionStreamDelegate + +#if !os(watchOS) + +@available(iOS 9.0, macOS 10.11, tvOS 9.0, *) +extension SessionDelegate: URLSessionStreamDelegate { + /// Tells the delegate that the read side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, readClosedFor streamTask: URLSessionStreamTask) { + streamTaskReadClosed?(session, streamTask) + } + + /// Tells the delegate that the write side of the connection has been closed. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, writeClosedFor streamTask: URLSessionStreamTask) { + streamTaskWriteClosed?(session, streamTask) + } + + /// Tells the delegate that the system has determined that a better route to the host is available. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + open func urlSession(_ session: URLSession, betterRouteDiscoveredFor streamTask: URLSessionStreamTask) { + streamTaskBetterRouteDiscovered?(session, streamTask) + } + + /// Tells the delegate that the stream task has been completed and provides the unopened stream objects. + /// + /// - parameter session: The session. + /// - parameter streamTask: The stream task. + /// - parameter inputStream: The new input stream. + /// - parameter outputStream: The new output stream. + open func urlSession( + _ session: URLSession, + streamTask: URLSessionStreamTask, + didBecome inputStream: InputStream, + outputStream: OutputStream) + { + streamTaskDidBecomeInputAndOutputStreams?(session, streamTask, inputStream, outputStream) + } +} + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift new file mode 100644 index 000000000000..02c36a76b7b4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/SessionManager.swift @@ -0,0 +1,899 @@ +// +// SessionManager.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for creating and managing `Request` objects, as well as their underlying `NSURLSession`. +open class SessionManager { + + // MARK: - Helper Types + + /// Defines whether the `MultipartFormData` encoding was successful and contains result of the encoding as + /// associated values. + /// + /// - Success: Represents a successful `MultipartFormData` encoding and contains the new `UploadRequest` along with + /// streaming information. + /// - Failure: Used to represent a failure in the `MultipartFormData` encoding and also contains the encoding + /// error. + public enum MultipartFormDataEncodingResult { + case success(request: UploadRequest, streamingFromDisk: Bool, streamFileURL: URL?) + case failure(Error) + } + + // MARK: - Properties + + /// A default instance of `SessionManager`, used by top-level Alamofire request methods, and suitable for use + /// directly for any ad hoc requests. + public static let `default`: SessionManager = { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = SessionManager.defaultHTTPHeaders + + return SessionManager(configuration: configuration) + }() + + /// Creates default values for the "Accept-Encoding", "Accept-Language" and "User-Agent" headers. + public static let defaultHTTPHeaders: HTTPHeaders = { + // Accept-Encoding HTTP Header; see https://tools.ietf.org/html/rfc7230#section-4.2.3 + let acceptEncoding: String = "gzip;q=1.0, compress;q=0.5" + + // Accept-Language HTTP Header; see https://tools.ietf.org/html/rfc7231#section-5.3.5 + let acceptLanguage = Locale.preferredLanguages.prefix(6).enumerated().map { index, languageCode in + let quality = 1.0 - (Double(index) * 0.1) + return "\(languageCode);q=\(quality)" + }.joined(separator: ", ") + + // User-Agent Header; see https://tools.ietf.org/html/rfc7231#section-5.5.3 + // Example: `iOS Example/1.0 (org.alamofire.iOS-Example; build:1; iOS 10.0.0) Alamofire/4.0.0` + let userAgent: String = { + if let info = Bundle.main.infoDictionary { + let executable = info[kCFBundleExecutableKey as String] as? String ?? "Unknown" + let bundle = info[kCFBundleIdentifierKey as String] as? String ?? "Unknown" + let appVersion = info["CFBundleShortVersionString"] as? String ?? "Unknown" + let appBuild = info[kCFBundleVersionKey as String] as? String ?? "Unknown" + + let osNameVersion: String = { + let version = ProcessInfo.processInfo.operatingSystemVersion + let versionString = "\(version.majorVersion).\(version.minorVersion).\(version.patchVersion)" + + let osName: String = { + #if os(iOS) + return "iOS" + #elseif os(watchOS) + return "watchOS" + #elseif os(tvOS) + return "tvOS" + #elseif os(macOS) + return "OS X" + #elseif os(Linux) + return "Linux" + #else + return "Unknown" + #endif + }() + + return "\(osName) \(versionString)" + }() + + let alamofireVersion: String = { + guard + let afInfo = Bundle(for: SessionManager.self).infoDictionary, + let build = afInfo["CFBundleShortVersionString"] + else { return "Unknown" } + + return "Alamofire/\(build)" + }() + + return "\(executable)/\(appVersion) (\(bundle); build:\(appBuild); \(osNameVersion)) \(alamofireVersion)" + } + + return "Alamofire" + }() + + return [ + "Accept-Encoding": acceptEncoding, + "Accept-Language": acceptLanguage, + "User-Agent": userAgent + ] + }() + + /// Default memory threshold used when encoding `MultipartFormData` in bytes. + public static let multipartFormDataEncodingMemoryThreshold: UInt64 = 10_000_000 + + /// The underlying session. + public let session: URLSession + + /// The session delegate handling all the task and session delegate callbacks. + public let delegate: SessionDelegate + + /// Whether to start requests immediately after being constructed. `true` by default. + open var startRequestsImmediately: Bool = true + + /// The request adapter called each time a new request is created. + open var adapter: RequestAdapter? + + /// The request retrier called each time a request encounters an error to determine whether to retry the request. + open var retrier: RequestRetrier? { + get { return delegate.retrier } + set { delegate.retrier = newValue } + } + + /// The background completion handler closure provided by the UIApplicationDelegate + /// `application:handleEventsForBackgroundURLSession:completionHandler:` method. By setting the background + /// completion handler, the SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` closure implementation + /// will automatically call the handler. + /// + /// If you need to handle your own events before the handler is called, then you need to override the + /// SessionDelegate `sessionDidFinishEventsForBackgroundURLSession` and manually call the handler when finished. + /// + /// `nil` by default. + open var backgroundCompletionHandler: (() -> Void)? + + let queue = DispatchQueue(label: "org.alamofire.session-manager." + UUID().uuidString) + + // MARK: - Lifecycle + + /// Creates an instance with the specified `configuration`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter configuration: The configuration used to construct the managed session. + /// `URLSessionConfiguration.default` by default. + /// - parameter delegate: The delegate used when initializing the session. `SessionDelegate()` by + /// default. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance. + public init( + configuration: URLSessionConfiguration = URLSessionConfiguration.default, + delegate: SessionDelegate = SessionDelegate(), + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + self.delegate = delegate + self.session = URLSession(configuration: configuration, delegate: delegate, delegateQueue: nil) + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + /// Creates an instance with the specified `session`, `delegate` and `serverTrustPolicyManager`. + /// + /// - parameter session: The URL session. + /// - parameter delegate: The delegate of the URL session. Must equal the URL session's delegate. + /// - parameter serverTrustPolicyManager: The server trust policy manager to use for evaluating all server trust + /// challenges. `nil` by default. + /// + /// - returns: The new `SessionManager` instance if the URL session's delegate matches; `nil` otherwise. + public init?( + session: URLSession, + delegate: SessionDelegate, + serverTrustPolicyManager: ServerTrustPolicyManager? = nil) + { + guard delegate === session.delegate else { return nil } + + self.delegate = delegate + self.session = session + + commonInit(serverTrustPolicyManager: serverTrustPolicyManager) + } + + private func commonInit(serverTrustPolicyManager: ServerTrustPolicyManager?) { + session.serverTrustPolicyManager = serverTrustPolicyManager + + delegate.sessionManager = self + + delegate.sessionDidFinishEventsForBackgroundURLSession = { [weak self] session in + guard let strongSelf = self else { return } + DispatchQueue.main.async { strongSelf.backgroundCompletionHandler?() } + } + } + + deinit { + session.invalidateAndCancel() + } + + // MARK: - Data Request + + /// Creates a `DataRequest` to retrieve the contents of the specified `url`, `method`, `parameters`, `encoding` + /// and `headers`. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil) + -> DataRequest + { + var originalRequest: URLRequest? + + do { + originalRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(originalRequest!, with: parameters) + return request(encodedURLRequest) + } catch { + return request(originalRequest, failedWith: error) + } + } + + /// Creates a `DataRequest` to retrieve the contents of a URL based on the specified `urlRequest`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `DataRequest`. + @discardableResult + open func request(_ urlRequest: URLRequestConvertible) -> DataRequest { + var originalRequest: URLRequest? + + do { + originalRequest = try urlRequest.asURLRequest() + let originalTask = DataRequest.Requestable(urlRequest: originalRequest!) + + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + let request = DataRequest(session: session, requestTask: .data(originalTask, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return request(originalRequest, failedWith: error) + } + } + + // MARK: Private - Request Implementation + + private func request(_ urlRequest: URLRequest?, failedWith error: Error) -> DataRequest { + var requestTask: Request.RequestTask = .data(nil, nil) + + if let urlRequest = urlRequest { + let originalTask = DataRequest.Requestable(urlRequest: urlRequest) + requestTask = .data(originalTask, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let request = DataRequest(session: session, requestTask: requestTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: request, with: underlyingError) + } else { + if startRequestsImmediately { request.resume() } + } + + return request + } + + // MARK: - Download Request + + // MARK: URL Request + + /// Creates a `DownloadRequest` to retrieve the contents the specified `url`, `method`, `parameters`, `encoding`, + /// `headers` and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.get` by default. + /// - parameter parameters: The parameters. `nil` by default. + /// - parameter encoding: The parameter encoding. `URLEncoding.default` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ url: URLConvertible, + method: HTTPMethod = .get, + parameters: Parameters? = nil, + encoding: ParameterEncoding = URLEncoding.default, + headers: HTTPHeaders? = nil, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + let encodedURLRequest = try encoding.encode(urlRequest, with: parameters) + return download(encodedURLRequest, to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + /// Creates a `DownloadRequest` to retrieve the contents of a URL based on the specified `urlRequest` and save + /// them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter urlRequest: The URL request + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + _ urlRequest: URLRequestConvertible, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + do { + let urlRequest = try urlRequest.asURLRequest() + return download(.request(urlRequest), to: destination) + } catch { + return download(nil, to: destination, failedWith: error) + } + } + + // MARK: Resume Data + + /// Creates a `DownloadRequest` from the `resumeData` produced from a previous request cancellation to retrieve + /// the contents of the original request and save them to the `destination`. + /// + /// If `destination` is not specified, the contents will remain in the temporary location determined by the + /// underlying URL session. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// On the latest release of all the Apple platforms (iOS 10, macOS 10.12, tvOS 10, watchOS 3), `resumeData` is broken + /// on background URL session configurations. There's an underlying bug in the `resumeData` generation logic where the + /// data is written incorrectly and will always fail to resume the download. For more information about the bug and + /// possible workarounds, please refer to the following Stack Overflow post: + /// + /// - http://stackoverflow.com/a/39347461/1342462 + /// + /// - parameter resumeData: The resume data. This is an opaque data blob produced by `URLSessionDownloadTask` + /// when a task is cancelled. See `URLSession -downloadTask(withResumeData:)` for + /// additional information. + /// - parameter destination: The closure used to determine the destination of the downloaded file. `nil` by default. + /// + /// - returns: The created `DownloadRequest`. + @discardableResult + open func download( + resumingWith resumeData: Data, + to destination: DownloadRequest.DownloadFileDestination? = nil) + -> DownloadRequest + { + return download(.resumeData(resumeData), to: destination) + } + + // MARK: Private - Download Implementation + + private func download( + _ downloadable: DownloadRequest.Downloadable, + to destination: DownloadRequest.DownloadFileDestination?) + -> DownloadRequest + { + do { + let task = try downloadable.task(session: session, adapter: adapter, queue: queue) + let download = DownloadRequest(session: session, requestTask: .download(downloadable, task)) + + download.downloadDelegate.destination = destination + + delegate[task] = download + + if startRequestsImmediately { download.resume() } + + return download + } catch { + return download(downloadable, to: destination, failedWith: error) + } + } + + private func download( + _ downloadable: DownloadRequest.Downloadable?, + to destination: DownloadRequest.DownloadFileDestination?, + failedWith error: Error) + -> DownloadRequest + { + var downloadTask: Request.RequestTask = .download(nil, nil) + + if let downloadable = downloadable { + downloadTask = .download(downloadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + + let download = DownloadRequest(session: session, requestTask: downloadTask, error: underlyingError) + download.downloadDelegate.destination = destination + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: download, with: underlyingError) + } else { + if startRequestsImmediately { download.resume() } + } + + return download + } + + // MARK: - Upload Request + + // MARK: File + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ fileURL: URL, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(fileURL, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates a `UploadRequest` from the specified `urlRequest` for uploading the `file`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter file: The file to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ fileURL: URL, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.file(fileURL, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: Data + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ data: Data, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(data, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `data`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter data: The data to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ data: Data, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.data(data, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: InputStream + + /// Creates an `UploadRequest` from the specified `url`, `method` and `headers` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload( + _ stream: InputStream, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil) + -> UploadRequest + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + return upload(stream, with: urlRequest) + } catch { + return upload(nil, failedWith: error) + } + } + + /// Creates an `UploadRequest` from the specified `urlRequest` for uploading the `stream`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter stream: The stream to upload. + /// - parameter urlRequest: The URL request. + /// + /// - returns: The created `UploadRequest`. + @discardableResult + open func upload(_ stream: InputStream, with urlRequest: URLRequestConvertible) -> UploadRequest { + do { + let urlRequest = try urlRequest.asURLRequest() + return upload(.stream(stream, urlRequest)) + } catch { + return upload(nil, failedWith: error) + } + } + + // MARK: MultipartFormData + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `url`, `method` and `headers`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter url: The URL. + /// - parameter method: The HTTP method. `.post` by default. + /// - parameter headers: The HTTP headers. `nil` by default. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + to url: URLConvertible, + method: HTTPMethod = .post, + headers: HTTPHeaders? = nil, + queue: DispatchQueue? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + do { + let urlRequest = try URLRequest(url: url, method: method, headers: headers) + + return upload( + multipartFormData: multipartFormData, + usingThreshold: encodingMemoryThreshold, + with: urlRequest, + queue: queue, + encodingCompletion: encodingCompletion + ) + } catch { + (queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) } + } + } + + /// Encodes `multipartFormData` using `encodingMemoryThreshold` and calls `encodingCompletion` with new + /// `UploadRequest` using the `urlRequest`. + /// + /// It is important to understand the memory implications of uploading `MultipartFormData`. If the cummulative + /// payload is small, encoding the data in-memory and directly uploading to a server is the by far the most + /// efficient approach. However, if the payload is too large, encoding the data in-memory could cause your app to + /// be terminated. Larger payloads must first be written to disk using input and output streams to keep the memory + /// footprint low, then the data can be uploaded as a stream from the resulting file. Streaming from disk MUST be + /// used for larger payloads such as video content. + /// + /// The `encodingMemoryThreshold` parameter allows Alamofire to automatically determine whether to encode in-memory + /// or stream from disk. If the content length of the `MultipartFormData` is below the `encodingMemoryThreshold`, + /// encoding takes place in-memory. If the content length exceeds the threshold, the data is streamed to disk + /// during the encoding process. Then the result is uploaded as data or as a stream depending on which encoding + /// technique was used. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter multipartFormData: The closure used to append body parts to the `MultipartFormData`. + /// - parameter encodingMemoryThreshold: The encoding memory threshold in bytes. + /// `multipartFormDataEncodingMemoryThreshold` by default. + /// - parameter urlRequest: The URL request. + /// - parameter encodingCompletion: The closure called when the `MultipartFormData` encoding is complete. + open func upload( + multipartFormData: @escaping (MultipartFormData) -> Void, + usingThreshold encodingMemoryThreshold: UInt64 = SessionManager.multipartFormDataEncodingMemoryThreshold, + with urlRequest: URLRequestConvertible, + queue: DispatchQueue? = nil, + encodingCompletion: ((MultipartFormDataEncodingResult) -> Void)?) + { + DispatchQueue.global(qos: .utility).async { + let formData = MultipartFormData() + multipartFormData(formData) + + var tempFileURL: URL? + + do { + var urlRequestWithContentType = try urlRequest.asURLRequest() + urlRequestWithContentType.setValue(formData.contentType, forHTTPHeaderField: "Content-Type") + + let isBackgroundSession = self.session.configuration.identifier != nil + + if formData.contentLength < encodingMemoryThreshold && !isBackgroundSession { + let data = try formData.encode() + + let encodingResult = MultipartFormDataEncodingResult.success( + request: self.upload(data, with: urlRequestWithContentType), + streamingFromDisk: false, + streamFileURL: nil + ) + + (queue ?? DispatchQueue.main).async { encodingCompletion?(encodingResult) } + } else { + let fileManager = FileManager.default + let tempDirectoryURL = URL(fileURLWithPath: NSTemporaryDirectory()) + let directoryURL = tempDirectoryURL.appendingPathComponent("org.alamofire.manager/multipart.form.data") + let fileName = UUID().uuidString + let fileURL = directoryURL.appendingPathComponent(fileName) + + tempFileURL = fileURL + + var directoryError: Error? + + // Create directory inside serial queue to ensure two threads don't do this in parallel + self.queue.sync { + do { + try fileManager.createDirectory(at: directoryURL, withIntermediateDirectories: true, attributes: nil) + } catch { + directoryError = error + } + } + + if let directoryError = directoryError { throw directoryError } + + try formData.writeEncodedData(to: fileURL) + + let upload = self.upload(fileURL, with: urlRequestWithContentType) + + // Cleanup the temp file once the upload is complete + upload.delegate.queue.addOperation { + do { + try FileManager.default.removeItem(at: fileURL) + } catch { + // No-op + } + } + + (queue ?? DispatchQueue.main).async { + let encodingResult = MultipartFormDataEncodingResult.success( + request: upload, + streamingFromDisk: true, + streamFileURL: fileURL + ) + + encodingCompletion?(encodingResult) + } + } + } catch { + // Cleanup the temp file in the event that the multipart form data encoding failed + if let tempFileURL = tempFileURL { + do { + try FileManager.default.removeItem(at: tempFileURL) + } catch { + // No-op + } + } + + (queue ?? DispatchQueue.main).async { encodingCompletion?(.failure(error)) } + } + } + } + + // MARK: Private - Upload Implementation + + private func upload(_ uploadable: UploadRequest.Uploadable) -> UploadRequest { + do { + let task = try uploadable.task(session: session, adapter: adapter, queue: queue) + let upload = UploadRequest(session: session, requestTask: .upload(uploadable, task)) + + if case let .stream(inputStream, _) = uploadable { + upload.delegate.taskNeedNewBodyStream = { _, _ in inputStream } + } + + delegate[task] = upload + + if startRequestsImmediately { upload.resume() } + + return upload + } catch { + return upload(uploadable, failedWith: error) + } + } + + private func upload(_ uploadable: UploadRequest.Uploadable?, failedWith error: Error) -> UploadRequest { + var uploadTask: Request.RequestTask = .upload(nil, nil) + + if let uploadable = uploadable { + uploadTask = .upload(uploadable, nil) + } + + let underlyingError = error.underlyingAdaptError ?? error + let upload = UploadRequest(session: session, requestTask: uploadTask, error: underlyingError) + + if let retrier = retrier, error is AdaptError { + allowRetrier(retrier, toRetry: upload, with: underlyingError) + } else { + if startRequestsImmediately { upload.resume() } + } + + return upload + } + +#if !os(watchOS) + + // MARK: - Stream Request + + // MARK: Hostname and Port + + /// Creates a `StreamRequest` for bidirectional streaming using the `hostname` and `port`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter hostName: The hostname of the server to connect to. + /// - parameter port: The port of the server to connect to. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(withHostName hostName: String, port: Int) -> StreamRequest { + return stream(.stream(hostName: hostName, port: port)) + } + + // MARK: NetService + + /// Creates a `StreamRequest` for bidirectional streaming using the `netService`. + /// + /// If `startRequestsImmediately` is `true`, the request will have `resume()` called before being returned. + /// + /// - parameter netService: The net service used to identify the endpoint. + /// + /// - returns: The created `StreamRequest`. + @discardableResult + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + open func stream(with netService: NetService) -> StreamRequest { + return stream(.netService(netService)) + } + + // MARK: Private - Stream Implementation + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(_ streamable: StreamRequest.Streamable) -> StreamRequest { + do { + let task = try streamable.task(session: session, adapter: adapter, queue: queue) + let request = StreamRequest(session: session, requestTask: .stream(streamable, task)) + + delegate[task] = request + + if startRequestsImmediately { request.resume() } + + return request + } catch { + return stream(failedWith: error) + } + } + + @available(iOS 9.0, macOS 10.11, tvOS 9.0, *) + private func stream(failedWith error: Error) -> StreamRequest { + let stream = StreamRequest(session: session, requestTask: .stream(nil, nil), error: error) + if startRequestsImmediately { stream.resume() } + return stream + } + +#endif + + // MARK: - Internal - Retry Request + + func retry(_ request: Request) -> Bool { + guard let originalTask = request.originalTask else { return false } + + do { + let task = try originalTask.task(session: session, adapter: adapter, queue: queue) + + if let originalTask = request.task { + delegate[originalTask] = nil // removes the old request to avoid endless growth + } + + request.delegate.task = task // resets all task delegate data + + request.retryCount += 1 + request.startTime = CFAbsoluteTimeGetCurrent() + request.endTime = nil + + task.resume() + + return true + } catch { + request.delegate.error = error.underlyingAdaptError ?? error + return false + } + } + + private func allowRetrier(_ retrier: RequestRetrier, toRetry request: Request, with error: Error) { + DispatchQueue.utility.async { [weak self] in + guard let strongSelf = self else { return } + + retrier.should(strongSelf, retry: request, with: error) { shouldRetry, timeDelay in + guard let strongSelf = self else { return } + + guard shouldRetry else { + if strongSelf.startRequestsImmediately { request.resume() } + return + } + + DispatchQueue.utility.after(timeDelay) { + guard let strongSelf = self else { return } + + let retrySucceeded = strongSelf.retry(request) + + if retrySucceeded, let task = request.task { + strongSelf.delegate[task] = request + } else { + if strongSelf.startRequestsImmediately { request.resume() } + } + } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift new file mode 100644 index 000000000000..5705737e49d7 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/TaskDelegate.swift @@ -0,0 +1,466 @@ +// +// TaskDelegate.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// The task delegate is responsible for handling all delegate callbacks for the underlying task as well as +/// executing all operations attached to the serial operation queue upon task completion. +open class TaskDelegate: NSObject { + + // MARK: Properties + + /// The serial operation queue used to execute all operations after the task completes. + public let queue: OperationQueue + + /// The data returned by the server. + public var data: Data? { return nil } + + /// The error generated throughout the lifecyle of the task. + public var error: Error? + + var task: URLSessionTask? { + set { + taskLock.lock(); defer { taskLock.unlock() } + _task = newValue + } + get { + taskLock.lock(); defer { taskLock.unlock() } + return _task + } + } + + var initialResponseTime: CFAbsoluteTime? + var credential: URLCredential? + var metrics: AnyObject? // URLSessionTaskMetrics + + private var _task: URLSessionTask? { + didSet { reset() } + } + + private let taskLock = NSLock() + + // MARK: Lifecycle + + init(task: URLSessionTask?) { + _task = task + + self.queue = { + let operationQueue = OperationQueue() + + operationQueue.maxConcurrentOperationCount = 1 + operationQueue.isSuspended = true + operationQueue.qualityOfService = .utility + + return operationQueue + }() + } + + func reset() { + error = nil + initialResponseTime = nil + } + + // MARK: URLSessionTaskDelegate + + var taskWillPerformHTTPRedirection: ((URLSession, URLSessionTask, HTTPURLResponse, URLRequest) -> URLRequest?)? + var taskDidReceiveChallenge: ((URLSession, URLSessionTask, URLAuthenticationChallenge) -> (URLSession.AuthChallengeDisposition, URLCredential?))? + var taskNeedNewBodyStream: ((URLSession, URLSessionTask) -> InputStream?)? + var taskDidCompleteWithError: ((URLSession, URLSessionTask, Error?) -> Void)? + + @objc(URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + willPerformHTTPRedirection response: HTTPURLResponse, + newRequest request: URLRequest, + completionHandler: @escaping (URLRequest?) -> Void) + { + var redirectRequest: URLRequest? = request + + if let taskWillPerformHTTPRedirection = taskWillPerformHTTPRedirection { + redirectRequest = taskWillPerformHTTPRedirection(session, task, response, request) + } + + completionHandler(redirectRequest) + } + + @objc(URLSession:task:didReceiveChallenge:completionHandler:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + didReceive challenge: URLAuthenticationChallenge, + completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) + { + var disposition: URLSession.AuthChallengeDisposition = .performDefaultHandling + var credential: URLCredential? + + if let taskDidReceiveChallenge = taskDidReceiveChallenge { + (disposition, credential) = taskDidReceiveChallenge(session, task, challenge) + } else if challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust { + let host = challenge.protectionSpace.host + + if + let serverTrustPolicy = session.serverTrustPolicyManager?.serverTrustPolicy(forHost: host), + let serverTrust = challenge.protectionSpace.serverTrust + { + if serverTrustPolicy.evaluate(serverTrust, forHost: host) { + disposition = .useCredential + credential = URLCredential(trust: serverTrust) + } else { + disposition = .cancelAuthenticationChallenge + } + } + } else { + if challenge.previousFailureCount > 0 { + disposition = .rejectProtectionSpace + } else { + credential = self.credential ?? session.configuration.urlCredentialStorage?.defaultCredential(for: challenge.protectionSpace) + + if credential != nil { + disposition = .useCredential + } + } + } + + completionHandler(disposition, credential) + } + + @objc(URLSession:task:needNewBodyStream:) + func urlSession( + _ session: URLSession, + task: URLSessionTask, + needNewBodyStream completionHandler: @escaping (InputStream?) -> Void) + { + var bodyStream: InputStream? + + if let taskNeedNewBodyStream = taskNeedNewBodyStream { + bodyStream = taskNeedNewBodyStream(session, task) + } + + completionHandler(bodyStream) + } + + @objc(URLSession:task:didCompleteWithError:) + func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?) { + if let taskDidCompleteWithError = taskDidCompleteWithError { + taskDidCompleteWithError(session, task, error) + } else { + if let error = error { + if self.error == nil { self.error = error } + + if + let downloadDelegate = self as? DownloadTaskDelegate, + let resumeData = (error as NSError).userInfo[NSURLSessionDownloadTaskResumeData] as? Data + { + downloadDelegate.resumeData = resumeData + } + } + + queue.isSuspended = false + } + } +} + +// MARK: - + +class DataTaskDelegate: TaskDelegate, URLSessionDataDelegate { + + // MARK: Properties + + var dataTask: URLSessionDataTask { return task as! URLSessionDataTask } + + override var data: Data? { + if dataStream != nil { + return nil + } else { + return mutableData + } + } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var dataStream: ((_ data: Data) -> Void)? + + private var totalBytesReceived: Int64 = 0 + private var mutableData: Data + + private var expectedContentLength: Int64? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + mutableData = Data() + progress = Progress(totalUnitCount: 0) + + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + totalBytesReceived = 0 + mutableData = Data() + expectedContentLength = nil + } + + // MARK: URLSessionDataDelegate + + var dataTaskDidReceiveResponse: ((URLSession, URLSessionDataTask, URLResponse) -> URLSession.ResponseDisposition)? + var dataTaskDidBecomeDownloadTask: ((URLSession, URLSessionDataTask, URLSessionDownloadTask) -> Void)? + var dataTaskDidReceiveData: ((URLSession, URLSessionDataTask, Data) -> Void)? + var dataTaskWillCacheResponse: ((URLSession, URLSessionDataTask, CachedURLResponse) -> CachedURLResponse?)? + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didReceive response: URLResponse, + completionHandler: @escaping (URLSession.ResponseDisposition) -> Void) + { + var disposition: URLSession.ResponseDisposition = .allow + + expectedContentLength = response.expectedContentLength + + if let dataTaskDidReceiveResponse = dataTaskDidReceiveResponse { + disposition = dataTaskDidReceiveResponse(session, dataTask, response) + } + + completionHandler(disposition) + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + didBecome downloadTask: URLSessionDownloadTask) + { + dataTaskDidBecomeDownloadTask?(session, dataTask, downloadTask) + } + + func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let dataTaskDidReceiveData = dataTaskDidReceiveData { + dataTaskDidReceiveData(session, dataTask, data) + } else { + if let dataStream = dataStream { + dataStream(data) + } else { + mutableData.append(data) + } + + let bytesReceived = Int64(data.count) + totalBytesReceived += bytesReceived + let totalBytesExpected = dataTask.response?.expectedContentLength ?? NSURLSessionTransferSizeUnknown + + progress.totalUnitCount = totalBytesExpected + progress.completedUnitCount = totalBytesReceived + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + dataTask: URLSessionDataTask, + willCacheResponse proposedResponse: CachedURLResponse, + completionHandler: @escaping (CachedURLResponse?) -> Void) + { + var cachedResponse: CachedURLResponse? = proposedResponse + + if let dataTaskWillCacheResponse = dataTaskWillCacheResponse { + cachedResponse = dataTaskWillCacheResponse(session, dataTask, proposedResponse) + } + + completionHandler(cachedResponse) + } +} + +// MARK: - + +class DownloadTaskDelegate: TaskDelegate, URLSessionDownloadDelegate { + + // MARK: Properties + + var downloadTask: URLSessionDownloadTask { return task as! URLSessionDownloadTask } + + var progress: Progress + var progressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + var resumeData: Data? + override var data: Data? { return resumeData } + + var destination: DownloadRequest.DownloadFileDestination? + + var temporaryURL: URL? + var destinationURL: URL? + + var fileURL: URL? { return destination != nil ? destinationURL : temporaryURL } + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + progress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + + progress = Progress(totalUnitCount: 0) + resumeData = nil + } + + // MARK: URLSessionDownloadDelegate + + var downloadTaskDidFinishDownloadingToURL: ((URLSession, URLSessionDownloadTask, URL) -> URL)? + var downloadTaskDidWriteData: ((URLSession, URLSessionDownloadTask, Int64, Int64, Int64) -> Void)? + var downloadTaskDidResumeAtOffset: ((URLSession, URLSessionDownloadTask, Int64, Int64) -> Void)? + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didFinishDownloadingTo location: URL) + { + temporaryURL = location + + guard + let destination = destination, + let response = downloadTask.response as? HTTPURLResponse + else { return } + + let result = destination(location, response) + let destinationURL = result.destinationURL + let options = result.options + + self.destinationURL = destinationURL + + do { + if options.contains(.removePreviousFile), FileManager.default.fileExists(atPath: destinationURL.path) { + try FileManager.default.removeItem(at: destinationURL) + } + + if options.contains(.createIntermediateDirectories) { + let directory = destinationURL.deletingLastPathComponent() + try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true) + } + + try FileManager.default.moveItem(at: location, to: destinationURL) + } catch { + self.error = error + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didWriteData bytesWritten: Int64, + totalBytesWritten: Int64, + totalBytesExpectedToWrite: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let downloadTaskDidWriteData = downloadTaskDidWriteData { + downloadTaskDidWriteData( + session, + downloadTask, + bytesWritten, + totalBytesWritten, + totalBytesExpectedToWrite + ) + } else { + progress.totalUnitCount = totalBytesExpectedToWrite + progress.completedUnitCount = totalBytesWritten + + if let progressHandler = progressHandler { + progressHandler.queue.async { progressHandler.closure(self.progress) } + } + } + } + + func urlSession( + _ session: URLSession, + downloadTask: URLSessionDownloadTask, + didResumeAtOffset fileOffset: Int64, + expectedTotalBytes: Int64) + { + if let downloadTaskDidResumeAtOffset = downloadTaskDidResumeAtOffset { + downloadTaskDidResumeAtOffset(session, downloadTask, fileOffset, expectedTotalBytes) + } else { + progress.totalUnitCount = expectedTotalBytes + progress.completedUnitCount = fileOffset + } + } +} + +// MARK: - + +class UploadTaskDelegate: DataTaskDelegate { + + // MARK: Properties + + var uploadTask: URLSessionUploadTask { return task as! URLSessionUploadTask } + + var uploadProgress: Progress + var uploadProgressHandler: (closure: Request.ProgressHandler, queue: DispatchQueue)? + + // MARK: Lifecycle + + override init(task: URLSessionTask?) { + uploadProgress = Progress(totalUnitCount: 0) + super.init(task: task) + } + + override func reset() { + super.reset() + uploadProgress = Progress(totalUnitCount: 0) + } + + // MARK: URLSessionTaskDelegate + + var taskDidSendBodyData: ((URLSession, URLSessionTask, Int64, Int64, Int64) -> Void)? + + func URLSession( + _ session: URLSession, + task: URLSessionTask, + didSendBodyData bytesSent: Int64, + totalBytesSent: Int64, + totalBytesExpectedToSend: Int64) + { + if initialResponseTime == nil { initialResponseTime = CFAbsoluteTimeGetCurrent() } + + if let taskDidSendBodyData = taskDidSendBodyData { + taskDidSendBodyData(session, task, bytesSent, totalBytesSent, totalBytesExpectedToSend) + } else { + uploadProgress.totalUnitCount = totalBytesExpectedToSend + uploadProgress.completedUnitCount = totalBytesSent + + if let uploadProgressHandler = uploadProgressHandler { + uploadProgressHandler.queue.async { uploadProgressHandler.closure(self.uploadProgress) } + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift new file mode 100644 index 000000000000..596c1bdc41f9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Timeline.swift @@ -0,0 +1,136 @@ +// +// Timeline.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +/// Responsible for computing the timing metrics for the complete lifecycle of a `Request`. +public struct Timeline { + /// The time the request was initialized. + public let requestStartTime: CFAbsoluteTime + + /// The time the first bytes were received from or sent to the server. + public let initialResponseTime: CFAbsoluteTime + + /// The time when the request was completed. + public let requestCompletedTime: CFAbsoluteTime + + /// The time when the response serialization was completed. + public let serializationCompletedTime: CFAbsoluteTime + + /// The time interval in seconds from the time the request started to the initial response from the server. + public let latency: TimeInterval + + /// The time interval in seconds from the time the request started to the time the request completed. + public let requestDuration: TimeInterval + + /// The time interval in seconds from the time the request completed to the time response serialization completed. + public let serializationDuration: TimeInterval + + /// The time interval in seconds from the time the request started to the time response serialization completed. + public let totalDuration: TimeInterval + + /// Creates a new `Timeline` instance with the specified request times. + /// + /// - parameter requestStartTime: The time the request was initialized. Defaults to `0.0`. + /// - parameter initialResponseTime: The time the first bytes were received from or sent to the server. + /// Defaults to `0.0`. + /// - parameter requestCompletedTime: The time when the request was completed. Defaults to `0.0`. + /// - parameter serializationCompletedTime: The time when the response serialization was completed. Defaults + /// to `0.0`. + /// + /// - returns: The new `Timeline` instance. + public init( + requestStartTime: CFAbsoluteTime = 0.0, + initialResponseTime: CFAbsoluteTime = 0.0, + requestCompletedTime: CFAbsoluteTime = 0.0, + serializationCompletedTime: CFAbsoluteTime = 0.0) + { + self.requestStartTime = requestStartTime + self.initialResponseTime = initialResponseTime + self.requestCompletedTime = requestCompletedTime + self.serializationCompletedTime = serializationCompletedTime + + self.latency = initialResponseTime - requestStartTime + self.requestDuration = requestCompletedTime - requestStartTime + self.serializationDuration = serializationCompletedTime - requestCompletedTime + self.totalDuration = serializationCompletedTime - requestStartTime + } +} + +// MARK: - CustomStringConvertible + +extension Timeline: CustomStringConvertible { + /// The textual representation used when written to an output stream, which includes the latency, the request + /// duration and the total duration. + public var description: String { + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} + +// MARK: - CustomDebugStringConvertible + +extension Timeline: CustomDebugStringConvertible { + /// The textual representation used when written to an output stream, which includes the request start time, the + /// initial response time, the request completed time, the serialization completed time, the latency, the request + /// duration and the total duration. + public var debugDescription: String { + let requestStartTime = String(format: "%.3f", self.requestStartTime) + let initialResponseTime = String(format: "%.3f", self.initialResponseTime) + let requestCompletedTime = String(format: "%.3f", self.requestCompletedTime) + let serializationCompletedTime = String(format: "%.3f", self.serializationCompletedTime) + let latency = String(format: "%.3f", self.latency) + let requestDuration = String(format: "%.3f", self.requestDuration) + let serializationDuration = String(format: "%.3f", self.serializationDuration) + let totalDuration = String(format: "%.3f", self.totalDuration) + + // NOTE: Had to move to string concatenation due to memory leak filed as rdar://26761490. Once memory leak is + // fixed, we should move back to string interpolation by reverting commit 7d4a43b1. + let timings = [ + "\"Request Start Time\": " + requestStartTime, + "\"Initial Response Time\": " + initialResponseTime, + "\"Request Completed Time\": " + requestCompletedTime, + "\"Serialization Completed Time\": " + serializationCompletedTime, + "\"Latency\": " + latency + " secs", + "\"Request Duration\": " + requestDuration + " secs", + "\"Serialization Duration\": " + serializationDuration + " secs", + "\"Total Duration\": " + totalDuration + " secs" + ] + + return "Timeline: { " + timings.joined(separator: ", ") + " }" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift new file mode 100644 index 000000000000..59e0bbb2b0e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Alamofire/Source/Validation.swift @@ -0,0 +1,321 @@ +// +// Validation.swift +// +// Copyright (c) 2014 Alamofire Software Foundation (http://alamofire.org/) +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. +// + +import Foundation + +extension Request { + + // MARK: Helper Types + + fileprivate typealias ErrorReason = AFError.ResponseValidationFailureReason + + /// Used to represent whether validation was successful or encountered an error resulting in a failure. + /// + /// - success: The validation was successful. + /// - failure: The validation failed encountering the provided error. + public enum ValidationResult { + case success + case failure(Error) + } + + fileprivate struct MIMEType { + let type: String + let subtype: String + + var isWildcard: Bool { return type == "*" && subtype == "*" } + + init?(_ string: String) { + let components: [String] = { + let stripped = string.trimmingCharacters(in: .whitespacesAndNewlines) + + #if swift(>=3.2) + let split = stripped[..<(stripped.range(of: ";")?.lowerBound ?? stripped.endIndex)] + #else + let split = stripped.substring(to: stripped.range(of: ";")?.lowerBound ?? stripped.endIndex) + #endif + + return split.components(separatedBy: "/") + }() + + if let type = components.first, let subtype = components.last { + self.type = type + self.subtype = subtype + } else { + return nil + } + } + + func matches(_ mime: MIMEType) -> Bool { + switch (type, subtype) { + case (mime.type, mime.subtype), (mime.type, "*"), ("*", mime.subtype), ("*", "*"): + return true + default: + return false + } + } + } + + // MARK: Properties + + fileprivate var acceptableStatusCodes: [Int] { return Array(200..<300) } + + fileprivate var acceptableContentTypes: [String] { + if let accept = request?.value(forHTTPHeaderField: "Accept") { + return accept.components(separatedBy: ",") + } + + return ["*/*"] + } + + // MARK: Status Code + + fileprivate func validate( + statusCode acceptableStatusCodes: S, + response: HTTPURLResponse) + -> ValidationResult + where S.Iterator.Element == Int + { + if acceptableStatusCodes.contains(response.statusCode) { + return .success + } else { + let reason: ErrorReason = .unacceptableStatusCode(code: response.statusCode) + return .failure(AFError.responseValidationFailed(reason: reason)) + } + } + + // MARK: Content Type + + fileprivate func validate( + contentType acceptableContentTypes: S, + response: HTTPURLResponse, + data: Data?) + -> ValidationResult + where S.Iterator.Element == String + { + guard let data = data, data.count > 0 else { return .success } + + guard + let responseContentType = response.mimeType, + let responseMIMEType = MIMEType(responseContentType) + else { + for contentType in acceptableContentTypes { + if let mimeType = MIMEType(contentType), mimeType.isWildcard { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .missingContentType(acceptableContentTypes: Array(acceptableContentTypes)) + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } + + for contentType in acceptableContentTypes { + if let acceptableMIMEType = MIMEType(contentType), acceptableMIMEType.matches(responseMIMEType) { + return .success + } + } + + let error: AFError = { + let reason: ErrorReason = .unacceptableContentType( + acceptableContentTypes: Array(acceptableContentTypes), + responseContentType: responseContentType + ) + + return AFError.responseValidationFailed(reason: reason) + }() + + return .failure(error) + } +} + +// MARK: - + +extension DataRequest { + /// A closure used to validate a request that takes a URL request, a URL response and data, and returns whether the + /// request was valid. + public typealias Validation = (URLRequest?, HTTPURLResponse, Data?) -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(self.request, response, self.delegate.data) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, data in + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + let contentTypes = { [unowned self] in + self.acceptableContentTypes + } + return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes()) + } +} + +// MARK: - + +extension DownloadRequest { + /// A closure used to validate a request that takes a URL request, a URL response, a temporary URL and a + /// destination URL, and returns whether the request was valid. + public typealias Validation = ( + _ request: URLRequest?, + _ response: HTTPURLResponse, + _ temporaryURL: URL?, + _ destinationURL: URL?) + -> ValidationResult + + /// Validates the request, using the specified closure. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter validation: A closure to validate the request. + /// + /// - returns: The request. + @discardableResult + public func validate(_ validation: @escaping Validation) -> Self { + let validationExecution: () -> Void = { [unowned self] in + let request = self.request + let temporaryURL = self.downloadDelegate.temporaryURL + let destinationURL = self.downloadDelegate.destinationURL + + if + let response = self.response, + self.delegate.error == nil, + case let .failure(error) = validation(request, response, temporaryURL, destinationURL) + { + self.delegate.error = error + } + } + + validations.append(validationExecution) + + return self + } + + /// Validates that the response has a status code in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter range: The range of acceptable status codes. + /// + /// - returns: The request. + @discardableResult + public func validate(statusCode acceptableStatusCodes: S) -> Self where S.Iterator.Element == Int { + return validate { [unowned self] _, response, _, _ in + return self.validate(statusCode: acceptableStatusCodes, response: response) + } + } + + /// Validates that the response has a content type in the specified sequence. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - parameter contentType: The acceptable content types, which may specify wildcard types and/or subtypes. + /// + /// - returns: The request. + @discardableResult + public func validate(contentType acceptableContentTypes: S) -> Self where S.Iterator.Element == String { + return validate { [unowned self] _, response, _, _ in + let fileURL = self.downloadDelegate.fileURL + + guard let validFileURL = fileURL else { + return .failure(AFError.responseValidationFailed(reason: .dataFileNil)) + } + + do { + let data = try Data(contentsOf: validFileURL) + return self.validate(contentType: acceptableContentTypes, response: response, data: data) + } catch { + return .failure(AFError.responseValidationFailed(reason: .dataFileReadFailed(at: validFileURL))) + } + } + } + + /// Validates that the response has a status code in the default acceptable range of 200...299, and that the content + /// type matches any specified in the Accept HTTP header field. + /// + /// If validation fails, subsequent calls to response handlers will have an associated error. + /// + /// - returns: The request. + @discardableResult + public func validate() -> Self { + let contentTypes = { [unowned self] in + self.acceptableContentTypes + } + return validate(statusCode: acceptableStatusCodes).validate(contentType: contentTypes()) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json new file mode 100644 index 000000000000..2d9c418f9086 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Local Podspecs/PetstoreClient.podspec.json @@ -0,0 +1,26 @@ +{ + "name": "PetstoreClient", + "platforms": { + "ios": "9.0", + "osx": "10.11", + "tvos": "9.0" + }, + "version": "1.0.0", + "source": { + "git": "git@github.com:OpenAPITools/openapi-generator.git", + "tag": "v1.0.0" + }, + "authors": "", + "license": "Proprietary", + "homepage": "https://github.com/openapitools/openapi-generator", + "summary": "PetstoreClient", + "source_files": "PetstoreClient/Classes/**/*.swift", + "dependencies": { + "RxSwift": [ + "~> 4.0" + ], + "Alamofire": [ + "~> 4.9.0" + ] + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Manifest.lock b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Manifest.lock new file mode 100644 index 000000000000..83d09b4381da --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Manifest.lock @@ -0,0 +1,27 @@ +PODS: + - Alamofire (4.9.0) + - PetstoreClient (1.0.0): + - Alamofire (~> 4.9.0) + - RxSwift (~> 4.0) + - RxSwift (4.5.0) + +DEPENDENCIES: + - PetstoreClient (from `../`) + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - RxSwift + +EXTERNAL SOURCES: + PetstoreClient: + :path: "../" + +SPEC CHECKSUMS: + Alamofire: afc3e7c6db61476cb45cdd23fed06bad03bbc321 + PetstoreClient: 432f1430feb6f893260645040aa967411fea06d9 + RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575 + +PODFILE CHECKSUM: cedb3058b02f4776d7c31f6d92ae2f674fdf424d + +COCOAPODS: 1.6.1 diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs.swift new file mode 100644 index 000000000000..bb2f200ba3af --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs.swift @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +open class PetstoreClientAPI { + open static var basePath = "http://petstore.swagger.io:80/v2" + open static var credential: URLCredential? + open static var customHeaders: [String: String] = [:] + open static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String: String] + public let parameters: [String: Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> Void)? + + required public init(method: String, URLString: String, parameters: [String: Any]?, isBody: Bool, headers: [String: String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders(PetstoreClientAPI.customHeaders) + } + + open func addHeaders(_ aHeaders: [String: String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = PetstoreClientAPI.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift new file mode 100644 index 000000000000..2fadeb51ceb1 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/AnotherFakeAPI.swift @@ -0,0 +1,67 @@ +// +// AnotherFakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + +open class AnotherFakeAPI { + /** + To test special tags + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testSpecialTags(client: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + testSpecialTagsWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test special tags + + - parameter client: (body) client model + - returns: Observable + */ + open class func testSpecialTags(client: Client) -> Observable { + return Observable.create { observer -> Disposable in + testSpecialTags(client: client) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test special tags + - PATCH /another-fake/dummy + - To test special tags + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testSpecialTagsWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/another-fake/dummy" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift new file mode 100644 index 000000000000..404824a2c73a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/FakeAPI.swift @@ -0,0 +1,712 @@ +// +// FakeAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + +open class FakeAPI { + /** + + - parameter body: (body) Input boolean as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil, completion: @escaping ((_ data: Bool?, _ error: Error?) -> Void)) { + fakeOuterBooleanSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input boolean as post body (optional) + - returns: Observable + */ + open class func fakeOuterBooleanSerialize(body: Bool? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterBooleanSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/boolean + - Test serialization of outer boolean types + - examples: [{contentType=*/*, example=null}] + - parameter body: (body) Input boolean as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterBooleanSerializeWithRequestBuilder(body: Bool? = nil) -> RequestBuilder { + let path = "/fake/outer/boolean" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil, completion: @escaping ((_ data: OuterComposite?, _ error: Error?) -> Void)) { + fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: outerComposite).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: Observable + */ + open class func fakeOuterCompositeSerialize(outerComposite: OuterComposite? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterCompositeSerialize(outerComposite: outerComposite) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/composite + - Test serialization of object with outer number type + - examples: [{contentType=*/*, example= { }}] + - parameter outerComposite: (body) Input composite as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterCompositeSerializeWithRequestBuilder(outerComposite: OuterComposite? = nil) -> RequestBuilder { + let path = "/fake/outer/composite" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: outerComposite) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input number as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterNumberSerialize(body: Double? = nil, completion: @escaping ((_ data: Double?, _ error: Error?) -> Void)) { + fakeOuterNumberSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input number as post body (optional) + - returns: Observable + */ + open class func fakeOuterNumberSerialize(body: Double? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterNumberSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/number + - Test serialization of outer number types + - examples: [{contentType=*/*, example=null}] + - parameter body: (body) Input number as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterNumberSerializeWithRequestBuilder(body: Double? = nil) -> RequestBuilder { + let path = "/fake/outer/number" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter body: (body) Input string as post body (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func fakeOuterStringSerialize(body: String? = nil, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + fakeOuterStringSerializeWithRequestBuilder(body: body).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + + - parameter body: (body) Input string as post body (optional) + - returns: Observable + */ + open class func fakeOuterStringSerialize(body: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + fakeOuterStringSerialize(body: body) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - POST /fake/outer/string + - Test serialization of outer string types + - examples: [{contentType=*/*, example=null}] + - parameter body: (body) Input string as post body (optional) + - returns: RequestBuilder + */ + open class func fakeOuterStringSerializeWithRequestBuilder(body: String? = nil) -> RequestBuilder { + let path = "/fake/outer/string" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: body) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + + - parameter query: (query) + - parameter user: (body) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testBodyWithQueryParams(query: String, user: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testBodyWithQueryParamsWithRequestBuilder(query: query, user: user).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + + - parameter query: (query) + - parameter user: (body) + - returns: Observable + */ + open class func testBodyWithQueryParams(query: String, user: User) -> Observable { + return Observable.create { observer -> Disposable in + testBodyWithQueryParams(query: query, user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + - PUT /fake/body-with-query-params + - parameter query: (query) + - parameter user: (body) + - returns: RequestBuilder + */ + open class func testBodyWithQueryParamsWithRequestBuilder(query: String, user: User) -> RequestBuilder { + let path = "/fake/body-with-query-params" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "query": query + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClientModel(client: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + testClientModelWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test \"client\" model + + - parameter client: (body) client model + - returns: Observable + */ + open class func testClientModel(client: Client) -> Observable { + return Observable.create { observer -> Disposable in + testClientModel(client: client) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test \"client\" model + - PATCH /fake + - To test \"client\" model + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClientModelWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEndpointParametersWithRequestBuilder(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: Observable + */ + open class func testEndpointParameters(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + testEndpointParameters(number: number, double: double, patternWithoutDelimiter: patternWithoutDelimiter, byte: byte, integer: integer, int32: int32, int64: int64, float: float, string: string, binary: binary, date: date, dateTime: dateTime, password: password, callback: callback) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - POST /fake + - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + - BASIC: + - type: http + - name: http_basic_test + - parameter number: (form) None + - parameter double: (form) None + - parameter patternWithoutDelimiter: (form) None + - parameter byte: (form) None + - parameter integer: (form) None (optional) + - parameter int32: (form) None (optional) + - parameter int64: (form) None (optional) + - parameter float: (form) None (optional) + - parameter string: (form) None (optional) + - parameter binary: (form) None (optional) + - parameter date: (form) None (optional) + - parameter dateTime: (form) None (optional) + - parameter password: (form) None (optional) + - parameter callback: (form) None (optional) + - returns: RequestBuilder + */ + open class func testEndpointParametersWithRequestBuilder(number: Double, double: Double, patternWithoutDelimiter: String, byte: Data, integer: Int? = nil, int32: Int? = nil, int64: Int64? = nil, float: Float? = nil, string: String? = nil, binary: URL? = nil, date: Date? = nil, dateTime: Date? = nil, password: String? = nil, callback: String? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "integer": integer?.encodeToJSON(), + "int32": int32?.encodeToJSON(), + "int64": int64?.encodeToJSON(), + "number": number, + "float": float, + "double": double, + "string": string, + "pattern_without_delimiter": patternWithoutDelimiter, + "byte": byte, + "binary": binary, + "date": date?.encodeToJSON(), + "dateTime": dateTime?.encodeToJSON(), + "password": password, + "callback": callback + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + * enum for parameter enumHeaderStringArray + */ + public enum EnumHeaderStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumHeaderString + */ + public enum EnumHeaderString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryStringArray + */ + public enum EnumQueryStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumQueryString + */ + public enum EnumQueryString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + * enum for parameter enumQueryInteger + */ + public enum EnumQueryInteger_testEnumParameters: Int { + case _1 = 1 + case number2 = -2 + } + + /** + * enum for parameter enumQueryDouble + */ + public enum EnumQueryDouble_testEnumParameters: Double { + case _11 = 1.1 + case number12 = -1.2 + } + + /** + * enum for parameter enumFormStringArray + */ + public enum EnumFormStringArray_testEnumParameters: String { + case greaterThan = ">" + case dollar = "$" + } + + /** + * enum for parameter enumFormString + */ + public enum EnumFormString_testEnumParameters: String { + case abc = "_abc" + case efg = "-efg" + case xyz = "(xyz)" + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testEnumParametersWithRequestBuilder(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + To test enum parameters + + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: Observable + */ + open class func testEnumParameters(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> Observable { + return Observable.create { observer -> Disposable in + testEnumParameters(enumHeaderStringArray: enumHeaderStringArray, enumHeaderString: enumHeaderString, enumQueryStringArray: enumQueryStringArray, enumQueryString: enumQueryString, enumQueryInteger: enumQueryInteger, enumQueryDouble: enumQueryDouble, enumFormStringArray: enumFormStringArray, enumFormString: enumFormString) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test enum parameters + - GET /fake + - To test enum parameters + - parameter enumHeaderStringArray: (header) Header parameter enum test (string array) (optional) + - parameter enumHeaderString: (header) Header parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryStringArray: (query) Query parameter enum test (string array) (optional) + - parameter enumQueryString: (query) Query parameter enum test (string) (optional, default to "-efg") + - parameter enumQueryInteger: (query) Query parameter enum test (double) (optional) + - parameter enumQueryDouble: (query) Query parameter enum test (double) (optional) + - parameter enumFormStringArray: (form) Form parameter enum test (string array) (optional, default to "$") + - parameter enumFormString: (form) Form parameter enum test (string) (optional, default to "-efg") + - returns: RequestBuilder + */ + open class func testEnumParametersWithRequestBuilder(enumHeaderStringArray: [String]? = nil, enumHeaderString: EnumHeaderString_testEnumParameters? = nil, enumQueryStringArray: [String]? = nil, enumQueryString: EnumQueryString_testEnumParameters? = nil, enumQueryInteger: EnumQueryInteger_testEnumParameters? = nil, enumQueryDouble: EnumQueryDouble_testEnumParameters? = nil, enumFormStringArray: [String]? = nil, enumFormString: EnumFormString_testEnumParameters? = nil) -> RequestBuilder { + let path = "/fake" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "enum_form_string_array": enumFormStringArray, + "enum_form_string": enumFormString?.rawValue + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "enum_query_string_array": enumQueryStringArray, + "enum_query_string": enumQueryString?.rawValue, + "enum_query_integer": enumQueryInteger?.rawValue, + "enum_query_double": enumQueryDouble?.rawValue + ]) + let nillableHeaders: [String: Any?] = [ + "enum_header_string_array": enumHeaderStringArray, + "enum_header_string": enumHeaderString?.rawValue + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testInlineAdditionalProperties(requestBody: [String: String], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testInlineAdditionalPropertiesWithRequestBuilder(requestBody: requestBody).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + test inline additionalProperties + + - parameter requestBody: (body) request body + - returns: Observable + */ + open class func testInlineAdditionalProperties(requestBody: [String: String]) -> Observable { + return Observable.create { observer -> Disposable in + testInlineAdditionalProperties(requestBody: requestBody) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + test inline additionalProperties + - POST /fake/inline-additionalProperties + - parameter requestBody: (body) request body + - returns: RequestBuilder + */ + open class func testInlineAdditionalPropertiesWithRequestBuilder(requestBody: [String: String]) -> RequestBuilder { + let path = "/fake/inline-additionalProperties" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: requestBody) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testJsonFormData(param: String, param2: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + testJsonFormDataWithRequestBuilder(param: param, param2: param2).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + test json serialization of form data + + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: Observable + */ + open class func testJsonFormData(param: String, param2: String) -> Observable { + return Observable.create { observer -> Disposable in + testJsonFormData(param: param, param2: param2) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + test json serialization of form data + - GET /fake/jsonFormData + - parameter param: (form) field1 + - parameter param2: (form) field2 + - returns: RequestBuilder + */ + open class func testJsonFormDataWithRequestBuilder(param: String, param2: String) -> RequestBuilder { + let path = "/fake/jsonFormData" + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "param": param, + "param2": param2 + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift new file mode 100644 index 000000000000..b14e41a990cc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/FakeClassnameTags123API.swift @@ -0,0 +1,70 @@ +// +// FakeClassnameTags123API.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + +open class FakeClassnameTags123API { + /** + To test class name in snake case + + - parameter client: (body) client model + - parameter completion: completion handler to receive the data and the error objects + */ + open class func testClassname(client: Client, completion: @escaping ((_ data: Client?, _ error: Error?) -> Void)) { + testClassnameWithRequestBuilder(client: client).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + To test class name in snake case + + - parameter client: (body) client model + - returns: Observable + */ + open class func testClassname(client: Client) -> Observable { + return Observable.create { observer -> Disposable in + testClassname(client: client) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + To test class name in snake case + - PATCH /fake_classname_test + - To test class name in snake case + - API Key: + - type: apiKey api_key_query (QUERY) + - name: api_key_query + - examples: [{contentType=application/json, example={ + "client" : "client" +}}] + - parameter client: (body) client model + - returns: RequestBuilder + */ + open class func testClassnameWithRequestBuilder(client: Client) -> RequestBuilder { + let path = "/fake_classname_test" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: client) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "PATCH", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift new file mode 100644 index 000000000000..5bfe5c64b2eb --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/PetAPI.swift @@ -0,0 +1,597 @@ +// +// PetAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + +open class PetAPI { + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func addPet(pet: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + addPetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Add a new pet to the store + + - parameter pet: (body) Pet object that needs to be added to the store + - returns: Observable + */ + open class func addPet(pet: Pet) -> Observable { + return Observable.create { observer -> Disposable in + addPet(pet: pet) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Add a new pet to the store + - POST /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func addPetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deletePet(petId: Int64, apiKey: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deletePetWithRequestBuilder(petId: petId, apiKey: apiKey).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Deletes a pet + + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: Observable + */ + open class func deletePet(petId: Int64, apiKey: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + deletePet(petId: petId, apiKey: apiKey) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Deletes a pet + - DELETE /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) Pet id to delete + - parameter apiKey: (header) (optional) + - returns: RequestBuilder + */ + open class func deletePetWithRequestBuilder(petId: Int64, apiKey: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + let nillableHeaders: [String: Any?] = [ + "api_key": apiKey + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false, headers: headerParameters) + } + + /** + * enum for parameter status + */ + public enum Status_findPetsByStatus: String { + case available = "available" + case pending = "pending" + case sold = "sold" + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByStatus(status: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + findPetsByStatusWithRequestBuilder(status: status).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Finds Pets by status + + - parameter status: (query) Status values that need to be considered for filter + - returns: Observable<[Pet]> + */ + open class func findPetsByStatus(status: [String]) -> Observable<[Pet]> { + return Observable.create { observer -> Disposable in + findPetsByStatus(status: status) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Finds Pets by status + - GET /pet/findByStatus + - Multiple status values can be provided with comma separated strings + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{contentType=application/json, example={ + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - parameter status: (query) Status values that need to be considered for filter + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByStatusWithRequestBuilder(status: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByStatus" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "status": status + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - parameter completion: completion handler to receive the data and the error objects + */ + open class func findPetsByTags(tags: [String], completion: @escaping ((_ data: [Pet]?, _ error: Error?) -> Void)) { + findPetsByTagsWithRequestBuilder(tags: tags).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Finds Pets by tags + + - parameter tags: (query) Tags to filter by + - returns: Observable<[Pet]> + */ + open class func findPetsByTags(tags: [String]) -> Observable<[Pet]> { + return Observable.create { observer -> Disposable in + findPetsByTags(tags: tags) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Finds Pets by tags + - GET /pet/findByTags + - Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{contentType=application/json, example={ + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - parameter tags: (query) Tags to filter by + - returns: RequestBuilder<[Pet]> + */ + open class func findPetsByTagsWithRequestBuilder(tags: [String]) -> RequestBuilder<[Pet]> { + let path = "/pet/findByTags" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "tags": tags + ]) + + let requestBuilder: RequestBuilder<[Pet]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getPetById(petId: Int64, completion: @escaping ((_ data: Pet?, _ error: Error?) -> Void)) { + getPetByIdWithRequestBuilder(petId: petId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Find pet by ID + + - parameter petId: (path) ID of pet to return + - returns: Observable + */ + open class func getPetById(petId: Int64) -> Observable { + return Observable.create { observer -> Disposable in + getPetById(petId: petId) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Find pet by ID + - GET /pet/{petId} + - Returns a single pet + - API Key: + - type: apiKey api_key + - name: api_key + - examples: [{contentType=application/json, example={ + "photoUrls" : [ "photoUrls", "photoUrls" ], + "name" : "doggie", + "id" : 0, + "category" : { + "name" : "name", + "id" : 6 + }, + "tags" : [ { + "name" : "name", + "id" : 1 + }, { + "name" : "name", + "id" : 1 + } ], + "status" : "available" +}}, {contentType=application/xml, example= + 123456789 + doggie + + aeiou + + + + aeiou +}] + - parameter petId: (path) ID of pet to return + - returns: RequestBuilder + */ + open class func getPetByIdWithRequestBuilder(petId: Int64) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePet(pet: Pet, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithRequestBuilder(pet: pet).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Update an existing pet + + - parameter pet: (body) Pet object that needs to be added to the store + - returns: Observable + */ + open class func updatePet(pet: Pet) -> Observable { + return Observable.create { observer -> Disposable in + updatePet(pet: pet) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Update an existing pet + - PUT /pet + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter pet: (body) Pet object that needs to be added to the store + - returns: RequestBuilder + */ + open class func updatePetWithRequestBuilder(pet: Pet) -> RequestBuilder { + let path = "/pet" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: pet) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updatePetWithFormWithRequestBuilder(petId: petId, name: name, status: status).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Updates a pet in the store with form data + + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: Observable + */ + open class func updatePetWithForm(petId: Int64, name: String? = nil, status: String? = nil) -> Observable { + return Observable.create { observer -> Disposable in + updatePetWithForm(petId: petId, name: name, status: status) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Updates a pet in the store with form data + - POST /pet/{petId} + - OAuth: + - type: oauth2 + - name: petstore_auth + - parameter petId: (path) ID of pet that needs to be updated + - parameter name: (form) Updated name of the pet (optional) + - parameter status: (form) Updated status of the pet (optional) + - returns: RequestBuilder + */ + open class func updatePetWithFormWithRequestBuilder(petId: Int64, name: String? = nil, status: String? = nil) -> RequestBuilder { + var path = "/pet/{petId}" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "name": name, + "status": status + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - parameter completion: completion handler to receive the data and the error objects + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil, completion: @escaping ((_ data: ApiResponse?, _ error: Error?) -> Void)) { + uploadFileWithRequestBuilder(petId: petId, additionalMetadata: additionalMetadata, file: file).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + uploads an image + + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: Observable + */ + open class func uploadFile(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> Observable { + return Observable.create { observer -> Disposable in + uploadFile(petId: petId, additionalMetadata: additionalMetadata, file: file) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + uploads an image + - POST /pet/{petId}/uploadImage + - OAuth: + - type: oauth2 + - name: petstore_auth + - examples: [{contentType=application/json, example={ + "code" : 0, + "type" : "type", + "message" : "message" +}}] + - parameter petId: (path) ID of pet to update + - parameter additionalMetadata: (form) Additional data to pass to server (optional) + - parameter file: (form) file to upload (optional) + - returns: RequestBuilder + */ + open class func uploadFileWithRequestBuilder(petId: Int64, additionalMetadata: String? = nil, file: URL? = nil) -> RequestBuilder { + var path = "/pet/{petId}/uploadImage" + let petIdPreEscape = "\(petId)" + let petIdPostEscape = petIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{petId}", with: petIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let formParams: [String: Any?] = [ + "additionalMetadata": additionalMetadata, + "file": file + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift new file mode 100644 index 000000000000..4fb14bc42d0f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/StoreAPI.swift @@ -0,0 +1,256 @@ +// +// StoreAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + +open class StoreAPI { + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteOrder(orderId: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteOrderWithRequestBuilder(orderId: orderId).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Delete purchase order by ID + + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: Observable + */ + open class func deleteOrder(orderId: String) -> Observable { + return Observable.create { observer -> Disposable in + deleteOrder(orderId: orderId) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Delete purchase order by ID + - DELETE /store/order/{order_id} + - For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + - parameter orderId: (path) ID of the order that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteOrderWithRequestBuilder(orderId: String) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Returns pet inventories by status + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getInventory(completion: @escaping ((_ data: [String: Int]?, _ error: Error?) -> Void)) { + getInventoryWithRequestBuilder().execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Returns pet inventories by status + + - returns: Observable<[String:Int]> + */ + open class func getInventory() -> Observable<[String: Int]> { + return Observable.create { observer -> Disposable in + getInventory { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Returns pet inventories by status + - GET /store/inventory + - Returns a map of status codes to quantities + - API Key: + - type: apiKey api_key + - name: api_key + - returns: RequestBuilder<[String:Int]> + */ + open class func getInventoryWithRequestBuilder() -> RequestBuilder<[String: Int]> { + let path = "/store/inventory" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder<[String: Int]>.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getOrderById(orderId: Int64, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + getOrderByIdWithRequestBuilder(orderId: orderId).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Find purchase order by ID + + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: Observable + */ + open class func getOrderById(orderId: Int64) -> Observable { + return Observable.create { observer -> Disposable in + getOrderById(orderId: orderId) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Find purchase order by ID + - GET /store/order/{order_id} + - For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + - examples: [{contentType=application/json, example={ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter orderId: (path) ID of pet that needs to be fetched + - returns: RequestBuilder + */ + open class func getOrderByIdWithRequestBuilder(orderId: Int64) -> RequestBuilder { + var path = "/store/order/{order_id}" + let orderIdPreEscape = "\(orderId)" + let orderIdPostEscape = orderIdPreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{order_id}", with: orderIdPostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - parameter completion: completion handler to receive the data and the error objects + */ + open class func placeOrder(order: Order, completion: @escaping ((_ data: Order?, _ error: Error?) -> Void)) { + placeOrderWithRequestBuilder(order: order).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Place an order for a pet + + - parameter order: (body) order placed for purchasing the pet + - returns: Observable + */ + open class func placeOrder(order: Order) -> Observable { + return Observable.create { observer -> Disposable in + placeOrder(order: order) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Place an order for a pet + - POST /store/order + - examples: [{contentType=application/json, example={ + "petId" : 6, + "quantity" : 1, + "id" : 0, + "shipDate" : "2000-01-23T04:56:07.000+00:00", + "complete" : false, + "status" : "placed" +}}, {contentType=application/xml, example= + 123456789 + 123456789 + 123 + 2000-01-23T04:56:07.000Z + aeiou + true +}] + - parameter order: (body) order placed for purchasing the pet + - returns: RequestBuilder + */ + open class func placeOrderWithRequestBuilder(order: Order) -> RequestBuilder { + let path = "/store/order" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: order) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift new file mode 100644 index 000000000000..9f5e670bfc2b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/APIs/UserAPI.swift @@ -0,0 +1,476 @@ +// +// UserAPI.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation +import Alamofire +import RxSwift + +open class UserAPI { + /** + Create user + + - parameter user: (body) Created user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUser(user: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUserWithRequestBuilder(user: user).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Create user + + - parameter user: (body) Created user object + - returns: Observable + */ + open class func createUser(user: User) -> Observable { + return Observable.create { observer -> Disposable in + createUser(user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Create user + - POST /user + - This can only be done by the logged in user. + - parameter user: (body) Created user object + - returns: RequestBuilder + */ + open class func createUserWithRequestBuilder(user: User) -> RequestBuilder { + let path = "/user" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithArrayInput(user: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithArrayInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - returns: Observable + */ + open class func createUsersWithArrayInput(user: [User]) -> Observable { + return Observable.create { observer -> Disposable in + createUsersWithArrayInput(user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Creates list of users with given input array + - POST /user/createWithArray + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithArrayInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithArray" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func createUsersWithListInput(user: [User], completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + createUsersWithListInputWithRequestBuilder(user: user).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Creates list of users with given input array + + - parameter user: (body) List of user object + - returns: Observable + */ + open class func createUsersWithListInput(user: [User]) -> Observable { + return Observable.create { observer -> Disposable in + createUsersWithListInput(user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Creates list of users with given input array + - POST /user/createWithList + - parameter user: (body) List of user object + - returns: RequestBuilder + */ + open class func createUsersWithListInputWithRequestBuilder(user: [User]) -> RequestBuilder { + let path = "/user/createWithList" + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "POST", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - parameter completion: completion handler to receive the data and the error objects + */ + open class func deleteUser(username: String, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + deleteUserWithRequestBuilder(username: username).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Delete user + + - parameter username: (path) The name that needs to be deleted + - returns: Observable + */ + open class func deleteUser(username: String) -> Observable { + return Observable.create { observer -> Disposable in + deleteUser(username: username) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Delete user + - DELETE /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) The name that needs to be deleted + - returns: RequestBuilder + */ + open class func deleteUserWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "DELETE", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - parameter completion: completion handler to receive the data and the error objects + */ + open class func getUserByName(username: String, completion: @escaping ((_ data: User?, _ error: Error?) -> Void)) { + getUserByNameWithRequestBuilder(username: username).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Get user by user name + + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: Observable + */ + open class func getUserByName(username: String) -> Observable { + return Observable.create { observer -> Disposable in + getUserByName(username: username) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Get user by user name + - GET /user/{username} + - examples: [{contentType=application/json, example={ + "firstName" : "firstName", + "lastName" : "lastName", + "password" : "password", + "userStatus" : 6, + "phone" : "phone", + "id" : 0, + "email" : "email", + "username" : "username" +}}, {contentType=application/xml, example= + 123456789 + aeiou + aeiou + aeiou + aeiou + aeiou + aeiou + 123 +}] + - parameter username: (path) The name that needs to be fetched. Use user1 for testing. + - returns: RequestBuilder + */ + open class func getUserByNameWithRequestBuilder(username: String) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - parameter completion: completion handler to receive the data and the error objects + */ + open class func loginUser(username: String, password: String, completion: @escaping ((_ data: String?, _ error: Error?) -> Void)) { + loginUserWithRequestBuilder(username: username, password: password).execute { (response, error) -> Void in + completion(response?.body, error) + } + } + + /** + Logs user into the system + + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: Observable + */ + open class func loginUser(username: String, password: String) -> Observable { + return Observable.create { observer -> Disposable in + loginUser(username: username, password: password) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Logs user into the system + - GET /user/login + - responseHeaders: [X-Rate-Limit(Int), X-Expires-After(Date)] + - parameter username: (query) The user name for login + - parameter password: (query) The password for login in clear text + - returns: RequestBuilder + */ + open class func loginUserWithRequestBuilder(username: String, password: String) -> RequestBuilder { + let path = "/user/login" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + "username": username, + "password": password + ]) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Logs out current logged in user session + + - parameter completion: completion handler to receive the data and the error objects + */ + open class func logoutUser(completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + logoutUserWithRequestBuilder().execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Logs out current logged in user session + + - returns: Observable + */ + open class func logoutUser() -> Observable { + return Observable.create { observer -> Disposable in + logoutUser { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Logs out current logged in user session + - GET /user/logout + - returns: RequestBuilder + */ + open class func logoutUserWithRequestBuilder() -> RequestBuilder { + let path = "/user/logout" + let URLString = PetstoreClientAPI.basePath + path + let parameters: [String: Any]? = nil + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "GET", URLString: (url?.string ?? URLString), parameters: parameters, isBody: false) + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - parameter completion: completion handler to receive the data and the error objects + */ + open class func updateUser(username: String, user: User, completion: @escaping ((_ data: Void?, _ error: Error?) -> Void)) { + updateUserWithRequestBuilder(username: username, user: user).execute { (_, error) -> Void in + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + } + } + + /** + Updated user + + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: Observable + */ + open class func updateUser(username: String, user: User) -> Observable { + return Observable.create { observer -> Disposable in + updateUser(username: username, user: user) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } + + /** + Updated user + - PUT /user/{username} + - This can only be done by the logged in user. + - parameter username: (path) name that need to be deleted + - parameter user: (body) Updated user object + - returns: RequestBuilder + */ + open class func updateUserWithRequestBuilder(username: String, user: User) -> RequestBuilder { + var path = "/user/{username}" + let usernamePreEscape = "\(username)" + let usernamePostEscape = usernamePreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{username}", with: usernamePostEscape, options: .literal, range: nil) + let URLString = PetstoreClientAPI.basePath + path + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: user) + + let url = URLComponents(string: URLString) + + let requestBuilder: RequestBuilder.Type = PetstoreClientAPI.requestBuilderFactory.getNonDecodableBuilder() + + return requestBuilder.init(method: "PUT", URLString: (url?.string ?? URLString), parameters: parameters, isBody: true) + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift new file mode 100644 index 000000000000..52c1d3bd2be1 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/AdditionalPropertiesClass.swift @@ -0,0 +1,25 @@ +// +// AdditionalPropertiesClass.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct AdditionalPropertiesClass: Codable { + + public var mapProperty: [String: String]? + public var mapOfMapProperty: [String: [String: String]]? + + public init(mapProperty: [String: String]?, mapOfMapProperty: [String: [String: String]]?) { + self.mapProperty = mapProperty + self.mapOfMapProperty = mapOfMapProperty + } + + public enum CodingKeys: String, CodingKey { + case mapProperty = "map_property" + case mapOfMapProperty = "map_of_map_property" + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Animal.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/AnimalFarm.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ApiResponse.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfArrayOfNumberOnly.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ArrayOfNumberOnly.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ArrayTest.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Capitalization.swift diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift new file mode 100644 index 000000000000..7ab887f3113f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Cat.swift @@ -0,0 +1,22 @@ +// +// Cat.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct Cat: Codable { + + public var className: String + public var color: String? = "red" + public var declawed: Bool? + + public init(className: String, color: String?, declawed: Bool?) { + self.className = className + self.color = color + self.declawed = declawed + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Category.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Category.swift new file mode 100644 index 000000000000..399a062cfa9f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Category.swift @@ -0,0 +1,25 @@ +// +// Category.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct Category: Codable { + + public var _id: Int64? + public var name: String? + + public init(_id: Int64?, name: String?) { + self._id = _id + self.name = name + } + + public enum CodingKeys: String, CodingKey { + case _id = "id" + case name + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ClassModel.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Client.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Client.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Client.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Dog.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/EnumArrays.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/EnumClass.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/EnumTest.swift diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift new file mode 100644 index 000000000000..20bd6d103b3d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/FormatTest.swift @@ -0,0 +1,42 @@ +// +// FormatTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct FormatTest: Codable { + + public var integer: Int? + public var int32: Int? + public var int64: Int64? + public var number: Double + public var float: Float? + public var double: Double? + public var string: String? + public var byte: Data + public var binary: URL? + public var date: Date + public var dateTime: Date? + public var uuid: UUID? + public var password: String + + public init(integer: Int?, int32: Int?, int64: Int64?, number: Double, float: Float?, double: Double?, string: String?, byte: Data, binary: URL?, date: Date, dateTime: Date?, uuid: UUID?, password: String) { + self.integer = integer + self.int32 = int32 + self.int64 = int64 + self.number = number + self.float = float + self.double = double + self.string = string + self.byte = byte + self.binary = binary + self.date = date + self.dateTime = dateTime + self.uuid = uuid + self.password = password + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/HasOnlyReadOnly.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/List.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/List.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/List.swift diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift new file mode 100644 index 000000000000..2860f9078511 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/MapTest.swift @@ -0,0 +1,29 @@ +// +// MapTest.swift +// +// Generated by openapi-generator +// https://openapi-generator.tech +// + +import Foundation + +public struct MapTest: Codable { + + public enum MapOfEnumString: String, Codable { + case upper = "UPPER" + case lower = "lower" + } + public var mapMapOfString: [String: [String: String]]? + public var mapOfEnumString: [String: String]? + + public init(mapMapOfString: [String: [String: String]]?, mapOfEnumString: [String: String]?) { + self.mapMapOfString = mapMapOfString + self.mapOfEnumString = mapOfEnumString + } + + public enum CodingKeys: String, CodingKey { + case mapMapOfString = "map_map_of_string" + case mapOfEnumString = "map_of_enum_string" + } + +} diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/MixedPropertiesAndAdditionalPropertiesClass.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Model200Response.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Name.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Name.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Name.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/NumberOnly.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/OuterComposite.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/OuterEnum.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/ReadOnlyFirst.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Return.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/Return.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/Return.swift diff --git a/samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift similarity index 100% rename from samples/client/petstore/swift4/objcCompatible/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift rename to CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/PetstoreClient/Classes/OpenAPIs/Models/SpecialModelName.swift diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..32601008ce52 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/Pods.xcodeproj/project.pbxproj @@ -0,0 +1,2179 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 00B92B3A8271BE0D78B2C346A45054EB /* Configuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2C8922E4E1E3C67279458D892BC37AD /* Configuration.swift */; }; + 00CD0D028A7C7FAD19004F30BF905FFA /* Event.swift in Sources */ = {isa = PBXBuildFile; fileRef = 14D946B2CD75D612D3AE3F72880C7FF3 /* Event.swift */; }; + 00EA7C74AF31550D150A68EC1DB4885A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* Foundation.framework */; }; + 018C6F5369B9ECCE29BA2F43D6C12385 /* DogAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6DFB261890C61E9C5ED205C350432C6 /* DogAllOf.swift */; }; + 01955339496D9F45BD537BEB03B04280 /* Range.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46285A50499BCD564104AE4AD8489A48 /* Range.swift */; }; + 01BBC91167CEED10419EC29FB25A84B4 /* PetAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3C12C50651DC7C8FE70BC93359C255DF /* PetAPI.swift */; }; + 024712F363DB19CB17FD9F36B489D43F /* PriorityQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7C8CB70C6C6B09D4BB90057C9BA7EEC2 /* PriorityQueue.swift */; }; + 02D5452095EF961AABF5EC9484D6700F /* Alamofire.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 110A71E71814850BBCD440AF198317DF /* Alamofire.framework */; }; + 04BCDBAEB221E44EBC35B35966D5329C /* First.swift in Sources */ = {isa = PBXBuildFile; fileRef = B29AE35CD92E0CB3A64D2E581DAD2CB4 /* First.swift */; }; + 04C06CF0B6C5C73B4CD192D070F21671 /* CompositeDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 410ED99EC03614CF82F7E2CCD4E628AF /* CompositeDisposable.swift */; }; + 04E7491A1A273461D639A352FDF90064 /* SubjectType.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5A7024FF197192803FBC9F7CEFD9C87 /* SubjectType.swift */; }; + 059D92B7BBFBEC53E9A3B6E11C5C3B3A /* Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7FBBD15C7EDE32F75E84BF63C4A0093 /* Response.swift */; }; + 068FC2A8666D98716567362F2E0D6845 /* AsyncLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D44154CE37C1B66CDC3D69453887262 /* AsyncLock.swift */; }; + 06F02D2382D5018D765DB0F34C9C276D /* AnonymousDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8ED3568E09862ADC85A6FE650FEC665 /* AnonymousDisposable.swift */; }; + 0A084BBB077AB3863D1500B7E79B3FD4 /* Platform.Darwin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 80EBCAEF4DEEB18B34DC5033FF20ECA8 /* Platform.Darwin.swift */; }; + 0A39AF55285A3A4F7CBABB6D822FA4A3 /* Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = C745F77F676CBAE7E68106481E9DF4B9 /* Alamofire.swift */; }; + 0A426503BF8551A7F24118E4D3133404 /* Multicast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79A4D30F2478E26FEA80A716FA038512 /* Multicast.swift */; }; + 0AB631DF2E9BC76B8736C9EFF6191C0B /* Pods-SwaggerClientTests-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 0C0D4B80E4F230F6A106A0E94C6A733E /* RecursiveScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B68A320DEB52A0B2CF5A7DCD714E84D3 /* RecursiveScheduler.swift */; }; + 0C8B09DF05E2E41B7DF054A3514DB945 /* CombineLatest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 54212BBF40F065FC93C168C875E2E209 /* CombineLatest.swift */; }; + 0CC204661593617D4DF5240BD993DF4A /* AnyObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AB42A286E75A2848A769570F01DAC24 /* AnyObserver.swift */; }; + 0CF84DB9C3AF68812DF22E3A7B1A5345 /* GroupBy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77CBC56217930F052D637B82D048BA3F /* GroupBy.swift */; }; + 0DC13877F21F72004D7711BF3D7EFA3C /* Cat.swift in Sources */ = {isa = PBXBuildFile; fileRef = D73E4AE40107F9E12D9933657017209A /* Cat.swift */; }; + 0E19118925E2ABE3DFE3392B76937491 /* RxSwift-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F77FDC4F04FEF422ACDCD587C512559 /* RxSwift-dummy.m */; }; + 0E35C38093091926F74510A897639D32 /* PrimitiveSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B990C87BD5B32BF54E420212C1A52B1 /* PrimitiveSequence.swift */; }; + 0E761CEA33A04DDA594CC7359F820A0B /* CatAllOf.swift in Sources */ = {isa = PBXBuildFile; fileRef = A1C5824ADAF044284DC74D7785926F01 /* CatAllOf.swift */; }; + 10F4BDB750BA6362739BBCFD77AFFC55 /* Disposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC35E81B52795E7CB75A8D1E9687BF16 /* Disposable.swift */; }; + 1316C19AE6BD02B2D67A610EB8124F48 /* SingleAssignmentDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = BDE1B1C73CF83B02289A255C14E108C9 /* SingleAssignmentDisposable.swift */; }; + 14A822B7A6821B022899A68D5003C85D /* ClassModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E271F2E357A3F1A972FF120671638B4 /* ClassModel.swift */; }; + 15CC488D9E6EF29B02174A4B036444F1 /* Queue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60E9C1BF2A5AAD8532B83D587D4B447A /* Queue.swift */; }; + 1624BFF13E6CFADD39065BAFE15CFE5E /* AdditionalPropertiesNumber.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2ABFCCD850DDE628412E12A3A36BC83 /* AdditionalPropertiesNumber.swift */; }; + 16E27971B029CD86CC9ABFBDAF0B50C3 /* Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = 979ECDDE99CE790DA21FE87298107E6B /* Error.swift */; }; + 17DBE97DF7E4655A51189118813169BA /* Using.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459E274832813076884CA4287E491429 /* Using.swift */; }; + 18F3B3ECDFE24B0D2BB6DFB066A7DD4A /* Window.swift in Sources */ = {isa = PBXBuildFile; fileRef = EFA2A0B903691A7C2293FD13EACB8E3F /* Window.swift */; }; + 1928C38569D41E9A17B2A7053C2737C5 /* Model200Response.swift in Sources */ = {isa = PBXBuildFile; fileRef = BD2133B0A357172D4E12A35C6488638D /* Model200Response.swift */; }; + 1B854BF767678148C17B436F65FEED5C /* SynchronizedOnType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757C5919A405D111AADAF18AFDDD9D5A /* SynchronizedOnType.swift */; }; + 1BE47AC4C39BCC2AD678B0D94066C3E7 /* ObserveOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 274B9D4CA658622B79DCE0F5E736A061 /* ObserveOn.swift */; }; + 1D29D2ACADF961F69D32B06FA6A09E28 /* Notifications.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39AE2AD9A01457ED8AC57D692A5F40AD /* Notifications.swift */; }; + 1FAE4751B8A1A4906CA23B6D14705DD1 /* ObserverBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB54B43833CB03F1D8749CE7C298D3B5 /* ObserverBase.swift */; }; + 20C9165173E84E273472110B783CEF0F /* HistoricalScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BF070C783A6786C9C92AA917E9AC879 /* HistoricalScheduler.swift */; }; + 21EA0909C5162AC1A2F0BEB44161C091 /* ScheduledItemType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBF81FDC5C51FD450958591E8EAF6EA /* ScheduledItemType.swift */; }; + 231FF5CEABDC19D5620EF1D250075969 /* DisposeBag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40D138874AFF1185A99996B4180C5AAB /* DisposeBag.swift */; }; + 23F822E146B3F3C63EF430F9ED1EA5B5 /* FakeClassnameTags123API.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF1DD94A10F409B4316DAC2A019FED34 /* FakeClassnameTags123API.swift */; }; + 247F1D441C3FFE1A86775F95FD5C526D /* Generate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8E5B43302C88640C1A05762A037012A /* Generate.swift */; }; + 26BE990BD12DA8BA3E8C11D9BE7A095D /* SynchronizedDisposeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0AF5386FC035BD7FBDA0B02884DE8324 /* SynchronizedDisposeType.swift */; }; + 2832890547C0F2BC47A5ACB24FE1E556 /* NopDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5F4524003B8CAF5944F3FD37875D795 /* NopDisposable.swift */; }; + 28783CBF85DD482E1793B019CD5E056A /* ObservableType+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B6C60D7E233892084DAC43F60C64C60 /* ObservableType+Extensions.swift */; }; + 28BC7B80549B8F4B21578D07D2D853AC /* TailRecursiveSink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19A8FEF66E4D85F1B100E0AD77AC60B1 /* TailRecursiveSink.swift */; }; + 2A1C0B23E2CEEE38D4C0133ED988004F /* XmlItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46FC0AD10406C3CE1828C826775E9650 /* XmlItem.swift */; }; + 2C5F3731461E52488C08666B9D752D8E /* WithLatestFrom.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2BC0F91A33991D668BEC3583CF46BAB /* WithLatestFrom.swift */; }; + 2C75624448C07245398F78A8E8F76C6C /* SerialDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = CF92C4858F759EABBDDB45D32BE8DDC2 /* SerialDispatchQueueScheduler.swift */; }; + 2DE581AFC0E6541F53D79C9CF5BA0252 /* SchedulerServices+Emulation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F9FDC7E72AC896C5D9031E49B0372D06 /* SchedulerServices+Emulation.swift */; }; + 2E2C54FE54D4ED7D30B9CFD7F5CE26ED /* DispatchQueue+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 679C1F8FF956155F71A31E63595C9AB9 /* DispatchQueue+Extensions.swift */; }; + 2F16BB60B2A862F9988A1C1D1DB25326 /* RefCountDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1555637002FBEDE13C94AEA5F61C763B /* RefCountDisposable.swift */; }; + 2F73B36CB2A0C051C5FF6865EC7505A8 /* Observable.swift in Sources */ = {isa = PBXBuildFile; fileRef = DBD0EFE5168A6526DB06F4A6800CF584 /* Observable.swift */; }; + 30769345FEC859A4DA77F0CBBBFF3890 /* AdditionalPropertiesArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D53702B1DFE795F10CD9F02ED7196FB /* AdditionalPropertiesArray.swift */; }; + 32C3F28679808D14D41E5CE764B18D68 /* HistoricalSchedulerTimeConverter.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB9FF8F32D5D6FC16033AF34AC1408FD /* HistoricalSchedulerTimeConverter.swift */; }; + 32FC3AD0AB13B89CE579D458841BB17B /* TakeUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0027A132D8BB718973989368CF5E63CF /* TakeUntil.swift */; }; + 3548E9B5F3D2CB1D6CF60A2E5E5B2A32 /* SingleAsync.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED1332D9E071ED0D532F6ACD2AD1AC38 /* SingleAsync.swift */; }; + 355C18EEC82624A06A6CC93965258E33 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 720601B930B8E6FB3B449B0C3EFB451F /* Request.swift */; }; + 367D7C38C9D75A77C7803E9ACE55F939 /* Order.swift in Sources */ = {isa = PBXBuildFile; fileRef = 87ADA33E38CF943875922CB316D2A29A /* Order.swift */; }; + 37BF531FD8F4EF30E68E9A205BDAB096 /* Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD8220D45545AC2A21A066A562081FF /* Optional.swift */; }; + 38B3FCCBE586F4016F203082690CEE6E /* Lock.swift in Sources */ = {isa = PBXBuildFile; fileRef = C89F6DBCB4EBE505168C934C00DB909D /* Lock.swift */; }; + 3BD1DAFE1F3E6C9E4EB0F2099B6D6FA2 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* Foundation.framework */; }; + 3CB84F06C826903645D046E00A08E94B /* RxSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0FDDD670EFAE8A21A0BD76C684193FAE /* RxSwift.framework */; }; + 3E0749AF6C51BCF0E4A41CF1D6A76FED /* DispatchQueue+Alamofire.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C008FB60F065D079DB1F0C69B60DDEA /* DispatchQueue+Alamofire.swift */; }; + 3E3FA01E3DC9CFFD4C738E922CDFA23C /* CombineLatest+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = D25BFF9CA1B3C8219A5F2A1C064AA6AA /* CombineLatest+arity.swift */; }; + 3E4C76A301104B55E4A601D4E59AF14E /* TakeLast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 57C559BAD8B2B8C949DA1C1837C049C6 /* TakeLast.swift */; }; + 3EAF0605A2B6B9A90A06560FAED89BF9 /* Timer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98C736C5D0850FA27DB5D0E58640C537 /* Timer.swift */; }; + 400710E3FF438CDC18E6D19C8E64E0D0 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* Foundation.framework */; }; + 40DC18CC960EEC0EE71E945A73F6D7BC /* ObservableType+PrimitiveSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47A00016C4275D6E28A1DD5AD98AC9AE /* ObservableType+PrimitiveSequence.swift */; }; + 411F93A1F501D9CE8A7BB17463F88BF2 /* Do.swift in Sources */ = {isa = PBXBuildFile; fileRef = 45C4BA95A0FC85CD30E5DD59545AF87F /* Do.swift */; }; + 418B6C450B8DFDF393B4EF9D8F2CE920 /* SpecialModelName.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF174B49C2E16DD172055DB12BC37B2F /* SpecialModelName.swift */; }; + 42403A783F23CEE64D8AF4D9BDB87802 /* ConcurrentMainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D765DC1CA9E827C5C155427A9C020AF8 /* ConcurrentMainScheduler.swift */; }; + 425395ADB55B02A98D0538731936BD79 /* Catch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49E9CEC3564840C6531A01B3402A3A12 /* Catch.swift */; }; + 438765B0F3642DE51D314A21726679AF /* JSONEncodingHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8308F433372AEFC6D557F1856FC9DA01 /* JSONEncodingHelper.swift */; }; + 4481D7A928F997D2717CA342C9CAF3AC /* ConcurrentDispatchQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = D95AD1D226C3858D35BDFD664BBFCC02 /* ConcurrentDispatchQueueScheduler.swift */; }; + 45EF4D7DAC7881BD321F59D769C3ED56 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 291E627729F653AC7E4BAB6FEDE416E3 /* Filter.swift */; }; + 4B3E6EC0A866782A28E4504AC67B4A1A /* StringBooleanMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0757CDB69F181DE86D31F260259CC63B /* StringBooleanMap.swift */; }; + 4CC43360234D5FCB4E5CAA95BAEF47C9 /* MainScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EC9D77DAB6AE650C74E828CE1557C00 /* MainScheduler.swift */; }; + 4CE0D20F55D373232019950D791B50AC /* Zip+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65FF8529B526BB8EC9A7CB5716CEB89F /* Zip+Collection.swift */; }; + 4D491A944EF08F4B8656305C65C71C76 /* Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5076FFA46D2287FC8EC0C217FC4BA0B7 /* Zip+arity.swift */; }; + 4EF745BE3763312A553314237EBB7B3A /* TypeHolderExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB709FAE1018A60657705217C88967AC /* TypeHolderExample.swift */; }; + 4FFF28AF1937884226953CC18EFFACCA /* Tag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8688291EDCC3CA07AEFAFFDC3ABBE224 /* Tag.swift */; }; + 51FF11FC8E286A54377E64297EEA7696 /* ObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8D048EFF0C58F0BC4BBC956A98937739 /* ObservableType.swift */; }; + 5318E7579B1107A6E6B8A80EAC437FA2 /* SchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33796A172718E1356E0E8337BAE01CD2 /* SchedulerType.swift */; }; + 536174909D73A714232615AB05687E15 /* InfiniteSequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = C308A93504B6AE628F892297A6EDD347 /* InfiniteSequence.swift */; }; + 55952681015C9453540298BF9C091033 /* UserAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 342554F69C1610DDADF3EBAC284CC8F6 /* UserAPI.swift */; }; + 5615DD06EEEA89A9237BB15D2E516B79 /* Disposables.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5FFB8448F56996188428783F8C6C98F /* Disposables.swift */; }; + 5720D4DCF4AA3DDB9D45802B854852A1 /* Sample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 192DC760893AF9295AD26599EF40763D /* Sample.swift */; }; + 584C49BA4DCCCFD50B2FAF41783029C3 /* DispatchQueueConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = 321D200CF6D488D976163C6A790DB8AA /* DispatchQueueConfiguration.swift */; }; + 5905B99E94D9ECE5157217BEC60C4FD9 /* JSONEncodableEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0440E1381A0610C4FE76AA2AF1814289 /* JSONEncodableEncoding.swift */; }; + 597234E9E02E21C0F83911110DCA6E74 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 47729A51DD7F47ED910F54FB3FBE5393 /* File.swift */; }; + 59A7BE86B0880261634D8F6F18EEB240 /* ArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97AE2157FA464312716D670ACC5FBA81 /* ArrayOfNumberOnly.swift */; }; + 5A74E080F11D3B73C6E6A2E406E7E648 /* StartWith.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836ADD02498B971DAA473321782A72A0 /* StartWith.swift */; }; + 5B4412836335EB28C03D517FD6F7EB65 /* ReplaySubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF2F44C17F277967404CE3DA788FD46 /* ReplaySubject.swift */; }; + 5B8FDB00381ED25B1D5F06A29649ADEE /* Client.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77E4025C4EF246541D617C626370FC16 /* Client.swift */; }; + 5B9F60D1EEAA27243456F6F5DE0FA31A /* ReadOnlyFirst.swift in Sources */ = {isa = PBXBuildFile; fileRef = B23D0E4BD36D6E24C66A8DB3F81FE656 /* ReadOnlyFirst.swift */; }; + 5BC3B4927F5E340F661D56FCF2B51D75 /* InvocableScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 305616479EFCF33CB4768627955493AB /* InvocableScheduledItem.swift */; }; + 5E08679A799BC6809B8DE2089F06E621 /* TypeHolderDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = C692DE62E3C756A61E2E9C829EA0BCE6 /* TypeHolderDefault.swift */; }; + 5E4C98BF473FF5D493E130A785EB73BA /* Category.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7239C4B748D482C26AE3B3EC168AD371 /* Category.swift */; }; + 5FB1BC9A57D01324146B7AE5F03C6370 /* Dematerialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F929FCCF076F0A692EA809B17DD7F31 /* Dematerialize.swift */; }; + 60B6C2A003864AAD3A426448152F67BE /* Timeline.swift in Sources */ = {isa = PBXBuildFile; fileRef = B22AF668079FC82298B5D800D6E575BB /* Timeline.swift */; }; + 60F135C1B2E2A3DBF5D91AAFEC889628 /* DefaultIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27F63D218F3E7685156696F53CEAB647 /* DefaultIfEmpty.swift */; }; + 611DDEABDBA112B4ED8A489288C5E3AA /* NumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = ACC20A8939D21B502E71D99F130B013E /* NumberOnly.swift */; }; + 63B9CDC423637A15BD3F8F4B9651B62D /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3B9412BBCE6A74BC742A54FD0B8186C /* Zip.swift */; }; + 64E469791F8F79F87724641C4B16AF22 /* StoreAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 387EBB01DADD396614945A01970A8222 /* StoreAPI.swift */; }; + 654F552A8DD4BF67850CAFEDF249D815 /* Skip.swift in Sources */ = {isa = PBXBuildFile; fileRef = F1FC53345CBCE9EF88576C6BDC5D16EE /* Skip.swift */; }; + 69E9DE3AD0F2CA6895BEAFA6691914BB /* AnimalFarm.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3A9349CCCD01B8CD6646B22BD8FAFFD /* AnimalFarm.swift */; }; + 6A3FA5DFDE7C0D52EA3B3E4A62F2969F /* EnumTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A933D6B3F16C58A90BFD589C4B23EE38 /* EnumTest.swift */; }; + 6B1C6B7CA8A53D9502AE9EB84CA3181F /* Empty.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3B003673B45236AA5A51A70A733399D /* Empty.swift */; }; + 6B598CD6C3665D587BD8EDE6202EA593 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* Foundation.framework */; }; + 6B9765DD631FED6DDDE0393B076895CC /* Debounce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 62326983DDFE0858FB48A88B024EAE9D /* Debounce.swift */; }; + 6C7F38FABFBDF77E5B4D6AB137E0A5F4 /* FakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6DF985F6F04F63AA4A9AE7866CB8D22 /* FakeAPI.swift */; }; + 6CB554A9CE0D611C158CC5B9DB6873D7 /* List.swift in Sources */ = {isa = PBXBuildFile; fileRef = E237960AB17F68A30227D83025D39488 /* List.swift */; }; + 6D1DF0296E23FD6AD4E4676FD690C3BA /* DeprecationWarner.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D0270A8CD4CA80B74E5EC729FBC1A7 /* DeprecationWarner.swift */; }; + 6DCDEA9935C7542C76178B25A7D873FF /* Completable+AndThen.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC49CD3902CF252FAA732A1DDA1DC1C9 /* Completable+AndThen.swift */; }; + 6E428993840E5F638CFD77582468C982 /* DistinctUntilChanged.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43029CD91769D491E685263C4CB46A97 /* DistinctUntilChanged.swift */; }; + 6EFD003458AE7F689DEA720A2030C261 /* ResponseSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95300CC9035C5766B62FE4FB54FA5951 /* ResponseSerialization.swift */; }; + 6F3CA008415A35BA7E271CFBB8311E6F /* Sequence.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5420BA5CD952DA0D4A8A31E4D69CC2 /* Sequence.swift */; }; + 700D3D95AF9520CB227846DFD943A2DA /* ParameterEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86A0FB6358543AEAB83BC45DD397D732 /* ParameterEncoding.swift */; }; + 7105E17FDE296BA6B37E8B5E2AAD9058 /* FormatTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E7E635C33CF3DE53B838B378535F65C /* FormatTest.swift */; }; + 72F440B2AB88E31879EE58D8B7D5A05E /* Producer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F2E147BD28F065756948CC15F0E6B68D /* Producer.swift */; }; + 73AB05789A4982944AF68DBD013E3EB7 /* NetworkReachabilityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8383047D766DF909F58645FCCF42048 /* NetworkReachabilityManager.swift */; }; + 755536BB16D53CBC961B0A8E3FDF7739 /* Timeout.swift in Sources */ = {isa = PBXBuildFile; fileRef = F42B2C25A2A499E0244E107DF28BA640 /* Timeout.swift */; }; + 76079C032826A835D0B13E6D617606C1 /* AdditionalPropertiesString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 417E0C1C7F4C17857E4C0D19275C6973 /* AdditionalPropertiesString.swift */; }; + 772911DA6E33D1CBBC30131B7C8BDBB3 /* Alamofire-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4CC7E2EF21164D2E203FEAF12D869A /* Alamofire-dummy.m */; }; + 77E8F0EB9FFBE2E3EB0C77095C644606 /* TaskDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575E60871C2A868C6B6D235B2DE25D83 /* TaskDelegate.swift */; }; + 786342EA1908DF041945B208001AB341 /* SerialDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55B63E482462E54A5366DAEA6318FB7E /* SerialDisposable.swift */; }; + 7893293BC4613AE2625D1684ED6888AD /* Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = B50B0F2486C6BB7F3AF76CD685C8B4E1 /* Rx.swift */; }; + 79523FA5D24E7AC22385AE14E18FA1CB /* Map.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FF198528C6AE20A99A5E33F76D0C527 /* Map.swift */; }; + 7B5B94CF82B28AED61861EC39D661BEC /* OuterEnum.swift in Sources */ = {isa = PBXBuildFile; fileRef = A71552570D704D50ABA564EB978406FA /* OuterEnum.swift */; }; + 7BAA9953F0607C50A41C04848C10E156 /* Pet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32DEB152EA23784FF891FB3850E4A1FE /* Pet.swift */; }; + 7C7B2182C3E7D832DF075B3016ED1B05 /* ObserverType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0D4584BAE72539FDF3D31787762B39D0 /* ObserverType.swift */; }; + 7D3D0B52CF0C6CD831B149E64FE4AB3E /* DisposeBase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E3B161DE103995FAFA429C1AD3E2875 /* DisposeBase.swift */; }; + 7DC19974867E0956AD13FA28D9038536 /* ImmediateSchedulerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 44F10FFC1F6C0F6A0F7C003C038C272B /* ImmediateSchedulerType.swift */; }; + 7E3538A6992A38276764936A9733493D /* AFError.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD714B38F6C265C97287CD6F713F3398 /* AFError.swift */; }; + 7E79F3A456266FFDA768E0CF14DBC2F1 /* SynchronizedUnsubscribeType.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC22F330006EA5F892970C69FBA9F199 /* SynchronizedUnsubscribeType.swift */; }; + 8012A57CFFC574F745FBA46D335BBA6F /* Pods-SwaggerClientTests-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */; }; + 81690915FE86ECD7CDE95633E3762009 /* AdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE9C5D5D818389294D9B773DD491B146 /* AdditionalPropertiesClass.swift */; }; + 82D86B9AEF31C560C2A0DB4FC9B979A1 /* HasOnlyReadOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = A403B12907B25FC32930C07AD4DF4600 /* HasOnlyReadOnly.swift */; }; + 83637EFE9CFF36EC1E7A73CCE55884B9 /* PetstoreClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = F4546CAE8AC2D5BD71A14E476145C771 /* PetstoreClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8487CC1DE956BDEEAC9CDF413E1A58E4 /* Materialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = C894BEC0DE9A446CBB01A0B7D63DA38A /* Materialize.swift */; }; + 860138DC0F719DA0953C144268F4FDD7 /* EnumArrays.swift in Sources */ = {isa = PBXBuildFile; fileRef = BB2944F75CA2FADBE47B2326252AAB5A /* EnumArrays.swift */; }; + 877B7447EF54C9ED4966D3D1AA9B8D07 /* ArrayTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25DE89C483E14ED16E9B0F96850BF3B /* ArrayTest.swift */; }; + 88B8F96E58CD89EC10B74A1F8365F6FD /* Pods-SwaggerClient-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 8A3542104FBA7C2FA7BF8E95AAAE0BE7 /* RetryWhen.swift in Sources */ = {isa = PBXBuildFile; fileRef = E22F3BDA0C336074E5EA13F37C05FF2C /* RetryWhen.swift */; }; + 8BB1ACFFA7880AE54B7300AF440F549D /* PublishSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F1E9D95E719B94DD98DDDB394278F2 /* PublishSubject.swift */; }; + 8CA88B336020592CDC5F3548A4DFE697 /* ToArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33FB85D186079ED93696702AD931FFDA /* ToArray.swift */; }; + 8D2A6A90A6DDAF75EA52D471258545CC /* ServerTrustPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A56088E87A9AACE94749A936B309080 /* ServerTrustPolicy.swift */; }; + 8DA0C6077B07424B6848BD63049B6777 /* AddRef.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64F819D835354426411C22FB35823EAD /* AddRef.swift */; }; + 8DDD2130C49010F4CCBA6EF665E1288F /* ConnectableObservableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB1FE5BDED74EBDC047C5B437A524854 /* ConnectableObservableType.swift */; }; + 8ED35E25E311CF3F12564041A7F8BB2B /* Throttle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DB4CEA0C0A7C4823A04EAD9FBA3961D /* Throttle.swift */; }; + 8FAB1056E36610DF9EE92221941D800D /* AsMaybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6BAA110BD7DD59D40985519BC3BAB2C /* AsMaybe.swift */; }; + 92BEB5554FA6A51ED6995B19BEC8D7ED /* AdditionalPropertiesObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 427485D09ADF908E73C20C8E8F56313E /* AdditionalPropertiesObject.swift */; }; + 93000BED51CFB0CDB262C897C8C104A7 /* Switch.swift in Sources */ = {isa = PBXBuildFile; fileRef = BAED0C18FF2FC7D97F0E5B2D4FE37F2C /* Switch.swift */; }; + 93D8F9361CA384D802B729C027A29D93 /* DelaySubscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13431ED497EC52994DA35A8DD3CB5C3C /* DelaySubscription.swift */; }; + 944A8ACBB625207067C5A154726E140A /* Return.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0568635049F72DE8DD05757186436324 /* Return.swift */; }; + 94C2BDABC69296B090CFC89FD5483D41 /* Bag+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF699627254D1F4E425E37E0306B828B /* Bag+Rx.swift */; }; + 957BB9043F5F5609C348C47C523D6C79 /* Take.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8050204E8821E9A399D7E830591E063B /* Take.swift */; }; + 9587E802C281FA381DF9E97EC426814D /* LockOwnerType.swift in Sources */ = {isa = PBXBuildFile; fileRef = F5CF777F69E934A92F78512092C53052 /* LockOwnerType.swift */; }; + 95A5DD145CB674719312A9CCE333C40A /* BehaviorSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 10A297E0A593ED4485BF3BAA9211E812 /* BehaviorSubject.swift */; }; + 96ED1FEACF444FF70C6550E95A572890 /* AsyncSubject.swift in Sources */ = {isa = PBXBuildFile; fileRef = 452FB9512A491F731556BD2F110347ED /* AsyncSubject.swift */; }; + 96F8C88984B492B5D186D6DC6FEF8D0C /* PrimitiveSequence+Zip+arity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8C65830349B23D7E262AB27BAB0E8188 /* PrimitiveSequence+Zip+arity.swift */; }; + 97AEDE420913FDB38F1F907BBAAF2E8B /* Deferred.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBF9232381581A50CA2E8FA9517D76EB /* Deferred.swift */; }; + 97BF7A9642F28D14C03458F24C030DB2 /* AlamofireImplementations.swift in Sources */ = {isa = PBXBuildFile; fileRef = C645ED7A39D8B9114C20CAFE2B7FBC2B /* AlamofireImplementations.swift */; }; + 9C66CB81052F764079D0FA68B6E36BEF /* SwitchIfEmpty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 97D7A50019AFFCCD39301BD1E594F91C /* SwitchIfEmpty.swift */; }; + 9C894D0C88D763CD86C16DDCE698F9B3 /* SkipWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2EDBEFED12864758CCA6F411205AB2E /* SkipWhile.swift */; }; + 9CD65D0519639A42284304F6A662E10A /* RxMutableBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CEA210E8205F311B1A19569BCDDEF63 /* RxMutableBox.swift */; }; + 9D443C8AF196B744F2340AD3DCE6CE0A /* Errors.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73E2FE9C0296B7647E36FDAB1A48E6E /* Errors.swift */; }; + 9E28E0EB779608B1E70DD6319247E826 /* FileSchemaTestClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ECAC6F788B1B30D9157D0A0ADC1148B /* FileSchemaTestClass.swift */; }; + 9F9CF99BD0C63948B4413396FD8DBA54 /* RecursiveLock.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55000F129FE5A09A0B51661892DB1F4E /* RecursiveLock.swift */; }; + A06C5095E2319DD4B8B8047539769999 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = D406BAD811EAD0952929B093F56F2BF2 /* MixedPropertiesAndAdditionalPropertiesClass.swift */; }; + A1A4F6F86BDF18C228F08311EBD03E84 /* GroupedObservable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0FA93D91962228BFC4F2058578D7A9EB /* GroupedObservable.swift */; }; + A1EC41966B261DCE460BCDE5124A1DBE /* SessionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 378449150E818606AADBD6FB5A562D0D /* SessionDelegate.swift */; }; + A26702A2CFB5B831F7FB80FFA29BEEEC /* InvocableType.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB834FF7C5DF4A05EB6179428E1A2D30 /* InvocableType.swift */; }; + A5E492F7194809622E130CC6569F46E2 /* SubscribeOn.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70180A07F00266A41D515742CBA72B74 /* SubscribeOn.swift */; }; + A9A00DE2FF9E8E7E0C750F495837D99E /* Cancelable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5A8B9F6DB3E903DC9635F9DA16D90A0C /* Cancelable.swift */; }; + AA56769D8733D3F3E7976742D5ABA998 /* Validation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51BEBD9500775258E10801B2D4636130 /* Validation.swift */; }; + AA6D3CED1566D71B0E39A1CDE3B32864 /* Enumerated.swift in Sources */ = {isa = PBXBuildFile; fileRef = EAFD9A5AE325CD48442A611EFD103D57 /* Enumerated.swift */; }; + AAA1712D2763B6D2CF0011403EBE512D /* Amb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7F4E8DC898B4C8D35F09B107CE705172 /* Amb.swift */; }; + AB6D07352A2E898824B49759CCA162EC /* AdditionalPropertiesAnyType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7628A653BCE0CE4F0CA24E4699FF04E5 /* AdditionalPropertiesAnyType.swift */; }; + AEA829AB1A8AF2AD077A808AED6B178A /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = D335B34B9871B74E10984781CC371CBA /* MultipartFormData.swift */; }; + AEB4C18DF052DCB1A0FF1EA600194A2E /* Dog.swift in Sources */ = {isa = PBXBuildFile; fileRef = 88BE3C1FFB1B8A373D68AFE8E2CE9E5B /* Dog.swift */; }; + B01F02AFF4BD60048220EE91C369DA72 /* Bag.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9289A1C05392D4FF88A897B4FDF77958 /* Bag.swift */; }; + B2F61D4C66E7E9BF795A768F9A52F889 /* ElementAt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6F10D694F6B9493FDA575E60FE695722 /* ElementAt.swift */; }; + B312CFC44488357265F713C8EF63291C /* TakeWhile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E67D2FEF499445214AF84B7B9C9B33E /* TakeWhile.swift */; }; + B385CD158B4DB49B50E46C688B9F0AED /* AtomicInt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C7E8D8382CCB07D68866B995A900D74 /* AtomicInt.swift */; }; + B38FF962610DEFB271EA1FCA95E3B37A /* SkipUntil.swift in Sources */ = {isa = PBXBuildFile; fileRef = 25B4A2E0DAA89840BB58C5D472574F66 /* SkipUntil.swift */; }; + B39356F857F84E608624AB4BA381F5B9 /* APIs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 55A64F269657828EFCFE8BFEBEC769FC /* APIs.swift */; }; + B6F6E4CC26451E91B59FAE0F6841DC1F /* Alamofire-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = AE110F03859CEB598ADBC6AF0026E6C6 /* Alamofire-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B7A2C80AE512BA32546E4BB9213F70CC /* Buffer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49A9E858642895322172FF16226C86AC /* Buffer.swift */; }; + B7CC8FC752B3A986B9DFC4A0F09BB316 /* ScheduledItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE0D448C7D74BFFB8604285DD7047EED /* ScheduledItem.swift */; }; + B822D1C05E59F8303723EA7F59C78F40 /* Single.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA9CEE837EF5EE1215788BEBC3959479 /* Single.swift */; }; + B8407A12CCFF56CC0C1C34C1B8A9F8D9 /* OuterComposite.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75E2A26619203BE094E23132BE4F9C6D /* OuterComposite.swift */; }; + B9EF5A80D032538680EFE75929C28D6D /* ObservableConvertibleType.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE64C63DA4FB40ACE396982AAB244DC0 /* ObservableConvertibleType.swift */; }; + BA2E85147C4CE9D6AA9EC39DBE99A6C0 /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28350F99E9985C0EFD64D72D74A3BB5B /* Models.swift */; }; + BA8C86B1D885FFA4850EC5F3528669E9 /* SwiftSupport.swift in Sources */ = {isa = PBXBuildFile; fileRef = D10F2A3D1BBD10CA8594739DB19CDC07 /* SwiftSupport.swift */; }; + BB7E003CB2D82BDBBBE3A9E1AA1C1682 /* CombineLatest+Collection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7B49FF45429D57DA0487C5BD90AA6398 /* CombineLatest+Collection.swift */; }; + BDEA420ADE6E58BFDB87E1339C6EF292 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* Foundation.framework */; }; + BF15B41D6CCCFAF4DCA617D0431D4781 /* Platform.Linux.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B1CB7693D74DF7AB61FB3A0064A532 /* Platform.Linux.swift */; }; + C0A9C53855321304AFBE800FC3BB8864 /* MapTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 40FA27876F7533BCDAAEB14AED6CC511 /* MapTest.swift */; }; + C1942DA08443E26FE1CD7BF2A972B27C /* String+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2788B53C02374D910EFFBCF48BFF0B1D /* String+Rx.swift */; }; + C2C0AE3588986E52B3965206EC540324 /* Delay.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CFB12945932D18A9721B6AF2D8D871E /* Delay.swift */; }; + C3F9BB06A12A0F61CDC2511CDDE62B09 /* AnotherFakeAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 89D4EF25430724C9CA591320E91F6ADE /* AnotherFakeAPI.swift */; }; + C54FB31D5C9750E9722B2EBB3C05754F /* AsSingle.swift in Sources */ = {isa = PBXBuildFile; fileRef = C638F1FAA7FFA890ACB0BAD594BAA07B /* AsSingle.swift */; }; + C8371B319EBEF3DFDBA5C573AB46EB4C /* Animal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2E62E4A381F97286B84952D8ABA59681 /* Animal.swift */; }; + C88589E390360E93817DA97CBF5DCBA4 /* Completable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0ACE6B378AD271E3ECC20C3EB267F4D8 /* Completable.swift */; }; + C939859F6DB0464712141486E944F42C /* Maybe.swift in Sources */ = {isa = PBXBuildFile; fileRef = A14370E500BCD2443559DB70F2786EB6 /* Maybe.swift */; }; + C99C068899D064944E605570D38E85F2 /* Reduce.swift in Sources */ = {isa = PBXBuildFile; fileRef = 060AAA21729D90B11F6FD9102F628758 /* Reduce.swift */; }; + CAB19EE096FBEAAE1FDB28F56B8B4F78 /* Merge.swift in Sources */ = {isa = PBXBuildFile; fileRef = FF4EA9F3121FB3144A5648BBC0A8004D /* Merge.swift */; }; + CAFFB7A58F51661BC7DD5284276EC1ED /* VirtualTimeScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6DA209283C4EBF0544FF63C7D1BCC40D /* VirtualTimeScheduler.swift */; }; + CB69E0C638A7C58B5FC9073B793273AD /* AnonymousObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3DC61667E570A41266B09E2160DAF2D /* AnonymousObserver.swift */; }; + D0847A960A008DA8608CBCF219A8A2A7 /* VirtualTimeConverterType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 745314207D827581C481CE38F4AEB7A3 /* VirtualTimeConverterType.swift */; }; + D0E317E6FC43BC7D4F07C17B584D8EFD /* Repeat.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2EAED007F778FE48F4D3EB2B398B0AFB /* Repeat.swift */; }; + D128DB98CB0B97380BDEC326306D0FFC /* Concat.swift in Sources */ = {isa = PBXBuildFile; fileRef = C71AEC0AF13D31F11719E203832081AF /* Concat.swift */; }; + D399C483EEF039C293A7B84B82BE2B49 /* ArrayOfArrayOfNumberOnly.swift in Sources */ = {isa = PBXBuildFile; fileRef = 59A65FEE7BCD66D95A4A236D44082214 /* ArrayOfArrayOfNumberOnly.swift */; }; + D3FA0AA634AAEA99AB3FABC36BB4958C /* SessionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02C7203E47628DD3832410EEA16A1D8B /* SessionManager.swift */; }; + D706A86E37DD6D833CA7A079A3E15B7E /* Sink.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE70B57B6CF22A99EBDA453C12741148 /* Sink.swift */; }; + D9D43BA204D86056FDBFCC92F87C7EAB /* ShareReplayScope.swift in Sources */ = {isa = PBXBuildFile; fileRef = EA01D2A2DB1E31168FFF75C6F9DAD5C5 /* ShareReplayScope.swift */; }; + DB2950EE1B19C535EBD1E572494F55E5 /* PetstoreClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = C3FFE137AD3E253AC3CC98BDB629E1CC /* PetstoreClient-dummy.m */; }; + DB94F9F67A94D6A5CBAA286F44ED10ED /* Name.swift in Sources */ = {isa = PBXBuildFile; fileRef = FEFFBEEA8F7216DF65BD978A823BEDA2 /* Name.swift */; }; + DC551676E7C8D267368063D532D092B2 /* Never.swift in Sources */ = {isa = PBXBuildFile; fileRef = 498E9106F2911C5C575288660EF2C14A /* Never.swift */; }; + DCAC99A86576E188AC0079FE5607C541 /* CodableHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35FACC9017B95B9A2C4A6F43E6168BE3 /* CodableHelper.swift */; }; + DED9A421CFF78F29A27F00A43A5478D1 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 892F30771518EB494D89A92413C04E85 /* Extensions.swift */; }; + DFAA7C26B25E676D63DD5FD0D74ABB30 /* ApiResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0755658D38EA295B964DD3D2AE6130E8 /* ApiResponse.swift */; }; + E16F11503BA04EC3B205DBF20BD33DE1 /* Just.swift in Sources */ = {isa = PBXBuildFile; fileRef = D95243E9789D171D24B3CCEF4A306E79 /* Just.swift */; }; + E2A989FE2A8C7E19B78150061B1F404E /* EnumClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1259C7EE8FBB3A324ED66A0FBE292D2 /* EnumClass.swift */; }; + E38FB4D007348119E958AED58DDD44B4 /* OperationQueueScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = E9ABCE94A0D10DF97FC367C061436E5F /* OperationQueueScheduler.swift */; }; + E403F1184BAC06680AF116EE8EDB7BEF /* Reactive.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240EE4633A0C295594350E7EC54BA3DF /* Reactive.swift */; }; + E4962E9CD3D8EA651C84498D271EC753 /* Pods-SwaggerClient-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */; }; + E4F4D8D1953813B37BD79C66BE55B132 /* BooleanDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28DE248049BE51CEA8ED1544F9D7FE9E /* BooleanDisposable.swift */; }; + E4F50B1433000199FD611EEBCF3B6BB0 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = B374449845CA94813BACD80BE4751992 /* User.swift */; }; + E6CAA0D168E81EF9679A5388F4BC95D8 /* BinaryDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C42EB9688F37F35C9110C57A8075DC4 /* BinaryDisposable.swift */; }; + E7AC1A5D6FA609B69AFDE50FC01127F2 /* SubscriptionDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4218AB53A6385BB02D95ED58A63B6AB /* SubscriptionDisposable.swift */; }; + E8BF5D98F29555477C6236F1890DF767 /* APIHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE55486083AAFB05A421910D689676CD /* APIHelper.swift */; }; + EB0DD8CEA1A69867A30267439C970440 /* Result.swift in Sources */ = {isa = PBXBuildFile; fileRef = E708A153C22A9339B8145278E89E64D8 /* Result.swift */; }; + EE1917B8030B1B81478973483D704AAE /* Debug.swift in Sources */ = {isa = PBXBuildFile; fileRef = BE02647BBDB83E0D48469A56FBF37C88 /* Debug.swift */; }; + EE2E9AE7C6CDF0C9D9E77E6EB2800E40 /* AdditionalPropertiesBoolean.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A9D6B8A244BC24B1DFF8AE87F94F792 /* AdditionalPropertiesBoolean.swift */; }; + EE5BB9D47B59D64E282A3FCB17CD6132 /* Deprecated.swift in Sources */ = {isa = PBXBuildFile; fileRef = B498E7AFBD0589628B31BD16154B20FF /* Deprecated.swift */; }; + EF7CEEFEE64CCFE8E050F33E8E6716EB /* Scan.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8942B778DC2EC96252BBB267B62D566B /* Scan.swift */; }; + F2179ACF4366D4B4E62CD5C99FA1A679 /* Capitalization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F74B8F482952B4F0D1ECBE5D900E09 /* Capitalization.swift */; }; + F33B53F266660974D851A82B03B2907E /* Create.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32615BCCDB0302A683583113699C168B /* Create.swift */; }; + F3B7AF12D1FD688C8942217F918E2917 /* RxSwift-umbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B22542F5E9A061C9F6214D75923635D /* RxSwift-umbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + F77A046367A53931C9B4424F17D83BB0 /* AdditionalPropertiesInteger.swift in Sources */ = {isa = PBXBuildFile; fileRef = CB268230F2A96F71335E107E497BC32C /* AdditionalPropertiesInteger.swift */; }; + F7D0A45619BD381EC7FDEF8F41057C4A /* ScheduledDisposable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 717C1608162B27019EBC04A33444BAEE /* ScheduledDisposable.swift */; }; + FCFED59A764898B95991A177DDEB362E /* CurrentThreadScheduler.swift in Sources */ = {isa = PBXBuildFile; fileRef = B18AB9B87BF0A071727872B64CC84137 /* CurrentThreadScheduler.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 116DEBAFC9022016EADCAFC9F9BC1542 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BA1FAA79F9B74485F4D7279FD41A7D1D; + remoteInfo = RxSwift; + }; + 2A8AF3B6391C5FF251470E3091B2B1D2 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3383968E74B5371B20BB519B170DC7FD; + remoteInfo = Alamofire; + }; + AEA2781CDC8DB413C920DD9F7F78F124 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 3383968E74B5371B20BB519B170DC7FD; + remoteInfo = Alamofire; + }; + B36C681A6EB35CB2430BAB3BAF9AB886 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 49CDD5ADAF3DA23F4C622CC2F9A75659; + remoteInfo = PetstoreClient; + }; + ED09ABD99E0D387BFD78CCCE937FA689 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = BA1FAA79F9B74485F4D7279FD41A7D1D; + remoteInfo = RxSwift; + }; + FA1A8E2F3FE2899A723889F94EACA0E5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = BFDFE7DC352907FC980B868725387E98 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1BAC3F8145EDD03FE8EDB0EACEAE3522; + remoteInfo = "Pods-SwaggerClient"; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 0027A132D8BB718973989368CF5E63CF /* TakeUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeUntil.swift; path = RxSwift/Observables/TakeUntil.swift; sourceTree = ""; }; + 02322A6B0543DADA4A6CB13A420ADA46 /* Capitalization.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Capitalization.md; path = docs/Capitalization.md; sourceTree = ""; }; + 02C7203E47628DD3832410EEA16A1D8B /* SessionManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionManager.swift; path = Source/SessionManager.swift; sourceTree = ""; }; + 0440E1381A0610C4FE76AA2AF1814289 /* JSONEncodableEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodableEncoding.swift; path = PetstoreClient/Classes/OpenAPIs/JSONEncodableEncoding.swift; sourceTree = ""; }; + 0568635049F72DE8DD05757186436324 /* Return.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Return.swift; sourceTree = ""; }; + 060AAA21729D90B11F6FD9102F628758 /* Reduce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reduce.swift; path = RxSwift/Observables/Reduce.swift; sourceTree = ""; }; + 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.release.xcconfig"; sourceTree = ""; }; + 0723F133C41FD08232F74124D0E3FC2E /* RxSwift-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-prefix.pch"; sourceTree = ""; }; + 0755658D38EA295B964DD3D2AE6130E8 /* ApiResponse.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ApiResponse.swift; sourceTree = ""; }; + 0757CDB69F181DE86D31F260259CC63B /* StringBooleanMap.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StringBooleanMap.swift; sourceTree = ""; }; + 09F1E9D95E719B94DD98DDDB394278F2 /* PublishSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PublishSubject.swift; path = RxSwift/Subjects/PublishSubject.swift; sourceTree = ""; }; + 0AB84B97D3A773262405DAE614E8AAC8 /* ArrayOfNumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayOfNumberOnly.md; path = docs/ArrayOfNumberOnly.md; sourceTree = ""; }; + 0ACE6B378AD271E3ECC20C3EB267F4D8 /* Completable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Completable.swift; path = RxSwift/Traits/Completable.swift; sourceTree = ""; }; + 0AF5386FC035BD7FBDA0B02884DE8324 /* SynchronizedDisposeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedDisposeType.swift; path = RxSwift/Concurrency/SynchronizedDisposeType.swift; sourceTree = ""; }; + 0B2EDA68E233F400804C89253BBFB2E5 /* TypeHolderExample.md */ = {isa = PBXFileReference; includeInIndex = 1; name = TypeHolderExample.md; path = docs/TypeHolderExample.md; sourceTree = ""; }; + 0D180F35B94BC88CF6D264D1CDF42624 /* MapTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = MapTest.md; path = docs/MapTest.md; sourceTree = ""; }; + 0D4584BAE72539FDF3D31787762B39D0 /* ObserverType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverType.swift; path = RxSwift/ObserverType.swift; sourceTree = ""; }; + 0F39AA54BB1773329C8151B721ED0D09 /* Pods_SwaggerClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClient.framework; path = "Pods-SwaggerClient.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 0FA93D91962228BFC4F2058578D7A9EB /* GroupedObservable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupedObservable.swift; path = RxSwift/GroupedObservable.swift; sourceTree = ""; }; + 0FDDD670EFAE8A21A0BD76C684193FAE /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 10A297E0A593ED4485BF3BAA9211E812 /* BehaviorSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BehaviorSubject.swift; path = RxSwift/Subjects/BehaviorSubject.swift; sourceTree = ""; }; + 110A71E71814850BBCD440AF198317DF /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 13431ED497EC52994DA35A8DD3CB5C3C /* DelaySubscription.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DelaySubscription.swift; path = RxSwift/Observables/DelaySubscription.swift; sourceTree = ""; }; + 14AAB621715B4F0218EABE72CE972494 /* PetstoreClient.podspec */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; includeInIndex = 1; indentWidth = 2; lastKnownFileType = text; path = PetstoreClient.podspec; sourceTree = ""; tabWidth = 2; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; + 14D946B2CD75D612D3AE3F72880C7FF3 /* Event.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Event.swift; path = RxSwift/Event.swift; sourceTree = ""; }; + 1555637002FBEDE13C94AEA5F61C763B /* RefCountDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RefCountDisposable.swift; path = RxSwift/Disposables/RefCountDisposable.swift; sourceTree = ""; }; + 192DC760893AF9295AD26599EF40763D /* Sample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sample.swift; path = RxSwift/Observables/Sample.swift; sourceTree = ""; }; + 19A8FEF66E4D85F1B100E0AD77AC60B1 /* TailRecursiveSink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TailRecursiveSink.swift; path = RxSwift/Observers/TailRecursiveSink.swift; sourceTree = ""; }; + 19B33AA036CD6E46A97113343C8904A0 /* FormatTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FormatTest.md; path = docs/FormatTest.md; sourceTree = ""; }; + 1AA4FF009847666EB74179EA6C75DE4D /* FakeAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FakeAPI.md; path = docs/FakeAPI.md; sourceTree = ""; }; + 240EE4633A0C295594350E7EC54BA3DF /* Reactive.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Reactive.swift; path = RxSwift/Reactive.swift; sourceTree = ""; }; + 25B4A2E0DAA89840BB58C5D472574F66 /* SkipUntil.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipUntil.swift; path = RxSwift/Observables/SkipUntil.swift; sourceTree = ""; }; + 2740D21DE2F99C963ACDC4261609EE50 /* NumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = NumberOnly.md; path = docs/NumberOnly.md; sourceTree = ""; }; + 274B9D4CA658622B79DCE0F5E736A061 /* ObserveOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserveOn.swift; path = RxSwift/Observables/ObserveOn.swift; sourceTree = ""; }; + 2788B53C02374D910EFFBCF48BFF0B1D /* String+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "String+Rx.swift"; path = "RxSwift/Extensions/String+Rx.swift"; sourceTree = ""; }; + 27B1CB7693D74DF7AB61FB3A0064A532 /* Platform.Linux.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Linux.swift; path = Platform/Platform.Linux.swift; sourceTree = ""; }; + 27F63D218F3E7685156696F53CEAB647 /* DefaultIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DefaultIfEmpty.swift; path = RxSwift/Observables/DefaultIfEmpty.swift; sourceTree = ""; }; + 28350F99E9985C0EFD64D72D74A3BB5B /* Models.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Models.swift; path = PetstoreClient/Classes/OpenAPIs/Models.swift; sourceTree = ""; }; + 2895E1635E3A30E234670ED9283C23EA /* MixedPropertiesAndAdditionalPropertiesClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = MixedPropertiesAndAdditionalPropertiesClass.md; path = docs/MixedPropertiesAndAdditionalPropertiesClass.md; sourceTree = ""; }; + 28DB89F2024F2DDD08AE89C3006D009E /* PetstoreClient.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = PetstoreClient.xcconfig; sourceTree = ""; }; + 28DE248049BE51CEA8ED1544F9D7FE9E /* BooleanDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BooleanDisposable.swift; path = RxSwift/Disposables/BooleanDisposable.swift; sourceTree = ""; }; + 291E627729F653AC7E4BAB6FEDE416E3 /* Filter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Filter.swift; path = RxSwift/Observables/Filter.swift; sourceTree = ""; }; + 2AE97CCDC8C4D014282DFBAE17CD786F /* ArrayTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayTest.md; path = docs/ArrayTest.md; sourceTree = ""; }; + 2B2AAC902CD2815AAAFD57064F19AB84 /* PetstoreClient-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-prefix.pch"; sourceTree = ""; }; + 2BF070C783A6786C9C92AA917E9AC879 /* HistoricalScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalScheduler.swift; path = RxSwift/Schedulers/HistoricalScheduler.swift; sourceTree = ""; }; + 2C7E8D8382CCB07D68866B995A900D74 /* AtomicInt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AtomicInt.swift; path = Platform/AtomicInt.swift; sourceTree = ""; }; + 2CD8220D45545AC2A21A066A562081FF /* Optional.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Optional.swift; path = RxSwift/Observables/Optional.swift; sourceTree = ""; }; + 2CEA210E8205F311B1A19569BCDDEF63 /* RxMutableBox.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RxMutableBox.swift; path = RxSwift/RxMutableBox.swift; sourceTree = ""; }; + 2E62E4A381F97286B84952D8ABA59681 /* Animal.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Animal.swift; sourceTree = ""; }; + 2EAED007F778FE48F4D3EB2B398B0AFB /* Repeat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Repeat.swift; path = RxSwift/Observables/Repeat.swift; sourceTree = ""; }; + 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClient-umbrella.h"; sourceTree = ""; }; + 2F4CC7E2EF21164D2E203FEAF12D869A /* Alamofire-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Alamofire-dummy.m"; sourceTree = ""; }; + 2F77FDC4F04FEF422ACDCD587C512559 /* RxSwift-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "RxSwift-dummy.m"; sourceTree = ""; }; + 305616479EFCF33CB4768627955493AB /* InvocableScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableScheduledItem.swift; path = RxSwift/Schedulers/Internal/InvocableScheduledItem.swift; sourceTree = ""; }; + 31ED5C3525921534592BF796A9C159CF /* Pods-SwaggerClientTests-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-acknowledgements.plist"; sourceTree = ""; }; + 321D200CF6D488D976163C6A790DB8AA /* DispatchQueueConfiguration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DispatchQueueConfiguration.swift; path = RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift; sourceTree = ""; }; + 32615BCCDB0302A683583113699C168B /* Create.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Create.swift; path = RxSwift/Observables/Create.swift; sourceTree = ""; }; + 32DEB152EA23784FF891FB3850E4A1FE /* Pet.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Pet.swift; sourceTree = ""; }; + 33796A172718E1356E0E8337BAE01CD2 /* SchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SchedulerType.swift; path = RxSwift/SchedulerType.swift; sourceTree = ""; }; + 33FB85D186079ED93696702AD931FFDA /* ToArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ToArray.swift; path = RxSwift/Observables/ToArray.swift; sourceTree = ""; }; + 342554F69C1610DDADF3EBAC284CC8F6 /* UserAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = UserAPI.swift; sourceTree = ""; }; + 353DE1A4F630D656323F08E7DBB62F93 /* Alamofire.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = Alamofire.modulemap; sourceTree = ""; }; + 35FACC9017B95B9A2C4A6F43E6168BE3 /* CodableHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CodableHelper.swift; path = PetstoreClient/Classes/OpenAPIs/CodableHelper.swift; sourceTree = ""; }; + 378449150E818606AADBD6FB5A562D0D /* SessionDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SessionDelegate.swift; path = Source/SessionDelegate.swift; sourceTree = ""; }; + 387EBB01DADD396614945A01970A8222 /* StoreAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = StoreAPI.swift; sourceTree = ""; }; + 39AE2AD9A01457ED8AC57D692A5F40AD /* Notifications.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Notifications.swift; path = Source/Notifications.swift; sourceTree = ""; }; + 39F74B8F482952B4F0D1ECBE5D900E09 /* Capitalization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Capitalization.swift; sourceTree = ""; }; + 3C12C50651DC7C8FE70BC93359C255DF /* PetAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = PetAPI.swift; sourceTree = ""; }; + 3D608B4966D9E19DF62468677C823AC5 /* Tag.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Tag.md; path = docs/Tag.md; sourceTree = ""; }; + 40D138874AFF1185A99996B4180C5AAB /* DisposeBag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBag.swift; path = RxSwift/Disposables/DisposeBag.swift; sourceTree = ""; }; + 40FA27876F7533BCDAAEB14AED6CC511 /* MapTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MapTest.swift; sourceTree = ""; }; + 410ED99EC03614CF82F7E2CCD4E628AF /* CompositeDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CompositeDisposable.swift; path = RxSwift/Disposables/CompositeDisposable.swift; sourceTree = ""; }; + 417E0C1C7F4C17857E4C0D19275C6973 /* AdditionalPropertiesString.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesString.swift; sourceTree = ""; }; + 427485D09ADF908E73C20C8E8F56313E /* AdditionalPropertiesObject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesObject.swift; sourceTree = ""; }; + 43029CD91769D491E685263C4CB46A97 /* DistinctUntilChanged.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DistinctUntilChanged.swift; path = RxSwift/Observables/DistinctUntilChanged.swift; sourceTree = ""; }; + 44F10FFC1F6C0F6A0F7C003C038C272B /* ImmediateSchedulerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ImmediateSchedulerType.swift; path = RxSwift/ImmediateSchedulerType.swift; sourceTree = ""; }; + 452FB9512A491F731556BD2F110347ED /* AsyncSubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncSubject.swift; path = RxSwift/Subjects/AsyncSubject.swift; sourceTree = ""; }; + 459E274832813076884CA4287E491429 /* Using.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Using.swift; path = RxSwift/Observables/Using.swift; sourceTree = ""; }; + 45C4BA95A0FC85CD30E5DD59545AF87F /* Do.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Do.swift; path = RxSwift/Observables/Do.swift; sourceTree = ""; }; + 46285A50499BCD564104AE4AD8489A48 /* Range.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Range.swift; path = RxSwift/Observables/Range.swift; sourceTree = ""; }; + 46FC0AD10406C3CE1828C826775E9650 /* XmlItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = XmlItem.swift; sourceTree = ""; }; + 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClient-dummy.m"; sourceTree = ""; }; + 47214E2FA3F755CB7B808800197ECE59 /* UserAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = UserAPI.md; path = docs/UserAPI.md; sourceTree = ""; }; + 47729A51DD7F47ED910F54FB3FBE5393 /* File.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = ""; }; + 47A00016C4275D6E28A1DD5AD98AC9AE /* ObservableType+PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+PrimitiveSequence.swift"; path = "RxSwift/Traits/ObservableType+PrimitiveSequence.swift"; sourceTree = ""; }; + 498E9106F2911C5C575288660EF2C14A /* Never.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Never.swift; path = RxSwift/Observables/Never.swift; sourceTree = ""; }; + 49A9E858642895322172FF16226C86AC /* Buffer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Buffer.swift; path = RxSwift/Observables/Buffer.swift; sourceTree = ""; }; + 49E9CEC3564840C6531A01B3402A3A12 /* Catch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Catch.swift; path = RxSwift/Observables/Catch.swift; sourceTree = ""; }; + 4A4CFDCD285AB04B85A4EF0446C859E4 /* EnumClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumClass.md; path = docs/EnumClass.md; sourceTree = ""; }; + 4B22542F5E9A061C9F6214D75923635D /* RxSwift-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "RxSwift-umbrella.h"; sourceTree = ""; }; + 4B5420BA5CD952DA0D4A8A31E4D69CC2 /* Sequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sequence.swift; path = RxSwift/Observables/Sequence.swift; sourceTree = ""; }; + 4C008FB60F065D079DB1F0C69B60DDEA /* DispatchQueue+Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Alamofire.swift"; path = "Source/DispatchQueue+Alamofire.swift"; sourceTree = ""; }; + 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "Pods-SwaggerClientTests-dummy.m"; sourceTree = ""; }; + 4C42EB9688F37F35C9110C57A8075DC4 /* BinaryDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = BinaryDisposable.swift; path = RxSwift/Disposables/BinaryDisposable.swift; sourceTree = ""; }; + 4DC5DC2F9BCEFA797895B33C16D2B17E /* Pods-SwaggerClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-Info.plist"; sourceTree = ""; }; + 4F8AC481F02DAF666B64D9A62FA7109F /* AnotherFakeAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AnotherFakeAPI.md; path = docs/AnotherFakeAPI.md; sourceTree = ""; }; + 4FB24B4936663207D1E346C5B6B9EAD4 /* Alamofire.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = Alamofire.xcconfig; sourceTree = ""; }; + 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Pods-SwaggerClientTests-umbrella.h"; sourceTree = ""; }; + 5076FFA46D2287FC8EC0C217FC4BA0B7 /* Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+arity.swift"; path = "RxSwift/Observables/Zip+arity.swift"; sourceTree = ""; }; + 5164EAF5A81C9C991085A3D5BA3A7627 /* FakeClassnameTags123API.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FakeClassnameTags123API.md; path = docs/FakeClassnameTags123API.md; sourceTree = ""; }; + 51BEBD9500775258E10801B2D4636130 /* Validation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Validation.swift; path = Source/Validation.swift; sourceTree = ""; }; + 54212BBF40F065FC93C168C875E2E209 /* CombineLatest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CombineLatest.swift; path = RxSwift/Observables/CombineLatest.swift; sourceTree = ""; }; + 55000F129FE5A09A0B51661892DB1F4E /* RecursiveLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveLock.swift; path = Platform/RecursiveLock.swift; sourceTree = ""; }; + 55A64F269657828EFCFE8BFEBEC769FC /* APIs.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIs.swift; path = PetstoreClient/Classes/OpenAPIs/APIs.swift; sourceTree = ""; }; + 55B63E482462E54A5366DAEA6318FB7E /* SerialDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDisposable.swift; path = RxSwift/Disposables/SerialDisposable.swift; sourceTree = ""; }; + 55D378FA7C24F905373016C59B3BE2C4 /* ArrayOfArrayOfNumberOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ArrayOfArrayOfNumberOnly.md; path = docs/ArrayOfArrayOfNumberOnly.md; sourceTree = ""; }; + 56430A53624DF50D17D8AB350D129613 /* Name.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Name.md; path = docs/Name.md; sourceTree = ""; }; + 575E60871C2A868C6B6D235B2DE25D83 /* TaskDelegate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TaskDelegate.swift; path = Source/TaskDelegate.swift; sourceTree = ""; }; + 57C559BAD8B2B8C949DA1C1837C049C6 /* TakeLast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeLast.swift; path = RxSwift/Observables/TakeLast.swift; sourceTree = ""; }; + 59A65FEE7BCD66D95A4A236D44082214 /* ArrayOfArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfArrayOfNumberOnly.swift; sourceTree = ""; }; + 5A4C226AA31A4DF5F6CE9579AE514B34 /* ClassModel.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ClassModel.md; path = docs/ClassModel.md; sourceTree = ""; }; + 5A8B9F6DB3E903DC9635F9DA16D90A0C /* Cancelable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Cancelable.swift; path = RxSwift/Cancelable.swift; sourceTree = ""; }; + 5B6C60D7E233892084DAC43F60C64C60 /* ObservableType+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "ObservableType+Extensions.swift"; path = "RxSwift/ObservableType+Extensions.swift"; sourceTree = ""; }; + 5EBFB4694957EBED5253C544C3917DBC /* Category.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Category.md; path = docs/Category.md; sourceTree = ""; }; + 5FF198528C6AE20A99A5E33F76D0C527 /* Map.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Map.swift; path = RxSwift/Observables/Map.swift; sourceTree = ""; }; + 608A407DE2A47612643C9271D707558C /* EnumTest.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumTest.md; path = docs/EnumTest.md; sourceTree = ""; }; + 60E9C1BF2A5AAD8532B83D587D4B447A /* Queue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Queue.swift; path = Platform/DataStructures/Queue.swift; sourceTree = ""; }; + 618C90E6044C36C76F3590183ED38CB2 /* Pods-SwaggerClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClient.modulemap"; sourceTree = ""; }; + 62326983DDFE0858FB48A88B024EAE9D /* Debounce.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debounce.swift; path = RxSwift/Observables/Debounce.swift; sourceTree = ""; }; + 64F819D835354426411C22FB35823EAD /* AddRef.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AddRef.swift; path = RxSwift/Observables/AddRef.swift; sourceTree = ""; }; + 65FF8529B526BB8EC9A7CB5716CEB89F /* Zip+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Zip+Collection.swift"; path = "RxSwift/Observables/Zip+Collection.swift"; sourceTree = ""; }; + 679C1F8FF956155F71A31E63595C9AB9 /* DispatchQueue+Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "DispatchQueue+Extensions.swift"; path = "Platform/DispatchQueue+Extensions.swift"; sourceTree = ""; }; + 6DA209283C4EBF0544FF63C7D1BCC40D /* VirtualTimeScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeScheduler.swift; path = RxSwift/Schedulers/VirtualTimeScheduler.swift; sourceTree = ""; }; + 6DB4CEA0C0A7C4823A04EAD9FBA3961D /* Throttle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Throttle.swift; path = RxSwift/Observables/Throttle.swift; sourceTree = ""; }; + 6E67D2FEF499445214AF84B7B9C9B33E /* TakeWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = TakeWhile.swift; path = RxSwift/Observables/TakeWhile.swift; sourceTree = ""; }; + 6EDF3214C286AFD4841B3551A037B0A9 /* Alamofire.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Alamofire.framework; path = Alamofire.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6F10D694F6B9493FDA575E60FE695722 /* ElementAt.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ElementAt.swift; path = RxSwift/Observables/ElementAt.swift; sourceTree = ""; }; + 6F9F8165FD8B1C4B07F06F5DCDDDE89A /* Pods_SwaggerClientTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = Pods_SwaggerClientTests.framework; path = "Pods-SwaggerClientTests.framework"; sourceTree = BUILT_PRODUCTS_DIR; }; + 70180A07F00266A41D515742CBA72B74 /* SubscribeOn.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscribeOn.swift; path = RxSwift/Observables/SubscribeOn.swift; sourceTree = ""; }; + 717C1608162B27019EBC04A33444BAEE /* ScheduledDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledDisposable.swift; path = RxSwift/Disposables/ScheduledDisposable.swift; sourceTree = ""; }; + 720601B930B8E6FB3B449B0C3EFB451F /* Request.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Request.swift; path = Source/Request.swift; sourceTree = ""; }; + 7239C4B748D482C26AE3B3EC168AD371 /* Category.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Category.swift; sourceTree = ""; }; + 745314207D827581C481CE38F4AEB7A3 /* VirtualTimeConverterType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = VirtualTimeConverterType.swift; path = RxSwift/Schedulers/VirtualTimeConverterType.swift; sourceTree = ""; }; + 757C5919A405D111AADAF18AFDDD9D5A /* SynchronizedOnType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedOnType.swift; path = RxSwift/Concurrency/SynchronizedOnType.swift; sourceTree = ""; }; + 758C5C2D6382B0F77807EFFC06E82BC4 /* OuterEnum.md */ = {isa = PBXFileReference; includeInIndex = 1; name = OuterEnum.md; path = docs/OuterEnum.md; sourceTree = ""; }; + 75E2A26619203BE094E23132BE4F9C6D /* OuterComposite.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterComposite.swift; sourceTree = ""; }; + 7628A653BCE0CE4F0CA24E4699FF04E5 /* AdditionalPropertiesAnyType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesAnyType.swift; sourceTree = ""; }; + 77CBC56217930F052D637B82D048BA3F /* GroupBy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = GroupBy.swift; path = RxSwift/Observables/GroupBy.swift; sourceTree = ""; }; + 77E4025C4EF246541D617C626370FC16 /* Client.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Client.swift; sourceTree = ""; }; + 799B734D0D692695C613949A6115718D /* Dog.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Dog.md; path = docs/Dog.md; sourceTree = ""; }; + 79A4D30F2478E26FEA80A716FA038512 /* Multicast.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Multicast.swift; path = RxSwift/Observables/Multicast.swift; sourceTree = ""; }; + 7AB42A286E75A2848A769570F01DAC24 /* AnyObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnyObserver.swift; path = RxSwift/AnyObserver.swift; sourceTree = ""; }; + 7B49FF45429D57DA0487C5BD90AA6398 /* CombineLatest+Collection.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+Collection.swift"; path = "RxSwift/Observables/CombineLatest+Collection.swift"; sourceTree = ""; }; + 7B990C87BD5B32BF54E420212C1A52B1 /* PrimitiveSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PrimitiveSequence.swift; path = RxSwift/Traits/PrimitiveSequence.swift; sourceTree = ""; }; + 7C8CB70C6C6B09D4BB90057C9BA7EEC2 /* PriorityQueue.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = PriorityQueue.swift; path = Platform/DataStructures/PriorityQueue.swift; sourceTree = ""; }; + 7D2AE1A0BBE6459478A73D38848B588E /* AdditionalPropertiesClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AdditionalPropertiesClass.md; path = docs/AdditionalPropertiesClass.md; sourceTree = ""; }; + 7D6449B4CFED6A13D7216B47179E7E4A /* OuterComposite.md */ = {isa = PBXFileReference; includeInIndex = 1; name = OuterComposite.md; path = docs/OuterComposite.md; sourceTree = ""; }; + 7EC9D77DAB6AE650C74E828CE1557C00 /* MainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MainScheduler.swift; path = RxSwift/Schedulers/MainScheduler.swift; sourceTree = ""; }; + 7F4E8DC898B4C8D35F09B107CE705172 /* Amb.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Amb.swift; path = RxSwift/Observables/Amb.swift; sourceTree = ""; }; + 8050204E8821E9A399D7E830591E063B /* Take.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Take.swift; path = RxSwift/Observables/Take.swift; sourceTree = ""; }; + 80EBCAEF4DEEB18B34DC5033FF20ECA8 /* Platform.Darwin.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Platform.Darwin.swift; path = Platform/Platform.Darwin.swift; sourceTree = ""; }; + 81629AD2DFFED981E047483057BE1362 /* ReadOnlyFirst.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ReadOnlyFirst.md; path = docs/ReadOnlyFirst.md; sourceTree = ""; }; + 8308F433372AEFC6D557F1856FC9DA01 /* JSONEncodingHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = JSONEncodingHelper.swift; path = PetstoreClient/Classes/OpenAPIs/JSONEncodingHelper.swift; sourceTree = ""; }; + 836ADD02498B971DAA473321782A72A0 /* StartWith.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = StartWith.swift; path = RxSwift/Observables/StartWith.swift; sourceTree = ""; }; + 857C9FC7F70D66015A686E5E392AB04F /* HasOnlyReadOnly.md */ = {isa = PBXFileReference; includeInIndex = 1; name = HasOnlyReadOnly.md; path = docs/HasOnlyReadOnly.md; sourceTree = ""; }; + 8688291EDCC3CA07AEFAFFDC3ABBE224 /* Tag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Tag.swift; sourceTree = ""; }; + 86A0FB6358543AEAB83BC45DD397D732 /* ParameterEncoding.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ParameterEncoding.swift; path = Source/ParameterEncoding.swift; sourceTree = ""; }; + 87ADA33E38CF943875922CB316D2A29A /* Order.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Order.swift; sourceTree = ""; }; + 88BE3C1FFB1B8A373D68AFE8E2CE9E5B /* Dog.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Dog.swift; sourceTree = ""; }; + 892F30771518EB494D89A92413C04E85 /* Extensions.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Extensions.swift; path = PetstoreClient/Classes/OpenAPIs/Extensions.swift; sourceTree = ""; }; + 8942B778DC2EC96252BBB267B62D566B /* Scan.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Scan.swift; path = RxSwift/Observables/Scan.swift; sourceTree = ""; }; + 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.debug.xcconfig"; sourceTree = ""; }; + 89D4EF25430724C9CA591320E91F6ADE /* AnotherFakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnotherFakeAPI.swift; sourceTree = ""; }; + 8C65830349B23D7E262AB27BAB0E8188 /* PrimitiveSequence+Zip+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "PrimitiveSequence+Zip+arity.swift"; path = "RxSwift/Traits/PrimitiveSequence+Zip+arity.swift"; sourceTree = ""; }; + 8CF5B2C124751B1983FA287330A81E51 /* TypeHolderDefault.md */ = {isa = PBXFileReference; includeInIndex = 1; name = TypeHolderDefault.md; path = docs/TypeHolderDefault.md; sourceTree = ""; }; + 8CFB12945932D18A9721B6AF2D8D871E /* Delay.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Delay.swift; path = RxSwift/Observables/Delay.swift; sourceTree = ""; }; + 8D048EFF0C58F0BC4BBC956A98937739 /* ObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableType.swift; path = RxSwift/ObservableType.swift; sourceTree = ""; }; + 8D44154CE37C1B66CDC3D69453887262 /* AsyncLock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsyncLock.swift; path = RxSwift/Concurrency/AsyncLock.swift; sourceTree = ""; }; + 8E271F2E357A3F1A972FF120671638B4 /* ClassModel.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ClassModel.swift; sourceTree = ""; }; + 8E309FED474011CFC561423B6D04ED9D /* Cat.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Cat.md; path = docs/Cat.md; sourceTree = ""; }; + 8E3B161DE103995FAFA429C1AD3E2875 /* DisposeBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DisposeBase.swift; path = RxSwift/Disposables/DisposeBase.swift; sourceTree = ""; }; + 8E7E635C33CF3DE53B838B378535F65C /* FormatTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FormatTest.swift; sourceTree = ""; }; + 901441DA8E39EF973EBE8D69C2CDADE7 /* Pods-SwaggerClientTests-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClientTests-Info.plist"; sourceTree = ""; }; + 90A6677EB26AA075208F098879E425DD /* List.md */ = {isa = PBXFileReference; includeInIndex = 1; name = List.md; path = docs/List.md; sourceTree = ""; }; + 9289A1C05392D4FF88A897B4FDF77958 /* Bag.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Bag.swift; path = Platform/DataStructures/Bag.swift; sourceTree = ""; }; + 928B725115295804C613BD7C865C8201 /* PetstoreClient.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = PetstoreClient.modulemap; sourceTree = ""; }; + 9448B03916DFC494CD68A614565A98B8 /* Pods-SwaggerClient-frameworks.sh */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.script.sh; path = "Pods-SwaggerClient-frameworks.sh"; sourceTree = ""; }; + 95300CC9035C5766B62FE4FB54FA5951 /* ResponseSerialization.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ResponseSerialization.swift; path = Source/ResponseSerialization.swift; sourceTree = ""; }; + 96FB30FE91CE11061D85EA6BDBE094E3 /* Pods-SwaggerClient-acknowledgements.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Pods-SwaggerClient-acknowledgements.plist"; sourceTree = ""; }; + 979ECDDE99CE790DA21FE87298107E6B /* Error.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Error.swift; path = RxSwift/Observables/Error.swift; sourceTree = ""; }; + 97AE2157FA464312716D670ACC5FBA81 /* ArrayOfNumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayOfNumberOnly.swift; sourceTree = ""; }; + 97CEA1BED002ABF0D6E5E078FB3F5895 /* ApiResponse.md */ = {isa = PBXFileReference; includeInIndex = 1; name = ApiResponse.md; path = docs/ApiResponse.md; sourceTree = ""; }; + 97D7A50019AFFCCD39301BD1E594F91C /* SwitchIfEmpty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwitchIfEmpty.swift; path = RxSwift/Observables/SwitchIfEmpty.swift; sourceTree = ""; }; + 98C736C5D0850FA27DB5D0E58640C537 /* Timer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timer.swift; path = RxSwift/Observables/Timer.swift; sourceTree = ""; }; + 9A56088E87A9AACE94749A936B309080 /* ServerTrustPolicy.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ServerTrustPolicy.swift; path = Source/ServerTrustPolicy.swift; sourceTree = ""; }; + 9A9D6B8A244BC24B1DFF8AE87F94F792 /* AdditionalPropertiesBoolean.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesBoolean.swift; sourceTree = ""; }; + 9D53702B1DFE795F10CD9F02ED7196FB /* AdditionalPropertiesArray.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesArray.swift; sourceTree = ""; }; + 9D597D60E3BD5AEA174D24F7409820EB /* RxSwift.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = RxSwift.modulemap; sourceTree = ""; }; + 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; }; + 9ECAC6F788B1B30D9157D0A0ADC1148B /* FileSchemaTestClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FileSchemaTestClass.swift; sourceTree = ""; }; + 9F929FCCF076F0A692EA809B17DD7F31 /* Dematerialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Dematerialize.swift; path = RxSwift/Observables/Dematerialize.swift; sourceTree = ""; }; + 9FBF81FDC5C51FD450958591E8EAF6EA /* ScheduledItemType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItemType.swift; path = RxSwift/Schedulers/Internal/ScheduledItemType.swift; sourceTree = ""; }; + A0F3842CFF62B5C53CBFA83436673969 /* PetAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = PetAPI.md; path = docs/PetAPI.md; sourceTree = ""; }; + A14370E500BCD2443559DB70F2786EB6 /* Maybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Maybe.swift; path = RxSwift/Traits/Maybe.swift; sourceTree = ""; }; + A1ADB924FB5616647988483D4A2F8229 /* PetstoreClient-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "PetstoreClient-Info.plist"; sourceTree = ""; }; + A1C5824ADAF044284DC74D7785926F01 /* CatAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = CatAllOf.swift; sourceTree = ""; }; + A2062FC5CF8950D95726336DA1F1F52C /* DogAllOf.md */ = {isa = PBXFileReference; includeInIndex = 1; name = DogAllOf.md; path = docs/DogAllOf.md; sourceTree = ""; }; + A2C8922E4E1E3C67279458D892BC37AD /* Configuration.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Configuration.swift; path = PetstoreClient/Classes/OpenAPIs/Configuration.swift; sourceTree = ""; }; + A2EDBEFED12864758CCA6F411205AB2E /* SkipWhile.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SkipWhile.swift; path = RxSwift/Observables/SkipWhile.swift; sourceTree = ""; }; + A403B12907B25FC32930C07AD4DF4600 /* HasOnlyReadOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = HasOnlyReadOnly.swift; sourceTree = ""; }; + A4218AB53A6385BB02D95ED58A63B6AB /* SubscriptionDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubscriptionDisposable.swift; path = RxSwift/Disposables/SubscriptionDisposable.swift; sourceTree = ""; }; + A5F4524003B8CAF5944F3FD37875D795 /* NopDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NopDisposable.swift; path = RxSwift/Disposables/NopDisposable.swift; sourceTree = ""; }; + A6DF985F6F04F63AA4A9AE7866CB8D22 /* FakeAPI.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeAPI.swift; sourceTree = ""; }; + A71552570D704D50ABA564EB978406FA /* OuterEnum.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = OuterEnum.swift; sourceTree = ""; }; + A8383047D766DF909F58645FCCF42048 /* NetworkReachabilityManager.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = NetworkReachabilityManager.swift; path = Source/NetworkReachabilityManager.swift; sourceTree = ""; }; + A933D6B3F16C58A90BFD589C4B23EE38 /* EnumTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumTest.swift; sourceTree = ""; }; + AA9CEE837EF5EE1215788BEBC3959479 /* Single.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Single.swift; path = RxSwift/Traits/Single.swift; sourceTree = ""; }; + AB1FE5BDED74EBDC047C5B437A524854 /* ConnectableObservableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConnectableObservableType.swift; path = RxSwift/ConnectableObservableType.swift; sourceTree = ""; }; + AB9FF8F32D5D6FC16033AF34AC1408FD /* HistoricalSchedulerTimeConverter.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = HistoricalSchedulerTimeConverter.swift; path = RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift; sourceTree = ""; }; + ACC20A8939D21B502E71D99F130B013E /* NumberOnly.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = NumberOnly.swift; sourceTree = ""; }; + AE110F03859CEB598ADBC6AF0026E6C6 /* Alamofire-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-umbrella.h"; sourceTree = ""; }; + AE55486083AAFB05A421910D689676CD /* APIHelper.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = APIHelper.swift; path = PetstoreClient/Classes/OpenAPIs/APIHelper.swift; sourceTree = ""; }; + AE9C5D5D818389294D9B773DD491B146 /* AdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesClass.swift; sourceTree = ""; }; + AEF2F44C17F277967404CE3DA788FD46 /* ReplaySubject.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ReplaySubject.swift; path = RxSwift/Subjects/ReplaySubject.swift; sourceTree = ""; }; + AF5C3CBAA31C59F82C8DE03C448B79D8 /* Order.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Order.md; path = docs/Order.md; sourceTree = ""; }; + B048D2348C3086D80D00537EC372C755 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; path = README.md; sourceTree = ""; }; + B18AB9B87BF0A071727872B64CC84137 /* CurrentThreadScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = CurrentThreadScheduler.swift; path = RxSwift/Schedulers/CurrentThreadScheduler.swift; sourceTree = ""; }; + B22AF668079FC82298B5D800D6E575BB /* Timeline.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeline.swift; path = Source/Timeline.swift; sourceTree = ""; }; + B23D0E4BD36D6E24C66A8DB3F81FE656 /* ReadOnlyFirst.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ReadOnlyFirst.swift; sourceTree = ""; }; + B29AE35CD92E0CB3A64D2E581DAD2CB4 /* First.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = First.swift; path = RxSwift/Observables/First.swift; sourceTree = ""; }; + B2BC0F91A33991D668BEC3583CF46BAB /* WithLatestFrom.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = WithLatestFrom.swift; path = RxSwift/Observables/WithLatestFrom.swift; sourceTree = ""; }; + B374449845CA94813BACD80BE4751992 /* User.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = ""; }; + B3B003673B45236AA5A51A70A733399D /* Empty.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Empty.swift; path = RxSwift/Observables/Empty.swift; sourceTree = ""; }; + B3DC61667E570A41266B09E2160DAF2D /* AnonymousObserver.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousObserver.swift; path = RxSwift/Observers/AnonymousObserver.swift; sourceTree = ""; }; + B498E7AFBD0589628B31BD16154B20FF /* Deprecated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deprecated.swift; path = RxSwift/Deprecated.swift; sourceTree = ""; }; + B50B0F2486C6BB7F3AF76CD685C8B4E1 /* Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Rx.swift; path = RxSwift/Rx.swift; sourceTree = ""; }; + B52D5D8ED9723274361CA73BDC3875A0 /* FileSchemaTestClass.md */ = {isa = PBXFileReference; includeInIndex = 1; name = FileSchemaTestClass.md; path = docs/FileSchemaTestClass.md; sourceTree = ""; }; + B5A26ADF8B68902A509D1A52E825E595 /* Pet.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Pet.md; path = docs/Pet.md; sourceTree = ""; }; + B5D0270A8CD4CA80B74E5EC729FBC1A7 /* DeprecationWarner.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = DeprecationWarner.swift; path = Platform/DeprecationWarner.swift; sourceTree = ""; }; + B68A320DEB52A0B2CF5A7DCD714E84D3 /* RecursiveScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RecursiveScheduler.swift; path = RxSwift/Schedulers/RecursiveScheduler.swift; sourceTree = ""; }; + B6DFB261890C61E9C5ED205C350432C6 /* DogAllOf.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = DogAllOf.swift; sourceTree = ""; }; + B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClient.release.xcconfig"; sourceTree = ""; }; + BAED0C18FF2FC7D97F0E5B2D4FE37F2C /* Switch.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Switch.swift; path = RxSwift/Observables/Switch.swift; sourceTree = ""; }; + BB2944F75CA2FADBE47B2326252AAB5A /* EnumArrays.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumArrays.swift; sourceTree = ""; }; + BC49CD3902CF252FAA732A1DDA1DC1C9 /* Completable+AndThen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Completable+AndThen.swift"; path = "RxSwift/Traits/Completable+AndThen.swift"; sourceTree = ""; }; + BD2133B0A357172D4E12A35C6488638D /* Model200Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Model200Response.swift; sourceTree = ""; }; + BDE1B1C73CF83B02289A255C14E108C9 /* SingleAssignmentDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAssignmentDisposable.swift; path = RxSwift/Disposables/SingleAssignmentDisposable.swift; sourceTree = ""; }; + BE02647BBDB83E0D48469A56FBF37C88 /* Debug.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Debug.swift; path = RxSwift/Observables/Debug.swift; sourceTree = ""; }; + BE1E7C2852E09D117ECDA841F0A5CE03 /* RxSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = RxSwift.framework; path = RxSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BE6232D0F85A4EF002139921CBA82C3F /* RxSwift.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = RxSwift.xcconfig; sourceTree = ""; }; + BE64C63DA4FB40ACE396982AAB244DC0 /* ObservableConvertibleType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObservableConvertibleType.swift; path = RxSwift/ObservableConvertibleType.swift; sourceTree = ""; }; + BE70B57B6CF22A99EBDA453C12741148 /* Sink.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Sink.swift; path = RxSwift/Observables/Sink.swift; sourceTree = ""; }; + BF174B49C2E16DD172055DB12BC37B2F /* SpecialModelName.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = SpecialModelName.swift; sourceTree = ""; }; + C2ABFCCD850DDE628412E12A3A36BC83 /* AdditionalPropertiesNumber.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesNumber.swift; sourceTree = ""; }; + C308A93504B6AE628F892297A6EDD347 /* InfiniteSequence.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InfiniteSequence.swift; path = Platform/DataStructures/InfiniteSequence.swift; sourceTree = ""; }; + C3633BEF1B1742609980D8C0500E4519 /* Client.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Client.md; path = docs/Client.md; sourceTree = ""; }; + C3FFE137AD3E253AC3CC98BDB629E1CC /* PetstoreClient-dummy.m */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.objc; path = "PetstoreClient-dummy.m"; sourceTree = ""; }; + C54917ABF2432A86A6CCB0EABE76F916 /* Animal.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Animal.md; path = docs/Animal.md; sourceTree = ""; }; + C5A7024FF197192803FBC9F7CEFD9C87 /* SubjectType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SubjectType.swift; path = RxSwift/Subjects/SubjectType.swift; sourceTree = ""; }; + C5FFB8448F56996188428783F8C6C98F /* Disposables.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposables.swift; path = RxSwift/Disposables/Disposables.swift; sourceTree = ""; }; + C638F1FAA7FFA890ACB0BAD594BAA07B /* AsSingle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsSingle.swift; path = RxSwift/Observables/AsSingle.swift; sourceTree = ""; }; + C645ED7A39D8B9114C20CAFE2B7FBC2B /* AlamofireImplementations.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AlamofireImplementations.swift; path = PetstoreClient/Classes/OpenAPIs/AlamofireImplementations.swift; sourceTree = ""; }; + C692DE62E3C756A61E2E9C829EA0BCE6 /* TypeHolderDefault.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TypeHolderDefault.swift; sourceTree = ""; }; + C71AEC0AF13D31F11719E203832081AF /* Concat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Concat.swift; path = RxSwift/Observables/Concat.swift; sourceTree = ""; }; + C745F77F676CBAE7E68106481E9DF4B9 /* Alamofire.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Alamofire.swift; path = Source/Alamofire.swift; sourceTree = ""; }; + C894BEC0DE9A446CBB01A0B7D63DA38A /* Materialize.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Materialize.swift; path = RxSwift/Observables/Materialize.swift; sourceTree = ""; }; + C89F6DBCB4EBE505168C934C00DB909D /* Lock.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Lock.swift; path = RxSwift/Concurrency/Lock.swift; sourceTree = ""; }; + CB268230F2A96F71335E107E497BC32C /* AdditionalPropertiesInteger.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AdditionalPropertiesInteger.swift; sourceTree = ""; }; + CB834FF7C5DF4A05EB6179428E1A2D30 /* InvocableType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = InvocableType.swift; path = RxSwift/Schedulers/Internal/InvocableType.swift; sourceTree = ""; }; + CD714B38F6C265C97287CD6F713F3398 /* AFError.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AFError.swift; path = Source/AFError.swift; sourceTree = ""; }; + CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; path = "Pods-SwaggerClientTests.debug.xcconfig"; sourceTree = ""; }; + CF92C4858F759EABBDDB45D32BE8DDC2 /* SerialDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SerialDispatchQueueScheduler.swift; path = RxSwift/Schedulers/SerialDispatchQueueScheduler.swift; sourceTree = ""; }; + D01ADEDF5E44D58ACB8ED1AED7BF7615 /* Pods-SwaggerClientTests-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClientTests-acknowledgements.markdown"; sourceTree = ""; }; + D10F2A3D1BBD10CA8594739DB19CDC07 /* SwiftSupport.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SwiftSupport.swift; path = RxSwift/SwiftSupport/SwiftSupport.swift; sourceTree = ""; }; + D1A6BA19B108998DF7350B40C83BFC47 /* Pods-SwaggerClientTests.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = "Pods-SwaggerClientTests.modulemap"; sourceTree = ""; }; + D1E589B3714F15E207FD32CD6EC52305 /* RxSwift-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "RxSwift-Info.plist"; sourceTree = ""; }; + D25BFF9CA1B3C8219A5F2A1C064AA6AA /* CombineLatest+arity.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "CombineLatest+arity.swift"; path = "RxSwift/Observables/CombineLatest+arity.swift"; sourceTree = ""; }; + D335B34B9871B74E10984781CC371CBA /* MultipartFormData.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = MultipartFormData.swift; path = Source/MultipartFormData.swift; sourceTree = ""; }; + D406BAD811EAD0952929B093F56F2BF2 /* MixedPropertiesAndAdditionalPropertiesClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = MixedPropertiesAndAdditionalPropertiesClass.swift; sourceTree = ""; }; + D46742F1F99243487DCC614C75C1413C /* Pods-SwaggerClient-acknowledgements.markdown */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; path = "Pods-SwaggerClient-acknowledgements.markdown"; sourceTree = ""; }; + D49FDF34DAD7FA627C657B59EEF5348A /* Alamofire-prefix.pch */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "Alamofire-prefix.pch"; sourceTree = ""; }; + D69932FBD99A6AC9733077CD793DE95E /* PetstoreClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; name = PetstoreClient.framework; path = PetstoreClient.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D73E4AE40107F9E12D9933657017209A /* Cat.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Cat.swift; sourceTree = ""; }; + D765DC1CA9E827C5C155427A9C020AF8 /* ConcurrentMainScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentMainScheduler.swift; path = RxSwift/Schedulers/ConcurrentMainScheduler.swift; sourceTree = ""; }; + D7FBBD15C7EDE32F75E84BF63C4A0093 /* Response.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Response.swift; path = Source/Response.swift; sourceTree = ""; }; + D8ED3568E09862ADC85A6FE650FEC665 /* AnonymousDisposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AnonymousDisposable.swift; path = RxSwift/Disposables/AnonymousDisposable.swift; sourceTree = ""; }; + D95243E9789D171D24B3CCEF4A306E79 /* Just.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Just.swift; path = RxSwift/Observables/Just.swift; sourceTree = ""; }; + D95AD1D226C3858D35BDFD664BBFCC02 /* ConcurrentDispatchQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ConcurrentDispatchQueueScheduler.swift; path = RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift; sourceTree = ""; }; + D98CA687BDA7E1DE6C6D098CFD6AE1C7 /* StoreAPI.md */ = {isa = PBXFileReference; includeInIndex = 1; name = StoreAPI.md; path = docs/StoreAPI.md; sourceTree = ""; }; + DBD0EFE5168A6526DB06F4A6800CF584 /* Observable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Observable.swift; path = RxSwift/Observable.swift; sourceTree = ""; }; + DCD118360416984364D92CA81D410FC2 /* Model200Response.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Model200Response.md; path = docs/Model200Response.md; sourceTree = ""; }; + DDC303FBE481D915EC0B8ADDAE1623CB /* CatAllOf.md */ = {isa = PBXFileReference; includeInIndex = 1; name = CatAllOf.md; path = docs/CatAllOf.md; sourceTree = ""; }; + DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* 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; }; + DF1DD94A10F409B4316DAC2A019FED34 /* FakeClassnameTags123API.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = FakeClassnameTags123API.swift; sourceTree = ""; }; + E1259C7EE8FBB3A324ED66A0FBE292D2 /* EnumClass.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = EnumClass.swift; sourceTree = ""; }; + E22F3BDA0C336074E5EA13F37C05FF2C /* RetryWhen.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = RetryWhen.swift; path = RxSwift/Observables/RetryWhen.swift; sourceTree = ""; }; + E237960AB17F68A30227D83025D39488 /* List.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = List.swift; sourceTree = ""; }; + E3B9412BBCE6A74BC742A54FD0B8186C /* Zip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Zip.swift; path = RxSwift/Observables/Zip.swift; sourceTree = ""; }; + E57A9C76D05E7DF25E045C8C83CF7B8C /* File.md */ = {isa = PBXFileReference; includeInIndex = 1; name = File.md; path = docs/File.md; sourceTree = ""; }; + E708A153C22A9339B8145278E89E64D8 /* Result.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Result.swift; path = Source/Result.swift; sourceTree = ""; }; + E7AE50AD71DB17321FA5240F1B1D2E70 /* AnimalFarm.md */ = {isa = PBXFileReference; includeInIndex = 1; name = AnimalFarm.md; path = docs/AnimalFarm.md; sourceTree = ""; }; + E9ABCE94A0D10DF97FC367C061436E5F /* OperationQueueScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = OperationQueueScheduler.swift; path = RxSwift/Schedulers/OperationQueueScheduler.swift; sourceTree = ""; }; + EA01D2A2DB1E31168FFF75C6F9DAD5C5 /* ShareReplayScope.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ShareReplayScope.swift; path = RxSwift/Observables/ShareReplayScope.swift; sourceTree = ""; }; + EAFD9A5AE325CD48442A611EFD103D57 /* Enumerated.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Enumerated.swift; path = RxSwift/Observables/Enumerated.swift; sourceTree = ""; }; + EC22F330006EA5F892970C69FBA9F199 /* SynchronizedUnsubscribeType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SynchronizedUnsubscribeType.swift; path = RxSwift/Concurrency/SynchronizedUnsubscribeType.swift; sourceTree = ""; }; + ED1332D9E071ED0D532F6ACD2AD1AC38 /* SingleAsync.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SingleAsync.swift; path = RxSwift/Observables/SingleAsync.swift; sourceTree = ""; }; + EDB38B126A5C5BA3195B41CDA7E3F6A3 /* EnumArrays.md */ = {isa = PBXFileReference; includeInIndex = 1; name = EnumArrays.md; path = docs/EnumArrays.md; sourceTree = ""; }; + EFA2A0B903691A7C2293FD13EACB8E3F /* Window.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Window.swift; path = RxSwift/Observables/Window.swift; sourceTree = ""; }; + F1577EF84ADE20D7F04CD82D5BAA684B /* User.md */ = {isa = PBXFileReference; includeInIndex = 1; name = User.md; path = docs/User.md; sourceTree = ""; }; + F1FC53345CBCE9EF88576C6BDC5D16EE /* Skip.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Skip.swift; path = RxSwift/Observables/Skip.swift; sourceTree = ""; }; + F25DE89C483E14ED16E9B0F96850BF3B /* ArrayTest.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = ArrayTest.swift; sourceTree = ""; }; + F2E147BD28F065756948CC15F0E6B68D /* Producer.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Producer.swift; path = RxSwift/Observables/Producer.swift; sourceTree = ""; }; + F3A9349CCCD01B8CD6646B22BD8FAFFD /* AnimalFarm.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = AnimalFarm.swift; sourceTree = ""; }; + F42B2C25A2A499E0244E107DF28BA640 /* Timeout.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Timeout.swift; path = RxSwift/Observables/Timeout.swift; sourceTree = ""; }; + F4546CAE8AC2D5BD71A14E476145C771 /* PetstoreClient-umbrella.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; path = "PetstoreClient-umbrella.h"; sourceTree = ""; }; + F53E66F85590280D11F64545A178CC13 /* StringBooleanMap.md */ = {isa = PBXFileReference; includeInIndex = 1; name = StringBooleanMap.md; path = docs/StringBooleanMap.md; sourceTree = ""; }; + F5CF777F69E934A92F78512092C53052 /* LockOwnerType.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = LockOwnerType.swift; path = RxSwift/Concurrency/LockOwnerType.swift; sourceTree = ""; }; + F6BAA110BD7DD59D40985519BC3BAB2C /* AsMaybe.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = AsMaybe.swift; path = RxSwift/Observables/AsMaybe.swift; sourceTree = ""; }; + F73E2FE9C0296B7647E36FDAB1A48E6E /* Errors.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Errors.swift; path = RxSwift/Errors.swift; sourceTree = ""; }; + F8D5778A0684580BB744D394024BB4A6 /* Return.md */ = {isa = PBXFileReference; includeInIndex = 1; name = Return.md; path = docs/Return.md; sourceTree = ""; }; + F8E5B43302C88640C1A05762A037012A /* Generate.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Generate.swift; path = RxSwift/Observables/Generate.swift; sourceTree = ""; }; + F9FDC7E72AC896C5D9031E49B0372D06 /* SchedulerServices+Emulation.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "SchedulerServices+Emulation.swift"; path = "RxSwift/Schedulers/SchedulerServices+Emulation.swift"; sourceTree = ""; }; + FB54B43833CB03F1D8749CE7C298D3B5 /* ObserverBase.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ObserverBase.swift; path = RxSwift/Observers/ObserverBase.swift; sourceTree = ""; }; + FB709FAE1018A60657705217C88967AC /* TypeHolderExample.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = TypeHolderExample.swift; sourceTree = ""; }; + FBF9232381581A50CA2E8FA9517D76EB /* Deferred.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Deferred.swift; path = RxSwift/Observables/Deferred.swift; sourceTree = ""; }; + FC35E81B52795E7CB75A8D1E9687BF16 /* Disposable.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Disposable.swift; path = RxSwift/Disposable.swift; sourceTree = ""; }; + FC82F67A5B34D020108D89B64C3BD691 /* SpecialModelName.md */ = {isa = PBXFileReference; includeInIndex = 1; name = SpecialModelName.md; path = docs/SpecialModelName.md; sourceTree = ""; }; + FD2207283F6AAB87403F6CC48462589C /* Alamofire-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; path = "Alamofire-Info.plist"; sourceTree = ""; }; + FE0D448C7D74BFFB8604285DD7047EED /* ScheduledItem.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = ScheduledItem.swift; path = RxSwift/Schedulers/Internal/ScheduledItem.swift; sourceTree = ""; }; + FEFFBEEA8F7216DF65BD978A823BEDA2 /* Name.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; path = Name.swift; sourceTree = ""; }; + FF4EA9F3121FB3144A5648BBC0A8004D /* Merge.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = Merge.swift; path = RxSwift/Observables/Merge.swift; sourceTree = ""; }; + FF699627254D1F4E425E37E0306B828B /* Bag+Rx.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = "Bag+Rx.swift"; path = "RxSwift/Extensions/Bag+Rx.swift"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9C5D10FD5C4D12FBA9AF8DE73A0476D4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 400710E3FF438CDC18E6D19C8E64E0D0 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BFF25BADA4BDAAF2C33C2AB4B7CC18DF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 02D5452095EF961AABF5EC9484D6700F /* Alamofire.framework in Frameworks */, + BDEA420ADE6E58BFDB87E1339C6EF292 /* Foundation.framework in Frameworks */, + 3CB84F06C826903645D046E00A08E94B /* RxSwift.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D4EC17B7E6732812B49C04E19E9C0EF3 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6B598CD6C3665D587BD8EDE6202EA593 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E44363F6A0C4B876C2CE0C89617F4A74 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 00EA7C74AF31550D150A68EC1DB4885A /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F1626ADC3A7EC435D2722B3173355D36 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 3BD1DAFE1F3E6C9E4EB0F2099B6D6FA2 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0EFA4421D8D59E9E4A8C8A50F313B3C5 /* Support Files */ = { + isa = PBXGroup; + children = ( + 9D597D60E3BD5AEA174D24F7409820EB /* RxSwift.modulemap */, + BE6232D0F85A4EF002139921CBA82C3F /* RxSwift.xcconfig */, + 2F77FDC4F04FEF422ACDCD587C512559 /* RxSwift-dummy.m */, + D1E589B3714F15E207FD32CD6EC52305 /* RxSwift-Info.plist */, + 0723F133C41FD08232F74124D0E3FC2E /* RxSwift-prefix.pch */, + 4B22542F5E9A061C9F6214D75923635D /* RxSwift-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/RxSwift"; + sourceTree = ""; + }; + 1C8221FE0071BDA2D0C5DE07B7736E88 /* Development Pods */ = { + isa = PBXGroup; + children = ( + ADB072EBDA2441CFD03AE3EE4E9CFE92 /* PetstoreClient */, + ); + name = "Development Pods"; + sourceTree = ""; + }; + 262AD758FCFC71C597EE703E744E279A /* Alamofire */ = { + isa = PBXGroup; + children = ( + CD714B38F6C265C97287CD6F713F3398 /* AFError.swift */, + C745F77F676CBAE7E68106481E9DF4B9 /* Alamofire.swift */, + 4C008FB60F065D079DB1F0C69B60DDEA /* DispatchQueue+Alamofire.swift */, + D335B34B9871B74E10984781CC371CBA /* MultipartFormData.swift */, + A8383047D766DF909F58645FCCF42048 /* NetworkReachabilityManager.swift */, + 39AE2AD9A01457ED8AC57D692A5F40AD /* Notifications.swift */, + 86A0FB6358543AEAB83BC45DD397D732 /* ParameterEncoding.swift */, + 720601B930B8E6FB3B449B0C3EFB451F /* Request.swift */, + D7FBBD15C7EDE32F75E84BF63C4A0093 /* Response.swift */, + 95300CC9035C5766B62FE4FB54FA5951 /* ResponseSerialization.swift */, + E708A153C22A9339B8145278E89E64D8 /* Result.swift */, + 9A56088E87A9AACE94749A936B309080 /* ServerTrustPolicy.swift */, + 378449150E818606AADBD6FB5A562D0D /* SessionDelegate.swift */, + 02C7203E47628DD3832410EEA16A1D8B /* SessionManager.swift */, + 575E60871C2A868C6B6D235B2DE25D83 /* TaskDelegate.swift */, + B22AF668079FC82298B5D800D6E575BB /* Timeline.swift */, + 51BEBD9500775258E10801B2D4636130 /* Validation.swift */, + 8342B3C0D5B5B78B6FF2EB9EBABDF316 /* Support Files */, + ); + name = Alamofire; + path = Alamofire; + sourceTree = ""; + }; + 27EB02841E0D43820F14F4377DE3547E /* Targets Support Files */ = { + isa = PBXGroup; + children = ( + 8244AEBEFB4AC3530215FA5CBA26673B /* Pods-SwaggerClient */, + 86B1F48A58BFA2FA26CD584937FBEED1 /* Pods-SwaggerClientTests */, + ); + name = "Targets Support Files"; + sourceTree = ""; + }; + 2F357899B70BCB34F071EB6F4C420F2E /* Support Files */ = { + isa = PBXGroup; + children = ( + 928B725115295804C613BD7C865C8201 /* PetstoreClient.modulemap */, + 28DB89F2024F2DDD08AE89C3006D009E /* PetstoreClient.xcconfig */, + C3FFE137AD3E253AC3CC98BDB629E1CC /* PetstoreClient-dummy.m */, + A1ADB924FB5616647988483D4A2F8229 /* PetstoreClient-Info.plist */, + 2B2AAC902CD2815AAAFD57064F19AB84 /* PetstoreClient-prefix.pch */, + F4546CAE8AC2D5BD71A14E476145C771 /* PetstoreClient-umbrella.h */, + ); + name = "Support Files"; + path = "SwaggerClientTests/Pods/Target Support Files/PetstoreClient"; + sourceTree = ""; + }; + 6C5DB4246A4C5DB39B520841339F1173 /* Pods */ = { + isa = PBXGroup; + children = ( + 262AD758FCFC71C597EE703E744E279A /* Alamofire */, + D5E8828356ABA3B9CC63A755C69FA492 /* RxSwift */, + ); + name = Pods; + sourceTree = ""; + }; + 752761252CF779269D588A7735D3E8BD /* Products */ = { + isa = PBXGroup; + children = ( + 6EDF3214C286AFD4841B3551A037B0A9 /* Alamofire.framework */, + D69932FBD99A6AC9733077CD793DE95E /* PetstoreClient.framework */, + 0F39AA54BB1773329C8151B721ED0D09 /* Pods_SwaggerClient.framework */, + 6F9F8165FD8B1C4B07F06F5DCDDDE89A /* Pods_SwaggerClientTests.framework */, + BE1E7C2852E09D117ECDA841F0A5CE03 /* RxSwift.framework */, + ); + name = Products; + sourceTree = ""; + }; + 76FC95CAFD3F67C42393B89FE11C631E /* Models */ = { + isa = PBXGroup; + children = ( + 7628A653BCE0CE4F0CA24E4699FF04E5 /* AdditionalPropertiesAnyType.swift */, + 9D53702B1DFE795F10CD9F02ED7196FB /* AdditionalPropertiesArray.swift */, + 9A9D6B8A244BC24B1DFF8AE87F94F792 /* AdditionalPropertiesBoolean.swift */, + AE9C5D5D818389294D9B773DD491B146 /* AdditionalPropertiesClass.swift */, + CB268230F2A96F71335E107E497BC32C /* AdditionalPropertiesInteger.swift */, + C2ABFCCD850DDE628412E12A3A36BC83 /* AdditionalPropertiesNumber.swift */, + 427485D09ADF908E73C20C8E8F56313E /* AdditionalPropertiesObject.swift */, + 417E0C1C7F4C17857E4C0D19275C6973 /* AdditionalPropertiesString.swift */, + 2E62E4A381F97286B84952D8ABA59681 /* Animal.swift */, + F3A9349CCCD01B8CD6646B22BD8FAFFD /* AnimalFarm.swift */, + 0755658D38EA295B964DD3D2AE6130E8 /* ApiResponse.swift */, + 59A65FEE7BCD66D95A4A236D44082214 /* ArrayOfArrayOfNumberOnly.swift */, + 97AE2157FA464312716D670ACC5FBA81 /* ArrayOfNumberOnly.swift */, + F25DE89C483E14ED16E9B0F96850BF3B /* ArrayTest.swift */, + 39F74B8F482952B4F0D1ECBE5D900E09 /* Capitalization.swift */, + D73E4AE40107F9E12D9933657017209A /* Cat.swift */, + A1C5824ADAF044284DC74D7785926F01 /* CatAllOf.swift */, + 7239C4B748D482C26AE3B3EC168AD371 /* Category.swift */, + 8E271F2E357A3F1A972FF120671638B4 /* ClassModel.swift */, + 77E4025C4EF246541D617C626370FC16 /* Client.swift */, + 88BE3C1FFB1B8A373D68AFE8E2CE9E5B /* Dog.swift */, + B6DFB261890C61E9C5ED205C350432C6 /* DogAllOf.swift */, + BB2944F75CA2FADBE47B2326252AAB5A /* EnumArrays.swift */, + E1259C7EE8FBB3A324ED66A0FBE292D2 /* EnumClass.swift */, + A933D6B3F16C58A90BFD589C4B23EE38 /* EnumTest.swift */, + 47729A51DD7F47ED910F54FB3FBE5393 /* File.swift */, + 9ECAC6F788B1B30D9157D0A0ADC1148B /* FileSchemaTestClass.swift */, + 8E7E635C33CF3DE53B838B378535F65C /* FormatTest.swift */, + A403B12907B25FC32930C07AD4DF4600 /* HasOnlyReadOnly.swift */, + E237960AB17F68A30227D83025D39488 /* List.swift */, + 40FA27876F7533BCDAAEB14AED6CC511 /* MapTest.swift */, + D406BAD811EAD0952929B093F56F2BF2 /* MixedPropertiesAndAdditionalPropertiesClass.swift */, + BD2133B0A357172D4E12A35C6488638D /* Model200Response.swift */, + FEFFBEEA8F7216DF65BD978A823BEDA2 /* Name.swift */, + ACC20A8939D21B502E71D99F130B013E /* NumberOnly.swift */, + 87ADA33E38CF943875922CB316D2A29A /* Order.swift */, + 75E2A26619203BE094E23132BE4F9C6D /* OuterComposite.swift */, + A71552570D704D50ABA564EB978406FA /* OuterEnum.swift */, + 32DEB152EA23784FF891FB3850E4A1FE /* Pet.swift */, + B23D0E4BD36D6E24C66A8DB3F81FE656 /* ReadOnlyFirst.swift */, + 0568635049F72DE8DD05757186436324 /* Return.swift */, + BF174B49C2E16DD172055DB12BC37B2F /* SpecialModelName.swift */, + 0757CDB69F181DE86D31F260259CC63B /* StringBooleanMap.swift */, + 8688291EDCC3CA07AEFAFFDC3ABBE224 /* Tag.swift */, + C692DE62E3C756A61E2E9C829EA0BCE6 /* TypeHolderDefault.swift */, + FB709FAE1018A60657705217C88967AC /* TypeHolderExample.swift */, + B374449845CA94813BACD80BE4751992 /* User.swift */, + 46FC0AD10406C3CE1828C826775E9650 /* XmlItem.swift */, + ); + name = Models; + path = PetstoreClient/Classes/OpenAPIs/Models; + sourceTree = ""; + }; + 8244AEBEFB4AC3530215FA5CBA26673B /* Pods-SwaggerClient */ = { + isa = PBXGroup; + children = ( + 618C90E6044C36C76F3590183ED38CB2 /* Pods-SwaggerClient.modulemap */, + D46742F1F99243487DCC614C75C1413C /* Pods-SwaggerClient-acknowledgements.markdown */, + 96FB30FE91CE11061D85EA6BDBE094E3 /* Pods-SwaggerClient-acknowledgements.plist */, + 471C1EEE2C56B756E004285EACEE72E2 /* Pods-SwaggerClient-dummy.m */, + 9448B03916DFC494CD68A614565A98B8 /* Pods-SwaggerClient-frameworks.sh */, + 4DC5DC2F9BCEFA797895B33C16D2B17E /* Pods-SwaggerClient-Info.plist */, + 2ED73BB76003B470F3B646AD3A5750D4 /* Pods-SwaggerClient-umbrella.h */, + 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */, + B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */, + ); + name = "Pods-SwaggerClient"; + path = "Target Support Files/Pods-SwaggerClient"; + sourceTree = ""; + }; + 8342B3C0D5B5B78B6FF2EB9EBABDF316 /* Support Files */ = { + isa = PBXGroup; + children = ( + 353DE1A4F630D656323F08E7DBB62F93 /* Alamofire.modulemap */, + 4FB24B4936663207D1E346C5B6B9EAD4 /* Alamofire.xcconfig */, + 2F4CC7E2EF21164D2E203FEAF12D869A /* Alamofire-dummy.m */, + FD2207283F6AAB87403F6CC48462589C /* Alamofire-Info.plist */, + D49FDF34DAD7FA627C657B59EEF5348A /* Alamofire-prefix.pch */, + AE110F03859CEB598ADBC6AF0026E6C6 /* Alamofire-umbrella.h */, + ); + name = "Support Files"; + path = "../Target Support Files/Alamofire"; + sourceTree = ""; + }; + 86B1F48A58BFA2FA26CD584937FBEED1 /* Pods-SwaggerClientTests */ = { + isa = PBXGroup; + children = ( + D1A6BA19B108998DF7350B40C83BFC47 /* Pods-SwaggerClientTests.modulemap */, + D01ADEDF5E44D58ACB8ED1AED7BF7615 /* Pods-SwaggerClientTests-acknowledgements.markdown */, + 31ED5C3525921534592BF796A9C159CF /* Pods-SwaggerClientTests-acknowledgements.plist */, + 4C2B15F359D7B06184AED746FB653F10 /* Pods-SwaggerClientTests-dummy.m */, + 901441DA8E39EF973EBE8D69C2CDADE7 /* Pods-SwaggerClientTests-Info.plist */, + 4FCA64AB7A1C3014939EFADD6F937DB1 /* Pods-SwaggerClientTests-umbrella.h */, + CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */, + 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */, + ); + name = "Pods-SwaggerClientTests"; + path = "Target Support Files/Pods-SwaggerClientTests"; + sourceTree = ""; + }; + 87C875AAE46C42F388F84017D9C9F70E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 110A71E71814850BBCD440AF198317DF /* Alamofire.framework */, + 0FDDD670EFAE8A21A0BD76C684193FAE /* RxSwift.framework */, + EA9AC0BC3CFB1D7F35089B6086FA77D8 /* iOS */, + ); + name = Frameworks; + sourceTree = ""; + }; + ADB072EBDA2441CFD03AE3EE4E9CFE92 /* PetstoreClient */ = { + isa = PBXGroup; + children = ( + C645ED7A39D8B9114C20CAFE2B7FBC2B /* AlamofireImplementations.swift */, + AE55486083AAFB05A421910D689676CD /* APIHelper.swift */, + 55A64F269657828EFCFE8BFEBEC769FC /* APIs.swift */, + 35FACC9017B95B9A2C4A6F43E6168BE3 /* CodableHelper.swift */, + A2C8922E4E1E3C67279458D892BC37AD /* Configuration.swift */, + 892F30771518EB494D89A92413C04E85 /* Extensions.swift */, + 0440E1381A0610C4FE76AA2AF1814289 /* JSONEncodableEncoding.swift */, + 8308F433372AEFC6D557F1856FC9DA01 /* JSONEncodingHelper.swift */, + 28350F99E9985C0EFD64D72D74A3BB5B /* Models.swift */, + B0F1355E884BA38BE356E5B3F34C7552 /* APIs */, + 76FC95CAFD3F67C42393B89FE11C631E /* Models */, + E43B365D3A2A9F7299C0632875837341 /* Pod */, + 2F357899B70BCB34F071EB6F4C420F2E /* Support Files */, + ); + name = PetstoreClient; + path = ../..; + sourceTree = ""; + }; + B0F1355E884BA38BE356E5B3F34C7552 /* APIs */ = { + isa = PBXGroup; + children = ( + 89D4EF25430724C9CA591320E91F6ADE /* AnotherFakeAPI.swift */, + A6DF985F6F04F63AA4A9AE7866CB8D22 /* FakeAPI.swift */, + DF1DD94A10F409B4316DAC2A019FED34 /* FakeClassnameTags123API.swift */, + 3C12C50651DC7C8FE70BC93359C255DF /* PetAPI.swift */, + 387EBB01DADD396614945A01970A8222 /* StoreAPI.swift */, + 342554F69C1610DDADF3EBAC284CC8F6 /* UserAPI.swift */, + ); + name = APIs; + path = PetstoreClient/Classes/OpenAPIs/APIs; + sourceTree = ""; + }; + CF1408CF629C7361332E53B88F7BD30C = { + isa = PBXGroup; + children = ( + 9D940727FF8FB9C785EB98E56350EF41 /* Podfile */, + 1C8221FE0071BDA2D0C5DE07B7736E88 /* Development Pods */, + 87C875AAE46C42F388F84017D9C9F70E /* Frameworks */, + 6C5DB4246A4C5DB39B520841339F1173 /* Pods */, + 752761252CF779269D588A7735D3E8BD /* Products */, + 27EB02841E0D43820F14F4377DE3547E /* Targets Support Files */, + ); + sourceTree = ""; + }; + D5E8828356ABA3B9CC63A755C69FA492 /* RxSwift */ = { + isa = PBXGroup; + children = ( + 64F819D835354426411C22FB35823EAD /* AddRef.swift */, + 7F4E8DC898B4C8D35F09B107CE705172 /* Amb.swift */, + D8ED3568E09862ADC85A6FE650FEC665 /* AnonymousDisposable.swift */, + B3DC61667E570A41266B09E2160DAF2D /* AnonymousObserver.swift */, + 7AB42A286E75A2848A769570F01DAC24 /* AnyObserver.swift */, + F6BAA110BD7DD59D40985519BC3BAB2C /* AsMaybe.swift */, + C638F1FAA7FFA890ACB0BAD594BAA07B /* AsSingle.swift */, + 8D44154CE37C1B66CDC3D69453887262 /* AsyncLock.swift */, + 452FB9512A491F731556BD2F110347ED /* AsyncSubject.swift */, + 2C7E8D8382CCB07D68866B995A900D74 /* AtomicInt.swift */, + 9289A1C05392D4FF88A897B4FDF77958 /* Bag.swift */, + FF699627254D1F4E425E37E0306B828B /* Bag+Rx.swift */, + 10A297E0A593ED4485BF3BAA9211E812 /* BehaviorSubject.swift */, + 4C42EB9688F37F35C9110C57A8075DC4 /* BinaryDisposable.swift */, + 28DE248049BE51CEA8ED1544F9D7FE9E /* BooleanDisposable.swift */, + 49A9E858642895322172FF16226C86AC /* Buffer.swift */, + 5A8B9F6DB3E903DC9635F9DA16D90A0C /* Cancelable.swift */, + 49E9CEC3564840C6531A01B3402A3A12 /* Catch.swift */, + 54212BBF40F065FC93C168C875E2E209 /* CombineLatest.swift */, + D25BFF9CA1B3C8219A5F2A1C064AA6AA /* CombineLatest+arity.swift */, + 7B49FF45429D57DA0487C5BD90AA6398 /* CombineLatest+Collection.swift */, + 0ACE6B378AD271E3ECC20C3EB267F4D8 /* Completable.swift */, + BC49CD3902CF252FAA732A1DDA1DC1C9 /* Completable+AndThen.swift */, + 410ED99EC03614CF82F7E2CCD4E628AF /* CompositeDisposable.swift */, + C71AEC0AF13D31F11719E203832081AF /* Concat.swift */, + D95AD1D226C3858D35BDFD664BBFCC02 /* ConcurrentDispatchQueueScheduler.swift */, + D765DC1CA9E827C5C155427A9C020AF8 /* ConcurrentMainScheduler.swift */, + AB1FE5BDED74EBDC047C5B437A524854 /* ConnectableObservableType.swift */, + 32615BCCDB0302A683583113699C168B /* Create.swift */, + B18AB9B87BF0A071727872B64CC84137 /* CurrentThreadScheduler.swift */, + 62326983DDFE0858FB48A88B024EAE9D /* Debounce.swift */, + BE02647BBDB83E0D48469A56FBF37C88 /* Debug.swift */, + 27F63D218F3E7685156696F53CEAB647 /* DefaultIfEmpty.swift */, + FBF9232381581A50CA2E8FA9517D76EB /* Deferred.swift */, + 8CFB12945932D18A9721B6AF2D8D871E /* Delay.swift */, + 13431ED497EC52994DA35A8DD3CB5C3C /* DelaySubscription.swift */, + 9F929FCCF076F0A692EA809B17DD7F31 /* Dematerialize.swift */, + B498E7AFBD0589628B31BD16154B20FF /* Deprecated.swift */, + B5D0270A8CD4CA80B74E5EC729FBC1A7 /* DeprecationWarner.swift */, + 679C1F8FF956155F71A31E63595C9AB9 /* DispatchQueue+Extensions.swift */, + 321D200CF6D488D976163C6A790DB8AA /* DispatchQueueConfiguration.swift */, + FC35E81B52795E7CB75A8D1E9687BF16 /* Disposable.swift */, + C5FFB8448F56996188428783F8C6C98F /* Disposables.swift */, + 40D138874AFF1185A99996B4180C5AAB /* DisposeBag.swift */, + 8E3B161DE103995FAFA429C1AD3E2875 /* DisposeBase.swift */, + 43029CD91769D491E685263C4CB46A97 /* DistinctUntilChanged.swift */, + 45C4BA95A0FC85CD30E5DD59545AF87F /* Do.swift */, + 6F10D694F6B9493FDA575E60FE695722 /* ElementAt.swift */, + B3B003673B45236AA5A51A70A733399D /* Empty.swift */, + EAFD9A5AE325CD48442A611EFD103D57 /* Enumerated.swift */, + 979ECDDE99CE790DA21FE87298107E6B /* Error.swift */, + F73E2FE9C0296B7647E36FDAB1A48E6E /* Errors.swift */, + 14D946B2CD75D612D3AE3F72880C7FF3 /* Event.swift */, + 291E627729F653AC7E4BAB6FEDE416E3 /* Filter.swift */, + B29AE35CD92E0CB3A64D2E581DAD2CB4 /* First.swift */, + F8E5B43302C88640C1A05762A037012A /* Generate.swift */, + 77CBC56217930F052D637B82D048BA3F /* GroupBy.swift */, + 0FA93D91962228BFC4F2058578D7A9EB /* GroupedObservable.swift */, + 2BF070C783A6786C9C92AA917E9AC879 /* HistoricalScheduler.swift */, + AB9FF8F32D5D6FC16033AF34AC1408FD /* HistoricalSchedulerTimeConverter.swift */, + 44F10FFC1F6C0F6A0F7C003C038C272B /* ImmediateSchedulerType.swift */, + C308A93504B6AE628F892297A6EDD347 /* InfiniteSequence.swift */, + 305616479EFCF33CB4768627955493AB /* InvocableScheduledItem.swift */, + CB834FF7C5DF4A05EB6179428E1A2D30 /* InvocableType.swift */, + D95243E9789D171D24B3CCEF4A306E79 /* Just.swift */, + C89F6DBCB4EBE505168C934C00DB909D /* Lock.swift */, + F5CF777F69E934A92F78512092C53052 /* LockOwnerType.swift */, + 7EC9D77DAB6AE650C74E828CE1557C00 /* MainScheduler.swift */, + 5FF198528C6AE20A99A5E33F76D0C527 /* Map.swift */, + C894BEC0DE9A446CBB01A0B7D63DA38A /* Materialize.swift */, + A14370E500BCD2443559DB70F2786EB6 /* Maybe.swift */, + FF4EA9F3121FB3144A5648BBC0A8004D /* Merge.swift */, + 79A4D30F2478E26FEA80A716FA038512 /* Multicast.swift */, + 498E9106F2911C5C575288660EF2C14A /* Never.swift */, + A5F4524003B8CAF5944F3FD37875D795 /* NopDisposable.swift */, + DBD0EFE5168A6526DB06F4A6800CF584 /* Observable.swift */, + BE64C63DA4FB40ACE396982AAB244DC0 /* ObservableConvertibleType.swift */, + 8D048EFF0C58F0BC4BBC956A98937739 /* ObservableType.swift */, + 5B6C60D7E233892084DAC43F60C64C60 /* ObservableType+Extensions.swift */, + 47A00016C4275D6E28A1DD5AD98AC9AE /* ObservableType+PrimitiveSequence.swift */, + 274B9D4CA658622B79DCE0F5E736A061 /* ObserveOn.swift */, + FB54B43833CB03F1D8749CE7C298D3B5 /* ObserverBase.swift */, + 0D4584BAE72539FDF3D31787762B39D0 /* ObserverType.swift */, + E9ABCE94A0D10DF97FC367C061436E5F /* OperationQueueScheduler.swift */, + 2CD8220D45545AC2A21A066A562081FF /* Optional.swift */, + 80EBCAEF4DEEB18B34DC5033FF20ECA8 /* Platform.Darwin.swift */, + 27B1CB7693D74DF7AB61FB3A0064A532 /* Platform.Linux.swift */, + 7B990C87BD5B32BF54E420212C1A52B1 /* PrimitiveSequence.swift */, + 8C65830349B23D7E262AB27BAB0E8188 /* PrimitiveSequence+Zip+arity.swift */, + 7C8CB70C6C6B09D4BB90057C9BA7EEC2 /* PriorityQueue.swift */, + F2E147BD28F065756948CC15F0E6B68D /* Producer.swift */, + 09F1E9D95E719B94DD98DDDB394278F2 /* PublishSubject.swift */, + 60E9C1BF2A5AAD8532B83D587D4B447A /* Queue.swift */, + 46285A50499BCD564104AE4AD8489A48 /* Range.swift */, + 240EE4633A0C295594350E7EC54BA3DF /* Reactive.swift */, + 55000F129FE5A09A0B51661892DB1F4E /* RecursiveLock.swift */, + B68A320DEB52A0B2CF5A7DCD714E84D3 /* RecursiveScheduler.swift */, + 060AAA21729D90B11F6FD9102F628758 /* Reduce.swift */, + 1555637002FBEDE13C94AEA5F61C763B /* RefCountDisposable.swift */, + 2EAED007F778FE48F4D3EB2B398B0AFB /* Repeat.swift */, + AEF2F44C17F277967404CE3DA788FD46 /* ReplaySubject.swift */, + E22F3BDA0C336074E5EA13F37C05FF2C /* RetryWhen.swift */, + B50B0F2486C6BB7F3AF76CD685C8B4E1 /* Rx.swift */, + 2CEA210E8205F311B1A19569BCDDEF63 /* RxMutableBox.swift */, + 192DC760893AF9295AD26599EF40763D /* Sample.swift */, + 8942B778DC2EC96252BBB267B62D566B /* Scan.swift */, + 717C1608162B27019EBC04A33444BAEE /* ScheduledDisposable.swift */, + FE0D448C7D74BFFB8604285DD7047EED /* ScheduledItem.swift */, + 9FBF81FDC5C51FD450958591E8EAF6EA /* ScheduledItemType.swift */, + F9FDC7E72AC896C5D9031E49B0372D06 /* SchedulerServices+Emulation.swift */, + 33796A172718E1356E0E8337BAE01CD2 /* SchedulerType.swift */, + 4B5420BA5CD952DA0D4A8A31E4D69CC2 /* Sequence.swift */, + CF92C4858F759EABBDDB45D32BE8DDC2 /* SerialDispatchQueueScheduler.swift */, + 55B63E482462E54A5366DAEA6318FB7E /* SerialDisposable.swift */, + EA01D2A2DB1E31168FFF75C6F9DAD5C5 /* ShareReplayScope.swift */, + AA9CEE837EF5EE1215788BEBC3959479 /* Single.swift */, + BDE1B1C73CF83B02289A255C14E108C9 /* SingleAssignmentDisposable.swift */, + ED1332D9E071ED0D532F6ACD2AD1AC38 /* SingleAsync.swift */, + BE70B57B6CF22A99EBDA453C12741148 /* Sink.swift */, + F1FC53345CBCE9EF88576C6BDC5D16EE /* Skip.swift */, + 25B4A2E0DAA89840BB58C5D472574F66 /* SkipUntil.swift */, + A2EDBEFED12864758CCA6F411205AB2E /* SkipWhile.swift */, + 836ADD02498B971DAA473321782A72A0 /* StartWith.swift */, + 2788B53C02374D910EFFBCF48BFF0B1D /* String+Rx.swift */, + C5A7024FF197192803FBC9F7CEFD9C87 /* SubjectType.swift */, + 70180A07F00266A41D515742CBA72B74 /* SubscribeOn.swift */, + A4218AB53A6385BB02D95ED58A63B6AB /* SubscriptionDisposable.swift */, + D10F2A3D1BBD10CA8594739DB19CDC07 /* SwiftSupport.swift */, + BAED0C18FF2FC7D97F0E5B2D4FE37F2C /* Switch.swift */, + 97D7A50019AFFCCD39301BD1E594F91C /* SwitchIfEmpty.swift */, + 0AF5386FC035BD7FBDA0B02884DE8324 /* SynchronizedDisposeType.swift */, + 757C5919A405D111AADAF18AFDDD9D5A /* SynchronizedOnType.swift */, + EC22F330006EA5F892970C69FBA9F199 /* SynchronizedUnsubscribeType.swift */, + 19A8FEF66E4D85F1B100E0AD77AC60B1 /* TailRecursiveSink.swift */, + 8050204E8821E9A399D7E830591E063B /* Take.swift */, + 57C559BAD8B2B8C949DA1C1837C049C6 /* TakeLast.swift */, + 0027A132D8BB718973989368CF5E63CF /* TakeUntil.swift */, + 6E67D2FEF499445214AF84B7B9C9B33E /* TakeWhile.swift */, + 6DB4CEA0C0A7C4823A04EAD9FBA3961D /* Throttle.swift */, + F42B2C25A2A499E0244E107DF28BA640 /* Timeout.swift */, + 98C736C5D0850FA27DB5D0E58640C537 /* Timer.swift */, + 33FB85D186079ED93696702AD931FFDA /* ToArray.swift */, + 459E274832813076884CA4287E491429 /* Using.swift */, + 745314207D827581C481CE38F4AEB7A3 /* VirtualTimeConverterType.swift */, + 6DA209283C4EBF0544FF63C7D1BCC40D /* VirtualTimeScheduler.swift */, + EFA2A0B903691A7C2293FD13EACB8E3F /* Window.swift */, + B2BC0F91A33991D668BEC3583CF46BAB /* WithLatestFrom.swift */, + E3B9412BBCE6A74BC742A54FD0B8186C /* Zip.swift */, + 5076FFA46D2287FC8EC0C217FC4BA0B7 /* Zip+arity.swift */, + 65FF8529B526BB8EC9A7CB5716CEB89F /* Zip+Collection.swift */, + 0EFA4421D8D59E9E4A8C8A50F313B3C5 /* Support Files */, + ); + name = RxSwift; + path = RxSwift; + sourceTree = ""; + }; + E43B365D3A2A9F7299C0632875837341 /* Pod */ = { + isa = PBXGroup; + children = ( + 7D2AE1A0BBE6459478A73D38848B588E /* AdditionalPropertiesClass.md */, + C54917ABF2432A86A6CCB0EABE76F916 /* Animal.md */, + E7AE50AD71DB17321FA5240F1B1D2E70 /* AnimalFarm.md */, + 4F8AC481F02DAF666B64D9A62FA7109F /* AnotherFakeAPI.md */, + 97CEA1BED002ABF0D6E5E078FB3F5895 /* ApiResponse.md */, + 55D378FA7C24F905373016C59B3BE2C4 /* ArrayOfArrayOfNumberOnly.md */, + 0AB84B97D3A773262405DAE614E8AAC8 /* ArrayOfNumberOnly.md */, + 2AE97CCDC8C4D014282DFBAE17CD786F /* ArrayTest.md */, + 02322A6B0543DADA4A6CB13A420ADA46 /* Capitalization.md */, + 8E309FED474011CFC561423B6D04ED9D /* Cat.md */, + DDC303FBE481D915EC0B8ADDAE1623CB /* CatAllOf.md */, + 5EBFB4694957EBED5253C544C3917DBC /* Category.md */, + 5A4C226AA31A4DF5F6CE9579AE514B34 /* ClassModel.md */, + C3633BEF1B1742609980D8C0500E4519 /* Client.md */, + 799B734D0D692695C613949A6115718D /* Dog.md */, + A2062FC5CF8950D95726336DA1F1F52C /* DogAllOf.md */, + EDB38B126A5C5BA3195B41CDA7E3F6A3 /* EnumArrays.md */, + 4A4CFDCD285AB04B85A4EF0446C859E4 /* EnumClass.md */, + 608A407DE2A47612643C9271D707558C /* EnumTest.md */, + 1AA4FF009847666EB74179EA6C75DE4D /* FakeAPI.md */, + 5164EAF5A81C9C991085A3D5BA3A7627 /* FakeClassnameTags123API.md */, + E57A9C76D05E7DF25E045C8C83CF7B8C /* File.md */, + B52D5D8ED9723274361CA73BDC3875A0 /* FileSchemaTestClass.md */, + 19B33AA036CD6E46A97113343C8904A0 /* FormatTest.md */, + 857C9FC7F70D66015A686E5E392AB04F /* HasOnlyReadOnly.md */, + 90A6677EB26AA075208F098879E425DD /* List.md */, + 0D180F35B94BC88CF6D264D1CDF42624 /* MapTest.md */, + 2895E1635E3A30E234670ED9283C23EA /* MixedPropertiesAndAdditionalPropertiesClass.md */, + DCD118360416984364D92CA81D410FC2 /* Model200Response.md */, + 56430A53624DF50D17D8AB350D129613 /* Name.md */, + 2740D21DE2F99C963ACDC4261609EE50 /* NumberOnly.md */, + AF5C3CBAA31C59F82C8DE03C448B79D8 /* Order.md */, + 7D6449B4CFED6A13D7216B47179E7E4A /* OuterComposite.md */, + 758C5C2D6382B0F77807EFFC06E82BC4 /* OuterEnum.md */, + B5A26ADF8B68902A509D1A52E825E595 /* Pet.md */, + A0F3842CFF62B5C53CBFA83436673969 /* PetAPI.md */, + 14AAB621715B4F0218EABE72CE972494 /* PetstoreClient.podspec */, + B048D2348C3086D80D00537EC372C755 /* README.md */, + 81629AD2DFFED981E047483057BE1362 /* ReadOnlyFirst.md */, + F8D5778A0684580BB744D394024BB4A6 /* Return.md */, + FC82F67A5B34D020108D89B64C3BD691 /* SpecialModelName.md */, + D98CA687BDA7E1DE6C6D098CFD6AE1C7 /* StoreAPI.md */, + F53E66F85590280D11F64545A178CC13 /* StringBooleanMap.md */, + 3D608B4966D9E19DF62468677C823AC5 /* Tag.md */, + 8CF5B2C124751B1983FA287330A81E51 /* TypeHolderDefault.md */, + 0B2EDA68E233F400804C89253BBFB2E5 /* TypeHolderExample.md */, + F1577EF84ADE20D7F04CD82D5BAA684B /* User.md */, + 47214E2FA3F755CB7B808800197ECE59 /* UserAPI.md */, + ); + name = Pod; + sourceTree = ""; + }; + EA9AC0BC3CFB1D7F35089B6086FA77D8 /* iOS */ = { + isa = PBXGroup; + children = ( + DEF099C2A3C48A1F639FAE8CCB3D0CD3 /* Foundation.framework */, + ); + name = iOS; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 23D70D9651451F43E7E8CC1A87B4B7E9 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + B6F6E4CC26451E91B59FAE0F6841DC1F /* Alamofire-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 26BF2B8B411556E53F9A1BF5BFBAB884 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + F3B7AF12D1FD688C8942217F918E2917 /* RxSwift-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 92694CC9CEC645ADF5EE0527F066151E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 83637EFE9CFF36EC1E7A73CCE55884B9 /* PetstoreClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A75A99D2E090C9BAAFA7D32A6536D24E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 0AB631DF2E9BC76B8736C9EFF6191C0B /* Pods-SwaggerClientTests-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D540D2F0FD93DE96146EC1B1DCF9577A /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 88B8F96E58CD89EC10B74A1F8365F6FD /* Pods-SwaggerClient-umbrella.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 1BAC3F8145EDD03FE8EDB0EACEAE3522 /* Pods-SwaggerClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9F0E63448933894561DF123D81422A1C /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */; + buildPhases = ( + D540D2F0FD93DE96146EC1B1DCF9577A /* Headers */, + D061CB8EF4036877AF78BF62F72CC9FE /* Sources */, + 9C5D10FD5C4D12FBA9AF8DE73A0476D4 /* Frameworks */, + 63F1A864D8FE7083A584B7AB1807C954 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5FF9BADF7EA9C29AF5D5BC7FE75A1966 /* PBXTargetDependency */, + 8F62547FFEE7B2E6D4745289BBC9CD98 /* PBXTargetDependency */, + B61EF3C7B9BF27A4D773281BD10FF5E4 /* PBXTargetDependency */, + ); + name = "Pods-SwaggerClient"; + productName = "Pods-SwaggerClient"; + productReference = 0F39AA54BB1773329C8151B721ED0D09 /* Pods_SwaggerClient.framework */; + productType = "com.apple.product-type.framework"; + }; + 3383968E74B5371B20BB519B170DC7FD /* Alamofire */ = { + isa = PBXNativeTarget; + buildConfigurationList = E87124444A44B7DB55208E7FEC21D331 /* Build configuration list for PBXNativeTarget "Alamofire" */; + buildPhases = ( + 23D70D9651451F43E7E8CC1A87B4B7E9 /* Headers */, + A1C8B029F600160149A2404C342F6E50 /* Sources */, + F1626ADC3A7EC435D2722B3173355D36 /* Frameworks */, + 28FF73341543B6F0A7DF3C20CFFEA0AA /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Alamofire; + productName = Alamofire; + productReference = 6EDF3214C286AFD4841B3551A037B0A9 /* Alamofire.framework */; + productType = "com.apple.product-type.framework"; + }; + 49CDD5ADAF3DA23F4C622CC2F9A75659 /* PetstoreClient */ = { + isa = PBXNativeTarget; + buildConfigurationList = 3679C7724191A63BC55F80144E8C3E8E /* Build configuration list for PBXNativeTarget "PetstoreClient" */; + buildPhases = ( + 92694CC9CEC645ADF5EE0527F066151E /* Headers */, + 8FB1A5B10FCFF638132C8B476224E639 /* Sources */, + BFF25BADA4BDAAF2C33C2AB4B7CC18DF /* Frameworks */, + BF5CB098891092F4E60775D327FED8B3 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 5D88AFB25CB03E9E800597DEEA2B2C26 /* PBXTargetDependency */, + C909BEA4C8ECA46A453E4E4B0D1CE3F7 /* PBXTargetDependency */, + ); + name = PetstoreClient; + productName = PetstoreClient; + productReference = D69932FBD99A6AC9733077CD793DE95E /* PetstoreClient.framework */; + productType = "com.apple.product-type.framework"; + }; + 7ECA32D1B18128C394D8D35F346BEEC7 /* Pods-SwaggerClientTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 8F09E039867007D3576FEED9032526A8 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */; + buildPhases = ( + A75A99D2E090C9BAAFA7D32A6536D24E /* Headers */, + F7D9DB86AE0913CC2B294C55BFD934AD /* Sources */, + D4EC17B7E6732812B49C04E19E9C0EF3 /* Frameworks */, + C2801E627F662CD786BE9F42773CBECF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C18A6DC0C9B8408542F3D944BB6D67F4 /* PBXTargetDependency */, + ); + name = "Pods-SwaggerClientTests"; + productName = "Pods-SwaggerClientTests"; + productReference = 6F9F8165FD8B1C4B07F06F5DCDDDE89A /* Pods_SwaggerClientTests.framework */; + productType = "com.apple.product-type.framework"; + }; + BA1FAA79F9B74485F4D7279FD41A7D1D /* RxSwift */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1CD3A89A87C87A3CE977265194B2F077 /* Build configuration list for PBXNativeTarget "RxSwift" */; + buildPhases = ( + 26BF2B8B411556E53F9A1BF5BFBAB884 /* Headers */, + F004E8F6BFA59A596E38AAEEA755BE2A /* Sources */, + E44363F6A0C4B876C2CE0C89617F4A74 /* Frameworks */, + DB5BDC9BAA86FDCA59A1DBF43CC5BE57 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = RxSwift; + productName = RxSwift; + productReference = BE1E7C2852E09D117ECDA841F0A5CE03 /* RxSwift.framework */; + productType = "com.apple.product-type.framework"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + BFDFE7DC352907FC980B868725387E98 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; + }; + buildConfigurationList = 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = CF1408CF629C7361332E53B88F7BD30C; + productRefGroup = 752761252CF779269D588A7735D3E8BD /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 3383968E74B5371B20BB519B170DC7FD /* Alamofire */, + 49CDD5ADAF3DA23F4C622CC2F9A75659 /* PetstoreClient */, + 1BAC3F8145EDD03FE8EDB0EACEAE3522 /* Pods-SwaggerClient */, + 7ECA32D1B18128C394D8D35F346BEEC7 /* Pods-SwaggerClientTests */, + BA1FAA79F9B74485F4D7279FD41A7D1D /* RxSwift */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 28FF73341543B6F0A7DF3C20CFFEA0AA /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 63F1A864D8FE7083A584B7AB1807C954 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + BF5CB098891092F4E60775D327FED8B3 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C2801E627F662CD786BE9F42773CBECF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + DB5BDC9BAA86FDCA59A1DBF43CC5BE57 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8FB1A5B10FCFF638132C8B476224E639 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + AB6D07352A2E898824B49759CCA162EC /* AdditionalPropertiesAnyType.swift in Sources */, + 30769345FEC859A4DA77F0CBBBFF3890 /* AdditionalPropertiesArray.swift in Sources */, + EE2E9AE7C6CDF0C9D9E77E6EB2800E40 /* AdditionalPropertiesBoolean.swift in Sources */, + 81690915FE86ECD7CDE95633E3762009 /* AdditionalPropertiesClass.swift in Sources */, + F77A046367A53931C9B4424F17D83BB0 /* AdditionalPropertiesInteger.swift in Sources */, + 1624BFF13E6CFADD39065BAFE15CFE5E /* AdditionalPropertiesNumber.swift in Sources */, + 92BEB5554FA6A51ED6995B19BEC8D7ED /* AdditionalPropertiesObject.swift in Sources */, + 76079C032826A835D0B13E6D617606C1 /* AdditionalPropertiesString.swift in Sources */, + 97BF7A9642F28D14C03458F24C030DB2 /* AlamofireImplementations.swift in Sources */, + C8371B319EBEF3DFDBA5C573AB46EB4C /* Animal.swift in Sources */, + 69E9DE3AD0F2CA6895BEAFA6691914BB /* AnimalFarm.swift in Sources */, + C3F9BB06A12A0F61CDC2511CDDE62B09 /* AnotherFakeAPI.swift in Sources */, + E8BF5D98F29555477C6236F1890DF767 /* APIHelper.swift in Sources */, + DFAA7C26B25E676D63DD5FD0D74ABB30 /* ApiResponse.swift in Sources */, + B39356F857F84E608624AB4BA381F5B9 /* APIs.swift in Sources */, + D399C483EEF039C293A7B84B82BE2B49 /* ArrayOfArrayOfNumberOnly.swift in Sources */, + 59A7BE86B0880261634D8F6F18EEB240 /* ArrayOfNumberOnly.swift in Sources */, + 877B7447EF54C9ED4966D3D1AA9B8D07 /* ArrayTest.swift in Sources */, + F2179ACF4366D4B4E62CD5C99FA1A679 /* Capitalization.swift in Sources */, + 0DC13877F21F72004D7711BF3D7EFA3C /* Cat.swift in Sources */, + 0E761CEA33A04DDA594CC7359F820A0B /* CatAllOf.swift in Sources */, + 5E4C98BF473FF5D493E130A785EB73BA /* Category.swift in Sources */, + 14A822B7A6821B022899A68D5003C85D /* ClassModel.swift in Sources */, + 5B8FDB00381ED25B1D5F06A29649ADEE /* Client.swift in Sources */, + DCAC99A86576E188AC0079FE5607C541 /* CodableHelper.swift in Sources */, + 00B92B3A8271BE0D78B2C346A45054EB /* Configuration.swift in Sources */, + AEB4C18DF052DCB1A0FF1EA600194A2E /* Dog.swift in Sources */, + 018C6F5369B9ECCE29BA2F43D6C12385 /* DogAllOf.swift in Sources */, + 860138DC0F719DA0953C144268F4FDD7 /* EnumArrays.swift in Sources */, + E2A989FE2A8C7E19B78150061B1F404E /* EnumClass.swift in Sources */, + 6A3FA5DFDE7C0D52EA3B3E4A62F2969F /* EnumTest.swift in Sources */, + DED9A421CFF78F29A27F00A43A5478D1 /* Extensions.swift in Sources */, + 6C7F38FABFBDF77E5B4D6AB137E0A5F4 /* FakeAPI.swift in Sources */, + 23F822E146B3F3C63EF430F9ED1EA5B5 /* FakeClassnameTags123API.swift in Sources */, + 597234E9E02E21C0F83911110DCA6E74 /* File.swift in Sources */, + 9E28E0EB779608B1E70DD6319247E826 /* FileSchemaTestClass.swift in Sources */, + 7105E17FDE296BA6B37E8B5E2AAD9058 /* FormatTest.swift in Sources */, + 82D86B9AEF31C560C2A0DB4FC9B979A1 /* HasOnlyReadOnly.swift in Sources */, + 5905B99E94D9ECE5157217BEC60C4FD9 /* JSONEncodableEncoding.swift in Sources */, + 438765B0F3642DE51D314A21726679AF /* JSONEncodingHelper.swift in Sources */, + 6CB554A9CE0D611C158CC5B9DB6873D7 /* List.swift in Sources */, + C0A9C53855321304AFBE800FC3BB8864 /* MapTest.swift in Sources */, + A06C5095E2319DD4B8B8047539769999 /* MixedPropertiesAndAdditionalPropertiesClass.swift in Sources */, + 1928C38569D41E9A17B2A7053C2737C5 /* Model200Response.swift in Sources */, + BA2E85147C4CE9D6AA9EC39DBE99A6C0 /* Models.swift in Sources */, + DB94F9F67A94D6A5CBAA286F44ED10ED /* Name.swift in Sources */, + 611DDEABDBA112B4ED8A489288C5E3AA /* NumberOnly.swift in Sources */, + 367D7C38C9D75A77C7803E9ACE55F939 /* Order.swift in Sources */, + B8407A12CCFF56CC0C1C34C1B8A9F8D9 /* OuterComposite.swift in Sources */, + 7B5B94CF82B28AED61861EC39D661BEC /* OuterEnum.swift in Sources */, + 7BAA9953F0607C50A41C04848C10E156 /* Pet.swift in Sources */, + 01BBC91167CEED10419EC29FB25A84B4 /* PetAPI.swift in Sources */, + DB2950EE1B19C535EBD1E572494F55E5 /* PetstoreClient-dummy.m in Sources */, + 5B9F60D1EEAA27243456F6F5DE0FA31A /* ReadOnlyFirst.swift in Sources */, + 944A8ACBB625207067C5A154726E140A /* Return.swift in Sources */, + 418B6C450B8DFDF393B4EF9D8F2CE920 /* SpecialModelName.swift in Sources */, + 64E469791F8F79F87724641C4B16AF22 /* StoreAPI.swift in Sources */, + 4B3E6EC0A866782A28E4504AC67B4A1A /* StringBooleanMap.swift in Sources */, + 4FFF28AF1937884226953CC18EFFACCA /* Tag.swift in Sources */, + 5E08679A799BC6809B8DE2089F06E621 /* TypeHolderDefault.swift in Sources */, + 4EF745BE3763312A553314237EBB7B3A /* TypeHolderExample.swift in Sources */, + E4F50B1433000199FD611EEBCF3B6BB0 /* User.swift in Sources */, + 55952681015C9453540298BF9C091033 /* UserAPI.swift in Sources */, + 2A1C0B23E2CEEE38D4C0133ED988004F /* XmlItem.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A1C8B029F600160149A2404C342F6E50 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 7E3538A6992A38276764936A9733493D /* AFError.swift in Sources */, + 772911DA6E33D1CBBC30131B7C8BDBB3 /* Alamofire-dummy.m in Sources */, + 0A39AF55285A3A4F7CBABB6D822FA4A3 /* Alamofire.swift in Sources */, + 3E0749AF6C51BCF0E4A41CF1D6A76FED /* DispatchQueue+Alamofire.swift in Sources */, + AEA829AB1A8AF2AD077A808AED6B178A /* MultipartFormData.swift in Sources */, + 73AB05789A4982944AF68DBD013E3EB7 /* NetworkReachabilityManager.swift in Sources */, + 1D29D2ACADF961F69D32B06FA6A09E28 /* Notifications.swift in Sources */, + 700D3D95AF9520CB227846DFD943A2DA /* ParameterEncoding.swift in Sources */, + 355C18EEC82624A06A6CC93965258E33 /* Request.swift in Sources */, + 059D92B7BBFBEC53E9A3B6E11C5C3B3A /* Response.swift in Sources */, + 6EFD003458AE7F689DEA720A2030C261 /* ResponseSerialization.swift in Sources */, + EB0DD8CEA1A69867A30267439C970440 /* Result.swift in Sources */, + 8D2A6A90A6DDAF75EA52D471258545CC /* ServerTrustPolicy.swift in Sources */, + A1EC41966B261DCE460BCDE5124A1DBE /* SessionDelegate.swift in Sources */, + D3FA0AA634AAEA99AB3FABC36BB4958C /* SessionManager.swift in Sources */, + 77E8F0EB9FFBE2E3EB0C77095C644606 /* TaskDelegate.swift in Sources */, + 60B6C2A003864AAD3A426448152F67BE /* Timeline.swift in Sources */, + AA56769D8733D3F3E7976742D5ABA998 /* Validation.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + D061CB8EF4036877AF78BF62F72CC9FE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E4962E9CD3D8EA651C84498D271EC753 /* Pods-SwaggerClient-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F004E8F6BFA59A596E38AAEEA755BE2A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8DA0C6077B07424B6848BD63049B6777 /* AddRef.swift in Sources */, + AAA1712D2763B6D2CF0011403EBE512D /* Amb.swift in Sources */, + 06F02D2382D5018D765DB0F34C9C276D /* AnonymousDisposable.swift in Sources */, + CB69E0C638A7C58B5FC9073B793273AD /* AnonymousObserver.swift in Sources */, + 0CC204661593617D4DF5240BD993DF4A /* AnyObserver.swift in Sources */, + 8FAB1056E36610DF9EE92221941D800D /* AsMaybe.swift in Sources */, + C54FB31D5C9750E9722B2EBB3C05754F /* AsSingle.swift in Sources */, + 068FC2A8666D98716567362F2E0D6845 /* AsyncLock.swift in Sources */, + 96ED1FEACF444FF70C6550E95A572890 /* AsyncSubject.swift in Sources */, + B385CD158B4DB49B50E46C688B9F0AED /* AtomicInt.swift in Sources */, + 94C2BDABC69296B090CFC89FD5483D41 /* Bag+Rx.swift in Sources */, + B01F02AFF4BD60048220EE91C369DA72 /* Bag.swift in Sources */, + 95A5DD145CB674719312A9CCE333C40A /* BehaviorSubject.swift in Sources */, + E6CAA0D168E81EF9679A5388F4BC95D8 /* BinaryDisposable.swift in Sources */, + E4F4D8D1953813B37BD79C66BE55B132 /* BooleanDisposable.swift in Sources */, + B7A2C80AE512BA32546E4BB9213F70CC /* Buffer.swift in Sources */, + A9A00DE2FF9E8E7E0C750F495837D99E /* Cancelable.swift in Sources */, + 425395ADB55B02A98D0538731936BD79 /* Catch.swift in Sources */, + 3E3FA01E3DC9CFFD4C738E922CDFA23C /* CombineLatest+arity.swift in Sources */, + BB7E003CB2D82BDBBBE3A9E1AA1C1682 /* CombineLatest+Collection.swift in Sources */, + 0C8B09DF05E2E41B7DF054A3514DB945 /* CombineLatest.swift in Sources */, + 6DCDEA9935C7542C76178B25A7D873FF /* Completable+AndThen.swift in Sources */, + C88589E390360E93817DA97CBF5DCBA4 /* Completable.swift in Sources */, + 04C06CF0B6C5C73B4CD192D070F21671 /* CompositeDisposable.swift in Sources */, + D128DB98CB0B97380BDEC326306D0FFC /* Concat.swift in Sources */, + 4481D7A928F997D2717CA342C9CAF3AC /* ConcurrentDispatchQueueScheduler.swift in Sources */, + 42403A783F23CEE64D8AF4D9BDB87802 /* ConcurrentMainScheduler.swift in Sources */, + 8DDD2130C49010F4CCBA6EF665E1288F /* ConnectableObservableType.swift in Sources */, + F33B53F266660974D851A82B03B2907E /* Create.swift in Sources */, + FCFED59A764898B95991A177DDEB362E /* CurrentThreadScheduler.swift in Sources */, + 6B9765DD631FED6DDDE0393B076895CC /* Debounce.swift in Sources */, + EE1917B8030B1B81478973483D704AAE /* Debug.swift in Sources */, + 60F135C1B2E2A3DBF5D91AAFEC889628 /* DefaultIfEmpty.swift in Sources */, + 97AEDE420913FDB38F1F907BBAAF2E8B /* Deferred.swift in Sources */, + C2C0AE3588986E52B3965206EC540324 /* Delay.swift in Sources */, + 93D8F9361CA384D802B729C027A29D93 /* DelaySubscription.swift in Sources */, + 5FB1BC9A57D01324146B7AE5F03C6370 /* Dematerialize.swift in Sources */, + EE5BB9D47B59D64E282A3FCB17CD6132 /* Deprecated.swift in Sources */, + 6D1DF0296E23FD6AD4E4676FD690C3BA /* DeprecationWarner.swift in Sources */, + 2E2C54FE54D4ED7D30B9CFD7F5CE26ED /* DispatchQueue+Extensions.swift in Sources */, + 584C49BA4DCCCFD50B2FAF41783029C3 /* DispatchQueueConfiguration.swift in Sources */, + 10F4BDB750BA6362739BBCFD77AFFC55 /* Disposable.swift in Sources */, + 5615DD06EEEA89A9237BB15D2E516B79 /* Disposables.swift in Sources */, + 231FF5CEABDC19D5620EF1D250075969 /* DisposeBag.swift in Sources */, + 7D3D0B52CF0C6CD831B149E64FE4AB3E /* DisposeBase.swift in Sources */, + 6E428993840E5F638CFD77582468C982 /* DistinctUntilChanged.swift in Sources */, + 411F93A1F501D9CE8A7BB17463F88BF2 /* Do.swift in Sources */, + B2F61D4C66E7E9BF795A768F9A52F889 /* ElementAt.swift in Sources */, + 6B1C6B7CA8A53D9502AE9EB84CA3181F /* Empty.swift in Sources */, + AA6D3CED1566D71B0E39A1CDE3B32864 /* Enumerated.swift in Sources */, + 16E27971B029CD86CC9ABFBDAF0B50C3 /* Error.swift in Sources */, + 9D443C8AF196B744F2340AD3DCE6CE0A /* Errors.swift in Sources */, + 00CD0D028A7C7FAD19004F30BF905FFA /* Event.swift in Sources */, + 45EF4D7DAC7881BD321F59D769C3ED56 /* Filter.swift in Sources */, + 04BCDBAEB221E44EBC35B35966D5329C /* First.swift in Sources */, + 247F1D441C3FFE1A86775F95FD5C526D /* Generate.swift in Sources */, + 0CF84DB9C3AF68812DF22E3A7B1A5345 /* GroupBy.swift in Sources */, + A1A4F6F86BDF18C228F08311EBD03E84 /* GroupedObservable.swift in Sources */, + 20C9165173E84E273472110B783CEF0F /* HistoricalScheduler.swift in Sources */, + 32C3F28679808D14D41E5CE764B18D68 /* HistoricalSchedulerTimeConverter.swift in Sources */, + 7DC19974867E0956AD13FA28D9038536 /* ImmediateSchedulerType.swift in Sources */, + 536174909D73A714232615AB05687E15 /* InfiniteSequence.swift in Sources */, + 5BC3B4927F5E340F661D56FCF2B51D75 /* InvocableScheduledItem.swift in Sources */, + A26702A2CFB5B831F7FB80FFA29BEEEC /* InvocableType.swift in Sources */, + E16F11503BA04EC3B205DBF20BD33DE1 /* Just.swift in Sources */, + 38B3FCCBE586F4016F203082690CEE6E /* Lock.swift in Sources */, + 9587E802C281FA381DF9E97EC426814D /* LockOwnerType.swift in Sources */, + 4CC43360234D5FCB4E5CAA95BAEF47C9 /* MainScheduler.swift in Sources */, + 79523FA5D24E7AC22385AE14E18FA1CB /* Map.swift in Sources */, + 8487CC1DE956BDEEAC9CDF413E1A58E4 /* Materialize.swift in Sources */, + C939859F6DB0464712141486E944F42C /* Maybe.swift in Sources */, + CAB19EE096FBEAAE1FDB28F56B8B4F78 /* Merge.swift in Sources */, + 0A426503BF8551A7F24118E4D3133404 /* Multicast.swift in Sources */, + DC551676E7C8D267368063D532D092B2 /* Never.swift in Sources */, + 2832890547C0F2BC47A5ACB24FE1E556 /* NopDisposable.swift in Sources */, + 2F73B36CB2A0C051C5FF6865EC7505A8 /* Observable.swift in Sources */, + B9EF5A80D032538680EFE75929C28D6D /* ObservableConvertibleType.swift in Sources */, + 28783CBF85DD482E1793B019CD5E056A /* ObservableType+Extensions.swift in Sources */, + 40DC18CC960EEC0EE71E945A73F6D7BC /* ObservableType+PrimitiveSequence.swift in Sources */, + 51FF11FC8E286A54377E64297EEA7696 /* ObservableType.swift in Sources */, + 1BE47AC4C39BCC2AD678B0D94066C3E7 /* ObserveOn.swift in Sources */, + 1FAE4751B8A1A4906CA23B6D14705DD1 /* ObserverBase.swift in Sources */, + 7C7B2182C3E7D832DF075B3016ED1B05 /* ObserverType.swift in Sources */, + E38FB4D007348119E958AED58DDD44B4 /* OperationQueueScheduler.swift in Sources */, + 37BF531FD8F4EF30E68E9A205BDAB096 /* Optional.swift in Sources */, + 0A084BBB077AB3863D1500B7E79B3FD4 /* Platform.Darwin.swift in Sources */, + BF15B41D6CCCFAF4DCA617D0431D4781 /* Platform.Linux.swift in Sources */, + 96F8C88984B492B5D186D6DC6FEF8D0C /* PrimitiveSequence+Zip+arity.swift in Sources */, + 0E35C38093091926F74510A897639D32 /* PrimitiveSequence.swift in Sources */, + 024712F363DB19CB17FD9F36B489D43F /* PriorityQueue.swift in Sources */, + 72F440B2AB88E31879EE58D8B7D5A05E /* Producer.swift in Sources */, + 8BB1ACFFA7880AE54B7300AF440F549D /* PublishSubject.swift in Sources */, + 15CC488D9E6EF29B02174A4B036444F1 /* Queue.swift in Sources */, + 01955339496D9F45BD537BEB03B04280 /* Range.swift in Sources */, + E403F1184BAC06680AF116EE8EDB7BEF /* Reactive.swift in Sources */, + 9F9CF99BD0C63948B4413396FD8DBA54 /* RecursiveLock.swift in Sources */, + 0C0D4B80E4F230F6A106A0E94C6A733E /* RecursiveScheduler.swift in Sources */, + C99C068899D064944E605570D38E85F2 /* Reduce.swift in Sources */, + 2F16BB60B2A862F9988A1C1D1DB25326 /* RefCountDisposable.swift in Sources */, + D0E317E6FC43BC7D4F07C17B584D8EFD /* Repeat.swift in Sources */, + 5B4412836335EB28C03D517FD6F7EB65 /* ReplaySubject.swift in Sources */, + 8A3542104FBA7C2FA7BF8E95AAAE0BE7 /* RetryWhen.swift in Sources */, + 7893293BC4613AE2625D1684ED6888AD /* Rx.swift in Sources */, + 9CD65D0519639A42284304F6A662E10A /* RxMutableBox.swift in Sources */, + 0E19118925E2ABE3DFE3392B76937491 /* RxSwift-dummy.m in Sources */, + 5720D4DCF4AA3DDB9D45802B854852A1 /* Sample.swift in Sources */, + EF7CEEFEE64CCFE8E050F33E8E6716EB /* Scan.swift in Sources */, + F7D0A45619BD381EC7FDEF8F41057C4A /* ScheduledDisposable.swift in Sources */, + B7CC8FC752B3A986B9DFC4A0F09BB316 /* ScheduledItem.swift in Sources */, + 21EA0909C5162AC1A2F0BEB44161C091 /* ScheduledItemType.swift in Sources */, + 2DE581AFC0E6541F53D79C9CF5BA0252 /* SchedulerServices+Emulation.swift in Sources */, + 5318E7579B1107A6E6B8A80EAC437FA2 /* SchedulerType.swift in Sources */, + 6F3CA008415A35BA7E271CFBB8311E6F /* Sequence.swift in Sources */, + 2C75624448C07245398F78A8E8F76C6C /* SerialDispatchQueueScheduler.swift in Sources */, + 786342EA1908DF041945B208001AB341 /* SerialDisposable.swift in Sources */, + D9D43BA204D86056FDBFCC92F87C7EAB /* ShareReplayScope.swift in Sources */, + B822D1C05E59F8303723EA7F59C78F40 /* Single.swift in Sources */, + 1316C19AE6BD02B2D67A610EB8124F48 /* SingleAssignmentDisposable.swift in Sources */, + 3548E9B5F3D2CB1D6CF60A2E5E5B2A32 /* SingleAsync.swift in Sources */, + D706A86E37DD6D833CA7A079A3E15B7E /* Sink.swift in Sources */, + 654F552A8DD4BF67850CAFEDF249D815 /* Skip.swift in Sources */, + B38FF962610DEFB271EA1FCA95E3B37A /* SkipUntil.swift in Sources */, + 9C894D0C88D763CD86C16DDCE698F9B3 /* SkipWhile.swift in Sources */, + 5A74E080F11D3B73C6E6A2E406E7E648 /* StartWith.swift in Sources */, + C1942DA08443E26FE1CD7BF2A972B27C /* String+Rx.swift in Sources */, + 04E7491A1A273461D639A352FDF90064 /* SubjectType.swift in Sources */, + A5E492F7194809622E130CC6569F46E2 /* SubscribeOn.swift in Sources */, + E7AC1A5D6FA609B69AFDE50FC01127F2 /* SubscriptionDisposable.swift in Sources */, + BA8C86B1D885FFA4850EC5F3528669E9 /* SwiftSupport.swift in Sources */, + 93000BED51CFB0CDB262C897C8C104A7 /* Switch.swift in Sources */, + 9C66CB81052F764079D0FA68B6E36BEF /* SwitchIfEmpty.swift in Sources */, + 26BE990BD12DA8BA3E8C11D9BE7A095D /* SynchronizedDisposeType.swift in Sources */, + 1B854BF767678148C17B436F65FEED5C /* SynchronizedOnType.swift in Sources */, + 7E79F3A456266FFDA768E0CF14DBC2F1 /* SynchronizedUnsubscribeType.swift in Sources */, + 28BC7B80549B8F4B21578D07D2D853AC /* TailRecursiveSink.swift in Sources */, + 957BB9043F5F5609C348C47C523D6C79 /* Take.swift in Sources */, + 3E4C76A301104B55E4A601D4E59AF14E /* TakeLast.swift in Sources */, + 32FC3AD0AB13B89CE579D458841BB17B /* TakeUntil.swift in Sources */, + B312CFC44488357265F713C8EF63291C /* TakeWhile.swift in Sources */, + 8ED35E25E311CF3F12564041A7F8BB2B /* Throttle.swift in Sources */, + 755536BB16D53CBC961B0A8E3FDF7739 /* Timeout.swift in Sources */, + 3EAF0605A2B6B9A90A06560FAED89BF9 /* Timer.swift in Sources */, + 8CA88B336020592CDC5F3548A4DFE697 /* ToArray.swift in Sources */, + 17DBE97DF7E4655A51189118813169BA /* Using.swift in Sources */, + D0847A960A008DA8608CBCF219A8A2A7 /* VirtualTimeConverterType.swift in Sources */, + CAFFB7A58F51661BC7DD5284276EC1ED /* VirtualTimeScheduler.swift in Sources */, + 18F3B3ECDFE24B0D2BB6DFB066A7DD4A /* Window.swift in Sources */, + 2C5F3731461E52488C08666B9D752D8E /* WithLatestFrom.swift in Sources */, + 4D491A944EF08F4B8656305C65C71C76 /* Zip+arity.swift in Sources */, + 4CE0D20F55D373232019950D791B50AC /* Zip+Collection.swift in Sources */, + 63B9CDC423637A15BD3F8F4B9651B62D /* Zip.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + F7D9DB86AE0913CC2B294C55BFD934AD /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8012A57CFFC574F745FBA46D335BBA6F /* Pods-SwaggerClientTests-dummy.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 5D88AFB25CB03E9E800597DEEA2B2C26 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 3383968E74B5371B20BB519B170DC7FD /* Alamofire */; + targetProxy = AEA2781CDC8DB413C920DD9F7F78F124 /* PBXContainerItemProxy */; + }; + 5FF9BADF7EA9C29AF5D5BC7FE75A1966 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = Alamofire; + target = 3383968E74B5371B20BB519B170DC7FD /* Alamofire */; + targetProxy = 2A8AF3B6391C5FF251470E3091B2B1D2 /* PBXContainerItemProxy */; + }; + 8F62547FFEE7B2E6D4745289BBC9CD98 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = PetstoreClient; + target = 49CDD5ADAF3DA23F4C622CC2F9A75659 /* PetstoreClient */; + targetProxy = B36C681A6EB35CB2430BAB3BAF9AB886 /* PBXContainerItemProxy */; + }; + B61EF3C7B9BF27A4D773281BD10FF5E4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RxSwift; + target = BA1FAA79F9B74485F4D7279FD41A7D1D /* RxSwift */; + targetProxy = ED09ABD99E0D387BFD78CCCE937FA689 /* PBXContainerItemProxy */; + }; + C18A6DC0C9B8408542F3D944BB6D67F4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = "Pods-SwaggerClient"; + target = 1BAC3F8145EDD03FE8EDB0EACEAE3522 /* Pods-SwaggerClient */; + targetProxy = FA1A8E2F3FE2899A723889F94EACA0E5 /* PBXContainerItemProxy */; + }; + C909BEA4C8ECA46A453E4E4B0D1CE3F7 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = RxSwift; + target = BA1FAA79F9B74485F4D7279FD41A7D1D /* RxSwift */; + targetProxy = 116DEBAFC9022016EADCAFC9F9BC1542 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 175DE0F32DFB9352D8BDE2242D146278 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 28DB89F2024F2DDD08AE89C3006D009E /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/PetstoreClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + PRODUCT_MODULE_NAME = PetstoreClient; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 2B15A656975AD6239E491D34DB89E598 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BE6232D0F85A4EF002139921CBA82C3F /* RxSwift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxSwift/RxSwift-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; + PRODUCT_MODULE_NAME = RxSwift; + PRODUCT_NAME = RxSwift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 3B00EA6E3BEB8B678C1C0FBE7D10EBB4 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = BE6232D0F85A4EF002139921CBA82C3F /* RxSwift.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/RxSwift/RxSwift-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/RxSwift/RxSwift-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/RxSwift/RxSwift.modulemap"; + PRODUCT_MODULE_NAME = RxSwift; + PRODUCT_NAME = RxSwift; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 41268AF552E2DC6A5873C87C81174F7D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4FB24B4936663207D1E346C5B6B9EAD4 /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Alamofire-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_MODULE_NAME = Alamofire; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.1; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 6FB7A8200113F8B35642AF088882257D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 89C039CC9F68E1DE11B36488154891AC /* Pods-SwaggerClient.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 72215A7E736410410139FC6A3FCEAAEC /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CD7450FA98C71F5F12227D9EE29EF6FF /* Pods-SwaggerClientTests.debug.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A345BCBDE6C296957161A3E85A47A280 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4FB24B4936663207D1E346C5B6B9EAD4 /* Alamofire.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/Alamofire/Alamofire-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Alamofire/Alamofire-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/Alamofire/Alamofire.modulemap"; + PRODUCT_MODULE_NAME = Alamofire; + PRODUCT_NAME = Alamofire; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.1; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + A65A298AF5D17903189605681170DC09 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = B8AE4746D376A853C4ABE57A194FD450 /* Pods-SwaggerClient.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClient/Pods-SwaggerClient.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + AB4D69770D8ACE3A05E80BB3502666F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Debug; + }; + E0CA0082E44CE578414DCAED684E16A2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 06F700708FB1FE830160940D2740EC68 /* Pods-SwaggerClientTests.release.xcconfig */; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-SwaggerClientTests/Pods-SwaggerClientTests.modulemap"; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + F232B5ECA11A71BFA199A229B323F454 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + STRIP_INSTALLED_PRODUCT = NO; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 4.2; + SYMROOT = "${SRCROOT}/../build"; + }; + name = Release; + }; + FA4585C83A71BBB23D144F31704C9C56 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 28DB89F2024F2DDD08AE89C3006D009E /* PetstoreClient.xcconfig */; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_PREFIX_HEADER = "Target Support Files/PetstoreClient/PetstoreClient-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/PetstoreClient/PetstoreClient-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "Target Support Files/PetstoreClient/PetstoreClient.modulemap"; + PRODUCT_MODULE_NAME = PetstoreClient; + PRODUCT_NAME = PetstoreClient; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1CD3A89A87C87A3CE977265194B2F077 /* Build configuration list for PBXNativeTarget "RxSwift" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 2B15A656975AD6239E491D34DB89E598 /* Debug */, + 3B00EA6E3BEB8B678C1C0FBE7D10EBB4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 3679C7724191A63BC55F80144E8C3E8E /* Build configuration list for PBXNativeTarget "PetstoreClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 175DE0F32DFB9352D8BDE2242D146278 /* Debug */, + FA4585C83A71BBB23D144F31704C9C56 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4821239608C13582E20E6DA73FD5F1F9 /* Build configuration list for PBXProject "Pods" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + AB4D69770D8ACE3A05E80BB3502666F6 /* Debug */, + F232B5ECA11A71BFA199A229B323F454 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 8F09E039867007D3576FEED9032526A8 /* Build configuration list for PBXNativeTarget "Pods-SwaggerClientTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 72215A7E736410410139FC6A3FCEAAEC /* Debug */, + E0CA0082E44CE578414DCAED684E16A2 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9F0E63448933894561DF123D81422A1C /* Build configuration list for PBXNativeTarget "Pods-SwaggerClient" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6FB7A8200113F8B35642AF088882257D /* Debug */, + A65A298AF5D17903189605681170DC09 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E87124444A44B7DB55208E7FEC21D331 /* Build configuration list for PBXNativeTarget "Alamofire" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 41268AF552E2DC6A5873C87C81174F7D /* Debug */, + A345BCBDE6C296957161A3E85A47A280 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = BFDFE7DC352907FC980B868725387E98 /* Project object */; +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/LICENSE.md b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/LICENSE.md new file mode 100644 index 000000000000..d6765d9c9b9b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/LICENSE.md @@ -0,0 +1,9 @@ +**The MIT License** +**Copyright © 2015 Krunoslav Zaher** +**All rights reserved.** + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/AtomicInt.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/AtomicInt.swift new file mode 100644 index 000000000000..d8d958078fa6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/AtomicInt.swift @@ -0,0 +1,71 @@ +// +// AtomicInt.swift +// Platform +// +// Created by Krunoslav Zaher on 10/28/18. +// Copyright © 2018 Krunoslav Zaher. All rights reserved. +// + +import class Foundation.NSLock + +final class AtomicInt: NSLock { + fileprivate var value: Int32 + public init(_ value: Int32 = 0) { + self.value = value + } +} + +@discardableResult +@inline(__always) +func add(_ this: AtomicInt, _ value: Int32) -> Int32 { + this.lock() + let oldValue = this.value + this.value += value + this.unlock() + return oldValue +} + +@discardableResult +@inline(__always) +func sub(_ this: AtomicInt, _ value: Int32) -> Int32 { + this.lock() + let oldValue = this.value + this.value -= value + this.unlock() + return oldValue +} + +@discardableResult +@inline(__always) +func fetchOr(_ this: AtomicInt, _ mask: Int32) -> Int32 { + this.lock() + let oldValue = this.value + this.value |= mask + this.unlock() + return oldValue +} + +@inline(__always) +func load(_ this: AtomicInt) -> Int32 { + this.lock() + let oldValue = this.value + this.unlock() + return oldValue +} + +@discardableResult +@inline(__always) +func increment(_ this: AtomicInt) -> Int32 { + return add(this, 1) +} + +@discardableResult +@inline(__always) +func decrement(_ this: AtomicInt) -> Int32 { + return sub(this, 1) +} + +@inline(__always) +func isFlagSet(_ this: AtomicInt, _ mask: Int32) -> Bool { + return (load(this) & mask) != 0 +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift new file mode 100644 index 000000000000..4ad0a2bc1887 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Bag.swift @@ -0,0 +1,187 @@ +// +// Bag.swift +// Platform +// +// Created by Krunoslav Zaher on 2/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Swift + +let arrayDictionaryMaxSize = 30 + +struct BagKey { + /** + Unique identifier for object added to `Bag`. + + It's underlying type is UInt64. If we assume there in an idealized CPU that works at 4GHz, + it would take ~150 years of continuous running time for it to overflow. + */ + fileprivate let rawValue: UInt64 +} + +/** +Data structure that represents a bag of elements typed `T`. + +Single element can be stored multiple times. + +Time and space complexity of insertion and deletion is O(n). + +It is suitable for storing small number of elements. +*/ +struct Bag : CustomDebugStringConvertible { + /// Type of identifier for inserted elements. + typealias KeyType = BagKey + + typealias Entry = (key: BagKey, value: T) + + fileprivate var _nextKey: BagKey = BagKey(rawValue: 0) + + // data + + // first fill inline variables + var _key0: BagKey? + var _value0: T? + + // then fill "array dictionary" + var _pairs = ContiguousArray() + + // last is sparse dictionary + var _dictionary: [BagKey: T]? + + var _onlyFastPath = true + + /// Creates new empty `Bag`. + init() { + } + + /** + Inserts `value` into bag. + + - parameter element: Element to insert. + - returns: Key that can be used to remove element from bag. + */ + mutating func insert(_ element: T) -> BagKey { + let key = _nextKey + + _nextKey = BagKey(rawValue: _nextKey.rawValue &+ 1) + + if _key0 == nil { + _key0 = key + _value0 = element + return key + } + + _onlyFastPath = false + + if _dictionary != nil { + _dictionary![key] = element + return key + } + + if _pairs.count < arrayDictionaryMaxSize { + _pairs.append((key: key, value: element)) + return key + } + + _dictionary = [key: element] + + return key + } + + /// - returns: Number of elements in bag. + var count: Int { + let dictionaryCount: Int = _dictionary?.count ?? 0 + return (_value0 != nil ? 1 : 0) + _pairs.count + dictionaryCount + } + + /// Removes all elements from bag and clears capacity. + mutating func removeAll() { + _key0 = nil + _value0 = nil + + _pairs.removeAll(keepingCapacity: false) + _dictionary?.removeAll(keepingCapacity: false) + } + + /** + Removes element with a specific `key` from bag. + + - parameter key: Key that identifies element to remove from bag. + - returns: Element that bag contained, or nil in case element was already removed. + */ + mutating func removeKey(_ key: BagKey) -> T? { + if _key0 == key { + _key0 = nil + let value = _value0! + _value0 = nil + return value + } + + if let existingObject = _dictionary?.removeValue(forKey: key) { + return existingObject + } + + for i in 0 ..< _pairs.count where _pairs[i].key == key { + let value = _pairs[i].value + _pairs.remove(at: i) + return value + } + + return nil + } +} + +extension Bag { + /// A textual representation of `self`, suitable for debugging. + var debugDescription : String { + return "\(self.count) elements in Bag" + } +} + +extension Bag { + /// Enumerates elements inside the bag. + /// + /// - parameter action: Enumeration closure. + func forEach(_ action: (T) -> Void) { + if _onlyFastPath { + if let value0 = _value0 { + action(value0) + } + return + } + + let value0 = _value0 + let dictionary = _dictionary + + if let value0 = value0 { + action(value0) + } + + for i in 0 ..< _pairs.count { + action(_pairs[i].value) + } + + if dictionary?.count ?? 0 > 0 { + for element in dictionary!.values { + action(element) + } + } + } +} + +extension BagKey: Hashable { + #if swift(>=4.2) + func hash(into hasher: inout Hasher) { + hasher.combine(rawValue) + } + #else + var hashValue: Int { + return rawValue.hashValue + } + #endif +} + +func ==(lhs: BagKey, rhs: BagKey) -> Bool { + return lhs.rawValue == rhs.rawValue +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift new file mode 100644 index 000000000000..5a573a0de168 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/InfiniteSequence.swift @@ -0,0 +1,26 @@ +// +// InfiniteSequence.swift +// Platform +// +// Created by Krunoslav Zaher on 6/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Sequence that repeats `repeatedValue` infinite number of times. +struct InfiniteSequence : Sequence { + typealias Element = E + typealias Iterator = AnyIterator + + private let _repeatedValue: E + + init(repeatedValue: E) { + _repeatedValue = repeatedValue + } + + func makeIterator() -> Iterator { + let repeatedValue = _repeatedValue + return AnyIterator { + return repeatedValue + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift new file mode 100644 index 000000000000..f7cb99c8b022 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/PriorityQueue.swift @@ -0,0 +1,111 @@ +// +// PriorityQueue.swift +// Platform +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +struct PriorityQueue { + private let _hasHigherPriority: (Element, Element) -> Bool + private let _isEqual: (Element, Element) -> Bool + + fileprivate var _elements = [Element]() + + init(hasHigherPriority: @escaping (Element, Element) -> Bool, isEqual: @escaping (Element, Element) -> Bool) { + _hasHigherPriority = hasHigherPriority + _isEqual = isEqual + } + + mutating func enqueue(_ element: Element) { + _elements.append(element) + bubbleToHigherPriority(_elements.count - 1) + } + + func peek() -> Element? { + return _elements.first + } + + var isEmpty: Bool { + return _elements.count == 0 + } + + mutating func dequeue() -> Element? { + guard let front = peek() else { + return nil + } + + removeAt(0) + + return front + } + + mutating func remove(_ element: Element) { + for i in 0 ..< _elements.count { + if _isEqual(_elements[i], element) { + removeAt(i) + return + } + } + } + + private mutating func removeAt(_ index: Int) { + let removingLast = index == _elements.count - 1 + if !removingLast { + _elements.swapAt(index, _elements.count - 1) + } + + _ = _elements.popLast() + + if !removingLast { + bubbleToHigherPriority(index) + bubbleToLowerPriority(index) + } + } + + private mutating func bubbleToHigherPriority(_ initialUnbalancedIndex: Int) { + precondition(initialUnbalancedIndex >= 0) + precondition(initialUnbalancedIndex < _elements.count) + + var unbalancedIndex = initialUnbalancedIndex + + while unbalancedIndex > 0 { + let parentIndex = (unbalancedIndex - 1) / 2 + guard _hasHigherPriority(_elements[unbalancedIndex], _elements[parentIndex]) else { break } + _elements.swapAt(unbalancedIndex, parentIndex) + unbalancedIndex = parentIndex + } + } + + private mutating func bubbleToLowerPriority(_ initialUnbalancedIndex: Int) { + precondition(initialUnbalancedIndex >= 0) + precondition(initialUnbalancedIndex < _elements.count) + + var unbalancedIndex = initialUnbalancedIndex + while true { + let leftChildIndex = unbalancedIndex * 2 + 1 + let rightChildIndex = unbalancedIndex * 2 + 2 + + var highestPriorityIndex = unbalancedIndex + + if leftChildIndex < _elements.count && _hasHigherPriority(_elements[leftChildIndex], _elements[highestPriorityIndex]) { + highestPriorityIndex = leftChildIndex + } + + if rightChildIndex < _elements.count && _hasHigherPriority(_elements[rightChildIndex], _elements[highestPriorityIndex]) { + highestPriorityIndex = rightChildIndex + } + + guard highestPriorityIndex != unbalancedIndex else { break } + _elements.swapAt(highestPriorityIndex, unbalancedIndex) + + unbalancedIndex = highestPriorityIndex + } + } +} + +extension PriorityQueue : CustomDebugStringConvertible { + var debugDescription: String { + return _elements.debugDescription + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift new file mode 100644 index 000000000000..d05726c7b99a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DataStructures/Queue.swift @@ -0,0 +1,152 @@ +// +// Queue.swift +// Platform +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/** +Data structure that represents queue. + +Complexity of `enqueue`, `dequeue` is O(1) when number of operations is +averaged over N operations. + +Complexity of `peek` is O(1). +*/ +struct Queue: Sequence { + /// Type of generator. + typealias Generator = AnyIterator + + private let _resizeFactor = 2 + + private var _storage: ContiguousArray + private var _count = 0 + private var _pushNextIndex = 0 + private let _initialCapacity: Int + + /** + Creates new queue. + + - parameter capacity: Capacity of newly created queue. + */ + init(capacity: Int) { + _initialCapacity = capacity + + _storage = ContiguousArray(repeating: nil, count: capacity) + } + + private var dequeueIndex: Int { + let index = _pushNextIndex - count + return index < 0 ? index + _storage.count : index + } + + /// - returns: Is queue empty. + var isEmpty: Bool { + return count == 0 + } + + /// - returns: Number of elements inside queue. + var count: Int { + return _count + } + + /// - returns: Element in front of a list of elements to `dequeue`. + func peek() -> T { + precondition(count > 0) + + return _storage[dequeueIndex]! + } + + mutating private func resizeTo(_ size: Int) { + var newStorage = ContiguousArray(repeating: nil, count: size) + + let count = _count + + let dequeueIndex = self.dequeueIndex + let spaceToEndOfQueue = _storage.count - dequeueIndex + + // first batch is from dequeue index to end of array + let countElementsInFirstBatch = Swift.min(count, spaceToEndOfQueue) + // second batch is wrapped from start of array to end of queue + let numberOfElementsInSecondBatch = count - countElementsInFirstBatch + + newStorage[0 ..< countElementsInFirstBatch] = _storage[dequeueIndex ..< (dequeueIndex + countElementsInFirstBatch)] + newStorage[countElementsInFirstBatch ..< (countElementsInFirstBatch + numberOfElementsInSecondBatch)] = _storage[0 ..< numberOfElementsInSecondBatch] + + _count = count + _pushNextIndex = count + _storage = newStorage + } + + /// Enqueues `element`. + /// + /// - parameter element: Element to enqueue. + mutating func enqueue(_ element: T) { + if count == _storage.count { + resizeTo(Swift.max(_storage.count, 1) * _resizeFactor) + } + + _storage[_pushNextIndex] = element + _pushNextIndex += 1 + _count += 1 + + if _pushNextIndex >= _storage.count { + _pushNextIndex -= _storage.count + } + } + + private mutating func dequeueElementOnly() -> T { + precondition(count > 0) + + let index = dequeueIndex + + defer { + _storage[index] = nil + _count -= 1 + } + + return _storage[index]! + } + + /// Dequeues element or throws an exception in case queue is empty. + /// + /// - returns: Dequeued element. + mutating func dequeue() -> T? { + if self.count == 0 { + return nil + } + + defer { + let downsizeLimit = _storage.count / (_resizeFactor * _resizeFactor) + if _count < downsizeLimit && downsizeLimit >= _initialCapacity { + resizeTo(_storage.count / _resizeFactor) + } + } + + return dequeueElementOnly() + } + + /// - returns: Generator of contained elements. + func makeIterator() -> AnyIterator { + var i = dequeueIndex + var count = _count + + return AnyIterator { + if count == 0 { + return nil + } + + defer { + count -= 1 + i += 1 + } + + if i >= self._storage.count { + i -= self._storage.count + } + + return self._storage[i] + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DeprecationWarner.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DeprecationWarner.swift new file mode 100644 index 000000000000..863636b7b7a5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DeprecationWarner.swift @@ -0,0 +1,43 @@ +// +// DeprecationWarner.swift +// Platform +// +// Created by Shai Mishali on 1/9/18. +// Copyright © 2018 Krunoslav Zaher. All rights reserved. +// + +import Foundation + +#if DEBUG + class DeprecationWarner { + private static var warned = Set() + private static var _lock = NSRecursiveLock() + + static func warnIfNeeded(_ kind: Kind) { + _lock.lock(); defer { _lock.unlock() } + guard !warned.contains(kind) else { return } + + warned.insert(kind) + print("ℹ️ [DEPRECATED] \(kind.message)") + } + } + + extension DeprecationWarner { + enum Kind { + case variable + case globalTestFunctionNext + case globalTestFunctionError + case globalTestFunctionCompleted + + var message: String { + switch self { + case .variable: return "`Variable` is planned for future deprecation. Please consider `BehaviorRelay` as a replacement. Read more at: https://git.io/vNqvx" + case .globalTestFunctionNext: return "The `next()` global function is planned for future deprecation. Please use `Recorded.next()` instead." + case .globalTestFunctionError: return "The `error()` global function is planned for future deprecation. Please use `Recorded.error()` instead." + case .globalTestFunctionCompleted: return "The `completed()` global function is planned for future deprecation. Please use `Recorded.completed()` instead." + } + } + } + } +#endif + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift new file mode 100644 index 000000000000..552314a16909 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/DispatchQueue+Extensions.swift @@ -0,0 +1,21 @@ +// +// DispatchQueue+Extensions.swift +// Platform +// +// Created by Krunoslav Zaher on 10/22/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Dispatch + +extension DispatchQueue { + private static var token: DispatchSpecificKey<()> = { + let key = DispatchSpecificKey<()>() + DispatchQueue.main.setSpecific(key: key, value: ()) + return key + }() + + static var isMain: Bool { + return DispatchQueue.getSpecific(key: token) != nil + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift new file mode 100644 index 000000000000..6dc36add7be8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Darwin.swift @@ -0,0 +1,36 @@ +// +// Platform.Darwin.swift +// Platform +// +// Created by Krunoslav Zaher on 12/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) + + import Darwin + import class Foundation.Thread + import protocol Foundation.NSCopying + + extension Thread { + static func setThreadLocalStorageValue(_ value: T?, forKey key: NSCopying) { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + if let newValue = value { + threadDictionary[key] = newValue + } + else { + threadDictionary[key] = nil + } + } + + static func getThreadLocalStorageValueForKey(_ key: NSCopying) -> T? { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + return threadDictionary[key] as? T + } + } + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift new file mode 100644 index 000000000000..570f8f00fa2a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/Platform.Linux.swift @@ -0,0 +1,37 @@ +// +// Platform.Linux.swift +// Platform +// +// Created by Krunoslav Zaher on 12/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if os(Linux) + + import class Foundation.Thread + + extension Thread { + + static func setThreadLocalStorageValue(_ value: T?, forKey key: String) { + let currentThread = Thread.current + var threadDictionary = currentThread.threadDictionary + + if let newValue = value { + threadDictionary[key] = newValue + } + else { + threadDictionary[key] = nil + } + + currentThread.threadDictionary = threadDictionary + } + + static func getThreadLocalStorageValueForKey(_ key: String) -> T? { + let currentThread = Thread.current + let threadDictionary = currentThread.threadDictionary + + return threadDictionary[key] as? T + } + } + +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/RecursiveLock.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/RecursiveLock.swift new file mode 100644 index 000000000000..c03471d502f4 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/Platform/RecursiveLock.swift @@ -0,0 +1,34 @@ +// +// RecursiveLock.swift +// Platform +// +// Created by Krunoslav Zaher on 12/18/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import class Foundation.NSRecursiveLock + +#if TRACE_RESOURCES + class RecursiveLock: NSRecursiveLock { + override init() { + _ = Resources.incrementTotal() + super.init() + } + + override func lock() { + super.lock() + _ = Resources.incrementTotal() + } + + override func unlock() { + super.unlock() + _ = Resources.decrementTotal() + } + + deinit { + _ = Resources.decrementTotal() + } + } +#else + typealias RecursiveLock = NSRecursiveLock +#endif diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/README.md b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/README.md new file mode 100644 index 000000000000..17c8a9523e51 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/README.md @@ -0,0 +1,217 @@ +Miss Electric Eel 2016 RxSwift: ReactiveX for Swift +====================================== + +[![Travis CI](https://travis-ci.org/ReactiveX/RxSwift.svg?branch=master)](https://travis-ci.org/ReactiveX/RxSwift) ![platforms](https://img.shields.io/badge/platforms-iOS%20%7C%20macOS%20%7C%20tvOS%20%7C%20watchOS%20%7C%20Linux-333333.svg) [![pod](https://img.shields.io/cocoapods/v/RxSwift.svg)](https://cocoapods.org/pods/RxSwift) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) + +* RxSwift 3.x / Swift 3.x can be found in [**rxswift-3.0** branch](https://github.com/ReactiveX/RxSwift/tree/rxswift-3.0). + +Rx is a [generic abstraction of computation](https://youtu.be/looJcaeboBY) expressed through `Observable` interface. + +This is a Swift version of [Rx](https://github.com/Reactive-Extensions/Rx.NET). + +It tries to port as many concepts from the original version as possible, but some concepts were adapted for more pleasant and performant integration with iOS/macOS environment. + +Cross platform documentation can be found on [ReactiveX.io](http://reactivex.io/). + +Like the original Rx, its intention is to enable easy composition of asynchronous operations and event/data streams. + +KVO observing, async operations and streams are all unified under [abstraction of sequence](Documentation/GettingStarted.md#observables-aka-sequences). This is the reason why Rx is so simple, elegant and powerful. + +## I came here because I want to ... + +###### ... understand + +* [why use rx?](Documentation/Why.md) +* [the basics, getting started with RxSwift](Documentation/GettingStarted.md) +* [traits](Documentation/Traits.md) - what are `Single`, `Completable`, `Maybe`, `Driver`, and `ControlProperty` ... and why do they exist? +* [testing](Documentation/UnitTests.md) +* [tips and common errors](Documentation/Tips.md) +* [debugging](Documentation/GettingStarted.md#debugging) +* [the math behind Rx](Documentation/MathBehindRx.md) +* [what are hot and cold observable sequences?](Documentation/HotAndColdObservables.md) + +###### ... install + +* Integrate RxSwift/RxCocoa with my app. [Installation Guide](#installation) + +###### ... hack around + +* with the example app. [Running Example App](Documentation/ExampleApp.md) +* with operators in playgrounds. [Playgrounds](Documentation/Playgrounds.md) + +###### ... interact + +* All of this is great, but it would be nice to talk with other people using RxSwift and exchange experiences.
[Join Slack Channel](http://slack.rxswift.org) +* Report a problem using the library. [Open an Issue With Bug Template](.github/ISSUE_TEMPLATE.md) +* Request a new feature. [Open an Issue With Feature Request Template](Documentation/NewFeatureRequestTemplate.md) +* Help out [Check out contribution guide](CONTRIBUTING.md) + +###### ... compare + +* [with other libraries](Documentation/ComparisonWithOtherLibraries.md). + + +###### ... find compatible + +* libraries from [RxSwiftCommunity](https://github.com/RxSwiftCommunity). +* [Pods using RxSwift](https://cocoapods.org/?q=uses%3Arxswift). + +###### ... see the broader vision + +* Does this exist for Android? [RxJava](https://github.com/ReactiveX/RxJava) +* Where is all of this going, what is the future, what about reactive architectures, how do you design entire apps this way? [Cycle.js](https://github.com/cyclejs/cycle-core) - this is javascript, but [RxJS](https://github.com/Reactive-Extensions/RxJS) is javascript version of Rx. + +## Usage + + + + + + + + + + + + + + + + + + + +
Here's an exampleIn Action
Define search for GitHub repositories ...
+let searchResults = searchBar.rx.text.orEmpty
+    .throttle(0.3, scheduler: MainScheduler.instance)
+    .distinctUntilChanged()
+    .flatMapLatest { query -> Observable<[Repository]> in
+        if query.isEmpty {
+            return .just([])
+        }
+        return searchGitHub(query)
+            .catchErrorJustReturn([])
+    }
+    .observeOn(MainScheduler.instance)
... then bind the results to your tableview
+searchResults
+    .bind(to: tableView.rx.items(cellIdentifier: "Cell")) {
+        (index, repository: Repository, cell) in
+        cell.textLabel?.text = repository.name
+        cell.detailTextLabel?.text = repository.url
+    }
+    .disposed(by: disposeBag)
+ + +## Requirements + +* Xcode 9.0 +* Swift 4.0 +* Swift 3.x ([use `rxswift-3.0` branch](https://github.com/ReactiveX/RxSwift/tree/rxswift-3.0) instead) +* Swift 2.3 ([use `rxswift-2.0` branch](https://github.com/ReactiveX/RxSwift/tree/rxswift-2.0) instead) + +## Installation + +Rx doesn't contain any external dependencies. + +These are currently the supported options: + +### Manual + +Open Rx.xcworkspace, choose `RxExample` and hit run. This method will build everything and run the sample app + +### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html) + +**Tested with `pod --version`: `1.3.1`** + +```ruby +# Podfile +use_frameworks! + +target 'YOUR_TARGET_NAME' do + pod 'RxSwift', '~> 4.0' + pod 'RxCocoa', '~> 4.0' +end + +# RxTest and RxBlocking make the most sense in the context of unit/integration tests +target 'YOUR_TESTING_TARGET' do + pod 'RxBlocking', '~> 4.0' + pod 'RxTest', '~> 4.0' +end +``` + +Replace `YOUR_TARGET_NAME` and then, in the `Podfile` directory, type: + +```bash +$ pod install +``` + +### [Carthage](https://github.com/Carthage/Carthage) + +**Tested with `carthage version`: `0.26.2`** + +Add this to `Cartfile` + +``` +github "ReactiveX/RxSwift" ~> 4.0 +``` + +```bash +$ carthage update +``` + +### [Swift Package Manager](https://github.com/apple/swift-package-manager) + +**Tested with `swift build --version`: `Swift 4.0.0-dev (swiftpm-13126)`** + +Create a `Package.swift` file. + +```swift +// swift-tools-version:4.0 + +import PackageDescription + +let package = Package( + name: "RxTestProject", + dependencies: [ + .package(url: "https://github.com/ReactiveX/RxSwift.git", "4.0.0" ..< "5.0.0") + ], + targets: [ + .target(name: "RxTestProject", dependencies: ["RxSwift", "RxCocoa"]) + ] +) +``` + +```bash +$ swift build +``` + +To build or test a module with RxTest dependency, set `TEST=1`. ([RxSwift >= 3.4.2](https://github.com/ReactiveX/RxSwift/releases/tag/3.4.2)) + +```bash +$ TEST=1 swift test +``` + +### Manually using git submodules + +* Add RxSwift as a submodule + +```bash +$ git submodule add git@github.com:ReactiveX/RxSwift.git +``` + +* Drag `Rx.xcodeproj` into Project Navigator +* Go to `Project > Targets > Build Phases > Link Binary With Libraries`, click `+` and select `RxSwift-[Platform]` and `RxCocoa-[Platform]` targets + + +## References + +* [http://reactivex.io/](http://reactivex.io/) +* [Reactive Extensions GitHub (GitHub)](https://github.com/Reactive-Extensions) +* [RxSwift RayWenderlich.com Book](https://store.raywenderlich.com/products/rxswift-reactive-programming-with-swift) +* [Boxue.io RxSwift Online Course](https://boxueio.com/series/rxswift-101) (Chinese 🇨🇳) +* [Erik Meijer (Wikipedia)](http://en.wikipedia.org/wiki/Erik_Meijer_%28computer_scientist%29) +* [Expert to Expert: Brian Beckman and Erik Meijer - Inside the .NET Reactive Framework (Rx) (video)](https://youtu.be/looJcaeboBY) +* [Reactive Programming Overview (Jafar Husain from Netflix)](https://www.youtube.com/watch?v=dwP1TNXE6fc) +* [Subject/Observer is Dual to Iterator (paper)](http://csl.stanford.edu/~christos/pldi2010.fit/meijer.duality.pdf) +* [Rx standard sequence operators visualized (visualization tool)](http://rxmarbles.com/) +* [Haskell](https://www.haskell.org/) diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift new file mode 100644 index 000000000000..85a5efa8fd49 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/AnyObserver.swift @@ -0,0 +1,72 @@ +// +// AnyObserver.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// A type-erased `ObserverType`. +/// +/// Forwards operations to an arbitrary underlying observer with the same `Element` type, hiding the specifics of the underlying observer type. +public struct AnyObserver : ObserverType { + /// The type of elements in sequence that observer can observe. + public typealias E = Element + + /// Anonymous event handler type. + public typealias EventHandler = (Event) -> Void + + private let observer: EventHandler + + /// Construct an instance whose `on(event)` calls `eventHandler(event)` + /// + /// - parameter eventHandler: Event handler that observes sequences events. + public init(eventHandler: @escaping EventHandler) { + self.observer = eventHandler + } + + /// Construct an instance whose `on(event)` calls `observer.on(event)` + /// + /// - parameter observer: Observer that receives sequence events. + public init(_ observer: O) where O.E == Element { + self.observer = observer.on + } + + /// Send `event` to this observer. + /// + /// - parameter event: Event instance. + public func on(_ event: Event) { + return self.observer(event) + } + + /// Erases type of observer and returns canonical observer. + /// + /// - returns: type erased observer. + public func asObserver() -> AnyObserver { + return self + } +} + +extension AnyObserver { + /// Collection of `AnyObserver`s + typealias s = Bag<(Event) -> Void> +} + +extension ObserverType { + /// Erases type of observer and returns canonical observer. + /// + /// - returns: type erased observer. + public func asObserver() -> AnyObserver { + return AnyObserver(self) + } + + /// Transforms observer of type R to type E using custom transform method. + /// Each event sent to result observer is transformed and sent to `self`. + /// + /// - returns: observer that transforms events. + public func mapObserver(_ transform: @escaping (R) throws -> E) -> AnyObserver { + return AnyObserver { e in + self.on(e.map(transform)) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift new file mode 100644 index 000000000000..1fa7a67726e5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Cancelable.swift @@ -0,0 +1,13 @@ +// +// Cancelable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents disposable resource with state tracking. +public protocol Cancelable : Disposable { + /// Was resource disposed. + var isDisposed: Bool { get } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift new file mode 100644 index 000000000000..80332dbc4f01 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/AsyncLock.swift @@ -0,0 +1,102 @@ +// +// AsyncLock.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/** +In case nobody holds this lock, the work will be queued and executed immediately +on thread that is requesting lock. + +In case there is somebody currently holding that lock, action will be enqueued. +When owned of the lock finishes with it's processing, it will also execute +and pending work. + +That means that enqueued work could possibly be executed later on a different thread. +*/ +final class AsyncLock + : Disposable + , Lock + , SynchronizedDisposeType { + typealias Action = () -> Void + + var _lock = SpinLock() + + private var _queue: Queue = Queue(capacity: 0) + + private var _isExecuting: Bool = false + private var _hasFaulted: Bool = false + + // lock { + func lock() { + self._lock.lock() + } + + func unlock() { + self._lock.unlock() + } + // } + + private func enqueue(_ action: I) -> I? { + self._lock.lock(); defer { self._lock.unlock() } // { + if self._hasFaulted { + return nil + } + + if self._isExecuting { + self._queue.enqueue(action) + return nil + } + + self._isExecuting = true + + return action + // } + } + + private func dequeue() -> I? { + self._lock.lock(); defer { self._lock.unlock() } // { + if !self._queue.isEmpty { + return self._queue.dequeue() + } + else { + self._isExecuting = false + return nil + } + // } + } + + func invoke(_ action: I) { + let firstEnqueuedAction = self.enqueue(action) + + if let firstEnqueuedAction = firstEnqueuedAction { + firstEnqueuedAction.invoke() + } + else { + // action is enqueued, it's somebody else's concern now + return + } + + while true { + let nextAction = self.dequeue() + + if let nextAction = nextAction { + nextAction.invoke() + } + else { + return + } + } + } + + func dispose() { + self.synchronizedDispose() + } + + func _synchronized_dispose() { + self._queue = Queue(capacity: 0) + self._hasFaulted = true + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift new file mode 100644 index 000000000000..b26f5b750165 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/Lock.swift @@ -0,0 +1,36 @@ +// +// Lock.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/31/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol Lock { + func lock() + func unlock() +} + +// https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000321.html +typealias SpinLock = RecursiveLock + +extension RecursiveLock : Lock { + @inline(__always) + final func performLocked(_ action: () -> Void) { + self.lock(); defer { self.unlock() } + action() + } + + @inline(__always) + final func calculateLocked(_ action: () -> T) -> T { + self.lock(); defer { self.unlock() } + return action() + } + + @inline(__always) + final func calculateLockedOrFail(_ action: () throws -> T) throws -> T { + self.lock(); defer { self.unlock() } + let result = try action() + return result + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift new file mode 100644 index 000000000000..ed6b28a780dd --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/LockOwnerType.swift @@ -0,0 +1,21 @@ +// +// LockOwnerType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol LockOwnerType : class, Lock { + var _lock: RecursiveLock { get } +} + +extension LockOwnerType { + func lock() { + self._lock.lock() + } + + func unlock() { + self._lock.unlock() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift new file mode 100644 index 000000000000..0490a69ba87f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedDisposeType.swift @@ -0,0 +1,18 @@ +// +// SynchronizedDisposeType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol SynchronizedDisposeType : class, Disposable, Lock { + func _synchronized_dispose() +} + +extension SynchronizedDisposeType { + func synchronizedDispose() { + self.lock(); defer { self.unlock() } + self._synchronized_dispose() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift new file mode 100644 index 000000000000..33aa84fc51e8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedOnType.swift @@ -0,0 +1,18 @@ +// +// SynchronizedOnType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol SynchronizedOnType : class, ObserverType, Lock { + func _synchronized_on(_ event: Event) +} + +extension SynchronizedOnType { + func synchronizedOn(_ event: Event) { + self.lock(); defer { self.unlock() } + self._synchronized_on(event) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift new file mode 100644 index 000000000000..bb1aa7e47df2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Concurrency/SynchronizedUnsubscribeType.swift @@ -0,0 +1,13 @@ +// +// SynchronizedUnsubscribeType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol SynchronizedUnsubscribeType : class { + associatedtype DisposeKey + + func synchronizedUnsubscribe(_ disposeKey: DisposeKey) +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift new file mode 100644 index 000000000000..52bf93c56862 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ConnectableObservableType.swift @@ -0,0 +1,19 @@ +// +// ConnectableObservableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/** +Represents an observable sequence wrapper that can be connected and disconnected from its underlying observable sequence. +*/ +public protocol ConnectableObservableType : ObservableType { + /** + Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. + + - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. + */ + func connect() -> Disposable +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift new file mode 100644 index 000000000000..cb410906eca9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Deprecated.swift @@ -0,0 +1,228 @@ +// +// Deprecated.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/5/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +extension Observable { + /** + Converts a optional to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter optional: Optional element in the resulting observable sequence. + - returns: An observable sequence containing the wrapped value or not from given optional. + */ + @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:)") + public static func from(_ optional: E?) -> Observable { + return Observable.from(optional: optional) + } + + /** + Converts a optional to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter optional: Optional element in the resulting observable sequence. + - parameter scheduler: Scheduler to send the optional element on. + - returns: An observable sequence containing the wrapped value or not from given optional. + */ + @available(*, deprecated, message: "Implicit conversions from any type to optional type are allowed and that is causing issues with `from` operator overloading.", renamed: "from(optional:scheduler:)") + public static func from(_ optional: E?, scheduler: ImmediateSchedulerType) -> Observable { + return Observable.from(optional: optional, scheduler: scheduler) + } +} + +extension ObservableType { + /** + + Projects each element of an observable sequence into a new form by incorporating the element's index. + + - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) + + - parameter selector: A transform function to apply to each source element; the second parameter of the function represents the index of the source element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. + */ + @available(*, deprecated, message: "Please use enumerated().map()") + public func mapWithIndex(_ selector: @escaping (E, Int) throws -> R) + -> Observable { + return self.enumerated().map { try selector($0.element, $0.index) } + } + + + /** + + Projects each element of an observable sequence to an observable sequence by incorporating the element's index and merges the resulting observable sequences into one observable sequence. + + - seealso: [flatMap operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to each element; the second parameter of the function represents the index of the source element. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. + */ + @available(*, deprecated, message: "Please use enumerated().flatMap()") + public func flatMapWithIndex(_ selector: @escaping (E, Int) throws -> O) + -> Observable { + return self.enumerated().flatMap { try selector($0.element, $0.index) } + } + + /** + + Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. + The element's index is used in the logic of the predicate function. + + - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) + + - parameter predicate: A function to test each element for a condition; the second parameter of the function represents the index of the source element. + - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. + */ + @available(*, deprecated, message: "Please use enumerated().skipWhile().map()") + public func skipWhileWithIndex(_ predicate: @escaping (E, Int) throws -> Bool) -> Observable { + return self.enumerated().skipWhile { try predicate($0.element, $0.index) }.map { $0.element } + } + + + /** + + Returns elements from an observable sequence as long as a specified condition is true. + + The element's index is used in the logic of the predicate function. + + - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) + + - parameter predicate: A function to test each element for a condition; the second parameter of the function represents the index of the source element. + - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. + */ + @available(*, deprecated, message: "Please use enumerated().takeWhile().map()") + public func takeWhileWithIndex(_ predicate: @escaping (E, Int) throws -> Bool) -> Observable { + return self.enumerated().takeWhile { try predicate($0.element, $0.index) }.map { $0.element } + } +} + +extension Disposable { + /// Deprecated in favor of `disposed(by:)` + /// + /// + /// Adds `self` to `bag`. + /// + /// - parameter bag: `DisposeBag` to add `self` to. + @available(*, deprecated, message: "use disposed(by:) instead", renamed: "disposed(by:)") + public func addDisposableTo(_ bag: DisposeBag) { + self.disposed(by: bag) + } +} + + +extension ObservableType { + + /** + Returns an observable sequence that shares a single subscription to the underlying sequence, and immediately upon subscription replays latest element in buffer. + + This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + + - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + @available(*, deprecated, message: "use share(replay: 1) instead", renamed: "share(replay:)") + public func shareReplayLatestWhileConnected() + -> Observable { + return self.share(replay: 1, scope: .whileConnected) + } +} + + +extension ObservableType { + + /** + Returns an observable sequence that shares a single subscription to the underlying sequence, and immediately upon subscription replays maximum number of elements in buffer. + + This operator is a specialization of replay which creates a subscription when the number of observers goes from zero to one, then shares that subscription with all subsequent observers until the number of observers returns to zero, at which point the subscription is disposed. + + - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - parameter bufferSize: Maximum element count of the replay buffer. + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + @available(*, deprecated, message: "Suggested replacement is `share(replay: 1)`. In case old 3.x behavior of `shareReplay` is required please use `share(replay: 1, scope: .forever)` instead.", renamed: "share(replay:)") + public func shareReplay(_ bufferSize: Int) + -> Observable { + return self.share(replay: bufferSize, scope: .forever) + } +} + +/// Variable is a wrapper for `BehaviorSubject`. +/// +/// Unlike `BehaviorSubject` it can't terminate with error, and when variable is deallocated +/// it will complete its observable sequence (`asObservable`). +/// +/// **This concept will be deprecated from RxSwift but offical migration path hasn't been decided yet.** +/// https://github.com/ReactiveX/RxSwift/issues/1501 +/// +/// Current recommended replacement for this API is `RxCocoa.BehaviorRelay` because: +/// * `Variable` isn't a standard cross platform concept, hence it's out of place in RxSwift target. +/// * It doesn't have a counterpart for handling events (`PublishRelay`). It models state only. +/// * It doesn't have a consistent naming with *Relay or other Rx concepts. +/// * It has an inconsistent memory management model compared to other parts of RxSwift (completes on `deinit`). +/// +/// Once plans are finalized, official availability attribute will be added in one of upcoming versions. +public final class Variable { + + public typealias E = Element + + private let _subject: BehaviorSubject + + private var _lock = SpinLock() + + // state + private var _value: E + + #if DEBUG + fileprivate let _synchronizationTracker = SynchronizationTracker() + #endif + + /// Gets or sets current value of variable. + /// + /// Whenever a new value is set, all the observers are notified of the change. + /// + /// Even if the newly set value is same as the old value, observers are still notified for change. + public var value: E { + get { + self._lock.lock(); defer { self._lock.unlock() } + return self._value + } + set(newValue) { + #if DEBUG + self._synchronizationTracker.register(synchronizationErrorMessage: .variable) + defer { self._synchronizationTracker.unregister() } + #endif + self._lock.lock() + self._value = newValue + self._lock.unlock() + + self._subject.on(.next(newValue)) + } + } + + /// Initializes variable with initial value. + /// + /// - parameter value: Initial variable value. + public init(_ value: Element) { + #if DEBUG + DeprecationWarner.warnIfNeeded(.variable) + #endif + + self._value = value + self._subject = BehaviorSubject(value: value) + } + + /// - returns: Canonical interface for push style sequence + public func asObservable() -> Observable { + return self._subject + } + + deinit { + self._subject.on(.completed) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift new file mode 100644 index 000000000000..b79c77a75819 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposable.swift @@ -0,0 +1,13 @@ +// +// Disposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a disposable resource. +public protocol Disposable { + /// Dispose resource. + func dispose() +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift new file mode 100644 index 000000000000..6fbd6355506a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/AnonymousDisposable.swift @@ -0,0 +1,59 @@ +// +// AnonymousDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents an Action-based disposable. +/// +/// When dispose method is called, disposal action will be dereferenced. +fileprivate final class AnonymousDisposable : DisposeBase, Cancelable { + public typealias DisposeAction = () -> Void + + private let _isDisposed = AtomicInt(0) + private var _disposeAction: DisposeAction? + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return isFlagSet(self._isDisposed, 1) + } + + /// Constructs a new disposable with the given action used for disposal. + /// + /// - parameter disposeAction: Disposal action which will be run upon calling `dispose`. + fileprivate init(_ disposeAction: @escaping DisposeAction) { + self._disposeAction = disposeAction + super.init() + } + + // Non-deprecated version of the constructor, used by `Disposables.create(with:)` + fileprivate init(disposeAction: @escaping DisposeAction) { + self._disposeAction = disposeAction + super.init() + } + + /// Calls the disposal action if and only if the current instance hasn't been disposed yet. + /// + /// After invoking disposal action, disposal action will be dereferenced. + fileprivate func dispose() { + if fetchOr(self._isDisposed, 1) == 0 { + if let action = self._disposeAction { + self._disposeAction = nil + action() + } + } + } +} + +extension Disposables { + + /// Constructs a new disposable with the given action used for disposal. + /// + /// - parameter dispose: Disposal action which will be run upon calling `dispose`. + public static func create(with dispose: @escaping () -> Void) -> Cancelable { + return AnonymousDisposable(disposeAction: dispose) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift new file mode 100644 index 000000000000..5693268d2a2a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BinaryDisposable.swift @@ -0,0 +1,53 @@ +// +// BinaryDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents two disposable resources that are disposed together. +private final class BinaryDisposable : DisposeBase, Cancelable { + + private let _isDisposed = AtomicInt(0) + + // state + private var _disposable1: Disposable? + private var _disposable2: Disposable? + + /// - returns: Was resource disposed. + var isDisposed: Bool { + return isFlagSet(self._isDisposed, 1) + } + + /// Constructs new binary disposable from two disposables. + /// + /// - parameter disposable1: First disposable + /// - parameter disposable2: Second disposable + init(_ disposable1: Disposable, _ disposable2: Disposable) { + self._disposable1 = disposable1 + self._disposable2 = disposable2 + super.init() + } + + /// Calls the disposal action if and only if the current instance hasn't been disposed yet. + /// + /// After invoking disposal action, disposal action will be dereferenced. + func dispose() { + if fetchOr(self._isDisposed, 1) == 0 { + self._disposable1?.dispose() + self._disposable2?.dispose() + self._disposable1 = nil + self._disposable2 = nil + } + } +} + +extension Disposables { + + /// Creates a disposable with the given disposables. + public static func create(_ disposable1: Disposable, _ disposable2: Disposable) -> Cancelable { + return BinaryDisposable(disposable1, disposable2) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift new file mode 100644 index 000000000000..a0f5c2fb8661 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/BooleanDisposable.swift @@ -0,0 +1,33 @@ +// +// BooleanDisposable.swift +// RxSwift +// +// Created by Junior B. on 10/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a disposable resource that can be checked for disposal status. +public final class BooleanDisposable : Cancelable { + + internal static let BooleanDisposableTrue = BooleanDisposable(isDisposed: true) + private var _isDisposed = false + + /// Initializes a new instance of the `BooleanDisposable` class + public init() { + } + + /// Initializes a new instance of the `BooleanDisposable` class with given value + public init(isDisposed: Bool) { + self._isDisposed = isDisposed + } + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return self._isDisposed + } + + /// Sets the status to disposed, which can be observer through the `isDisposed` property. + public func dispose() { + self._isDisposed = true + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift new file mode 100644 index 000000000000..ce0da6a7c62c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/CompositeDisposable.swift @@ -0,0 +1,151 @@ +// +// CompositeDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/20/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a group of disposable resources that are disposed together. +public final class CompositeDisposable : DisposeBase, Cancelable { + /// Key used to remove disposable from composite disposable + public struct DisposeKey { + fileprivate let key: BagKey + fileprivate init(key: BagKey) { + self.key = key + } + } + + private var _lock = SpinLock() + + // state + private var _disposables: Bag? = Bag() + + public var isDisposed: Bool { + self._lock.lock(); defer { self._lock.unlock() } + return self._disposables == nil + } + + public override init() { + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(_ disposable1: Disposable, _ disposable2: Disposable) { + // This overload is here to make sure we are using optimized version up to 4 arguments. + _ = self._disposables!.insert(disposable1) + _ = self._disposables!.insert(disposable2) + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) { + // This overload is here to make sure we are using optimized version up to 4 arguments. + _ = self._disposables!.insert(disposable1) + _ = self._disposables!.insert(disposable2) + _ = self._disposables!.insert(disposable3) + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposable4: Disposable, _ disposables: Disposable...) { + // This overload is here to make sure we are using optimized version up to 4 arguments. + _ = self._disposables!.insert(disposable1) + _ = self._disposables!.insert(disposable2) + _ = self._disposables!.insert(disposable3) + _ = self._disposables!.insert(disposable4) + + for disposable in disposables { + _ = self._disposables!.insert(disposable) + } + } + + /// Initializes a new instance of composite disposable with the specified number of disposables. + public init(disposables: [Disposable]) { + for disposable in disposables { + _ = self._disposables!.insert(disposable) + } + } + + /** + Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed. + + - parameter disposable: Disposable to add. + - returns: Key that can be used to remove disposable from composite disposable. In case dispose bag was already + disposed `nil` will be returned. + */ + public func insert(_ disposable: Disposable) -> DisposeKey? { + let key = self._insert(disposable) + + if key == nil { + disposable.dispose() + } + + return key + } + + private func _insert(_ disposable: Disposable) -> DisposeKey? { + self._lock.lock(); defer { self._lock.unlock() } + + let bagKey = self._disposables?.insert(disposable) + return bagKey.map(DisposeKey.init) + } + + /// - returns: Gets the number of disposables contained in the `CompositeDisposable`. + public var count: Int { + self._lock.lock(); defer { self._lock.unlock() } + return self._disposables?.count ?? 0 + } + + /// Removes and disposes the disposable identified by `disposeKey` from the CompositeDisposable. + /// + /// - parameter disposeKey: Key used to identify disposable to be removed. + public func remove(for disposeKey: DisposeKey) { + self._remove(for: disposeKey)?.dispose() + } + + private func _remove(for disposeKey: DisposeKey) -> Disposable? { + self._lock.lock(); defer { self._lock.unlock() } + return self._disposables?.removeKey(disposeKey.key) + } + + /// Disposes all disposables in the group and removes them from the group. + public func dispose() { + if let disposables = self._dispose() { + disposeAll(in: disposables) + } + } + + private func _dispose() -> Bag? { + self._lock.lock(); defer { self._lock.unlock() } + + let disposeBag = self._disposables + self._disposables = nil + + return disposeBag + } +} + +extension Disposables { + + /// Creates a disposable with the given disposables. + public static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable) -> Cancelable { + return CompositeDisposable(disposable1, disposable2, disposable3) + } + + /// Creates a disposable with the given disposables. + public static func create(_ disposable1: Disposable, _ disposable2: Disposable, _ disposable3: Disposable, _ disposables: Disposable ...) -> Cancelable { + var disposables = disposables + disposables.append(disposable1) + disposables.append(disposable2) + disposables.append(disposable3) + return CompositeDisposable(disposables: disposables) + } + + /// Creates a disposable with the given disposables. + public static func create(_ disposables: [Disposable]) -> Cancelable { + switch disposables.count { + case 2: + return Disposables.create(disposables[0], disposables[1]) + default: + return CompositeDisposable(disposables: disposables) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift new file mode 100644 index 000000000000..8cd6e28c3c90 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/Disposables.swift @@ -0,0 +1,13 @@ +// +// Disposables.swift +// RxSwift +// +// Created by Mohsen Ramezanpoor on 01/08/2016. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +/// A collection of utility methods for common disposable operations. +public struct Disposables { + private init() {} +} + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift new file mode 100644 index 000000000000..22e5cb02f980 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBag.swift @@ -0,0 +1,114 @@ +// +// DisposeBag.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension Disposable { + /// Adds `self` to `bag` + /// + /// - parameter bag: `DisposeBag` to add `self` to. + public func disposed(by bag: DisposeBag) { + bag.insert(self) + } +} + +/** +Thread safe bag that disposes added disposables on `deinit`. + +This returns ARC (RAII) like resource management to `RxSwift`. + +In case contained disposables need to be disposed, just put a different dispose bag +or create a new one in its place. + + self.existingDisposeBag = DisposeBag() + +In case explicit disposal is necessary, there is also `CompositeDisposable`. +*/ +public final class DisposeBag: DisposeBase { + + private var _lock = SpinLock() + + // state + fileprivate var _disposables = [Disposable]() + fileprivate var _isDisposed = false + + /// Constructs new empty dispose bag. + public override init() { + super.init() + } + + /// Adds `disposable` to be disposed when dispose bag is being deinited. + /// + /// - parameter disposable: Disposable to add. + public func insert(_ disposable: Disposable) { + self._insert(disposable)?.dispose() + } + + private func _insert(_ disposable: Disposable) -> Disposable? { + self._lock.lock(); defer { self._lock.unlock() } + if self._isDisposed { + return disposable + } + + self._disposables.append(disposable) + + return nil + } + + /// This is internal on purpose, take a look at `CompositeDisposable` instead. + private func dispose() { + let oldDisposables = self._dispose() + + for disposable in oldDisposables { + disposable.dispose() + } + } + + private func _dispose() -> [Disposable] { + self._lock.lock(); defer { self._lock.unlock() } + + let disposables = self._disposables + + self._disposables.removeAll(keepingCapacity: false) + self._isDisposed = true + + return disposables + } + + deinit { + self.dispose() + } +} + +extension DisposeBag { + + /// Convenience init allows a list of disposables to be gathered for disposal. + public convenience init(disposing disposables: Disposable...) { + self.init() + self._disposables += disposables + } + + /// Convenience init allows an array of disposables to be gathered for disposal. + public convenience init(disposing disposables: [Disposable]) { + self.init() + self._disposables += disposables + } + + /// Convenience function allows a list of disposables to be gathered for disposal. + public func insert(_ disposables: Disposable...) { + self.insert(disposables) + } + + /// Convenience function allows an array of disposables to be gathered for disposal. + public func insert(_ disposables: [Disposable]) { + self._lock.lock(); defer { self._lock.unlock() } + if self._isDisposed { + disposables.forEach { $0.dispose() } + } else { + self._disposables += disposables + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift new file mode 100644 index 000000000000..0d4b2fb7f9b8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/DisposeBase.swift @@ -0,0 +1,22 @@ +// +// DisposeBase.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/4/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Base class for all disposables. +public class DisposeBase { + init() { +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + } + + deinit { +#if TRACE_RESOURCES + _ = Resources.decrementTotal() +#endif + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift new file mode 100644 index 000000000000..149f86643425 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/NopDisposable.swift @@ -0,0 +1,32 @@ +// +// NopDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a disposable that does nothing on disposal. +/// +/// Nop = No Operation +fileprivate struct NopDisposable : Disposable { + + fileprivate static let noOp: Disposable = NopDisposable() + + fileprivate init() { + + } + + /// Does nothing. + public func dispose() { + } +} + +extension Disposables { + /** + Creates a disposable that does nothing on disposal. + */ + static public func create() -> Disposable { + return NopDisposable.noOp + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift new file mode 100644 index 000000000000..922f20a6db01 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/RefCountDisposable.swift @@ -0,0 +1,113 @@ +// +// RefCountDisposable.swift +// RxSwift +// +// Created by Junior B. on 10/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a disposable resource that only disposes its underlying disposable resource when all dependent disposable objects have been disposed. +public final class RefCountDisposable : DisposeBase, Cancelable { + private var _lock = SpinLock() + private var _disposable = nil as Disposable? + private var _primaryDisposed = false + private var _count = 0 + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + self._lock.lock(); defer { self._lock.unlock() } + return self._disposable == nil + } + + /// Initializes a new instance of the `RefCountDisposable`. + public init(disposable: Disposable) { + self._disposable = disposable + super.init() + } + + /** + Holds a dependent disposable that when disposed decreases the refcount on the underlying disposable. + + When getter is called, a dependent disposable contributing to the reference count that manages the underlying disposable's lifetime is returned. + */ + public func retain() -> Disposable { + return self._lock.calculateLocked { + if self._disposable != nil { + do { + _ = try incrementChecked(&self._count) + } catch { + rxFatalError("RefCountDisposable increment failed") + } + + return RefCountInnerDisposable(self) + } else { + return Disposables.create() + } + } + } + + /// Disposes the underlying disposable only when all dependent disposables have been disposed. + public func dispose() { + let oldDisposable: Disposable? = self._lock.calculateLocked { + if let oldDisposable = self._disposable, !self._primaryDisposed { + self._primaryDisposed = true + + if self._count == 0 { + self._disposable = nil + return oldDisposable + } + } + + return nil + } + + if let disposable = oldDisposable { + disposable.dispose() + } + } + + fileprivate func release() { + let oldDisposable: Disposable? = self._lock.calculateLocked { + if let oldDisposable = self._disposable { + do { + _ = try decrementChecked(&self._count) + } catch { + rxFatalError("RefCountDisposable decrement on release failed") + } + + guard self._count >= 0 else { + rxFatalError("RefCountDisposable counter is lower than 0") + } + + if self._primaryDisposed && self._count == 0 { + self._disposable = nil + return oldDisposable + } + } + + return nil + } + + if let disposable = oldDisposable { + disposable.dispose() + } + } +} + +internal final class RefCountInnerDisposable: DisposeBase, Disposable +{ + private let _parent: RefCountDisposable + private let _isDisposed = AtomicInt(0) + + init(_ parent: RefCountDisposable) { + self._parent = parent + super.init() + } + + internal func dispose() + { + if fetchOr(self._isDisposed, 1) == 0 { + self._parent.release() + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift new file mode 100644 index 000000000000..c834f5be1b08 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/ScheduledDisposable.swift @@ -0,0 +1,50 @@ +// +// ScheduledDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +private let disposeScheduledDisposable: (ScheduledDisposable) -> Disposable = { sd in + sd.disposeInner() + return Disposables.create() +} + +/// Represents a disposable resource whose disposal invocation will be scheduled on the specified scheduler. +public final class ScheduledDisposable : Cancelable { + public let scheduler: ImmediateSchedulerType + + private let _isDisposed = AtomicInt(0) + + // state + private var _disposable: Disposable? + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return isFlagSet(self._isDisposed, 1) + } + + /** + Initializes a new instance of the `ScheduledDisposable` that uses a `scheduler` on which to dispose the `disposable`. + + - parameter scheduler: Scheduler where the disposable resource will be disposed on. + - parameter disposable: Disposable resource to dispose on the given scheduler. + */ + public init(scheduler: ImmediateSchedulerType, disposable: Disposable) { + self.scheduler = scheduler + self._disposable = disposable + } + + /// Disposes the wrapped disposable on the provided scheduler. + public func dispose() { + _ = self.scheduler.schedule(self, action: disposeScheduledDisposable) + } + + func disposeInner() { + if fetchOr(self._isDisposed, 1) == 0 { + self._disposable!.dispose() + self._disposable = nil + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift new file mode 100644 index 000000000000..22dce3620b1b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SerialDisposable.swift @@ -0,0 +1,75 @@ +// +// SerialDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a disposable resource whose underlying disposable resource can be replaced by another disposable resource, causing automatic disposal of the previous underlying disposable resource. +public final class SerialDisposable : DisposeBase, Cancelable { + private var _lock = SpinLock() + + // state + private var _current = nil as Disposable? + private var _isDisposed = false + + /// - returns: Was resource disposed. + public var isDisposed: Bool { + return self._isDisposed + } + + /// Initializes a new instance of the `SerialDisposable`. + override public init() { + super.init() + } + + /** + Gets or sets the underlying disposable. + + Assigning this property disposes the previous disposable object. + + If the `SerialDisposable` has already been disposed, assignment to this property causes immediate disposal of the given disposable object. + */ + public var disposable: Disposable { + get { + return self._lock.calculateLocked { + return self._current ?? Disposables.create() + } + } + set (newDisposable) { + let disposable: Disposable? = self._lock.calculateLocked { + if self._isDisposed { + return newDisposable + } + else { + let toDispose = self._current + self._current = newDisposable + return toDispose + } + } + + if let disposable = disposable { + disposable.dispose() + } + } + } + + /// Disposes the underlying disposable as well as all future replacements. + public func dispose() { + self._dispose()?.dispose() + } + + private func _dispose() -> Disposable? { + self._lock.lock(); defer { self._lock.unlock() } + if self._isDisposed { + return nil + } + else { + self._isDisposed = true + let current = self._current + self._current = nil + return current + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift new file mode 100644 index 000000000000..88d59dbe31aa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SingleAssignmentDisposable.swift @@ -0,0 +1,70 @@ +// +// SingleAssignmentDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/** +Represents a disposable resource which only allows a single assignment of its underlying disposable resource. + +If an underlying disposable resource has already been set, future attempts to set the underlying disposable resource will throw an exception. +*/ +public final class SingleAssignmentDisposable : DisposeBase, Cancelable { + + fileprivate enum DisposeState: Int32 { + case disposed = 1 + case disposableSet = 2 + } + + // state + private let _state = AtomicInt(0) + private var _disposable = nil as Disposable? + + /// - returns: A value that indicates whether the object is disposed. + public var isDisposed: Bool { + return isFlagSet(self._state, DisposeState.disposed.rawValue) + } + + /// Initializes a new instance of the `SingleAssignmentDisposable`. + public override init() { + super.init() + } + + /// Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined. + /// + /// **Throws exception if the `SingleAssignmentDisposable` has already been assigned to.** + public func setDisposable(_ disposable: Disposable) { + self._disposable = disposable + + let previousState = fetchOr(self._state, DisposeState.disposableSet.rawValue) + + if (previousState & DisposeState.disposableSet.rawValue) != 0 { + rxFatalError("oldState.disposable != nil") + } + + if (previousState & DisposeState.disposed.rawValue) != 0 { + disposable.dispose() + self._disposable = nil + } + } + + /// Disposes the underlying disposable. + public func dispose() { + let previousState = fetchOr(self._state, DisposeState.disposed.rawValue) + + if (previousState & DisposeState.disposed.rawValue) != 0 { + return + } + + if (previousState & DisposeState.disposableSet.rawValue) != 0 { + guard let disposable = self._disposable else { + rxFatalError("Disposable not set") + } + disposable.dispose() + self._disposable = nil + } + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift new file mode 100644 index 000000000000..430e4c6b550d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Disposables/SubscriptionDisposable.swift @@ -0,0 +1,21 @@ +// +// SubscriptionDisposable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +struct SubscriptionDisposable : Disposable { + private let _key: T.DisposeKey + private weak var _owner: T? + + init(owner: T, key: T.DisposeKey) { + self._owner = owner + self._key = key + } + + func dispose() { + self._owner?.synchronizedUnsubscribe(self._key) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift new file mode 100644 index 000000000000..f17b52d882a8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Errors.swift @@ -0,0 +1,52 @@ +// +// Errors.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +let RxErrorDomain = "RxErrorDomain" +let RxCompositeFailures = "RxCompositeFailures" + +/// Generic Rx error codes. +public enum RxError + : Swift.Error + , CustomDebugStringConvertible { + /// Unknown error occurred. + case unknown + /// Performing an action on disposed object. + case disposed(object: AnyObject) + /// Aritmetic overflow error. + case overflow + /// Argument out of range error. + case argumentOutOfRange + /// Sequence doesn't contain any elements. + case noElements + /// Sequence contains more than one element. + case moreThanOneElement + /// Timeout error. + case timeout +} + +extension RxError { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + switch self { + case .unknown: + return "Unknown error occurred." + case .disposed(let object): + return "Object `\(object)` was already disposed." + case .overflow: + return "Arithmetic overflow occurred." + case .argumentOutOfRange: + return "Argument out of range." + case .noElements: + return "Sequence doesn't contain any elements." + case .moreThanOneElement: + return "Sequence contains more than one element." + case .timeout: + return "Sequence timeout." + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift new file mode 100644 index 000000000000..9193e3504d4d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Event.swift @@ -0,0 +1,106 @@ +// +// Event.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a sequence event. +/// +/// Sequence grammar: +/// **next\* (error | completed)** +public enum Event { + /// Next element is produced. + case next(Element) + + /// Sequence terminated with an error. + case error(Swift.Error) + + /// Sequence completed successfully. + case completed +} + +extension Event : CustomDebugStringConvertible { + /// Description of event. + public var debugDescription: String { + switch self { + case .next(let value): + return "next(\(value))" + case .error(let error): + return "error(\(error))" + case .completed: + return "completed" + } + } +} + +extension Event { + /// Is `completed` or `error` event. + public var isStopEvent: Bool { + switch self { + case .next: return false + case .error, .completed: return true + } + } + + /// If `next` event, returns element value. + public var element: Element? { + if case .next(let value) = self { + return value + } + return nil + } + + /// If `error` event, returns error. + public var error: Swift.Error? { + if case .error(let error) = self { + return error + } + return nil + } + + /// If `completed` event, returns `true`. + public var isCompleted: Bool { + if case .completed = self { + return true + } + return false + } +} + +extension Event { + /// Maps sequence elements using transform. If error happens during the transform, `.error` + /// will be returned as value. + public func map(_ transform: (Element) throws -> Result) -> Event { + do { + switch self { + case let .next(element): + return .next(try transform(element)) + case let .error(error): + return .error(error) + case .completed: + return .completed + } + } + catch let e { + return .error(e) + } + } +} + +/// A type that can be converted to `Event`. +public protocol EventConvertible { + /// Type of element in event + associatedtype ElementType + + /// Event representation of this instance + var event: Event { get } +} + +extension Event : EventConvertible { + /// Event representation of this instance + public var event: Event { + return self + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift new file mode 100644 index 000000000000..fc9b22cd7f80 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/Bag+Rx.swift @@ -0,0 +1,50 @@ +// +// Bag+Rx.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/19/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + + +// MARK: forEach + +@inline(__always) +func dispatch(_ bag: Bag<(Event) -> Void>, _ event: Event) { + bag._value0?(event) + + if bag._onlyFastPath { + return + } + + let pairs = bag._pairs + for i in 0 ..< pairs.count { + pairs[i].value(event) + } + + if let dictionary = bag._dictionary { + for element in dictionary.values { + element(event) + } + } +} + +/// Dispatches `dispose` to all disposables contained inside bag. +func disposeAll(in bag: Bag) { + bag._value0?.dispose() + + if bag._onlyFastPath { + return + } + + let pairs = bag._pairs + for i in 0 ..< pairs.count { + pairs[i].value.dispose() + } + + if let dictionary = bag._dictionary { + for element in dictionary.values { + element.dispose() + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift new file mode 100644 index 000000000000..70d4786cbb19 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Extensions/String+Rx.swift @@ -0,0 +1,22 @@ +// +// String+Rx.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension String { + /// This is needed because on Linux Swift doesn't have `rangeOfString(..., options: .BackwardsSearch)` + func lastIndexOf(_ character: Character) -> Index? { + var index = self.endIndex + while index > self.startIndex { + index = self.index(before: index) + if self[index] == character { + return index + } + } + + return nil + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift new file mode 100644 index 000000000000..c5b0a9d6d10a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/GroupedObservable.swift @@ -0,0 +1,37 @@ +// +// GroupedObservable.swift +// RxSwift +// +// Created by Tomi Koskinen on 01/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents an observable sequence of elements that have a common key. +public struct GroupedObservable : ObservableType { + public typealias E = Element + + /// Gets the common key. + public let key: Key + + private let source: Observable + + /// Initializes grouped observable sequence with key and source observable sequence. + /// + /// - parameter key: Grouped observable sequence key + /// - parameter source: Observable sequence that represents sequence of elements for the key + /// - returns: Grouped observable sequence of elements for the specific key + public init(key: Key, source: Observable) { + self.key = key + self.source = source + } + + /// Subscribes `observer` to receive events for this sequence. + public func subscribe(_ observer: O) -> Disposable where O.E == E { + return self.source.subscribe(observer) + } + + /// Converts `self` to `Observable` sequence. + public func asObservable() -> Observable { + return self.source + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift new file mode 100644 index 000000000000..954fbf04b2a0 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ImmediateSchedulerType.swift @@ -0,0 +1,36 @@ +// +// ImmediateSchedulerType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/31/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents an object that immediately schedules units of work. +public protocol ImmediateSchedulerType { + /** + Schedules an action to be executed immediately. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable +} + +extension ImmediateSchedulerType { + /** + Schedules an action to be executed recursively. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleRecursive(_ state: State, action: @escaping (_ state: State, _ recurse: (State) -> Void) -> Void) -> Disposable { + let recursiveScheduler = RecursiveImmediateScheduler(action: action, scheduler: self) + + recursiveScheduler.schedule(state) + + return Disposables.create(with: recursiveScheduler.dispose) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift new file mode 100644 index 000000000000..08caab43765f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observable.swift @@ -0,0 +1,44 @@ +// +// Observable.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// A type-erased `ObservableType`. +/// +/// It represents a push style sequence. +public class Observable : ObservableType { + /// Type of elements in sequence. + public typealias E = Element + + init() { +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + } + + public func subscribe(_ observer: O) -> Disposable where O.E == E { + rxAbstractMethod() + } + + public func asObservable() -> Observable { + return self + } + + deinit { +#if TRACE_RESOURCES + _ = Resources.decrementTotal() +#endif + } + + // this is kind of ugly I know :( + // Swift compiler reports "Not supported yet" when trying to override protocol extensions, so ¯\_(ツ)_/¯ + + /// Optimizations for map operator + internal func composeMap(_ transform: @escaping (Element) throws -> R) -> Observable { + return _map(source: self, transform: transform) + } +} + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift new file mode 100644 index 000000000000..d89c5aa70b9c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableConvertibleType.swift @@ -0,0 +1,18 @@ +// +// ObservableConvertibleType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Type that can be converted to observable sequence (`Observable`). +public protocol ObservableConvertibleType { + /// Type of elements in sequence. + associatedtype E + + /// Converts `self` to `Observable` sequence. + /// + /// - returns: Observable sequence that represents `self`. + func asObservable() -> Observable +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift new file mode 100644 index 000000000000..362fc58a5ad5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType+Extensions.swift @@ -0,0 +1,131 @@ +// +// ObservableType+Extensions.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if DEBUG + import Foundation +#endif + +extension ObservableType { + /** + Subscribes an event handler to an observable sequence. + + - parameter on: Action to invoke for each event in the observable sequence. + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func subscribe(_ on: @escaping (Event) -> Void) + -> Disposable { + let observer = AnonymousObserver { e in + on(e) + } + return self.asObservable().subscribe(observer) + } + + + /** + Subscribes an element handler, an error handler, a completion handler and disposed handler to an observable sequence. + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onError: Action to invoke upon errored termination of the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + - parameter onDisposed: Action to invoke upon any type of termination of sequence (if the sequence has + gracefully completed, errored, or if the generation is canceled by disposing subscription). + - returns: Subscription object used to unsubscribe from the observable sequence. + */ + public func subscribe(onNext: ((E) -> Void)? = nil, onError: ((Swift.Error) -> Void)? = nil, onCompleted: (() -> Void)? = nil, onDisposed: (() -> Void)? = nil) + -> Disposable { + let disposable: Disposable + + if let disposed = onDisposed { + disposable = Disposables.create(with: disposed) + } + else { + disposable = Disposables.create() + } + + #if DEBUG + let synchronizationTracker = SynchronizationTracker() + #endif + + let callStack = Hooks.recordCallStackOnError ? Hooks.customCaptureSubscriptionCallstack() : [] + + let observer = AnonymousObserver { event in + + #if DEBUG + synchronizationTracker.register(synchronizationErrorMessage: .default) + defer { synchronizationTracker.unregister() } + #endif + + switch event { + case .next(let value): + onNext?(value) + case .error(let error): + if let onError = onError { + onError(error) + } + else { + Hooks.defaultErrorHandler(callStack, error) + } + disposable.dispose() + case .completed: + onCompleted?() + disposable.dispose() + } + } + return Disposables.create( + self.asObservable().subscribe(observer), + disposable + ) + } +} + +import class Foundation.NSRecursiveLock + +extension Hooks { + public typealias DefaultErrorHandler = (_ subscriptionCallStack: [String], _ error: Error) -> Void + public typealias CustomCaptureSubscriptionCallstack = () -> [String] + + fileprivate static let _lock = RecursiveLock() + fileprivate static var _defaultErrorHandler: DefaultErrorHandler = { subscriptionCallStack, error in + #if DEBUG + let serializedCallStack = subscriptionCallStack.joined(separator: "\n") + print("Unhandled error happened: \(error)\n subscription called from:\n\(serializedCallStack)") + #endif + } + fileprivate static var _customCaptureSubscriptionCallstack: CustomCaptureSubscriptionCallstack = { + #if DEBUG + return Thread.callStackSymbols + #else + return [] + #endif + } + + /// Error handler called in case onError handler wasn't provided. + public static var defaultErrorHandler: DefaultErrorHandler { + get { + _lock.lock(); defer { _lock.unlock() } + return _defaultErrorHandler + } + set { + _lock.lock(); defer { _lock.unlock() } + _defaultErrorHandler = newValue + } + } + + /// Subscription callstack block to fetch custom callstack information. + public static var customCaptureSubscriptionCallstack: CustomCaptureSubscriptionCallstack { + get { + _lock.lock(); defer { _lock.unlock() } + return _customCaptureSubscriptionCallstack + } + set { + _lock.lock(); defer { _lock.unlock() } + _customCaptureSubscriptionCallstack = newValue + } + } +} + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift new file mode 100644 index 000000000000..e41a36a1ae63 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObservableType.swift @@ -0,0 +1,47 @@ +// +// ObservableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Represents a push style sequence. +public protocol ObservableType : ObservableConvertibleType { + /** + Subscribes `observer` to receive events for this sequence. + + ### Grammar + + **Next\* (Error | Completed)?** + + * sequences can produce zero or more elements so zero or more `Next` events can be sent to `observer` + * once an `Error` or `Completed` event is sent, the sequence terminates and can't produce any other elements + + It is possible that events are sent from different threads, but no two events can be sent concurrently to + `observer`. + + ### Resource Management + + When sequence sends `Complete` or `Error` event all internal resources that compute sequence elements + will be freed. + + To cancel production of sequence elements and free resources immediately, call `dispose` on returned + subscription. + + - returns: Subscription for `observer` that can be used to cancel production of sequence elements and free resources. + */ + func subscribe(_ observer: O) -> Disposable where O.E == E +} + +extension ObservableType { + + /// Default implementation of converting `ObservableType` to `Observable`. + public func asObservable() -> Observable { + // temporary workaround + //return Observable.create(subscribe: self.subscribe) + return Observable.create { o in + return self.subscribe(o) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift new file mode 100644 index 000000000000..a69147c84911 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AddRef.swift @@ -0,0 +1,44 @@ +// +// AddRef.swift +// RxSwift +// +// Created by Junior B. on 30/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +final class AddRefSink : Sink, ObserverType { + typealias Element = O.E + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next: + self.forwardOn(event) + case .completed, .error: + self.forwardOn(event) + self.dispose() + } + } +} + +final class AddRef : Producer { + + private let _source: Observable + private let _refCount: RefCountDisposable + + init(source: Observable, refCount: RefCountDisposable) { + self._source = source + self._refCount = refCount + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let releaseDisposable = self._refCount.retain() + let sink = AddRefSink(observer: observer, cancel: cancel) + let subscription = Disposables.create(releaseDisposable, self._source.subscribe(sink)) + + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift new file mode 100644 index 000000000000..b4b9b7ee9020 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Amb.swift @@ -0,0 +1,157 @@ +// +// Amb.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Propagates the observable sequence that reacts first. + + - seealso: [amb operator on reactivex.io](http://reactivex.io/documentation/operators/amb.html) + + - returns: An observable sequence that surfaces any of the given sequences, whichever reacted first. + */ + public static func amb(_ sequence: S) -> Observable + where S.Iterator.Element == Observable { + return sequence.reduce(Observable.never()) { a, o in + return a.amb(o.asObservable()) + } + } +} + +extension ObservableType { + + /** + Propagates the observable sequence that reacts first. + + - seealso: [amb operator on reactivex.io](http://reactivex.io/documentation/operators/amb.html) + + - parameter right: Second observable sequence. + - returns: An observable sequence that surfaces either of the given sequences, whichever reacted first. + */ + public func amb + (_ right: O2) + -> Observable where O2.E == E { + return Amb(left: self.asObservable(), right: right.asObservable()) + } +} + +fileprivate enum AmbState { + case neither + case left + case right +} + +final private class AmbObserver: ObserverType { + typealias Element = O.E + typealias Parent = AmbSink + typealias This = AmbObserver + typealias Sink = (This, Event) -> Void + + fileprivate let _parent: Parent + fileprivate var _sink: Sink + fileprivate var _cancel: Disposable + + init(parent: Parent, cancel: Disposable, sink: @escaping Sink) { +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + + self._parent = parent + self._sink = sink + self._cancel = cancel + } + + func on(_ event: Event) { + self._sink(self, event) + if event.isStopEvent { + self._cancel.dispose() + } + } + + deinit { +#if TRACE_RESOURCES + _ = Resources.decrementTotal() +#endif + } +} + +final private class AmbSink: Sink { + typealias ElementType = O.E + typealias Parent = Amb + typealias AmbObserverType = AmbObserver + + private let _parent: Parent + + private let _lock = RecursiveLock() + // state + private var _choice = AmbState.neither + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let disposeAll = Disposables.create(subscription1, subscription2) + + let forwardEvent = { (o: AmbObserverType, event: Event) -> Void in + self.forwardOn(event) + if event.isStopEvent { + self.dispose() + } + } + + let decide = { (o: AmbObserverType, event: Event, me: AmbState, otherSubscription: Disposable) in + self._lock.performLocked { + if self._choice == .neither { + self._choice = me + o._sink = forwardEvent + o._cancel = disposeAll + otherSubscription.dispose() + } + + if self._choice == me { + self.forwardOn(event) + if event.isStopEvent { + self.dispose() + } + } + } + } + + let sink1 = AmbObserver(parent: self, cancel: subscription1) { o, e in + decide(o, e, .left, subscription2) + } + + let sink2 = AmbObserver(parent: self, cancel: subscription1) { o, e in + decide(o, e, .right, subscription1) + } + + subscription1.setDisposable(self._parent._left.subscribe(sink1)) + subscription2.setDisposable(self._parent._right.subscribe(sink2)) + + return disposeAll + } +} + +final private class Amb: Producer { + fileprivate let _left: Observable + fileprivate let _right: Observable + + init(left: Observable, right: Observable) { + self._left = left + self._right = right + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = AmbSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift new file mode 100644 index 000000000000..d9010dd43311 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsMaybe.swift @@ -0,0 +1,49 @@ +// +// AsMaybe.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +fileprivate final class AsMaybeSink : Sink, ObserverType { + typealias ElementType = O.E + typealias E = ElementType + + private var _element: Event? + + func on(_ event: Event) { + switch event { + case .next: + if self._element != nil { + self.forwardOn(.error(RxError.moreThanOneElement)) + self.dispose() + } + + self._element = event + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + if let element = self._element { + self.forwardOn(element) + } + self.forwardOn(.completed) + self.dispose() + } + } +} + +final class AsMaybe: Producer { + fileprivate let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = AsMaybeSink(observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift new file mode 100644 index 000000000000..8682f1fb0ae9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/AsSingle.swift @@ -0,0 +1,52 @@ +// +// AsSingle.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +fileprivate final class AsSingleSink : Sink, ObserverType { + typealias ElementType = O.E + typealias E = ElementType + + private var _element: Event? + + func on(_ event: Event) { + switch event { + case .next: + if self._element != nil { + self.forwardOn(.error(RxError.moreThanOneElement)) + self.dispose() + } + + self._element = event + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + if let element = self._element { + self.forwardOn(element) + self.forwardOn(.completed) + } + else { + self.forwardOn(.error(RxError.noElements)) + } + self.dispose() + } + } +} + +final class AsSingle: Producer { + fileprivate let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = AsSingleSink(observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift new file mode 100644 index 000000000000..db4cf2107583 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Buffer.swift @@ -0,0 +1,139 @@ +// +// Buffer.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Projects each element of an observable sequence into a buffer that's sent out when either it's full or a given amount of time has elapsed, using the specified scheduler to run timers. + + A useful real-world analogy of this overload is the behavior of a ferry leaving the dock when all seats are taken, or at the scheduled time of departure, whichever event occurs first. + + - seealso: [buffer operator on reactivex.io](http://reactivex.io/documentation/operators/buffer.html) + + - parameter timeSpan: Maximum time length of a buffer. + - parameter count: Maximum element count of a buffer. + - parameter scheduler: Scheduler to run buffering timers on. + - returns: An observable sequence of buffers. + */ + public func buffer(timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) + -> Observable<[E]> { + return BufferTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) + } +} + +final private class BufferTimeCount: Producer<[Element]> { + + fileprivate let _timeSpan: RxTimeInterval + fileprivate let _count: Int + fileprivate let _scheduler: SchedulerType + fileprivate let _source: Observable + + init(source: Observable, timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) { + self._source = source + self._timeSpan = timeSpan + self._count = count + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [Element] { + let sink = BufferTimeCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +final private class BufferTimeCountSink + : Sink + , LockOwnerType + , ObserverType + , SynchronizedOnType where O.E == [Element] { + typealias Parent = BufferTimeCount + typealias E = Element + + private let _parent: Parent + + let _lock = RecursiveLock() + + // state + private let _timerD = SerialDisposable() + private var _buffer = [Element]() + private var _windowID = 0 + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + self.createTimer(self._windowID) + return Disposables.create(_timerD, _parent._source.subscribe(self)) + } + + func startNewWindowAndSendCurrentOne() { + self._windowID = self._windowID &+ 1 + let windowID = self._windowID + + let buffer = self._buffer + self._buffer = [] + self.forwardOn(.next(buffer)) + + self.createTimer(windowID) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + self._buffer.append(element) + + if self._buffer.count == self._parent._count { + self.startNewWindowAndSendCurrentOne() + } + + case .error(let error): + self._buffer = [] + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self.forwardOn(.next(self._buffer)) + self.forwardOn(.completed) + self.dispose() + } + } + + func createTimer(_ windowID: Int) { + if self._timerD.isDisposed { + return + } + + if self._windowID != windowID { + return + } + + let nextTimer = SingleAssignmentDisposable() + + self._timerD.disposable = nextTimer + + let disposable = self._parent._scheduler.scheduleRelative(windowID, dueTime: self._parent._timeSpan) { previousWindowID in + self._lock.performLocked { + if previousWindowID != self._windowID { + return + } + + self.startNewWindowAndSendCurrentOne() + } + + return Disposables.create() + } + + nextTimer.setDisposable(disposable) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift new file mode 100644 index 000000000000..130607675728 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Catch.swift @@ -0,0 +1,235 @@ +// +// Catch.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Continues an observable sequence that is terminated by an error with the observable sequence produced by the handler. + + - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) + + - parameter handler: Error handler function, producing another observable sequence. + - returns: An observable sequence containing the source sequence's elements, followed by the elements produced by the handler's resulting observable sequence in case an error occurred. + */ + public func catchError(_ handler: @escaping (Swift.Error) throws -> Observable) + -> Observable { + return Catch(source: self.asObservable(), handler: handler) + } + + /** + Continues an observable sequence that is terminated by an error with a single element. + + - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) + + - parameter element: Last element in an observable sequence in case error occurs. + - returns: An observable sequence containing the source sequence's elements, followed by the `element` in case an error occurred. + */ + public func catchErrorJustReturn(_ element: E) + -> Observable { + return Catch(source: self.asObservable(), handler: { _ in Observable.just(element) }) + } + +} + +extension ObservableType { + /** + Continues an observable sequence that is terminated by an error with the next observable sequence. + + - seealso: [catch operator on reactivex.io](http://reactivex.io/documentation/operators/catch.html) + + - returns: An observable sequence containing elements from consecutive source sequences until a source sequence terminates successfully. + */ + public static func catchError(_ sequence: S) -> Observable + where S.Iterator.Element == Observable { + return CatchSequence(sources: sequence) + } +} + +extension ObservableType { + + /** + Repeats the source observable sequence until it successfully terminates. + + **This could potentially create an infinite sequence.** + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - returns: Observable sequence to repeat until it successfully terminates. + */ + public func retry() -> Observable { + return CatchSequence(sources: InfiniteSequence(repeatedValue: self.asObservable())) + } + + /** + Repeats the source observable sequence the specified number of times in case of an error or until it successfully terminates. + + If you encounter an error and want it to retry once, then you must use `retry(2)` + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - parameter maxAttemptCount: Maximum number of times to repeat the sequence. + - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully. + */ + public func retry(_ maxAttemptCount: Int) + -> Observable { + return CatchSequence(sources: Swift.repeatElement(self.asObservable(), count: maxAttemptCount)) + } +} + +// catch with callback + +final private class CatchSinkProxy: ObserverType { + typealias E = O.E + typealias Parent = CatchSink + + private let _parent: Parent + + init(parent: Parent) { + self._parent = parent + } + + func on(_ event: Event) { + self._parent.forwardOn(event) + + switch event { + case .next: + break + case .error, .completed: + self._parent.dispose() + } + } +} + +final private class CatchSink: Sink, ObserverType { + typealias E = O.E + typealias Parent = Catch + + private let _parent: Parent + private let _subscription = SerialDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let d1 = SingleAssignmentDisposable() + self._subscription.disposable = d1 + d1.setDisposable(self._parent._source.subscribe(self)) + + return self._subscription + } + + func on(_ event: Event) { + switch event { + case .next: + self.forwardOn(event) + case .completed: + self.forwardOn(event) + self.dispose() + case .error(let error): + do { + let catchSequence = try self._parent._handler(error) + + let observer = CatchSinkProxy(parent: self) + + self._subscription.disposable = catchSequence.subscribe(observer) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + } + } +} + +final private class Catch: Producer { + typealias Handler = (Swift.Error) throws -> Observable + + fileprivate let _source: Observable + fileprivate let _handler: Handler + + init(source: Observable, handler: @escaping Handler) { + self._source = source + self._handler = handler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = CatchSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +// catch enumerable + +final private class CatchSequenceSink + : TailRecursiveSink + , ObserverType where S.Iterator.Element: ObservableConvertibleType, S.Iterator.Element.E == O.E { + typealias Element = O.E + typealias Parent = CatchSequence + + private var _lastError: Swift.Error? + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next: + self.forwardOn(event) + case .error(let error): + self._lastError = error + self.schedule(.moveNext) + case .completed: + self.forwardOn(event) + self.dispose() + } + } + + override func subscribeToNext(_ source: Observable) -> Disposable { + return source.subscribe(self) + } + + override func done() { + if let lastError = self._lastError { + self.forwardOn(.error(lastError)) + } + else { + self.forwardOn(.completed) + } + + self.dispose() + } + + override func extract(_ observable: Observable) -> SequenceGenerator? { + if let onError = observable as? CatchSequence { + return (onError.sources.makeIterator(), nil) + } + else { + return nil + } + } +} + +final private class CatchSequence: Producer where S.Iterator.Element: ObservableConvertibleType { + typealias Element = S.Iterator.Element.E + + let sources: S + + init(sources: S) { + self.sources = sources + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = CatchSequenceSink(observer: observer, cancel: cancel) + let subscription = sink.run((self.sources.makeIterator(), nil)) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift new file mode 100644 index 000000000000..b62fa2929af2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+Collection.swift @@ -0,0 +1,157 @@ +// +// CombineLatest+Collection.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/29/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combinelatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest(_ collection: C, _ resultSelector: @escaping ([C.Iterator.Element.E]) throws -> E) -> Observable + where C.Iterator.Element: ObservableType { + return CombineLatestCollectionType(sources: collection, resultSelector: resultSelector) + } + + /** + Merges the specified observable sequences into one observable sequence whenever any of the observable sequences produces an element. + + - seealso: [combinelatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest(_ collection: C) -> Observable<[E]> + where C.Iterator.Element: ObservableType, C.Iterator.Element.E == E { + return CombineLatestCollectionType(sources: collection, resultSelector: { $0 }) + } +} + +final private class CombineLatestCollectionTypeSink + : Sink where C.Iterator.Element: ObservableConvertibleType { + typealias R = O.E + typealias Parent = CombineLatestCollectionType + typealias SourceElement = C.Iterator.Element.E + + let _parent: Parent + + let _lock = RecursiveLock() + + // state + var _numberOfValues = 0 + var _values: [SourceElement?] + var _isDone: [Bool] + var _numberOfDone = 0 + var _subscriptions: [SingleAssignmentDisposable] + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._values = [SourceElement?](repeating: nil, count: parent._count) + self._isDone = [Bool](repeating: false, count: parent._count) + self._subscriptions = [SingleAssignmentDisposable]() + self._subscriptions.reserveCapacity(parent._count) + + for _ in 0 ..< parent._count { + self._subscriptions.append(SingleAssignmentDisposable()) + } + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event, atIndex: Int) { + self._lock.lock(); defer { self._lock.unlock() } // { + switch event { + case .next(let element): + if self._values[atIndex] == nil { + self._numberOfValues += 1 + } + + self._values[atIndex] = element + + if self._numberOfValues < self._parent._count { + let numberOfOthersThatAreDone = self._numberOfDone - (self._isDone[atIndex] ? 1 : 0) + if numberOfOthersThatAreDone == self._parent._count - 1 { + self.forwardOn(.completed) + self.dispose() + } + return + } + + do { + let result = try self._parent._resultSelector(self._values.map { $0! }) + self.forwardOn(.next(result)) + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + if self._isDone[atIndex] { + return + } + + self._isDone[atIndex] = true + self._numberOfDone += 1 + + if self._numberOfDone == self._parent._count { + self.forwardOn(.completed) + self.dispose() + } + else { + self._subscriptions[atIndex].dispose() + } + } + // } + } + + func run() -> Disposable { + var j = 0 + for i in self._parent._sources { + let index = j + let source = i.asObservable() + let disposable = source.subscribe(AnyObserver { event in + self.on(event, atIndex: index) + }) + + self._subscriptions[j].setDisposable(disposable) + + j += 1 + } + + if self._parent._sources.isEmpty { + self.forwardOn(.completed) + } + + return Disposables.create(_subscriptions) + } +} + +final private class CombineLatestCollectionType: Producer where C.Iterator.Element: ObservableConvertibleType { + typealias ResultSelector = ([C.Iterator.Element.E]) throws -> R + + let _sources: C + let _resultSelector: ResultSelector + let _count: Int + + init(sources: C, resultSelector: @escaping ResultSelector) { + self._sources = sources + self._resultSelector = resultSelector + self._count = Int(Int64(self._sources.count)) + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestCollectionTypeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift new file mode 100644 index 000000000000..7474bdc449f5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest+arity.swift @@ -0,0 +1,843 @@ +// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project +// +// CombineLatest+arity.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + + + +// 2 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) + -> Observable { + return CombineLatest2( + source1: source1.asObservable(), source2: source2.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2) + -> Observable<(O1.E, O2.E)> { + return CombineLatest2( + source1: source1.asObservable(), source2: source2.asObservable(), + resultSelector: { ($0, $1) } + ) + } +} + +final class CombineLatestSink2_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest2 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 2, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + + return Disposables.create([ + subscription1, + subscription2 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2) + } +} + +final class CombineLatest2 : Producer { + typealias ResultSelector = (E1, E2) throws -> R + + let _source1: Observable + let _source2: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink2_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 3 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) + -> Observable { + return CombineLatest3( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3) + -> Observable<(O1.E, O2.E, O3.E)> { + return CombineLatest3( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), + resultSelector: { ($0, $1, $2) } + ) + } +} + +final class CombineLatestSink3_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest3 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 3, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + subscription3.setDisposable(self._parent._source3.subscribe(observer3)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3) + } +} + +final class CombineLatest3 : Producer { + typealias ResultSelector = (E1, E2, E3) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + self._source3 = source3 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink3_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 4 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) + -> Observable { + return CombineLatest4( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) + -> Observable<(O1.E, O2.E, O3.E, O4.E)> { + return CombineLatest4( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), + resultSelector: { ($0, $1, $2, $3) } + ) + } +} + +final class CombineLatestSink4_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest4 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 4, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + subscription3.setDisposable(self._parent._source3.subscribe(observer3)) + subscription4.setDisposable(self._parent._source4.subscribe(observer4)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4) + } +} + +final class CombineLatest4 : Producer { + typealias ResultSelector = (E1, E2, E3, E4) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + self._source3 = source3 + self._source4 = source4 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink4_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 5 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) + -> Observable { + return CombineLatest5( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E)> { + return CombineLatest5( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4) } + ) + } +} + +final class CombineLatestSink5_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest5 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 5, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + subscription3.setDisposable(self._parent._source3.subscribe(observer3)) + subscription4.setDisposable(self._parent._source4.subscribe(observer4)) + subscription5.setDisposable(self._parent._source5.subscribe(observer5)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5) + } +} + +final class CombineLatest5 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + self._source3 = source3 + self._source4 = source4 + self._source5 = source5 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink5_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 6 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) + -> Observable { + return CombineLatest6( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E)> { + return CombineLatest6( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4, $5) } + ) + } +} + +final class CombineLatestSink6_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest6 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + var _latestElement6: E6! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 6, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + let observer6 = CombineLatestObserver(lock: self._lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + subscription3.setDisposable(self._parent._source3.subscribe(observer3)) + subscription4.setDisposable(self._parent._source4.subscribe(observer4)) + subscription5.setDisposable(self._parent._source5.subscribe(observer5)) + subscription6.setDisposable(self._parent._source6.subscribe(observer6)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5, self._latestElement6) + } +} + +final class CombineLatest6 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + let _source6: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + self._source3 = source3 + self._source4 = source4 + self._source5 = source5 + self._source6 = source6 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink6_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 7 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) + -> Observable { + return CombineLatest7( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E)> { + return CombineLatest7( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4, $5, $6) } + ) + } +} + +final class CombineLatestSink7_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest7 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + var _latestElement6: E6! = nil + var _latestElement7: E7! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 7, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + let observer6 = CombineLatestObserver(lock: self._lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) + let observer7 = CombineLatestObserver(lock: self._lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + subscription3.setDisposable(self._parent._source3.subscribe(observer3)) + subscription4.setDisposable(self._parent._source4.subscribe(observer4)) + subscription5.setDisposable(self._parent._source5.subscribe(observer5)) + subscription6.setDisposable(self._parent._source6.subscribe(observer6)) + subscription7.setDisposable(self._parent._source7.subscribe(observer7)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5, self._latestElement6, self._latestElement7) + } +} + +final class CombineLatest7 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + let _source6: Observable + let _source7: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + self._source3 = source3 + self._source4 = source4 + self._source5 = source5 + self._source6 = source6 + self._source7 = source7 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink7_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 8 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter resultSelector: Function to invoke whenever any of the sources produces an element. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) + -> Observable { + return CombineLatest8( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever any of the observable sequences produces an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func combineLatest + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E)> { + return CombineLatest8( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4, $5, $6, $7) } + ) + } +} + +final class CombineLatestSink8_ : CombineLatestSink { + typealias R = O.E + typealias Parent = CombineLatest8 + + let _parent: Parent + + var _latestElement1: E1! = nil + var _latestElement2: E2! = nil + var _latestElement3: E3! = nil + var _latestElement4: E4! = nil + var _latestElement5: E5! = nil + var _latestElement6: E6! = nil + var _latestElement7: E7! = nil + var _latestElement8: E8! = nil + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 8, observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + let subscription8 = SingleAssignmentDisposable() + + let observer1 = CombineLatestObserver(lock: self._lock, parent: self, index: 0, setLatestValue: { (e: E1) -> Void in self._latestElement1 = e }, this: subscription1) + let observer2 = CombineLatestObserver(lock: self._lock, parent: self, index: 1, setLatestValue: { (e: E2) -> Void in self._latestElement2 = e }, this: subscription2) + let observer3 = CombineLatestObserver(lock: self._lock, parent: self, index: 2, setLatestValue: { (e: E3) -> Void in self._latestElement3 = e }, this: subscription3) + let observer4 = CombineLatestObserver(lock: self._lock, parent: self, index: 3, setLatestValue: { (e: E4) -> Void in self._latestElement4 = e }, this: subscription4) + let observer5 = CombineLatestObserver(lock: self._lock, parent: self, index: 4, setLatestValue: { (e: E5) -> Void in self._latestElement5 = e }, this: subscription5) + let observer6 = CombineLatestObserver(lock: self._lock, parent: self, index: 5, setLatestValue: { (e: E6) -> Void in self._latestElement6 = e }, this: subscription6) + let observer7 = CombineLatestObserver(lock: self._lock, parent: self, index: 6, setLatestValue: { (e: E7) -> Void in self._latestElement7 = e }, this: subscription7) + let observer8 = CombineLatestObserver(lock: self._lock, parent: self, index: 7, setLatestValue: { (e: E8) -> Void in self._latestElement8 = e }, this: subscription8) + + subscription1.setDisposable(self._parent._source1.subscribe(observer1)) + subscription2.setDisposable(self._parent._source2.subscribe(observer2)) + subscription3.setDisposable(self._parent._source3.subscribe(observer3)) + subscription4.setDisposable(self._parent._source4.subscribe(observer4)) + subscription5.setDisposable(self._parent._source5.subscribe(observer5)) + subscription6.setDisposable(self._parent._source6.subscribe(observer6)) + subscription7.setDisposable(self._parent._source7.subscribe(observer7)) + subscription8.setDisposable(self._parent._source8.subscribe(observer8)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7, + subscription8 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._latestElement1, self._latestElement2, self._latestElement3, self._latestElement4, self._latestElement5, self._latestElement6, self._latestElement7, self._latestElement8) + } +} + +final class CombineLatest8 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> R + + let _source1: Observable + let _source2: Observable + let _source3: Observable + let _source4: Observable + let _source5: Observable + let _source6: Observable + let _source7: Observable + let _source8: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, source8: Observable, resultSelector: @escaping ResultSelector) { + self._source1 = source1 + self._source2 = source2 + self._source3 = source3 + self._source4 = source4 + self._source5 = source5 + self._source6 = source6 + self._source7 = source7 + self._source8 = source8 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = CombineLatestSink8_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift new file mode 100644 index 000000000000..dbecf98ab363 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/CombineLatest.swift @@ -0,0 +1,132 @@ +// +// CombineLatest.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol CombineLatestProtocol : class { + func next(_ index: Int) + func fail(_ error: Swift.Error) + func done(_ index: Int) +} + +class CombineLatestSink + : Sink + , CombineLatestProtocol { + typealias Element = O.E + + let _lock = RecursiveLock() + + private let _arity: Int + private var _numberOfValues = 0 + private var _numberOfDone = 0 + private var _hasValue: [Bool] + private var _isDone: [Bool] + + init(arity: Int, observer: O, cancel: Cancelable) { + self._arity = arity + self._hasValue = [Bool](repeating: false, count: arity) + self._isDone = [Bool](repeating: false, count: arity) + + super.init(observer: observer, cancel: cancel) + } + + func getResult() throws -> Element { + rxAbstractMethod() + } + + func next(_ index: Int) { + if !self._hasValue[index] { + self._hasValue[index] = true + self._numberOfValues += 1 + } + + if self._numberOfValues == self._arity { + do { + let result = try self.getResult() + self.forwardOn(.next(result)) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + } + else { + var allOthersDone = true + + for i in 0 ..< self._arity { + if i != index && !self._isDone[i] { + allOthersDone = false + break + } + } + + if allOthersDone { + self.forwardOn(.completed) + self.dispose() + } + } + } + + func fail(_ error: Swift.Error) { + self.forwardOn(.error(error)) + self.dispose() + } + + func done(_ index: Int) { + if self._isDone[index] { + return + } + + self._isDone[index] = true + self._numberOfDone += 1 + + if self._numberOfDone == self._arity { + self.forwardOn(.completed) + self.dispose() + } + } +} + +final class CombineLatestObserver + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = ElementType + typealias ValueSetter = (Element) -> Void + + private let _parent: CombineLatestProtocol + + let _lock: RecursiveLock + private let _index: Int + private let _this: Disposable + private let _setLatestValue: ValueSetter + + init(lock: RecursiveLock, parent: CombineLatestProtocol, index: Int, setLatestValue: @escaping ValueSetter, this: Disposable) { + self._lock = lock + self._parent = parent + self._index = index + self._this = this + self._setLatestValue = setLatestValue + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let value): + self._setLatestValue(value) + self._parent.next(self._index) + case .error(let error): + self._this.dispose() + self._parent.fail(error) + case .completed: + self._this.dispose() + self._parent.done(self._index) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift new file mode 100644 index 000000000000..27daf8d4dc8d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Concat.swift @@ -0,0 +1,131 @@ +// +// Concat.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Concatenates the second observable sequence to `self` upon successful termination of `self`. + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - parameter second: Second observable sequence. + - returns: An observable sequence that contains the elements of `self`, followed by those of the second sequence. + */ + public func concat(_ second: O) -> Observable where O.E == E { + return Observable.concat([self.asObservable(), second.asObservable()]) + } +} + +extension ObservableType { + /** + Concatenates all observable sequences in the given sequence, as long as the previous observable sequence terminated successfully. + + This operator has tail recursive optimizations that will prevent stack overflow. + + Optimizations will be performed in cases equivalent to following: + + [1, [2, [3, .....].concat()].concat].concat() + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ sequence: S) -> Observable + where S.Iterator.Element == Observable { + return Concat(sources: sequence, count: nil) + } + + /** + Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully. + + This operator has tail recursive optimizations that will prevent stack overflow. + + Optimizations will be performed in cases equivalent to following: + + [1, [2, [3, .....].concat()].concat].concat() + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ collection: S) -> Observable + where S.Iterator.Element == Observable { + return Concat(sources: collection, count: Int64(collection.count)) + } + + /** + Concatenates all observable sequences in the given collection, as long as the previous observable sequence terminated successfully. + + This operator has tail recursive optimizations that will prevent stack overflow. + + Optimizations will be performed in cases equivalent to following: + + [1, [2, [3, .....].concat()].concat].concat() + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each given sequence, in sequential order. + */ + public static func concat(_ sources: Observable ...) -> Observable { + return Concat(sources: sources, count: Int64(sources.count)) + } +} + +final private class ConcatSink + : TailRecursiveSink + , ObserverType where S.Iterator.Element: ObservableConvertibleType, S.Iterator.Element.E == O.E { + typealias Element = O.E + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event){ + switch event { + case .next: + self.forwardOn(event) + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self.schedule(.moveNext) + } + } + + override func subscribeToNext(_ source: Observable) -> Disposable { + return source.subscribe(self) + } + + override func extract(_ observable: Observable) -> SequenceGenerator? { + if let source = observable as? Concat { + return (source._sources.makeIterator(), source._count) + } + else { + return nil + } + } +} + +final private class Concat: Producer where S.Iterator.Element: ObservableConvertibleType { + typealias Element = S.Iterator.Element.E + + fileprivate let _sources: S + fileprivate let _count: IntMax? + + init(sources: S, count: IntMax?) { + self._sources = sources + self._count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = ConcatSink(observer: observer, cancel: cancel) + let subscription = sink.run((self._sources.makeIterator(), self._count)) + return (sink: sink, subscription: subscription) + } +} + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift new file mode 100644 index 000000000000..b57a63ab1081 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Create.swift @@ -0,0 +1,78 @@ +// +// Create.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + // MARK: create + + /** + Creates an observable sequence from a specified subscribe method implementation. + + - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) + + - parameter subscribe: Implementation of the resulting observable sequence's `subscribe` method. + - returns: The observable sequence with the specified implementation for the `subscribe` method. + */ + public static func create(_ subscribe: @escaping (AnyObserver) -> Disposable) -> Observable { + return AnonymousObservable(subscribe) + } +} + +final private class AnonymousObservableSink: Sink, ObserverType { + typealias E = O.E + typealias Parent = AnonymousObservable + + // state + private let _isStopped = AtomicInt(0) + + #if DEBUG + fileprivate let _synchronizationTracker = SynchronizationTracker() + #endif + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + #if DEBUG + self._synchronizationTracker.register(synchronizationErrorMessage: .default) + defer { self._synchronizationTracker.unregister() } + #endif + switch event { + case .next: + if load(self._isStopped) == 1 { + return + } + self.forwardOn(event) + case .error, .completed: + if fetchOr(self._isStopped, 1) == 0 { + self.forwardOn(event) + self.dispose() + } + } + } + + func run(_ parent: Parent) -> Disposable { + return parent._subscribeHandler(AnyObserver(self)) + } +} + +final private class AnonymousObservable: Producer { + typealias SubscribeHandler = (AnyObserver) -> Disposable + + let _subscribeHandler: SubscribeHandler + + init(_ subscribeHandler: @escaping SubscribeHandler) { + self._subscribeHandler = subscribeHandler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = AnonymousObservableSink(observer: observer, cancel: cancel) + let subscription = sink.run(self) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift new file mode 100644 index 000000000000..0b23cc94b7ab --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debounce.swift @@ -0,0 +1,118 @@ +// +// Debounce.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/11/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Ignores elements from an observable sequence which are followed by another element within a specified relative time duration, using the specified scheduler to run throttling timers. + + - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) + + - parameter dueTime: Throttling duration for each element. + - parameter scheduler: Scheduler to run the throttle timers on. + - returns: The throttled sequence. + */ + public func debounce(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Debounce(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) + } +} + +final private class DebounceSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = O.E + typealias ParentType = Debounce + + private let _parent: ParentType + + let _lock = RecursiveLock() + + // state + private var _id = 0 as UInt64 + private var _value: Element? + + let cancellable = SerialDisposable() + + init(parent: ParentType, observer: O, cancel: Cancelable) { + self._parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription = self._parent._source.subscribe(self) + + return Disposables.create(subscription, cancellable) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + self._id = self._id &+ 1 + let currentId = self._id + self._value = element + + + let scheduler = self._parent._scheduler + let dueTime = self._parent._dueTime + + let d = SingleAssignmentDisposable() + self.cancellable.disposable = d + d.setDisposable(scheduler.scheduleRelative(currentId, dueTime: dueTime, action: self.propagate)) + case .error: + self._value = nil + self.forwardOn(event) + self.dispose() + case .completed: + if let value = self._value { + self._value = nil + self.forwardOn(.next(value)) + } + self.forwardOn(.completed) + self.dispose() + } + } + + func propagate(_ currentId: UInt64) -> Disposable { + self._lock.lock(); defer { self._lock.unlock() } // { + let originalValue = self._value + + if let value = originalValue, self._id == currentId { + self._value = nil + self.forwardOn(.next(value)) + } + // } + return Disposables.create() + } +} + +final private class Debounce: Producer { + fileprivate let _source: Observable + fileprivate let _dueTime: RxTimeInterval + fileprivate let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { + self._source = source + self._dueTime = dueTime + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DebounceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift new file mode 100644 index 000000000000..1a07eb6e454e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Debug.swift @@ -0,0 +1,103 @@ +// +// Debug.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date +import class Foundation.DateFormatter + +extension ObservableType { + + /** + Prints received events for all observers on standard output. + + - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) + + - parameter identifier: Identifier that is printed together with event description to standard output. + - parameter trimOutput: Should output be trimmed to max 40 characters. + - returns: An observable sequence whose events are printed to standard output. + */ + public func debug(_ identifier: String? = nil, trimOutput: Bool = false, file: String = #file, line: UInt = #line, function: String = #function) + -> Observable { + return Debug(source: self, identifier: identifier, trimOutput: trimOutput, file: file, line: line, function: function) + } +} + +fileprivate let dateFormat = "yyyy-MM-dd HH:mm:ss.SSS" + +fileprivate func logEvent(_ identifier: String, dateFormat: DateFormatter, content: String) { + print("\(dateFormat.string(from: Date())): \(identifier) -> \(content)") +} + +final private class DebugSink: Sink, ObserverType where O.E == Source.E { + typealias Element = O.E + typealias Parent = Debug + + private let _parent: Parent + private let _timestampFormatter = DateFormatter() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._timestampFormatter.dateFormat = dateFormat + + logEvent(self._parent._identifier, dateFormat: self._timestampFormatter, content: "subscribed") + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + let maxEventTextLength = 40 + let eventText = "\(event)" + + let eventNormalized = (eventText.count > maxEventTextLength) && self._parent._trimOutput + ? String(eventText.prefix(maxEventTextLength / 2)) + "..." + String(eventText.suffix(maxEventTextLength / 2)) + : eventText + + logEvent(self._parent._identifier, dateFormat: self._timestampFormatter, content: "Event \(eventNormalized)") + + self.forwardOn(event) + if event.isStopEvent { + self.dispose() + } + } + + override func dispose() { + if !self.disposed { + logEvent(self._parent._identifier, dateFormat: self._timestampFormatter, content: "isDisposed") + } + super.dispose() + } +} + +final private class Debug: Producer { + fileprivate let _identifier: String + fileprivate let _trimOutput: Bool + fileprivate let _source: Source + + init(source: Source, identifier: String?, trimOutput: Bool, file: String, line: UInt, function: String) { + self._trimOutput = trimOutput + if let identifier = identifier { + self._identifier = identifier + } + else { + let trimmedFile: String + if let lastIndex = file.lastIndexOf("/") { + trimmedFile = String(file[file.index(after: lastIndex) ..< file.endIndex]) + } + else { + trimmedFile = file + } + self._identifier = "\(trimmedFile):\(line) (\(function))" + } + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Source.E { + let sink = DebugSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift new file mode 100644 index 000000000000..cf0bfed9dc61 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DefaultIfEmpty.swift @@ -0,0 +1,66 @@ +// +// DefaultIfEmpty.swift +// RxSwift +// +// Created by sergdort on 23/12/2016. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Emits elements from the source observable sequence, or a default element if the source observable sequence is empty. + + - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) + + - parameter default: Default element to be sent if the source does not emit any elements + - returns: An observable sequence which emits default element end completes in case the original sequence is empty + */ + public func ifEmpty(default: E) -> Observable { + return DefaultIfEmpty(source: self.asObservable(), default: `default`) + } +} + +final private class DefaultIfEmptySink: Sink, ObserverType { + typealias E = O.E + private let _default: E + private var _isEmpty = true + + init(default: E, observer: O, cancel: Cancelable) { + self._default = `default` + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next: + self._isEmpty = false + self.forwardOn(event) + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + if self._isEmpty { + self.forwardOn(.next(self._default)) + } + self.forwardOn(.completed) + self.dispose() + } + } +} + +final private class DefaultIfEmpty: Producer { + private let _source: Observable + private let _default: SourceType + + init(source: Observable, `default`: SourceType) { + self._source = source + self._default = `default` + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { + let sink = DefaultIfEmptySink(default: self._default, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift new file mode 100644 index 000000000000..b75fbf9162b9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Deferred.swift @@ -0,0 +1,74 @@ +// +// Deferred.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Returns an observable sequence that invokes the specified factory function whenever a new observer subscribes. + + - seealso: [defer operator on reactivex.io](http://reactivex.io/documentation/operators/defer.html) + + - parameter observableFactory: Observable factory function to invoke for each observer that subscribes to the resulting sequence. + - returns: An observable sequence whose observers trigger an invocation of the given observable factory function. + */ + public static func deferred(_ observableFactory: @escaping () throws -> Observable) + -> Observable { + return Deferred(observableFactory: observableFactory) + } +} + +final private class DeferredSink: Sink, ObserverType where S.E == O.E { + typealias E = O.E + + private let _observableFactory: () throws -> S + + init(observableFactory: @escaping () throws -> S, observer: O, cancel: Cancelable) { + self._observableFactory = observableFactory + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + do { + let result = try self._observableFactory() + return result.subscribe(self) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + return Disposables.create() + } + } + + func on(_ event: Event) { + self.forwardOn(event) + + switch event { + case .next: + break + case .error: + self.dispose() + case .completed: + self.dispose() + } + } +} + +final private class Deferred: Producer { + typealias Factory = () throws -> S + + private let _observableFactory : Factory + + init(observableFactory: @escaping Factory) { + self._observableFactory = observableFactory + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = DeferredSink(observableFactory: self._observableFactory, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift new file mode 100644 index 000000000000..61969d5cfe56 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Delay.swift @@ -0,0 +1,179 @@ +// +// Delay.swift +// RxSwift +// +// Created by tarunon on 2016/02/09. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date + +extension ObservableType { + + /** + Returns an observable sequence by the source observable sequence shifted forward in time by a specified delay. Error events from the source observable sequence are not delayed. + + - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) + + - parameter dueTime: Relative time shift of the source by. + - parameter scheduler: Scheduler to run the subscription delay timer on. + - returns: the source Observable shifted in time by the specified delay. + */ + public func delay(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Delay(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) + } +} + +final private class DelaySink + : Sink + , ObserverType { + typealias E = O.E + typealias Source = Observable + typealias DisposeKey = Bag.KeyType + + private let _lock = RecursiveLock() + + private let _dueTime: RxTimeInterval + private let _scheduler: SchedulerType + + private let _sourceSubscription = SingleAssignmentDisposable() + private let _cancelable = SerialDisposable() + + // is scheduled some action + private var _active = false + // is "run loop" on different scheduler running + private var _running = false + private var _errorEvent: Event? + + // state + private var _queue = Queue<(eventTime: RxTime, event: Event)>(capacity: 0) + private var _disposed = false + + init(observer: O, dueTime: RxTimeInterval, scheduler: SchedulerType, cancel: Cancelable) { + self._dueTime = dueTime + self._scheduler = scheduler + super.init(observer: observer, cancel: cancel) + } + + // All of these complications in this method are caused by the fact that + // error should be propagated immediately. Error can be potentially received on different + // scheduler so this process needs to be synchronized somehow. + // + // Another complication is that scheduler is potentially concurrent so internal queue is used. + func drainQueue(state: (), scheduler: AnyRecursiveScheduler<()>) { + + self._lock.lock() // { + let hasFailed = self._errorEvent != nil + if !hasFailed { + self._running = true + } + self._lock.unlock() // } + + if hasFailed { + return + } + + var ranAtLeastOnce = false + + while true { + self._lock.lock() // { + let errorEvent = self._errorEvent + + let eventToForwardImmediately = ranAtLeastOnce ? nil : self._queue.dequeue()?.event + let nextEventToScheduleOriginalTime: Date? = ranAtLeastOnce && !self._queue.isEmpty ? self._queue.peek().eventTime : nil + + if errorEvent == nil { + if eventToForwardImmediately != nil { + } + else if nextEventToScheduleOriginalTime != nil { + self._running = false + } + else { + self._running = false + self._active = false + } + } + self._lock.unlock() // { + + if let errorEvent = errorEvent { + self.forwardOn(errorEvent) + self.dispose() + return + } + else { + if let eventToForwardImmediately = eventToForwardImmediately { + ranAtLeastOnce = true + self.forwardOn(eventToForwardImmediately) + if case .completed = eventToForwardImmediately { + self.dispose() + return + } + } + else if let nextEventToScheduleOriginalTime = nextEventToScheduleOriginalTime { + let elapsedTime = self._scheduler.now.timeIntervalSince(nextEventToScheduleOriginalTime) + let interval = self._dueTime - elapsedTime + let normalizedInterval = interval < 0.0 ? 0.0 : interval + scheduler.schedule((), dueTime: normalizedInterval) + return + } + else { + return + } + } + } + } + + func on(_ event: Event) { + if event.isStopEvent { + self._sourceSubscription.dispose() + } + + switch event { + case .error: + self._lock.lock() // { + let shouldSendImmediately = !self._running + self._queue = Queue(capacity: 0) + self._errorEvent = event + self._lock.unlock() // } + + if shouldSendImmediately { + self.forwardOn(event) + self.dispose() + } + default: + self._lock.lock() // { + let shouldSchedule = !self._active + self._active = true + self._queue.enqueue((self._scheduler.now, event)) + self._lock.unlock() // } + + if shouldSchedule { + self._cancelable.disposable = self._scheduler.scheduleRecursive((), dueTime: self._dueTime, action: self.drainQueue) + } + } + } + + func run(source: Observable) -> Disposable { + self._sourceSubscription.setDisposable(source.subscribe(self)) + return Disposables.create(_sourceSubscription, _cancelable) + } +} + +final private class Delay: Producer { + private let _source: Observable + private let _dueTime: RxTimeInterval + private let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { + self._source = source + self._dueTime = dueTime + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DelaySink(observer: observer, dueTime: self._dueTime, scheduler: self._scheduler, cancel: cancel) + let subscription = sink.run(source: self._source) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift new file mode 100644 index 000000000000..16218a701f31 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DelaySubscription.swift @@ -0,0 +1,58 @@ +// +// DelaySubscription.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Time shifts the observable sequence by delaying the subscription with the specified relative time duration, using the specified scheduler to run timers. + + - seealso: [delay operator on reactivex.io](http://reactivex.io/documentation/operators/delay.html) + + - parameter dueTime: Relative time shift of the subscription. + - parameter scheduler: Scheduler to run the subscription delay timer on. + - returns: Time-shifted sequence. + */ + public func delaySubscription(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return DelaySubscription(source: self.asObservable(), dueTime: dueTime, scheduler: scheduler) + } +} + +final private class DelaySubscriptionSink + : Sink, ObserverType { + typealias E = O.E + + func on(_ event: Event) { + self.forwardOn(event) + if event.isStopEvent { + self.dispose() + } + } + +} + +final private class DelaySubscription: Producer { + private let _source: Observable + private let _dueTime: RxTimeInterval + private let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, scheduler: SchedulerType) { + self._source = source + self._dueTime = dueTime + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DelaySubscriptionSink(observer: observer, cancel: cancel) + let subscription = self._scheduler.scheduleRelative((), dueTime: self._dueTime) { _ in + return self._source.subscribe(sink) + } + + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift new file mode 100644 index 000000000000..e315d17103e6 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Dematerialize.swift @@ -0,0 +1,51 @@ +// +// Dematerialize.swift +// RxSwift +// +// Created by Jamie Pinkham on 3/13/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType where E: EventConvertible { + /** + Convert any previously materialized Observable into it's original form. + - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) + - returns: The dematerialized observable sequence. + */ + public func dematerialize() -> Observable { + return Dematerialize(source: self.asObservable()) + } + +} + +fileprivate final class DematerializeSink: Sink, ObserverType where O.E == Element.ElementType { + fileprivate func on(_ event: Event) { + switch event { + case .next(let element): + self.forwardOn(element.event) + if element.event.isStopEvent { + self.dispose() + } + case .completed: + self.forwardOn(.completed) + self.dispose() + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + } + } +} + +final private class Dematerialize: Producer { + private let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element.ElementType { + let sink = DematerializeSink(observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift new file mode 100644 index 000000000000..db0b0ab92180 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/DistinctUntilChanged.swift @@ -0,0 +1,125 @@ +// +// DistinctUntilChanged.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType where E: Equatable { + + /** + Returns an observable sequence that contains only distinct contiguous elements according to equality operator. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - returns: An observable sequence only containing the distinct contiguous elements, based on equality operator, from the source sequence. + */ + public func distinctUntilChanged() + -> Observable { + return self.distinctUntilChanged({ $0 }, comparer: { ($0 == $1) }) + } +} + +extension ObservableType { + /** + Returns an observable sequence that contains only distinct contiguous elements according to the `keySelector`. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - parameter keySelector: A function to compute the comparison key for each element. + - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value, from the source sequence. + */ + public func distinctUntilChanged(_ keySelector: @escaping (E) throws -> K) + -> Observable { + return self.distinctUntilChanged(keySelector, comparer: { $0 == $1 }) + } + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the `comparer`. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - parameter comparer: Equality comparer for computed key values. + - returns: An observable sequence only containing the distinct contiguous elements, based on `comparer`, from the source sequence. + */ + public func distinctUntilChanged(_ comparer: @escaping (E, E) throws -> Bool) + -> Observable { + return self.distinctUntilChanged({ $0 }, comparer: comparer) + } + + /** + Returns an observable sequence that contains only distinct contiguous elements according to the keySelector and the comparer. + + - seealso: [distinct operator on reactivex.io](http://reactivex.io/documentation/operators/distinct.html) + + - parameter keySelector: A function to compute the comparison key for each element. + - parameter comparer: Equality comparer for computed key values. + - returns: An observable sequence only containing the distinct contiguous elements, based on a computed key value and the comparer, from the source sequence. + */ + public func distinctUntilChanged(_ keySelector: @escaping (E) throws -> K, comparer: @escaping (K, K) throws -> Bool) + -> Observable { + return DistinctUntilChanged(source: self.asObservable(), selector: keySelector, comparer: comparer) + } +} + +final private class DistinctUntilChangedSink: Sink, ObserverType { + typealias E = O.E + + private let _parent: DistinctUntilChanged + private var _currentKey: Key? + + init(parent: DistinctUntilChanged, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let key = try self._parent._selector(value) + var areEqual = false + if let currentKey = self._currentKey { + areEqual = try self._parent._comparer(currentKey, key) + } + + if areEqual { + return + } + + self._currentKey = key + + self.forwardOn(event) + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + case .error, .completed: + self.forwardOn(event) + self.dispose() + } + } +} + +final private class DistinctUntilChanged: Producer { + typealias KeySelector = (Element) throws -> Key + typealias EqualityComparer = (Key, Key) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _selector: KeySelector + fileprivate let _comparer: EqualityComparer + + init(source: Observable, selector: @escaping KeySelector, comparer: @escaping EqualityComparer) { + self._source = source + self._selector = selector + self._comparer = comparer + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = DistinctUntilChangedSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift new file mode 100644 index 000000000000..d05713194182 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Do.swift @@ -0,0 +1,93 @@ +// +// Do.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Invokes an action for each event in the observable sequence, and propagates all observer messages through the result sequence. + + - seealso: [do operator on reactivex.io](http://reactivex.io/documentation/operators/do.html) + + - parameter onNext: Action to invoke for each element in the observable sequence. + - parameter onError: Action to invoke upon errored termination of the observable sequence. + - parameter onCompleted: Action to invoke upon graceful termination of the observable sequence. + - parameter onSubscribe: Action to invoke before subscribing to source observable sequence. + - parameter onSubscribed: Action to invoke after subscribing to source observable sequence. + - parameter onDispose: Action to invoke after subscription to source observable has been disposed for any reason. It can be either because sequence terminates for some reason or observer subscription being disposed. + - returns: The source sequence with the side-effecting behavior applied. + */ + public func `do`(onNext: ((E) throws -> Void)? = nil, onError: ((Swift.Error) throws -> Void)? = nil, onCompleted: (() throws -> Void)? = nil, onSubscribe: (() -> Void)? = nil, onSubscribed: (() -> Void)? = nil, onDispose: (() -> Void)? = nil) + -> Observable { + return Do(source: self.asObservable(), eventHandler: { e in + switch e { + case .next(let element): + try onNext?(element) + case .error(let e): + try onError?(e) + case .completed: + try onCompleted?() + } + }, onSubscribe: onSubscribe, onSubscribed: onSubscribed, onDispose: onDispose) + } +} + +final private class DoSink: Sink, ObserverType { + typealias Element = O.E + typealias EventHandler = (Event) throws -> Void + + private let _eventHandler: EventHandler + + init(eventHandler: @escaping EventHandler, observer: O, cancel: Cancelable) { + self._eventHandler = eventHandler + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + do { + try self._eventHandler(event) + self.forwardOn(event) + if event.isStopEvent { + self.dispose() + } + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + } +} + +final private class Do: Producer { + typealias EventHandler = (Event) throws -> Void + + fileprivate let _source: Observable + fileprivate let _eventHandler: EventHandler + fileprivate let _onSubscribe: (() -> Void)? + fileprivate let _onSubscribed: (() -> Void)? + fileprivate let _onDispose: (() -> Void)? + + init(source: Observable, eventHandler: @escaping EventHandler, onSubscribe: (() -> Void)?, onSubscribed: (() -> Void)?, onDispose: (() -> Void)?) { + self._source = source + self._eventHandler = eventHandler + self._onSubscribe = onSubscribe + self._onSubscribed = onSubscribed + self._onDispose = onDispose + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + self._onSubscribe?() + let sink = DoSink(eventHandler: self._eventHandler, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + self._onSubscribed?() + let onDispose = self._onDispose + let allSubscriptions = Disposables.create { + subscription.dispose() + onDispose?() + } + return (sink: sink, subscription: allSubscriptions) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift new file mode 100644 index 000000000000..2279400229da --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ElementAt.swift @@ -0,0 +1,92 @@ +// +// ElementAt.swift +// RxSwift +// +// Created by Junior B. on 21/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns a sequence emitting only element _n_ emitted by an Observable + + - seealso: [elementAt operator on reactivex.io](http://reactivex.io/documentation/operators/elementat.html) + + - parameter index: The index of the required element (starting from 0). + - returns: An observable sequence that emits the desired element as its own sole emission. + */ + public func elementAt(_ index: Int) + -> Observable { + return ElementAt(source: self.asObservable(), index: index, throwOnEmpty: true) + } +} + +final private class ElementAtSink: Sink, ObserverType { + typealias SourceType = O.E + typealias Parent = ElementAt + + let _parent: Parent + var _i: Int + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._i = parent._index + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next: + + if self._i == 0 { + self.forwardOn(event) + self.forwardOn(.completed) + self.dispose() + } + + do { + _ = try decrementChecked(&self._i) + } catch let e { + self.forwardOn(.error(e)) + self.dispose() + return + } + + case .error(let e): + self.forwardOn(.error(e)) + self.dispose() + case .completed: + if self._parent._throwOnEmpty { + self.forwardOn(.error(RxError.argumentOutOfRange)) + } else { + self.forwardOn(.completed) + } + + self.dispose() + } + } +} + +final private class ElementAt: Producer { + let _source: Observable + let _throwOnEmpty: Bool + let _index: Int + + init(source: Observable, index: Int, throwOnEmpty: Bool) { + if index < 0 { + rxFatalError("index can't be negative") + } + + self._source = source + self._index = index + self._throwOnEmpty = throwOnEmpty + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceType { + let sink = ElementAtSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift new file mode 100644 index 000000000000..cf72519126aa --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Empty.swift @@ -0,0 +1,27 @@ +// +// Empty.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Returns an empty observable sequence, using the specified scheduler to send out the single `Completed` message. + + - seealso: [empty operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) + + - returns: An observable sequence with no elements. + */ + public static func empty() -> Observable { + return EmptyProducer() + } +} + +final private class EmptyProducer: Producer { + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + observer.on(.completed) + return Disposables.create() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Enumerated.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Enumerated.swift new file mode 100644 index 000000000000..fdf326ec623c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Enumerated.swift @@ -0,0 +1,62 @@ +// +// Enumerated.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/6/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Enumerates the elements of an observable sequence. + + - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) + + - returns: An observable sequence that contains tuples of source sequence elements and their indexes. + */ + public func enumerated() + -> Observable<(index: Int, element: E)> { + return Enumerated(source: self.asObservable()) + } +} + +final private class EnumeratedSink: Sink, ObserverType where O.E == (index: Int, element: Element) { + typealias E = Element + var index = 0 + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let nextIndex = try incrementChecked(&self.index) + let next = (index: nextIndex, element: value) + self.forwardOn(.next(next)) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + case .completed: + self.forwardOn(.completed) + self.dispose() + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + } + } +} + +final private class Enumerated: Producer<(index: Int, element: Element)> { + private let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == (index: Int, element: Element) { + let sink = EnumeratedSink(observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift new file mode 100644 index 000000000000..026a7cee0098 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Error.swift @@ -0,0 +1,33 @@ +// +// Error.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Returns an observable sequence that terminates with an `error`. + + - seealso: [throw operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) + + - returns: The observable sequence that terminates with specified error. + */ + public static func error(_ error: Swift.Error) -> Observable { + return ErrorProducer(error: error) + } +} + +final private class ErrorProducer: Producer { + private let _error: Swift.Error + + init(error: Swift.Error) { + self._error = error + } + + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + observer.on(.error(self._error)) + return Disposables.create() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift new file mode 100644 index 000000000000..d77e89022d85 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Filter.swift @@ -0,0 +1,90 @@ +// +// Filter.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Filters the elements of an observable sequence based on a predicate. + + - seealso: [filter operator on reactivex.io](http://reactivex.io/documentation/operators/filter.html) + + - parameter predicate: A function to test each source element for a condition. + - returns: An observable sequence that contains elements from the input sequence that satisfy the condition. + */ + public func filter(_ predicate: @escaping (E) throws -> Bool) + -> Observable { + return Filter(source: self.asObservable(), predicate: predicate) + } +} + +extension ObservableType { + + /** + Skips elements and completes (or errors) when the observable sequence completes (or errors). Equivalent to filter that always returns false. + + - seealso: [ignoreElements operator on reactivex.io](http://reactivex.io/documentation/operators/ignoreelements.html) + + - returns: An observable sequence that skips all elements of the source sequence. + */ + public func ignoreElements() + -> Completable { + return self.flatMap { _ in + return Observable.empty() + } + .asCompletable() + } +} + +final private class FilterSink: Sink, ObserverType { + typealias Predicate = (Element) throws -> Bool + typealias Element = O.E + + private let _predicate: Predicate + + init(predicate: @escaping Predicate, observer: O, cancel: Cancelable) { + self._predicate = predicate + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let satisfies = try self._predicate(value) + if satisfies { + self.forwardOn(.next(value)) + } + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + case .completed, .error: + self.forwardOn(event) + self.dispose() + } + } +} + +final private class Filter: Producer { + typealias Predicate = (Element) throws -> Bool + + private let _source: Observable + private let _predicate: Predicate + + init(source: Observable, predicate: @escaping Predicate) { + self._source = source + self._predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = FilterSink(predicate: self._predicate, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/First.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/First.swift new file mode 100644 index 000000000000..29ba8dedc4f5 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/First.swift @@ -0,0 +1,42 @@ +// +// First.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/31/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +fileprivate final class FirstSink : Sink, ObserverType where O.E == Element? { + typealias E = Element + typealias Parent = First + + func on(_ event: Event) { + switch event { + case .next(let value): + self.forwardOn(.next(value)) + self.forwardOn(.completed) + self.dispose() + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self.forwardOn(.next(nil)) + self.forwardOn(.completed) + self.dispose() + } + } +} + +final class First: Producer { + fileprivate let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element? { + let sink = FirstSink(observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift new file mode 100644 index 000000000000..98635e9748a8 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Generate.swift @@ -0,0 +1,87 @@ +// +// Generate.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Generates an observable sequence by running a state-driven loop producing the sequence's elements, using the specified scheduler + to run the loop send out observer messages. + + - seealso: [create operator on reactivex.io](http://reactivex.io/documentation/operators/create.html) + + - parameter initialState: Initial state. + - parameter condition: Condition to terminate generation (upon returning `false`). + - parameter iterate: Iteration step function. + - parameter scheduler: Scheduler on which to run the generator loop. + - returns: The generated sequence. + */ + public static func generate(initialState: E, condition: @escaping (E) throws -> Bool, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance, iterate: @escaping (E) throws -> E) -> Observable { + return Generate(initialState: initialState, condition: condition, iterate: iterate, resultSelector: { $0 }, scheduler: scheduler) + } +} + +final private class GenerateSink: Sink { + typealias Parent = Generate + + private let _parent: Parent + + private var _state: S + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._state = parent._initialState + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.scheduleRecursive(true) { isFirst, recurse -> Void in + do { + if !isFirst { + self._state = try self._parent._iterate(self._state) + } + + if try self._parent._condition(self._state) { + let result = try self._parent._resultSelector(self._state) + self.forwardOn(.next(result)) + + recurse(false) + } + else { + self.forwardOn(.completed) + self.dispose() + } + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + } + } +} + +final private class Generate: Producer { + fileprivate let _initialState: S + fileprivate let _condition: (S) throws -> Bool + fileprivate let _iterate: (S) throws -> S + fileprivate let _resultSelector: (S) throws -> E + fileprivate let _scheduler: ImmediateSchedulerType + + init(initialState: S, condition: @escaping (S) throws -> Bool, iterate: @escaping (S) throws -> S, resultSelector: @escaping (S) throws -> E, scheduler: ImmediateSchedulerType) { + self._initialState = initialState + self._condition = condition + self._iterate = iterate + self._resultSelector = resultSelector + self._scheduler = scheduler + super.init() + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = GenerateSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift new file mode 100644 index 000000000000..adce8763a974 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/GroupBy.swift @@ -0,0 +1,134 @@ +// +// GroupBy.swift +// RxSwift +// +// Created by Tomi Koskinen on 01/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /* + Groups the elements of an observable sequence according to a specified key selector function. + + - seealso: [groupBy operator on reactivex.io](http://reactivex.io/documentation/operators/groupby.html) + + - parameter keySelector: A function to extract the key for each element. + - returns: A sequence of observable groups, each of which corresponds to a unique key value, containing all elements that share that same key value. + */ + public func groupBy(keySelector: @escaping (E) throws -> K) + -> Observable> { + return GroupBy(source: self.asObservable(), selector: keySelector) + } +} + +final private class GroupedObservableImpl: Observable { + private var _subject: PublishSubject + private var _refCount: RefCountDisposable + + init(subject: PublishSubject, refCount: RefCountDisposable) { + self._subject = subject + self._refCount = refCount + } + + override public func subscribe(_ observer: O) -> Disposable where O.E == E { + let release = self._refCount.retain() + let subscription = self._subject.subscribe(observer) + return Disposables.create(release, subscription) + } +} + + +final private class GroupBySink + : Sink + , ObserverType where O.E == GroupedObservable { + typealias E = Element + typealias ResultType = O.E + typealias Parent = GroupBy + + private let _parent: Parent + private let _subscription = SingleAssignmentDisposable() + private var _refCountDisposable: RefCountDisposable! + private var _groupedSubjectTable: [Key: PublishSubject] + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._groupedSubjectTable = [Key: PublishSubject]() + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + self._refCountDisposable = RefCountDisposable(disposable: self._subscription) + + self._subscription.setDisposable(self._parent._source.subscribe(self)) + + return self._refCountDisposable + } + + private func onGroupEvent(key: Key, value: Element) { + if let writer = self._groupedSubjectTable[key] { + writer.on(.next(value)) + } else { + let writer = PublishSubject() + self._groupedSubjectTable[key] = writer + + let group = GroupedObservable( + key: key, + source: GroupedObservableImpl(subject: writer, refCount: _refCountDisposable) + ) + + self.forwardOn(.next(group)) + writer.on(.next(value)) + } + } + + final func on(_ event: Event) { + switch event { + case let .next(value): + do { + let groupKey = try self._parent._selector(value) + self.onGroupEvent(key: groupKey, value: value) + } + catch let e { + self.error(e) + return + } + case let .error(e): + self.error(e) + case .completed: + self.forwardOnGroups(event: .completed) + self.forwardOn(.completed) + self._subscription.dispose() + self.dispose() + } + } + + final func error(_ error: Swift.Error) { + self.forwardOnGroups(event: .error(error)) + self.forwardOn(.error(error)) + self._subscription.dispose() + self.dispose() + } + + final func forwardOnGroups(event: Event) { + for writer in self._groupedSubjectTable.values { + writer.on(event) + } + } +} + +final private class GroupBy: Producer> { + typealias KeySelector = (Element) throws -> Key + + fileprivate let _source: Observable + fileprivate let _selector: KeySelector + + init(source: Observable, selector: @escaping KeySelector) { + self._source = source + self._selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == GroupedObservable { + let sink = GroupBySink(parent: self, observer: observer, cancel: cancel) + return (sink: sink, subscription: sink.run()) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift new file mode 100644 index 000000000000..f4fa0d2d5d3e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Just.swift @@ -0,0 +1,87 @@ +// +// Just.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Returns an observable sequence that contains a single element. + + - seealso: [just operator on reactivex.io](http://reactivex.io/documentation/operators/just.html) + + - parameter element: Single element in the resulting observable sequence. + - returns: An observable sequence containing the single specified element. + */ + public static func just(_ element: E) -> Observable { + return Just(element: element) + } + + /** + Returns an observable sequence that contains a single element. + + - seealso: [just operator on reactivex.io](http://reactivex.io/documentation/operators/just.html) + + - parameter element: Single element in the resulting observable sequence. + - parameter scheduler: Scheduler to send the single element on. + - returns: An observable sequence containing the single specified element. + */ + public static func just(_ element: E, scheduler: ImmediateSchedulerType) -> Observable { + return JustScheduled(element: element, scheduler: scheduler) + } +} + +final private class JustScheduledSink: Sink { + typealias Parent = JustScheduled + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let scheduler = self._parent._scheduler + return scheduler.schedule(self._parent._element) { element in + self.forwardOn(.next(element)) + return scheduler.schedule(()) { _ in + self.forwardOn(.completed) + self.dispose() + return Disposables.create() + } + } + } +} + +final private class JustScheduled: Producer { + fileprivate let _scheduler: ImmediateSchedulerType + fileprivate let _element: Element + + init(element: Element, scheduler: ImmediateSchedulerType) { + self._scheduler = scheduler + self._element = element + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = JustScheduledSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +final private class Just: Producer { + private let _element: Element + + init(element: Element) { + self._element = element + } + + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + observer.on(.next(self._element)) + observer.on(.completed) + return Disposables.create() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift new file mode 100644 index 000000000000..b5ae37092417 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Map.swift @@ -0,0 +1,108 @@ +// +// Map.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Projects each element of an observable sequence into a new form. + + - seealso: [map operator on reactivex.io](http://reactivex.io/documentation/operators/map.html) + + - parameter transform: A transform function to apply to each source element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source. + + */ + public func map(_ transform: @escaping (E) throws -> R) + -> Observable { + return self.asObservable().composeMap(transform) + } +} + +final private class MapSink: Sink, ObserverType { + typealias Transform = (SourceType) throws -> ResultType + + typealias ResultType = O.E + typealias Element = SourceType + + private let _transform: Transform + + init(transform: @escaping Transform, observer: O, cancel: Cancelable) { + self._transform = transform + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let element): + do { + let mappedElement = try self._transform(element) + self.forwardOn(.next(mappedElement)) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self.forwardOn(.completed) + self.dispose() + } + } +} + +#if TRACE_RESOURCES + fileprivate let _numberOfMapOperators = AtomicInt(0) + extension Resources { + public static var numberOfMapOperators: Int32 { + return load(_numberOfMapOperators) + } + } +#endif + +internal func _map(source: Observable, transform: @escaping (Element) throws -> R) -> Observable { + return Map(source: source, transform: transform) +} + +final private class Map: Producer { + typealias Transform = (SourceType) throws -> ResultType + + private let _source: Observable + + private let _transform: Transform + + init(source: Observable, transform: @escaping Transform) { + self._source = source + self._transform = transform + +#if TRACE_RESOURCES + _ = increment(_numberOfMapOperators) +#endif + } + + override func composeMap(_ selector: @escaping (ResultType) throws -> R) -> Observable { + let originalSelector = self._transform + return Map(source: self._source, transform: { (s: SourceType) throws -> R in + let r: ResultType = try originalSelector(s) + return try selector(r) + }) + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = MapSink(transform: self._transform, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + + #if TRACE_RESOURCES + deinit { + _ = decrement(_numberOfMapOperators) + } + #endif +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift new file mode 100644 index 000000000000..1a5e2f52bff9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Materialize.swift @@ -0,0 +1,44 @@ +// +// Materialize.swift +// RxSwift +// +// Created by sergdort on 08/03/2017. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Convert any Observable into an Observable of its events. + - seealso: [materialize operator on reactivex.io](http://reactivex.io/documentation/operators/materialize-dematerialize.html) + - returns: An observable sequence that wraps events in an Event. The returned Observable never errors, but it does complete after observing all of the events of the underlying Observable. + */ + public func materialize() -> Observable> { + return Materialize(source: self.asObservable()) + } +} + +fileprivate final class MaterializeSink: Sink, ObserverType where O.E == Event { + + func on(_ event: Event) { + self.forwardOn(.next(event)) + if event.isStopEvent { + self.forwardOn(.completed) + self.dispose() + } + } +} + +final private class Materialize: Producer> { + private let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = MaterializeSink(observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift new file mode 100644 index 000000000000..0bc0a383471a --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Merge.swift @@ -0,0 +1,598 @@ +// +// Merge.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/28/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. + + - seealso: [flatMap operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to each element. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. + */ + public func flatMap(_ selector: @escaping (E) throws -> O) + -> Observable { + return FlatMap(source: self.asObservable(), selector: selector) + } + +} + +extension ObservableType { + + /** + Projects each element of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence. + If element is received while there is some projected observable sequence being merged it will simply be ignored. + + - seealso: [flatMapFirst operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to element that was observed while no observable is executing in parallel. + - returns: An observable sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence that was received while no other sequence was being calculated. + */ + public func flatMapFirst(_ selector: @escaping (E) throws -> O) + -> Observable { + return FlatMapFirst(source: self.asObservable(), selector: selector) + } +} + +extension ObservableType where E : ObservableConvertibleType { + + /** + Merges elements from all observable sequences in the given enumerable sequence into a single observable sequence. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - returns: The observable sequence that merges the elements of the observable sequences. + */ + public func merge() -> Observable { + return Merge(source: self.asObservable()) + } + + /** + Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - parameter maxConcurrent: Maximum number of inner observable sequences being subscribed to concurrently. + - returns: The observable sequence that merges the elements of the inner sequences. + */ + public func merge(maxConcurrent: Int) + -> Observable { + return MergeLimited(source: self.asObservable(), maxConcurrent: maxConcurrent) + } +} + +extension ObservableType where E : ObservableConvertibleType { + + /** + Concatenates all inner observable sequences, as long as the previous observable sequence terminated successfully. + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each observed inner sequence, in sequential order. + */ + public func concat() -> Observable { + return self.merge(maxConcurrent: 1) + } +} + +extension ObservableType { + /** + Merges elements from all observable sequences from collection into a single observable sequence. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - parameter sources: Collection of observable sequences to merge. + - returns: The observable sequence that merges the elements of the observable sequences. + */ + public static func merge(_ sources: C) -> Observable where C.Iterator.Element == Observable { + return MergeArray(sources: Array(sources)) + } + + /** + Merges elements from all observable sequences from array into a single observable sequence. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - parameter sources: Array of observable sequences to merge. + - returns: The observable sequence that merges the elements of the observable sequences. + */ + public static func merge(_ sources: [Observable]) -> Observable { + return MergeArray(sources: sources) + } + + /** + Merges elements from all observable sequences into a single observable sequence. + + - seealso: [merge operator on reactivex.io](http://reactivex.io/documentation/operators/merge.html) + + - parameter sources: Collection of observable sequences to merge. + - returns: The observable sequence that merges the elements of the observable sequences. + */ + public static func merge(_ sources: Observable...) -> Observable { + return MergeArray(sources: sources) + } +} + +// MARK: concatMap + +extension ObservableType { + /** + Projects each element of an observable sequence to an observable sequence and concatenates the resulting observable sequences into one observable sequence. + + - seealso: [concat operator on reactivex.io](http://reactivex.io/documentation/operators/concat.html) + + - returns: An observable sequence that contains the elements of each observed inner sequence, in sequential order. + */ + + public func concatMap(_ selector: @escaping (E) throws -> O) + -> Observable { + return ConcatMap(source: self.asObservable(), selector: selector) + } +} + +fileprivate final class MergeLimitedSinkIter + : ObserverType + , LockOwnerType + , SynchronizedOnType where SourceSequence.E == Observer.E { + typealias E = Observer.E + typealias DisposeKey = CompositeDisposable.DisposeKey + typealias Parent = MergeLimitedSink + + private let _parent: Parent + private let _disposeKey: DisposeKey + + var _lock: RecursiveLock { + return self._parent._lock + } + + init(parent: Parent, disposeKey: DisposeKey) { + self._parent = parent + self._disposeKey = disposeKey + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + self._parent.forwardOn(event) + case .error: + self._parent.forwardOn(event) + self._parent.dispose() + case .completed: + self._parent._group.remove(for: self._disposeKey) + if let next = self._parent._queue.dequeue() { + self._parent.subscribe(next, group: self._parent._group) + } + else { + self._parent._activeCount -= 1 + + if self._parent._stopped && self._parent._activeCount == 0 { + self._parent.forwardOn(.completed) + self._parent.dispose() + } + } + } + } +} + +fileprivate final class ConcatMapSink: MergeLimitedSink where Observer.E == SourceSequence.E { + typealias Selector = (SourceElement) throws -> SourceSequence + + private let _selector: Selector + + init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { + self._selector = selector + super.init(maxConcurrent: 1, observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceElement) throws -> SourceSequence { + return try self._selector(element) + } +} + +fileprivate final class MergeLimitedBasicSink: MergeLimitedSink where Observer.E == SourceSequence.E { + + override func performMap(_ element: SourceSequence) throws -> SourceSequence { + return element + } +} + +private class MergeLimitedSink + : Sink + , ObserverType where Observer.E == SourceSequence.E { + typealias QueueType = Queue + + let _maxConcurrent: Int + + let _lock = RecursiveLock() + + // state + var _stopped = false + var _activeCount = 0 + var _queue = QueueType(capacity: 2) + + let _sourceSubscription = SingleAssignmentDisposable() + let _group = CompositeDisposable() + + init(maxConcurrent: Int, observer: Observer, cancel: Cancelable) { + self._maxConcurrent = maxConcurrent + super.init(observer: observer, cancel: cancel) + } + + func run(_ source: Observable) -> Disposable { + _ = self._group.insert(self._sourceSubscription) + + let disposable = source.subscribe(self) + self._sourceSubscription.setDisposable(disposable) + return self._group + } + + func subscribe(_ innerSource: SourceSequence, group: CompositeDisposable) { + let subscription = SingleAssignmentDisposable() + + let key = group.insert(subscription) + + if let key = key { + let observer = MergeLimitedSinkIter(parent: self, disposeKey: key) + + let disposable = innerSource.asObservable().subscribe(observer) + subscription.setDisposable(disposable) + } + } + + func performMap(_ element: SourceElement) throws -> SourceSequence { + rxAbstractMethod() + } + + @inline(__always) + final private func nextElementArrived(element: SourceElement) -> SourceSequence? { + self._lock.lock(); defer { self._lock.unlock() } // { + let subscribe: Bool + if self._activeCount < self._maxConcurrent { + self._activeCount += 1 + subscribe = true + } + else { + do { + let value = try self.performMap(element) + self._queue.enqueue(value) + } catch { + self.forwardOn(.error(error)) + self.dispose() + } + subscribe = false + } + + if subscribe { + do { + return try self.performMap(element) + } catch { + self.forwardOn(.error(error)) + self.dispose() + } + } + + return nil + // } + } + + func on(_ event: Event) { + switch event { + case .next(let element): + if let sequence = self.nextElementArrived(element: element) { + self.subscribe(sequence, group: self._group) + } + case .error(let error): + self._lock.lock(); defer { self._lock.unlock() } + + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self._lock.lock(); defer { self._lock.unlock() } + + if self._activeCount == 0 { + self.forwardOn(.completed) + self.dispose() + } + else { + self._sourceSubscription.dispose() + } + + self._stopped = true + } + } +} + +final private class MergeLimited: Producer { + private let _source: Observable + private let _maxConcurrent: Int + + init(source: Observable, maxConcurrent: Int) { + self._source = source + self._maxConcurrent = maxConcurrent + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { + let sink = MergeLimitedBasicSink(maxConcurrent: self._maxConcurrent, observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} + +// MARK: Merge + +fileprivate final class MergeBasicSink : MergeSink where O.E == S.E { + override func performMap(_ element: S) throws -> S { + return element + } +} + +// MARK: flatMap + +fileprivate final class FlatMapSink : MergeSink where Observer.E == SourceSequence.E { + typealias Selector = (SourceElement) throws -> SourceSequence + + private let _selector: Selector + + init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { + self._selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceElement) throws -> SourceSequence { + return try self._selector(element) + } +} + +// MARK: FlatMapFirst + +fileprivate final class FlatMapFirstSink : MergeSink where Observer.E == SourceSequence.E { + typealias Selector = (SourceElement) throws -> SourceSequence + + private let _selector: Selector + + override var subscribeNext: Bool { + return self._activeCount == 0 + } + + init(selector: @escaping Selector, observer: Observer, cancel: Cancelable) { + self._selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceElement) throws -> SourceSequence { + return try self._selector(element) + } +} + +fileprivate final class MergeSinkIter : ObserverType where Observer.E == SourceSequence.E { + typealias Parent = MergeSink + typealias DisposeKey = CompositeDisposable.DisposeKey + typealias E = Observer.E + + private let _parent: Parent + private let _disposeKey: DisposeKey + + init(parent: Parent, disposeKey: DisposeKey) { + self._parent = parent + self._disposeKey = disposeKey + } + + func on(_ event: Event) { + self._parent._lock.lock(); defer { self._parent._lock.unlock() } // lock { + switch event { + case .next(let value): + self._parent.forwardOn(.next(value)) + case .error(let error): + self._parent.forwardOn(.error(error)) + self._parent.dispose() + case .completed: + self._parent._group.remove(for: self._disposeKey) + self._parent._activeCount -= 1 + self._parent.checkCompleted() + } + // } + } +} + + +private class MergeSink + : Sink + , ObserverType where Observer.E == SourceSequence.E { + typealias ResultType = Observer.E + typealias Element = SourceElement + + let _lock = RecursiveLock() + + var subscribeNext: Bool { + return true + } + + // state + let _group = CompositeDisposable() + let _sourceSubscription = SingleAssignmentDisposable() + + var _activeCount = 0 + var _stopped = false + + override init(observer: Observer, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func performMap(_ element: SourceElement) throws -> SourceSequence { + rxAbstractMethod() + } + + @inline(__always) + final private func nextElementArrived(element: SourceElement) -> SourceSequence? { + self._lock.lock(); defer { self._lock.unlock() } // { + if !self.subscribeNext { + return nil + } + + do { + let value = try self.performMap(element) + self._activeCount += 1 + return value + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + return nil + } + // } + } + + func on(_ event: Event) { + switch event { + case .next(let element): + if let value = self.nextElementArrived(element: element) { + self.subscribeInner(value.asObservable()) + } + case .error(let error): + self._lock.lock(); defer { self._lock.unlock() } + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self._lock.lock(); defer { self._lock.unlock() } + self._stopped = true + self._sourceSubscription.dispose() + self.checkCompleted() + } + } + + func subscribeInner(_ source: Observable) { + let iterDisposable = SingleAssignmentDisposable() + if let disposeKey = self._group.insert(iterDisposable) { + let iter = MergeSinkIter(parent: self, disposeKey: disposeKey) + let subscription = source.subscribe(iter) + iterDisposable.setDisposable(subscription) + } + } + + func run(_ sources: [Observable]) -> Disposable { + self._activeCount += sources.count + + for source in sources { + self.subscribeInner(source) + } + + self._stopped = true + + self.checkCompleted() + + return self._group + } + + @inline(__always) + func checkCompleted() { + if self._stopped && self._activeCount == 0 { + self.forwardOn(.completed) + self.dispose() + } + } + + func run(_ source: Observable) -> Disposable { + _ = self._group.insert(self._sourceSubscription) + + let subscription = source.subscribe(self) + self._sourceSubscription.setDisposable(subscription) + + return self._group + } +} + +// MARK: Producers + +final private class FlatMap: Producer { + typealias Selector = (SourceElement) throws -> SourceSequence + + private let _source: Observable + + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + self._source = source + self._selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { + let sink = FlatMapSink(selector: self._selector, observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} + +final private class FlatMapFirst: Producer { + typealias Selector = (SourceElement) throws -> SourceSequence + + private let _source: Observable + + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + self._source = source + self._selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { + let sink = FlatMapFirstSink(selector: self._selector, observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} + +final class ConcatMap: Producer { + typealias Selector = (SourceElement) throws -> SourceSequence + + private let _source: Observable + private let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + self._source = source + self._selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { + let sink = ConcatMapSink(selector: self._selector, observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} + +final class Merge : Producer { + private let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == SourceSequence.E { + let sink = MergeBasicSink(observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} + +final private class MergeArray: Producer { + private let _sources: [Observable] + + init(sources: [Observable]) { + self._sources = sources + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = MergeBasicSink, O>(observer: observer, cancel: cancel) + let subscription = sink.run(self._sources) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift new file mode 100644 index 000000000000..7e47389f725b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Multicast.swift @@ -0,0 +1,408 @@ +// +// Multicast.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/** + Represents an observable wrapper that can be connected and disconnected from its underlying observable sequence. + */ +public class ConnectableObservable + : Observable + , ConnectableObservableType { + + /** + Connects the observable wrapper to its source. All subscribed observers will receive values from the underlying observable sequence as long as the connection is established. + + - returns: Disposable used to disconnect the observable wrapper from its source, causing subscribed observer to stop receiving values from the underlying observable sequence. + */ + public func connect() -> Disposable { + rxAbstractMethod() + } +} + +extension ObservableType { + + /** + Multicasts the source sequence notifications through an instantiated subject into all uses of the sequence within a selector function. + + Each subscription to the resulting sequence causes a separate multicast invocation, exposing the sequence resulting from the selector function's invocation. + + For specializations with fixed subject types, see `publish` and `replay`. + + - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - parameter subjectSelector: Factory function to create an intermediate subject through which the source sequence's elements will be multicast to the selector function. + - parameter selector: Selector function which can use the multicasted source sequence subject to the policies enforced by the created subject. + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence within a selector function. + */ + public func multicast(_ subjectSelector: @escaping () throws -> S, selector: @escaping (Observable) throws -> Observable) + -> Observable where S.SubjectObserverType.E == E { + return Multicast( + source: self.asObservable(), + subjectSelector: subjectSelector, + selector: selector + ) + } +} + +extension ObservableType { + + /** + Returns a connectable observable sequence that shares a single subscription to the underlying sequence. + + This operator is a specialization of `multicast` using a `PublishSubject`. + + - seealso: [publish operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. + */ + public func publish() -> ConnectableObservable { + return self.multicast { PublishSubject() } + } +} + +extension ObservableType { + + /** + Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying bufferSize elements. + + This operator is a specialization of `multicast` using a `ReplaySubject`. + + - seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - parameter bufferSize: Maximum element count of the replay buffer. + - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. + */ + public func replay(_ bufferSize: Int) + -> ConnectableObservable { + return self.multicast { ReplaySubject.create(bufferSize: bufferSize) } + } + + /** + Returns a connectable observable sequence that shares a single subscription to the underlying sequence replaying all elements. + + This operator is a specialization of `multicast` using a `ReplaySubject`. + + - seealso: [replay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - returns: A connectable observable sequence that shares a single subscription to the underlying sequence. + */ + public func replayAll() + -> ConnectableObservable { + return self.multicast { ReplaySubject.createUnbounded() } + } +} + +extension ConnectableObservableType { + + /** + Returns an observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. + + - seealso: [refCount operator on reactivex.io](http://reactivex.io/documentation/operators/refcount.html) + + - returns: An observable sequence that stays connected to the source as long as there is at least one subscription to the observable sequence. + */ + public func refCount() -> Observable { + return RefCount(source: self) + } +} + +extension ObservableType { + + /** + Multicasts the source sequence notifications through the specified subject to the resulting connectable observable. + + Upon connection of the connectable observable, the subject is subscribed to the source exactly one, and messages are forwarded to the observers registered with the connectable observable. + + For specializations with fixed subject types, see `publish` and `replay`. + + - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - parameter subject: Subject to push source elements into. + - returns: A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. + */ + public func multicast(_ subject: S) + -> ConnectableObservable where S.SubjectObserverType.E == E { + return ConnectableObservableAdapter(source: self.asObservable(), makeSubject: { subject }) + } + + /** + Multicasts the source sequence notifications through an instantiated subject to the resulting connectable observable. + + Upon connection of the connectable observable, the subject is subscribed to the source exactly one, and messages are forwarded to the observers registered with the connectable observable. + + Subject is cleared on connection disposal or in case source sequence produces terminal event. + + - seealso: [multicast operator on reactivex.io](http://reactivex.io/documentation/operators/publish.html) + + - parameter makeSubject: Factory function used to instantiate a subject for each connection. + - returns: A connectable observable sequence that upon connection causes the source sequence to push results into the specified subject. + */ + public func multicast(makeSubject: @escaping () -> S) + -> ConnectableObservable where S.SubjectObserverType.E == E { + return ConnectableObservableAdapter(source: self.asObservable(), makeSubject: makeSubject) + } +} + +final private class Connection: ObserverType, Disposable { + typealias E = S.SubjectObserverType.E + + private var _lock: RecursiveLock + // state + private var _parent: ConnectableObservableAdapter? + private var _subscription : Disposable? + private var _subjectObserver: S.SubjectObserverType + + private let _disposed = AtomicInt(0) + + init(parent: ConnectableObservableAdapter, subjectObserver: S.SubjectObserverType, lock: RecursiveLock, subscription: Disposable) { + self._parent = parent + self._subscription = subscription + self._lock = lock + self._subjectObserver = subjectObserver + } + + func on(_ event: Event) { + if isFlagSet(self._disposed, 1) { + return + } + if event.isStopEvent { + self.dispose() + } + self._subjectObserver.on(event) + } + + func dispose() { + _lock.lock(); defer { _lock.unlock() } // { + fetchOr(self._disposed, 1) + guard let parent = _parent else { + return + } + + if parent._connection === self { + parent._connection = nil + parent._subject = nil + } + self._parent = nil + + self._subscription?.dispose() + self._subscription = nil + // } + } +} + +final private class ConnectableObservableAdapter + : ConnectableObservable { + typealias ConnectionType = Connection + + fileprivate let _source: Observable + fileprivate let _makeSubject: () -> S + + fileprivate let _lock = RecursiveLock() + fileprivate var _subject: S? + + // state + fileprivate var _connection: ConnectionType? + + init(source: Observable, makeSubject: @escaping () -> S) { + self._source = source + self._makeSubject = makeSubject + self._subject = nil + self._connection = nil + } + + override func connect() -> Disposable { + return self._lock.calculateLocked { + if let connection = self._connection { + return connection + } + + let singleAssignmentDisposable = SingleAssignmentDisposable() + let connection = Connection(parent: self, subjectObserver: self.lazySubject.asObserver(), lock: self._lock, subscription: singleAssignmentDisposable) + self._connection = connection + let subscription = self._source.subscribe(connection) + singleAssignmentDisposable.setDisposable(subscription) + return connection + } + } + + fileprivate var lazySubject: S { + if let subject = self._subject { + return subject + } + + let subject = self._makeSubject() + self._subject = subject + return subject + } + + override func subscribe(_ observer: O) -> Disposable where O.E == S.E { + return self.lazySubject.subscribe(observer) + } +} + +final private class RefCountSink + : Sink + , ObserverType where CO.E == O.E { + typealias Element = O.E + typealias Parent = RefCount + + private let _parent: Parent + + private var _connectionIdSnapshot: Int64 = -1 + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription = self._parent._source.subscribe(self) + self._parent._lock.lock(); defer { self._parent._lock.unlock() } // { + + self._connectionIdSnapshot = self._parent._connectionId + + if self.disposed { + return Disposables.create() + } + + if self._parent._count == 0 { + self._parent._count = 1 + self._parent._connectableSubscription = self._parent._source.connect() + } + else { + self._parent._count += 1 + } + // } + + return Disposables.create { + subscription.dispose() + self._parent._lock.lock(); defer { self._parent._lock.unlock() } // { + if self._parent._connectionId != self._connectionIdSnapshot { + return + } + if self._parent._count == 1 { + self._parent._count = 0 + guard let connectableSubscription = self._parent._connectableSubscription else { + return + } + + connectableSubscription.dispose() + self._parent._connectableSubscription = nil + } + else if self._parent._count > 1 { + self._parent._count -= 1 + } + else { + rxFatalError("Something went wrong with RefCount disposing mechanism") + } + // } + } + } + + func on(_ event: Event) { + switch event { + case .next: + self.forwardOn(event) + case .error, .completed: + self._parent._lock.lock() // { + if self._parent._connectionId == self._connectionIdSnapshot { + let connection = self._parent._connectableSubscription + defer { connection?.dispose() } + self._parent._count = 0 + self._parent._connectionId = self._parent._connectionId &+ 1 + self._parent._connectableSubscription = nil + } + // } + self._parent._lock.unlock() + self.forwardOn(event) + self.dispose() + } + } +} + +final private class RefCount: Producer { + fileprivate let _lock = RecursiveLock() + + // state + fileprivate var _count = 0 + fileprivate var _connectionId: Int64 = 0 + fileprivate var _connectableSubscription = nil as Disposable? + + fileprivate let _source: CO + + init(source: CO) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == CO.E { + let sink = RefCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +final private class MulticastSink: Sink, ObserverType { + typealias Element = O.E + typealias ResultType = Element + typealias MutlicastType = Multicast + + private let _parent: MutlicastType + + init(parent: MutlicastType, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + do { + let subject = try self._parent._subjectSelector() + let connectable = ConnectableObservableAdapter(source: self._parent._source, makeSubject: { subject }) + + let observable = try self._parent._selector(connectable) + + let subscription = observable.subscribe(self) + let connection = connectable.connect() + + return Disposables.create(subscription, connection) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + return Disposables.create() + } + } + + func on(_ event: Event) { + self.forwardOn(event) + switch event { + case .next: break + case .error, .completed: + self.dispose() + } + } +} + +final private class Multicast: Producer { + typealias SubjectSelectorType = () throws -> S + typealias SelectorType = (Observable) throws -> Observable + + fileprivate let _source: Observable + fileprivate let _subjectSelector: SubjectSelectorType + fileprivate let _selector: SelectorType + + init(source: Observable, subjectSelector: @escaping SubjectSelectorType, selector: @escaping SelectorType) { + self._source = source + self._subjectSelector = subjectSelector + self._selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = MulticastSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift new file mode 100644 index 000000000000..51aa3f05049c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Never.swift @@ -0,0 +1,27 @@ +// +// Never.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns a non-terminating observable sequence, which can be used to denote an infinite duration. + + - seealso: [never operator on reactivex.io](http://reactivex.io/documentation/operators/empty-never-throw.html) + + - returns: An observable sequence whose observers will never get called. + */ + public static func never() -> Observable { + return NeverProducer() + } +} + +final private class NeverProducer: Producer { + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + return Disposables.create() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift new file mode 100644 index 000000000000..cf7e0b6b811f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ObserveOn.swift @@ -0,0 +1,231 @@ +// +// ObserveOn.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Wraps the source sequence in order to run its observer callbacks on the specified scheduler. + + This only invokes observer callbacks on a `scheduler`. In case the subscription and/or unsubscription + actions have side-effects that require to be run on a scheduler, use `subscribeOn`. + + - seealso: [observeOn operator on reactivex.io](http://reactivex.io/documentation/operators/observeon.html) + + - parameter scheduler: Scheduler to notify observers on. + - returns: The source sequence whose observations happen on the specified scheduler. + */ + public func observeOn(_ scheduler: ImmediateSchedulerType) + -> Observable { + if let scheduler = scheduler as? SerialDispatchQueueScheduler { + return ObserveOnSerialDispatchQueue(source: self.asObservable(), scheduler: scheduler) + } + else { + return ObserveOn(source: self.asObservable(), scheduler: scheduler) + } + } +} + +final private class ObserveOn: Producer { + let scheduler: ImmediateSchedulerType + let source: Observable + + init(source: Observable, scheduler: ImmediateSchedulerType) { + self.scheduler = scheduler + self.source = source + +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObserveOnSink(scheduler: self.scheduler, observer: observer, cancel: cancel) + let subscription = self.source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + +#if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } +#endif +} + +enum ObserveOnState : Int32 { + // pump is not running + case stopped = 0 + // pump is running + case running = 1 +} + +final private class ObserveOnSink: ObserverBase { + typealias E = O.E + + let _scheduler: ImmediateSchedulerType + + var _lock = SpinLock() + let _observer: O + + // state + var _state = ObserveOnState.stopped + var _queue = Queue>(capacity: 10) + + let _scheduleDisposable = SerialDisposable() + let _cancel: Cancelable + + init(scheduler: ImmediateSchedulerType, observer: O, cancel: Cancelable) { + self._scheduler = scheduler + self._observer = observer + self._cancel = cancel + } + + override func onCore(_ event: Event) { + let shouldStart = self._lock.calculateLocked { () -> Bool in + self._queue.enqueue(event) + + switch self._state { + case .stopped: + self._state = .running + return true + case .running: + return false + } + } + + if shouldStart { + self._scheduleDisposable.disposable = self._scheduler.scheduleRecursive((), action: self.run) + } + } + + func run(_ state: (), _ recurse: (()) -> Void) { + let (nextEvent, observer) = self._lock.calculateLocked { () -> (Event?, O) in + if !self._queue.isEmpty { + return (self._queue.dequeue(), self._observer) + } + else { + self._state = .stopped + return (nil, self._observer) + } + } + + if let nextEvent = nextEvent, !self._cancel.isDisposed { + observer.on(nextEvent) + if nextEvent.isStopEvent { + self.dispose() + } + } + else { + return + } + + let shouldContinue = self._shouldContinue_synchronized() + + if shouldContinue { + recurse(()) + } + } + + func _shouldContinue_synchronized() -> Bool { + self._lock.lock(); defer { self._lock.unlock() } // { + if !self._queue.isEmpty { + return true + } + else { + self._state = .stopped + return false + } + // } + } + + override func dispose() { + super.dispose() + + self._cancel.dispose() + self._scheduleDisposable.dispose() + } +} + +#if TRACE_RESOURCES + fileprivate let _numberOfSerialDispatchQueueObservables = AtomicInt(0) + extension Resources { + /** + Counts number of `SerialDispatchQueueObservables`. + + Purposed for unit tests. + */ + public static var numberOfSerialDispatchQueueObservables: Int32 { + return load(_numberOfSerialDispatchQueueObservables) + } + } +#endif + +final private class ObserveOnSerialDispatchQueueSink: ObserverBase { + let scheduler: SerialDispatchQueueScheduler + let observer: O + + let cancel: Cancelable + + var cachedScheduleLambda: (((sink: ObserveOnSerialDispatchQueueSink, event: Event)) -> Disposable)! + + init(scheduler: SerialDispatchQueueScheduler, observer: O, cancel: Cancelable) { + self.scheduler = scheduler + self.observer = observer + self.cancel = cancel + super.init() + + self.cachedScheduleLambda = { pair in + guard !cancel.isDisposed else { return Disposables.create() } + + pair.sink.observer.on(pair.event) + + if pair.event.isStopEvent { + pair.sink.dispose() + } + + return Disposables.create() + } + } + + override func onCore(_ event: Event) { + _ = self.scheduler.schedule((self, event), action: self.cachedScheduleLambda!) + } + + override func dispose() { + super.dispose() + + self.cancel.dispose() + } +} + +final private class ObserveOnSerialDispatchQueue: Producer { + let scheduler: SerialDispatchQueueScheduler + let source: Observable + + init(source: Observable, scheduler: SerialDispatchQueueScheduler) { + self.scheduler = scheduler + self.source = source + + #if TRACE_RESOURCES + _ = Resources.incrementTotal() + _ = increment(_numberOfSerialDispatchQueueObservables) + #endif + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObserveOnSerialDispatchQueueSink(scheduler: self.scheduler, observer: observer, cancel: cancel) + let subscription = self.source.subscribe(sink) + return (sink: sink, subscription: subscription) + } + + #if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + _ = decrement(_numberOfSerialDispatchQueueObservables) + } + #endif +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift new file mode 100644 index 000000000000..43fede5aec72 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Optional.swift @@ -0,0 +1,95 @@ +// +// Optional.swift +// RxSwift +// +// Created by tarunon on 2016/12/13. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Converts a optional to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter optional: Optional element in the resulting observable sequence. + - returns: An observable sequence containing the wrapped value or not from given optional. + */ + public static func from(optional: E?) -> Observable { + return ObservableOptional(optional: optional) + } + + /** + Converts a optional to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter optional: Optional element in the resulting observable sequence. + - parameter scheduler: Scheduler to send the optional element on. + - returns: An observable sequence containing the wrapped value or not from given optional. + */ + public static func from(optional: E?, scheduler: ImmediateSchedulerType) -> Observable { + return ObservableOptionalScheduled(optional: optional, scheduler: scheduler) + } +} + +final private class ObservableOptionalScheduledSink: Sink { + typealias E = O.E + typealias Parent = ObservableOptionalScheduled + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.schedule(self._parent._optional) { (optional: E?) -> Disposable in + if let next = optional { + self.forwardOn(.next(next)) + return self._parent._scheduler.schedule(()) { _ in + self.forwardOn(.completed) + self.dispose() + return Disposables.create() + } + } else { + self.forwardOn(.completed) + self.dispose() + return Disposables.create() + } + } + } +} + +final private class ObservableOptionalScheduled: Producer { + fileprivate let _optional: E? + fileprivate let _scheduler: ImmediateSchedulerType + + init(optional: E?, scheduler: ImmediateSchedulerType) { + self._optional = optional + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObservableOptionalScheduledSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +final private class ObservableOptional: Producer { + private let _optional: E? + + init(optional: E?) { + self._optional = optional + } + + override func subscribe(_ observer: O) -> Disposable where O.E == E { + if let element = self._optional { + observer.on(.next(element)) + } + observer.on(.completed) + return Disposables.create() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift new file mode 100644 index 000000000000..f687d1145fd3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Producer.swift @@ -0,0 +1,92 @@ +// +// Producer.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/20/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +class Producer : Observable { + override init() { + super.init() + } + + override func subscribe(_ observer: O) -> Disposable where O.E == Element { + if !CurrentThreadScheduler.isScheduleRequired { + // The returned disposable needs to release all references once it was disposed. + let disposer = SinkDisposer() + let sinkAndSubscription = self.run(observer, cancel: disposer) + disposer.setSinkAndSubscription(sink: sinkAndSubscription.sink, subscription: sinkAndSubscription.subscription) + + return disposer + } + else { + return CurrentThreadScheduler.instance.schedule(()) { _ in + let disposer = SinkDisposer() + let sinkAndSubscription = self.run(observer, cancel: disposer) + disposer.setSinkAndSubscription(sink: sinkAndSubscription.sink, subscription: sinkAndSubscription.subscription) + + return disposer + } + } + } + + func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + rxAbstractMethod() + } +} + +fileprivate final class SinkDisposer: Cancelable { + fileprivate enum DisposeState: Int32 { + case disposed = 1 + case sinkAndSubscriptionSet = 2 + } + + private let _state = AtomicInt(0) + private var _sink: Disposable? + private var _subscription: Disposable? + + var isDisposed: Bool { + return isFlagSet(self._state, DisposeState.disposed.rawValue) + } + + func setSinkAndSubscription(sink: Disposable, subscription: Disposable) { + self._sink = sink + self._subscription = subscription + + let previousState = fetchOr(self._state, DisposeState.sinkAndSubscriptionSet.rawValue) + if (previousState & DisposeState.sinkAndSubscriptionSet.rawValue) != 0 { + rxFatalError("Sink and subscription were already set") + } + + if (previousState & DisposeState.disposed.rawValue) != 0 { + sink.dispose() + subscription.dispose() + self._sink = nil + self._subscription = nil + } + } + + func dispose() { + let previousState = fetchOr(self._state, DisposeState.disposed.rawValue) + + if (previousState & DisposeState.disposed.rawValue) != 0 { + return + } + + if (previousState & DisposeState.sinkAndSubscriptionSet.rawValue) != 0 { + guard let sink = self._sink else { + rxFatalError("Sink not set") + } + guard let subscription = self._subscription else { + rxFatalError("Subscription not set") + } + + sink.dispose() + subscription.dispose() + + self._sink = nil + self._subscription = nil + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift new file mode 100644 index 000000000000..67a441204b0f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Range.swift @@ -0,0 +1,73 @@ +// +// Range.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType where E : RxAbstractInteger { + /** + Generates an observable sequence of integral numbers within a specified range, using the specified scheduler to generate and send out observer messages. + + - seealso: [range operator on reactivex.io](http://reactivex.io/documentation/operators/range.html) + + - parameter start: The value of the first integer in the sequence. + - parameter count: The number of sequential integers to generate. + - parameter scheduler: Scheduler to run the generator loop on. + - returns: An observable sequence that contains a range of sequential integral numbers. + */ + public static func range(start: E, count: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return RangeProducer(start: start, count: count, scheduler: scheduler) + } +} + +final private class RangeProducer: Producer { + fileprivate let _start: E + fileprivate let _count: E + fileprivate let _scheduler: ImmediateSchedulerType + + init(start: E, count: E, scheduler: ImmediateSchedulerType) { + guard count >= 0 else { + rxFatalError("count can't be negative") + } + + guard start &+ (count - 1) >= start || count == 0 else { + rxFatalError("overflow of count") + } + + self._start = start + self._count = count + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = RangeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +final private class RangeSink: Sink where O.E: RxAbstractInteger { + typealias Parent = RangeProducer + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.scheduleRecursive(0 as O.E) { i, recurse in + if i < self._parent._count { + self.forwardOn(.next(self._parent._start + i)) + recurse(i + 1) + } + else { + self.forwardOn(.completed) + self.dispose() + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift new file mode 100644 index 000000000000..5b3efd82e526 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Reduce.swift @@ -0,0 +1,109 @@ +// +// Reduce.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + + +extension ObservableType { + /** + Applies an `accumulator` function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified `seed` value is used as the initial accumulator value. + + For aggregation behavior with incremental intermediate results, see `scan`. + + - seealso: [reduce operator on reactivex.io](http://reactivex.io/documentation/operators/reduce.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: A accumulator function to be invoked on each element. + - parameter mapResult: A function to transform the final accumulator value into the result value. + - returns: An observable sequence containing a single element with the final accumulator value. + */ + public func reduce(_ seed: A, accumulator: @escaping (A, E) throws -> A, mapResult: @escaping (A) throws -> R) + -> Observable { + return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: mapResult) + } + + /** + Applies an `accumulator` function over an observable sequence, returning the result of the aggregation as a single element in the result sequence. The specified `seed` value is used as the initial accumulator value. + + For aggregation behavior with incremental intermediate results, see `scan`. + + - seealso: [reduce operator on reactivex.io](http://reactivex.io/documentation/operators/reduce.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: A accumulator function to be invoked on each element. + - returns: An observable sequence containing a single element with the final accumulator value. + */ + public func reduce(_ seed: A, accumulator: @escaping (A, E) throws -> A) + -> Observable { + return Reduce(source: self.asObservable(), seed: seed, accumulator: accumulator, mapResult: { $0 }) + } +} + +final private class ReduceSink: Sink, ObserverType { + typealias ResultType = O.E + typealias Parent = Reduce + + private let _parent: Parent + private var _accumulation: AccumulateType + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._accumulation = parent._seed + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + self._accumulation = try self._parent._accumulator(self._accumulation, value) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + case .error(let e): + self.forwardOn(.error(e)) + self.dispose() + case .completed: + do { + let result = try self._parent._mapResult(self._accumulation) + self.forwardOn(.next(result)) + self.forwardOn(.completed) + self.dispose() + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + } + } +} + +final private class Reduce: Producer { + typealias AccumulatorType = (AccumulateType, SourceType) throws -> AccumulateType + typealias ResultSelectorType = (AccumulateType) throws -> ResultType + + fileprivate let _source: Observable + fileprivate let _seed: AccumulateType + fileprivate let _accumulator: AccumulatorType + fileprivate let _mapResult: ResultSelectorType + + init(source: Observable, seed: AccumulateType, accumulator: @escaping AccumulatorType, mapResult: @escaping ResultSelectorType) { + self._source = source + self._seed = seed + self._accumulator = accumulator + self._mapResult = mapResult + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = ReduceSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift new file mode 100644 index 000000000000..f430c90b8191 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Repeat.swift @@ -0,0 +1,57 @@ +// +// Repeat.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/13/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Generates an observable sequence that repeats the given element infinitely, using the specified scheduler to send out observer messages. + + - seealso: [repeat operator on reactivex.io](http://reactivex.io/documentation/operators/repeat.html) + + - parameter element: Element to repeat. + - parameter scheduler: Scheduler to run the producer loop on. + - returns: An observable sequence that repeats the given element infinitely. + */ + public static func repeatElement(_ element: E, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return RepeatElement(element: element, scheduler: scheduler) + } +} + +final private class RepeatElement: Producer { + fileprivate let _element: Element + fileprivate let _scheduler: ImmediateSchedulerType + + init(element: Element, scheduler: ImmediateSchedulerType) { + self._element = element + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = RepeatElementSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + + return (sink: sink, subscription: subscription) + } +} + +final private class RepeatElementSink: Sink { + typealias Parent = RepeatElement + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.scheduleRecursive(self._parent._element) { e, recurse in + self.forwardOn(.next(e)) + recurse(e) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift new file mode 100644 index 000000000000..ce82df9bcc82 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/RetryWhen.swift @@ -0,0 +1,182 @@ +// +// RetryWhen.swift +// RxSwift +// +// Created by Junior B. on 06/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Repeats the source observable sequence on error when the notifier emits a next value. + If the source observable errors and the notifier completes, it will complete the source sequence. + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - parameter notificationHandler: A handler that is passed an observable sequence of errors raised by the source observable and returns and observable that either continues, completes or errors. This behavior is then applied to the source observable. + - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully or is notified to error or complete. + */ + public func retryWhen(_ notificationHandler: @escaping (Observable) -> TriggerObservable) + -> Observable { + return RetryWhenSequence(sources: InfiniteSequence(repeatedValue: self.asObservable()), notificationHandler: notificationHandler) + } + + /** + Repeats the source observable sequence on error when the notifier emits a next value. + If the source observable errors and the notifier completes, it will complete the source sequence. + + - seealso: [retry operator on reactivex.io](http://reactivex.io/documentation/operators/retry.html) + + - parameter notificationHandler: A handler that is passed an observable sequence of errors raised by the source observable and returns and observable that either continues, completes or errors. This behavior is then applied to the source observable. + - returns: An observable sequence producing the elements of the given sequence repeatedly until it terminates successfully or is notified to error or complete. + */ + public func retryWhen(_ notificationHandler: @escaping (Observable) -> TriggerObservable) + -> Observable { + return RetryWhenSequence(sources: InfiniteSequence(repeatedValue: self.asObservable()), notificationHandler: notificationHandler) + } +} + +final private class RetryTriggerSink + : ObserverType where S.Iterator.Element: ObservableType, S.Iterator.Element.E == O.E { + typealias E = TriggerObservable.E + + typealias Parent = RetryWhenSequenceSinkIter + + fileprivate let _parent: Parent + + init(parent: Parent) { + self._parent = parent + } + + func on(_ event: Event) { + switch event { + case .next: + self._parent._parent._lastError = nil + self._parent._parent.schedule(.moveNext) + case .error(let e): + self._parent._parent.forwardOn(.error(e)) + self._parent._parent.dispose() + case .completed: + self._parent._parent.forwardOn(.completed) + self._parent._parent.dispose() + } + } +} + +final private class RetryWhenSequenceSinkIter + : ObserverType + , Disposable where S.Iterator.Element: ObservableType, S.Iterator.Element.E == O.E { + typealias E = O.E + typealias Parent = RetryWhenSequenceSink + + fileprivate let _parent: Parent + fileprivate let _errorHandlerSubscription = SingleAssignmentDisposable() + fileprivate let _subscription: Disposable + + init(parent: Parent, subscription: Disposable) { + self._parent = parent + self._subscription = subscription + } + + func on(_ event: Event) { + switch event { + case .next: + self._parent.forwardOn(event) + case .error(let error): + self._parent._lastError = error + + if let failedWith = error as? Error { + // dispose current subscription + self._subscription.dispose() + + let errorHandlerSubscription = self._parent._notifier.subscribe(RetryTriggerSink(parent: self)) + self._errorHandlerSubscription.setDisposable(errorHandlerSubscription) + self._parent._errorSubject.on(.next(failedWith)) + } + else { + self._parent.forwardOn(.error(error)) + self._parent.dispose() + } + case .completed: + self._parent.forwardOn(event) + self._parent.dispose() + } + } + + final func dispose() { + self._subscription.dispose() + self._errorHandlerSubscription.dispose() + } +} + +final private class RetryWhenSequenceSink + : TailRecursiveSink where S.Iterator.Element: ObservableType, S.Iterator.Element.E == O.E { + typealias Element = O.E + typealias Parent = RetryWhenSequence + + let _lock = RecursiveLock() + + fileprivate let _parent: Parent + + fileprivate var _lastError: Swift.Error? + fileprivate let _errorSubject = PublishSubject() + fileprivate let _handler: Observable + fileprivate let _notifier = PublishSubject() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._handler = parent._notificationHandler(self._errorSubject).asObservable() + super.init(observer: observer, cancel: cancel) + } + + override func done() { + if let lastError = self._lastError { + self.forwardOn(.error(lastError)) + self._lastError = nil + } + else { + self.forwardOn(.completed) + } + + self.dispose() + } + + override func extract(_ observable: Observable) -> SequenceGenerator? { + // It is important to always return `nil` here because there are sideffects in the `run` method + // that are dependant on particular `retryWhen` operator so single operator stack can't be reused in this + // case. + return nil + } + + override func subscribeToNext(_ source: Observable) -> Disposable { + let subscription = SingleAssignmentDisposable() + let iter = RetryWhenSequenceSinkIter(parent: self, subscription: subscription) + subscription.setDisposable(source.subscribe(iter)) + return iter + } + + override func run(_ sources: SequenceGenerator) -> Disposable { + let triggerSubscription = self._handler.subscribe(self._notifier.asObserver()) + let superSubscription = super.run(sources) + return Disposables.create(superSubscription, triggerSubscription) + } +} + +final private class RetryWhenSequence: Producer where S.Iterator.Element: ObservableType { + typealias Element = S.Iterator.Element.E + + fileprivate let _sources: S + fileprivate let _notificationHandler: (Observable) -> TriggerObservable + + init(sources: S, notificationHandler: @escaping (Observable) -> TriggerObservable) { + self._sources = sources + self._notificationHandler = notificationHandler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = RetryWhenSequenceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run((self._sources.makeIterator(), nil)) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift new file mode 100644 index 000000000000..a930f0d456e1 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sample.swift @@ -0,0 +1,133 @@ +// +// Sample.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/1/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Samples the source observable sequence using a sampler observable sequence producing sampling ticks. + + Upon each sampling tick, the latest element (if any) in the source sequence during the last sampling interval is sent to the resulting sequence. + + **In case there were no new elements between sampler ticks, no element is sent to the resulting sequence.** + + - seealso: [sample operator on reactivex.io](http://reactivex.io/documentation/operators/sample.html) + + - parameter sampler: Sampling tick sequence. + - returns: Sampled observable sequence. + */ + public func sample(_ sampler: O) + -> Observable { + return Sample(source: self.asObservable(), sampler: sampler.asObservable()) + } +} + +final private class SamplerSink + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias E = SampleType + + typealias Parent = SampleSequenceSink + + fileprivate let _parent: Parent + + var _lock: RecursiveLock { + return self._parent._lock + } + + init(parent: Parent) { + self._parent = parent + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next, .completed: + if let element = _parent._element { + self._parent._element = nil + self._parent.forwardOn(.next(element)) + } + + if self._parent._atEnd { + self._parent.forwardOn(.completed) + self._parent.dispose() + } + case .error(let e): + self._parent.forwardOn(.error(e)) + self._parent.dispose() + } + } +} + +final private class SampleSequenceSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = O.E + typealias Parent = Sample + + fileprivate let _parent: Parent + + let _lock = RecursiveLock() + + // state + fileprivate var _element = nil as Element? + fileprivate var _atEnd = false + + fileprivate let _sourceSubscription = SingleAssignmentDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + self._sourceSubscription.setDisposable(self._parent._source.subscribe(self)) + let samplerSubscription = self._parent._sampler.subscribe(SamplerSink(parent: self)) + + return Disposables.create(_sourceSubscription, samplerSubscription) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + self._element = element + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self._atEnd = true + self._sourceSubscription.dispose() + } + } + +} + +final private class Sample: Producer { + fileprivate let _source: Observable + fileprivate let _sampler: Observable + + init(source: Observable, sampler: Observable) { + self._source = source + self._sampler = sampler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SampleSequenceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift new file mode 100644 index 000000000000..c6df6084e9be --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Scan.swift @@ -0,0 +1,101 @@ +// +// Scan.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. + + For aggregation behavior with no intermediate results, see `reduce`. + + - seealso: [scan operator on reactivex.io](http://reactivex.io/documentation/operators/scan.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: An accumulator function to be invoked on each element. + - returns: An observable sequence containing the accumulated values. + */ + public func scan(into seed: A, accumulator: @escaping (inout A, E) throws -> Void) + -> Observable { + return Scan(source: self.asObservable(), seed: seed, accumulator: accumulator) + } + + /** + Applies an accumulator function over an observable sequence and returns each intermediate result. The specified seed value is used as the initial accumulator value. + + For aggregation behavior with no intermediate results, see `reduce`. + + - seealso: [scan operator on reactivex.io](http://reactivex.io/documentation/operators/scan.html) + + - parameter seed: The initial accumulator value. + - parameter accumulator: An accumulator function to be invoked on each element. + - returns: An observable sequence containing the accumulated values. + */ + public func scan(_ seed: A, accumulator: @escaping (A, E) throws -> A) + -> Observable { + return Scan(source: self.asObservable(), seed: seed) { acc, element in + let currentAcc = acc + acc = try accumulator(currentAcc, element) + } + } +} + +final private class ScanSink: Sink, ObserverType { + typealias Accumulate = O.E + typealias Parent = Scan + typealias E = ElementType + + fileprivate let _parent: Parent + fileprivate var _accumulate: Accumulate + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._accumulate = parent._seed + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let element): + do { + try self._parent._accumulator(&self._accumulate, element) + self.forwardOn(.next(self._accumulate)) + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self.forwardOn(.completed) + self.dispose() + } + } + +} + +final private class Scan: Producer { + typealias Accumulator = (inout Accumulate, Element) throws -> Void + + fileprivate let _source: Observable + fileprivate let _seed: Accumulate + fileprivate let _accumulator: Accumulator + + init(source: Observable, seed: Accumulate, accumulator: @escaping Accumulator) { + self._source = source + self._seed = seed + self._accumulator = accumulator + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Accumulate { + let sink = ScanSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift new file mode 100644 index 000000000000..a7f6450a3275 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sequence.swift @@ -0,0 +1,89 @@ +// +// Sequence.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + // MARK: of + + /** + This method creates a new Observable instance with a variable number of elements. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - parameter elements: Elements to generate. + - parameter scheduler: Scheduler to send elements on. If `nil`, elements are sent immediately on subscription. + - returns: The observable sequence whose elements are pulled from the given arguments. + */ + public static func of(_ elements: E ..., scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return ObservableSequence(elements: elements, scheduler: scheduler) + } +} + +extension ObservableType { + /** + Converts an array to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - returns: The observable sequence whose elements are pulled from the given enumerable sequence. + */ + public static func from(_ array: [E], scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable { + return ObservableSequence(elements: array, scheduler: scheduler) + } + + /** + Converts a sequence to an observable sequence. + + - seealso: [from operator on reactivex.io](http://reactivex.io/documentation/operators/from.html) + + - returns: The observable sequence whose elements are pulled from the given enumerable sequence. + */ + public static func from(_ sequence: S, scheduler: ImmediateSchedulerType = CurrentThreadScheduler.instance) -> Observable where S.Iterator.Element == E { + return ObservableSequence(elements: sequence, scheduler: scheduler) + } +} + +final private class ObservableSequenceSink: Sink where S.Iterator.Element == O.E { + typealias Parent = ObservableSequence + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.scheduleRecursive(self._parent._elements.makeIterator()) { iterator, recurse in + var mutableIterator = iterator + if let next = mutableIterator.next() { + self.forwardOn(.next(next)) + recurse(mutableIterator) + } + else { + self.forwardOn(.completed) + self.dispose() + } + } + } +} + +final private class ObservableSequence: Producer { + fileprivate let _elements: S + fileprivate let _scheduler: ImmediateSchedulerType + + init(elements: S, scheduler: ImmediateSchedulerType) { + self._elements = elements + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = ObservableSequenceSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift new file mode 100644 index 000000000000..44e37d9fb73d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ShareReplayScope.swift @@ -0,0 +1,458 @@ +// +// ShareReplayScope.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/28/17. +// Copyright © 2017 Krunoslav Zaher. All rights reserved. +// + +/// Subject lifetime scope +public enum SubjectLifetimeScope { + /** + **Each connection will have it's own subject instance to store replay events.** + **Connections will be isolated from each another.** + + Configures the underlying implementation to behave equivalent to. + + ``` + source.multicast(makeSubject: { MySubject() }).refCount() + ``` + + **This is the recommended default.** + + This has the following consequences: + * `retry` or `concat` operators will function as expected because terminating the sequence will clear internal state. + * Each connection to source observable sequence will use it's own subject. + * When the number of subscribers drops from 1 to 0 and connection to source sequence is disposed, subject will be cleared. + + + ``` + let xs = Observable.deferred { () -> Observable in + print("Performing work ...") + return Observable.just(Date().timeIntervalSince1970) + } + .share(replay: 1, scope: .whileConnected) + + _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) + _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) + _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) + + ``` + + Notice how time interval is different and `Performing work ...` is printed each time) + + ``` + Performing work ... + next 1495998900.82141 + completed + + Performing work ... + next 1495998900.82359 + completed + + Performing work ... + next 1495998900.82444 + completed + + + ``` + + */ + case whileConnected + + /** + **One subject will store replay events for all connections to source.** + **Connections won't be isolated from each another.** + + Configures the underlying implementation behave equivalent to. + + ``` + source.multicast(MySubject()).refCount() + ``` + + This has the following consequences: + * Using `retry` or `concat` operators after this operator usually isn't advised. + * Each connection to source observable sequence will share the same subject. + * After number of subscribers drops from 1 to 0 and connection to source observable sequence is dispose, this operator will + continue holding a reference to the same subject. + If at some later moment a new observer initiates a new connection to source it can potentially receive + some of the stale events received during previous connection. + * After source sequence terminates any new observer will always immediately receive replayed elements and terminal event. + No new subscriptions to source observable sequence will be attempted. + + ``` + let xs = Observable.deferred { () -> Observable in + print("Performing work ...") + return Observable.just(Date().timeIntervalSince1970) + } + .share(replay: 1, scope: .forever) + + _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) + _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) + _ = xs.subscribe(onNext: { print("next \($0)") }, onCompleted: { print("completed\n") }) + ``` + + Notice how time interval is the same, replayed, and `Performing work ...` is printed only once + + ``` + Performing work ... + next 1495999013.76356 + completed + + next 1495999013.76356 + completed + + next 1495999013.76356 + completed + ``` + + */ + case forever +} + +extension ObservableType { + + /** + Returns an observable sequence that **shares a single subscription to the underlying sequence**, and immediately upon subscription replays elements in buffer. + + This operator is equivalent to: + * `.whileConnected` + ``` + // Each connection will have it's own subject instance to store replay events. + // Connections will be isolated from each another. + source.multicast(makeSubject: { Replay.create(bufferSize: replay) }).refCount() + ``` + * `.forever` + ``` + // One subject will store replay events for all connections to source. + // Connections won't be isolated from each another. + source.multicast(Replay.create(bufferSize: replay)).refCount() + ``` + + It uses optimized versions of the operators for most common operations. + + - parameter replay: Maximum element count of the replay buffer. + - parameter scope: Lifetime scope of sharing subject. For more information see `SubjectLifetimeScope` enum. + + - seealso: [shareReplay operator on reactivex.io](http://reactivex.io/documentation/operators/replay.html) + + - returns: An observable sequence that contains the elements of a sequence produced by multicasting the source sequence. + */ + public func share(replay: Int = 0, scope: SubjectLifetimeScope = .whileConnected) + -> Observable { + switch scope { + case .forever: + switch replay { + case 0: return self.multicast(PublishSubject()).refCount() + default: return self.multicast(ReplaySubject.create(bufferSize: replay)).refCount() + } + case .whileConnected: + switch replay { + case 0: return ShareWhileConnected(source: self.asObservable()) + case 1: return ShareReplay1WhileConnected(source: self.asObservable()) + default: return self.multicast(makeSubject: { ReplaySubject.create(bufferSize: replay) }).refCount() + } + } + } +} + +fileprivate final class ShareReplay1WhileConnectedConnection + : ObserverType + , SynchronizedUnsubscribeType { + typealias E = Element + typealias Observers = AnyObserver.s + typealias DisposeKey = Observers.KeyType + + typealias Parent = ShareReplay1WhileConnected + private let _parent: Parent + private let _subscription = SingleAssignmentDisposable() + + private let _lock: RecursiveLock + private var _disposed: Bool = false + fileprivate var _observers = Observers() + fileprivate var _element: Element? + + init(parent: Parent, lock: RecursiveLock) { + self._parent = parent + self._lock = lock + + #if TRACE_RESOURCES + _ = Resources.incrementTotal() + #endif + } + + final func on(_ event: Event) { + self._lock.lock() + let observers = self._synchronized_on(event) + self._lock.unlock() + dispatch(observers, event) + } + + final private func _synchronized_on(_ event: Event) -> Observers { + if self._disposed { + return Observers() + } + + switch event { + case .next(let element): + self._element = element + return self._observers + case .error, .completed: + let observers = self._observers + self._synchronized_dispose() + return observers + } + } + + final func connect() { + self._subscription.setDisposable(self._parent._source.subscribe(self)) + } + + final func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == Element { + self._lock.lock(); defer { self._lock.unlock() } + if let element = self._element { + observer.on(.next(element)) + } + + let disposeKey = self._observers.insert(observer.on) + + return SubscriptionDisposable(owner: self, key: disposeKey) + } + + final private func _synchronized_dispose() { + self._disposed = true + if self._parent._connection === self { + self._parent._connection = nil + } + self._observers = Observers() + } + + final func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { + self._lock.lock() + let shouldDisconnect = self._synchronized_unsubscribe(disposeKey) + self._lock.unlock() + if shouldDisconnect { + self._subscription.dispose() + } + } + + @inline(__always) + final private func _synchronized_unsubscribe(_ disposeKey: DisposeKey) -> Bool { + // if already unsubscribed, just return + if self._observers.removeKey(disposeKey) == nil { + return false + } + + if self._observers.count == 0 { + self._synchronized_dispose() + return true + } + + return false + } + + #if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } + #endif +} + +// optimized version of share replay for most common case +final private class ShareReplay1WhileConnected + : Observable { + + fileprivate typealias Connection = ShareReplay1WhileConnectedConnection + + fileprivate let _source: Observable + + fileprivate let _lock = RecursiveLock() + + fileprivate var _connection: Connection? + + init(source: Observable) { + self._source = source + } + + override func subscribe(_ observer: O) -> Disposable where O.E == E { + self._lock.lock() + + let connection = self._synchronized_subscribe(observer) + let count = connection._observers.count + + let disposable = connection._synchronized_subscribe(observer) + + self._lock.unlock() + + if count == 0 { + connection.connect() + } + + return disposable + } + + @inline(__always) + private func _synchronized_subscribe(_ observer: O) -> Connection where O.E == E { + let connection: Connection + + if let existingConnection = self._connection { + connection = existingConnection + } + else { + connection = ShareReplay1WhileConnectedConnection( + parent: self, + lock: self._lock) + self._connection = connection + } + + return connection + } +} + +fileprivate final class ShareWhileConnectedConnection + : ObserverType + , SynchronizedUnsubscribeType { + typealias E = Element + typealias Observers = AnyObserver.s + typealias DisposeKey = Observers.KeyType + + typealias Parent = ShareWhileConnected + private let _parent: Parent + private let _subscription = SingleAssignmentDisposable() + + private let _lock: RecursiveLock + private var _disposed: Bool = false + fileprivate var _observers = Observers() + + init(parent: Parent, lock: RecursiveLock) { + self._parent = parent + self._lock = lock + + #if TRACE_RESOURCES + _ = Resources.incrementTotal() + #endif + } + + final func on(_ event: Event) { + self._lock.lock() + let observers = self._synchronized_on(event) + self._lock.unlock() + dispatch(observers, event) + } + + final private func _synchronized_on(_ event: Event) -> Observers { + if self._disposed { + return Observers() + } + + switch event { + case .next: + return self._observers + case .error, .completed: + let observers = self._observers + self._synchronized_dispose() + return observers + } + } + + final func connect() { + self._subscription.setDisposable(self._parent._source.subscribe(self)) + } + + final func _synchronized_subscribe(_ observer: O) -> Disposable where O.E == Element { + self._lock.lock(); defer { self._lock.unlock() } + + let disposeKey = self._observers.insert(observer.on) + + return SubscriptionDisposable(owner: self, key: disposeKey) + } + + final private func _synchronized_dispose() { + self._disposed = true + if self._parent._connection === self { + self._parent._connection = nil + } + self._observers = Observers() + } + + final func synchronizedUnsubscribe(_ disposeKey: DisposeKey) { + self._lock.lock() + let shouldDisconnect = self._synchronized_unsubscribe(disposeKey) + self._lock.unlock() + if shouldDisconnect { + self._subscription.dispose() + } + } + + @inline(__always) + final private func _synchronized_unsubscribe(_ disposeKey: DisposeKey) -> Bool { + // if already unsubscribed, just return + if self._observers.removeKey(disposeKey) == nil { + return false + } + + if self._observers.count == 0 { + self._synchronized_dispose() + return true + } + + return false + } + + #if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } + #endif +} + +// optimized version of share replay for most common case +final private class ShareWhileConnected + : Observable { + + fileprivate typealias Connection = ShareWhileConnectedConnection + + fileprivate let _source: Observable + + fileprivate let _lock = RecursiveLock() + + fileprivate var _connection: Connection? + + init(source: Observable) { + self._source = source + } + + override func subscribe(_ observer: O) -> Disposable where O.E == E { + self._lock.lock() + + let connection = self._synchronized_subscribe(observer) + let count = connection._observers.count + + let disposable = connection._synchronized_subscribe(observer) + + self._lock.unlock() + + if count == 0 { + connection.connect() + } + + return disposable + } + + @inline(__always) + private func _synchronized_subscribe(_ observer: O) -> Connection where O.E == E { + let connection: Connection + + if let existingConnection = self._connection { + connection = existingConnection + } + else { + connection = ShareWhileConnectedConnection( + parent: self, + lock: self._lock) + self._connection = connection + } + + return connection + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift new file mode 100644 index 000000000000..cf40b65e3d3c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SingleAsync.swift @@ -0,0 +1,105 @@ +// +// SingleAsync.swift +// RxSwift +// +// Created by Junior B. on 09/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + The single operator is similar to first, but throws a `RxError.noElements` or `RxError.moreThanOneElement` + if the source Observable does not emit exactly one element before successfully completing. + + - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) + + - returns: An observable sequence that emits a single element or throws an exception if more (or none) of them are emitted. + */ + public func single() + -> Observable { + return SingleAsync(source: self.asObservable()) + } + + /** + The single operator is similar to first, but throws a `RxError.NoElements` or `RxError.MoreThanOneElement` + if the source Observable does not emit exactly one element before successfully completing. + + - seealso: [single operator on reactivex.io](http://reactivex.io/documentation/operators/first.html) + + - parameter predicate: A function to test each source element for a condition. + - returns: An observable sequence that emits a single element or throws an exception if more (or none) of them are emitted. + */ + public func single(_ predicate: @escaping (E) throws -> Bool) + -> Observable { + return SingleAsync(source: self.asObservable(), predicate: predicate) + } +} + +fileprivate final class SingleAsyncSink : Sink, ObserverType { + typealias ElementType = O.E + typealias Parent = SingleAsync + typealias E = ElementType + + private let _parent: Parent + private var _seenValue: Bool = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + do { + let forward = try self._parent._predicate?(value) ?? true + if !forward { + return + } + } + catch let error { + self.forwardOn(.error(error as Swift.Error)) + self.dispose() + return + } + + if self._seenValue { + self.forwardOn(.error(RxError.moreThanOneElement)) + self.dispose() + return + } + + self._seenValue = true + self.forwardOn(.next(value)) + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + if self._seenValue { + self.forwardOn(.completed) + } else { + self.forwardOn(.error(RxError.noElements)) + } + self.dispose() + } + } +} + +final class SingleAsync: Producer { + typealias Predicate = (Element) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate? + + init(source: Observable, predicate: Predicate? = nil) { + self._source = source + self._predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SingleAsyncSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift new file mode 100644 index 000000000000..9b1018b61000 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Sink.swift @@ -0,0 +1,75 @@ +// +// Sink.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +class Sink : Disposable { + fileprivate let _observer: O + fileprivate let _cancel: Cancelable + fileprivate let _disposed = AtomicInt(0) + + #if DEBUG + fileprivate let _synchronizationTracker = SynchronizationTracker() + #endif + + init(observer: O, cancel: Cancelable) { +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + self._observer = observer + self._cancel = cancel + } + + final func forwardOn(_ event: Event) { + #if DEBUG + self._synchronizationTracker.register(synchronizationErrorMessage: .default) + defer { self._synchronizationTracker.unregister() } + #endif + if isFlagSet(self._disposed, 1) { + return + } + self._observer.on(event) + } + + final func forwarder() -> SinkForward { + return SinkForward(forward: self) + } + + final var disposed: Bool { + return isFlagSet(self._disposed, 1) + } + + func dispose() { + fetchOr(self._disposed, 1) + self._cancel.dispose() + } + + deinit { +#if TRACE_RESOURCES + _ = Resources.decrementTotal() +#endif + } +} + +final class SinkForward: ObserverType { + typealias E = O.E + + private let _forward: Sink + + init(forward: Sink) { + self._forward = forward + } + + final func on(_ event: Event) { + switch event { + case .next: + self._forward._observer.on(event) + case .error, .completed: + self._forward._observer.on(event) + self._forward._cancel.dispose() + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift new file mode 100644 index 000000000000..bc49283fdb41 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Skip.swift @@ -0,0 +1,159 @@ +// +// Skip.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/25/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Bypasses a specified number of elements in an observable sequence and then returns the remaining elements. + + - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) + + - parameter count: The number of elements to skip before returning the remaining elements. + - returns: An observable sequence that contains the elements that occur after the specified index in the input sequence. + */ + public func skip(_ count: Int) + -> Observable { + return SkipCount(source: self.asObservable(), count: count) + } +} + +extension ObservableType { + + /** + Skips elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. + + - seealso: [skip operator on reactivex.io](http://reactivex.io/documentation/operators/skip.html) + + - parameter duration: Duration for skipping elements from the start of the sequence. + - parameter scheduler: Scheduler to run the timer on. + - returns: An observable sequence with the elements skipped during the specified duration from the start of the source sequence. + */ + public func skip(_ duration: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return SkipTime(source: self.asObservable(), duration: duration, scheduler: scheduler) + } +} + +// count version + +final private class SkipCountSink: Sink, ObserverType { + typealias Element = O.E + typealias Parent = SkipCount + + let parent: Parent + + var remaining: Int + + init(parent: Parent, observer: O, cancel: Cancelable) { + self.parent = parent + self.remaining = parent.count + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + + if self.remaining <= 0 { + self.forwardOn(.next(value)) + } + else { + self.remaining -= 1 + } + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self.forwardOn(event) + self.dispose() + } + } + +} + +final private class SkipCount: Producer { + let source: Observable + let count: Int + + init(source: Observable, count: Int) { + self.source = source + self.count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = self.source.subscribe(sink) + + return (sink: sink, subscription: subscription) + } +} + +// time version + +final private class SkipTimeSink: Sink, ObserverType where O.E == ElementType { + typealias Parent = SkipTime + typealias Element = ElementType + + let parent: Parent + + // state + var open = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + self.parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if self.open { + self.forwardOn(.next(value)) + } + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self.forwardOn(event) + self.dispose() + } + } + + func tick() { + self.open = true + } + + func run() -> Disposable { + let disposeTimer = self.parent.scheduler.scheduleRelative((), dueTime: self.parent.duration) { _ in + self.tick() + return Disposables.create() + } + + let disposeSubscription = self.parent.source.subscribe(self) + + return Disposables.create(disposeTimer, disposeSubscription) + } +} + +final private class SkipTime: Producer { + let source: Observable + let duration: RxTimeInterval + let scheduler: SchedulerType + + init(source: Observable, duration: RxTimeInterval, scheduler: SchedulerType) { + self.source = source + self.scheduler = scheduler + self.duration = duration + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipTimeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift new file mode 100644 index 000000000000..7681b14143d1 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipUntil.swift @@ -0,0 +1,139 @@ +// +// SkipUntil.swift +// RxSwift +// +// Created by Yury Korolev on 10/3/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns the elements from the source observable sequence that are emitted after the other observable sequence produces an element. + + - seealso: [skipUntil operator on reactivex.io](http://reactivex.io/documentation/operators/skipuntil.html) + + - parameter other: Observable sequence that starts propagation of elements of the source sequence. + - returns: An observable sequence containing the elements of the source sequence that are emitted after the other sequence emits an item. + */ + public func skipUntil(_ other: O) + -> Observable { + return SkipUntil(source: self.asObservable(), other: other.asObservable()) + } +} + +final private class SkipUntilSinkOther + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Parent = SkipUntilSink + typealias E = Other + + fileprivate let _parent: Parent + + var _lock: RecursiveLock { + return self._parent._lock + } + + let _subscription = SingleAssignmentDisposable() + + init(parent: Parent) { + self._parent = parent + #if TRACE_RESOURCES + _ = Resources.incrementTotal() + #endif + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + self._parent._forwardElements = true + self._subscription.dispose() + case .error(let e): + self._parent.forwardOn(.error(e)) + self._parent.dispose() + case .completed: + self._subscription.dispose() + } + } + + #if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } + #endif + +} + + +final private class SkipUntilSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias E = O.E + typealias Parent = SkipUntil + + let _lock = RecursiveLock() + fileprivate let _parent: Parent + fileprivate var _forwardElements = false + + fileprivate let _sourceSubscription = SingleAssignmentDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + if self._forwardElements { + self.forwardOn(event) + } + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + if self._forwardElements { + self.forwardOn(event) + } + self.dispose() + } + } + + func run() -> Disposable { + let sourceSubscription = self._parent._source.subscribe(self) + let otherObserver = SkipUntilSinkOther(parent: self) + let otherSubscription = self._parent._other.subscribe(otherObserver) + self._sourceSubscription.setDisposable(sourceSubscription) + otherObserver._subscription.setDisposable(otherSubscription) + + return Disposables.create(_sourceSubscription, otherObserver._subscription) + } +} + +final private class SkipUntil: Producer { + + fileprivate let _source: Observable + fileprivate let _other: Observable + + init(source: Observable, other: Observable) { + self._source = source + self._other = other + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipUntilSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift new file mode 100644 index 000000000000..a0fbdf5585e9 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SkipWhile.swift @@ -0,0 +1,75 @@ +// +// SkipWhile.swift +// RxSwift +// +// Created by Yury Korolev on 10/9/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Bypasses elements in an observable sequence as long as a specified condition is true and then returns the remaining elements. + + - seealso: [skipWhile operator on reactivex.io](http://reactivex.io/documentation/operators/skipwhile.html) + + - parameter predicate: A function to test each element for a condition. + - returns: An observable sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. + */ + public func skipWhile(_ predicate: @escaping (E) throws -> Bool) -> Observable { + return SkipWhile(source: self.asObservable(), predicate: predicate) + } +} + +final private class SkipWhileSink: Sink, ObserverType { + typealias Element = O.E + typealias Parent = SkipWhile + + fileprivate let _parent: Parent + fileprivate var _running = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !self._running { + do { + self._running = try !self._parent._predicate(value) + } catch let e { + self.forwardOn(.error(e)) + self.dispose() + return + } + } + + if self._running { + self.forwardOn(.next(value)) + } + case .error, .completed: + self.forwardOn(event) + self.dispose() + } + } +} + +final private class SkipWhile: Producer { + typealias Predicate = (Element) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate + + init(source: Observable, predicate: @escaping Predicate) { + self._source = source + self._predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SkipWhileSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift new file mode 100644 index 000000000000..842f4afbc0cb --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/StartWith.swift @@ -0,0 +1,42 @@ +// +// StartWith.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Prepends a sequence of values to an observable sequence. + + - seealso: [startWith operator on reactivex.io](http://reactivex.io/documentation/operators/startwith.html) + + - parameter elements: Elements to prepend to the specified sequence. + - returns: The source sequence prepended with the specified values. + */ + public func startWith(_ elements: E ...) + -> Observable { + return StartWith(source: self.asObservable(), elements: elements) + } +} + +final private class StartWith: Producer { + let elements: [Element] + let source: Observable + + init(source: Observable, elements: [Element]) { + self.source = source + self.elements = elements + super.init() + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + for e in self.elements { + observer.on(.next(e)) + } + + return (sink: Disposables.create(), subscription: self.source.subscribe(observer)) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift new file mode 100644 index 000000000000..2d0d34853248 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SubscribeOn.swift @@ -0,0 +1,83 @@ +// +// SubscribeOn.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Wraps the source sequence in order to run its subscription and unsubscription logic on the specified + scheduler. + + This operation is not commonly used. + + This only performs the side-effects of subscription and unsubscription on the specified scheduler. + + In order to invoke observer callbacks on a `scheduler`, use `observeOn`. + + - seealso: [subscribeOn operator on reactivex.io](http://reactivex.io/documentation/operators/subscribeon.html) + + - parameter scheduler: Scheduler to perform subscription and unsubscription actions on. + - returns: The source sequence whose subscriptions and unsubscriptions happen on the specified scheduler. + */ + public func subscribeOn(_ scheduler: ImmediateSchedulerType) + -> Observable { + return SubscribeOn(source: self, scheduler: scheduler) + } +} + +final private class SubscribeOnSink: Sink, ObserverType where Ob.E == O.E { + typealias Element = O.E + typealias Parent = SubscribeOn + + let parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self.parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + self.forwardOn(event) + + if event.isStopEvent { + self.dispose() + } + } + + func run() -> Disposable { + let disposeEverything = SerialDisposable() + let cancelSchedule = SingleAssignmentDisposable() + + disposeEverything.disposable = cancelSchedule + + let disposeSchedule = self.parent.scheduler.schedule(()) { _ -> Disposable in + let subscription = self.parent.source.subscribe(self) + disposeEverything.disposable = ScheduledDisposable(scheduler: self.parent.scheduler, disposable: subscription) + return Disposables.create() + } + + cancelSchedule.setDisposable(disposeSchedule) + + return disposeEverything + } +} + +final private class SubscribeOn: Producer { + let source: Ob + let scheduler: ImmediateSchedulerType + + init(source: Ob, scheduler: ImmediateSchedulerType) { + self.source = source + self.scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Ob.E { + let sink = SubscribeOnSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift new file mode 100644 index 000000000000..5139f0eccd66 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Switch.swift @@ -0,0 +1,233 @@ +// +// Switch.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Projects each element of an observable sequence into a new sequence of observable sequences and then + transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence. + + It is a combination of `map` + `switchLatest` operator + + - seealso: [flatMapLatest operator on reactivex.io](http://reactivex.io/documentation/operators/flatmap.html) + + - parameter selector: A transform function to apply to each element. + - returns: An observable sequence whose elements are the result of invoking the transform function on each element of source producing an + Observable of Observable sequences and that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + public func flatMapLatest(_ selector: @escaping (E) throws -> O) + -> Observable { + return FlatMapLatest(source: self.asObservable(), selector: selector) + } +} + +extension ObservableType where E : ObservableConvertibleType { + + /** + Transforms an observable sequence of observable sequences into an observable sequence + producing values only from the most recent observable sequence. + + Each time a new inner observable sequence is received, unsubscribe from the + previous inner observable sequence. + + - seealso: [switch operator on reactivex.io](http://reactivex.io/documentation/operators/switch.html) + + - returns: The observable sequence that at any point in time produces the elements of the most recent inner observable sequence that has been received. + */ + public func switchLatest() -> Observable { + return Switch(source: self.asObservable()) + } +} + +private class SwitchSink + : Sink + , ObserverType where S.E == O.E { + typealias E = SourceType + + fileprivate let _subscriptions: SingleAssignmentDisposable = SingleAssignmentDisposable() + fileprivate let _innerSubscription: SerialDisposable = SerialDisposable() + + let _lock = RecursiveLock() + + // state + fileprivate var _stopped = false + fileprivate var _latest = 0 + fileprivate var _hasLatest = false + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func run(_ source: Observable) -> Disposable { + let subscription = source.subscribe(self) + self._subscriptions.setDisposable(subscription) + return Disposables.create(_subscriptions, _innerSubscription) + } + + func performMap(_ element: SourceType) throws -> S { + rxAbstractMethod() + } + + @inline(__always) + final private func nextElementArrived(element: E) -> (Int, Observable)? { + self._lock.lock(); defer { self._lock.unlock() } // { + do { + let observable = try self.performMap(element).asObservable() + self._hasLatest = true + self._latest = self._latest &+ 1 + return (self._latest, observable) + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + + return nil + // } + } + + func on(_ event: Event) { + switch event { + case .next(let element): + if let (latest, observable) = self.nextElementArrived(element: element) { + let d = SingleAssignmentDisposable() + self._innerSubscription.disposable = d + + let observer = SwitchSinkIter(parent: self, id: latest, _self: d) + let disposable = observable.subscribe(observer) + d.setDisposable(disposable) + } + case .error(let error): + self._lock.lock(); defer { self._lock.unlock() } + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self._lock.lock(); defer { self._lock.unlock() } + self._stopped = true + + self._subscriptions.dispose() + + if !self._hasLatest { + self.forwardOn(.completed) + self.dispose() + } + } + } +} + +final private class SwitchSinkIter + : ObserverType + , LockOwnerType + , SynchronizedOnType where S.E == O.E { + typealias E = S.E + typealias Parent = SwitchSink + + fileprivate let _parent: Parent + fileprivate let _id: Int + fileprivate let _self: Disposable + + var _lock: RecursiveLock { + return self._parent._lock + } + + init(parent: Parent, id: Int, _self: Disposable) { + self._parent = parent + self._id = id + self._self = _self + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: break + case .error, .completed: + self._self.dispose() + } + + if self._parent._latest != self._id { + return + } + + switch event { + case .next: + self._parent.forwardOn(event) + case .error: + self._parent.forwardOn(event) + self._parent.dispose() + case .completed: + self._parent._hasLatest = false + if self._parent._stopped { + self._parent.forwardOn(event) + self._parent.dispose() + } + } + } +} + +// MARK: Specializations + +final private class SwitchIdentitySink: SwitchSink where O.E == S.E { + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: S) throws -> S { + return element + } +} + +final private class MapSwitchSink: SwitchSink where O.E == S.E { + typealias Selector = (SourceType) throws -> S + + fileprivate let _selector: Selector + + init(selector: @escaping Selector, observer: O, cancel: Cancelable) { + self._selector = selector + super.init(observer: observer, cancel: cancel) + } + + override func performMap(_ element: SourceType) throws -> S { + return try self._selector(element) + } +} + +// MARK: Producers + +final private class Switch: Producer { + fileprivate let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = SwitchIdentitySink(observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} + +final private class FlatMapLatest: Producer { + typealias Selector = (SourceType) throws -> S + + fileprivate let _source: Observable + fileprivate let _selector: Selector + + init(source: Observable, selector: @escaping Selector) { + self._source = source + self._selector = selector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == S.E { + let sink = MapSwitchSink(selector: self._selector, observer: observer, cancel: cancel) + let subscription = sink.run(self._source) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift new file mode 100644 index 000000000000..2ce6f246a270 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/SwitchIfEmpty.swift @@ -0,0 +1,104 @@ +// +// SwitchIfEmpty.swift +// RxSwift +// +// Created by sergdort on 23/12/2016. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Returns the elements of the specified sequence or `switchTo` sequence if the sequence is empty. + + - seealso: [DefaultIfEmpty operator on reactivex.io](http://reactivex.io/documentation/operators/defaultifempty.html) + + - parameter switchTo: Observable sequence being returned when source sequence is empty. + - returns: Observable sequence that contains elements from switchTo sequence if source is empty, otherwise returns source sequence elements. + */ + public func ifEmpty(switchTo other: Observable) -> Observable { + return SwitchIfEmpty(source: self.asObservable(), ifEmpty: other) + } +} + +final private class SwitchIfEmpty: Producer { + + private let _source: Observable + private let _ifEmpty: Observable + + init(source: Observable, ifEmpty: Observable) { + self._source = source + self._ifEmpty = ifEmpty + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = SwitchIfEmptySink(ifEmpty: self._ifEmpty, + observer: observer, + cancel: cancel) + let subscription = sink.run(self._source.asObservable()) + + return (sink: sink, subscription: subscription) + } +} + +final private class SwitchIfEmptySink: Sink + , ObserverType { + typealias E = O.E + + private let _ifEmpty: Observable + private var _isEmpty = true + private let _ifEmptySubscription = SingleAssignmentDisposable() + + init(ifEmpty: Observable, observer: O, cancel: Cancelable) { + self._ifEmpty = ifEmpty + super.init(observer: observer, cancel: cancel) + } + + func run(_ source: Observable) -> Disposable { + let subscription = source.subscribe(self) + return Disposables.create(subscription, _ifEmptySubscription) + } + + func on(_ event: Event) { + switch event { + case .next: + self._isEmpty = false + self.forwardOn(event) + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + guard self._isEmpty else { + self.forwardOn(.completed) + self.dispose() + return + } + let ifEmptySink = SwitchIfEmptySinkIter(parent: self) + self._ifEmptySubscription.setDisposable(self._ifEmpty.subscribe(ifEmptySink)) + } + } +} + +final private class SwitchIfEmptySinkIter + : ObserverType { + typealias E = O.E + typealias Parent = SwitchIfEmptySink + + private let _parent: Parent + + init(parent: Parent) { + self._parent = parent + } + + func on(_ event: Event) { + switch event { + case .next: + self._parent.forwardOn(event) + case .error: + self._parent.forwardOn(event) + self._parent.dispose() + case .completed: + self._parent.forwardOn(event) + self._parent.dispose() + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift new file mode 100644 index 000000000000..cbfb57fcac1b --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Take.swift @@ -0,0 +1,180 @@ +// +// Take.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/12/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns a specified number of contiguous elements from the start of an observable sequence. + + - seealso: [take operator on reactivex.io](http://reactivex.io/documentation/operators/take.html) + + - parameter count: The number of elements to return. + - returns: An observable sequence that contains the specified number of elements from the start of the input sequence. + */ + public func take(_ count: Int) + -> Observable { + if count == 0 { + return Observable.empty() + } + else { + return TakeCount(source: self.asObservable(), count: count) + } + } +} + +extension ObservableType { + + /** + Takes elements for the specified duration from the start of the observable source sequence, using the specified scheduler to run timers. + + - seealso: [take operator on reactivex.io](http://reactivex.io/documentation/operators/take.html) + + - parameter duration: Duration for taking elements from the start of the sequence. + - parameter scheduler: Scheduler to run the timer on. + - returns: An observable sequence with the elements taken during the specified duration from the start of the source sequence. + */ + public func take(_ duration: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return TakeTime(source: self.asObservable(), duration: duration, scheduler: scheduler) + } +} + +// count version + +final private class TakeCountSink: Sink, ObserverType { + typealias E = O.E + typealias Parent = TakeCount + + private let _parent: Parent + + private var _remaining: Int + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._remaining = parent._count + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + + if self._remaining > 0 { + self._remaining -= 1 + + self.forwardOn(.next(value)) + + if self._remaining == 0 { + self.forwardOn(.completed) + self.dispose() + } + } + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self.forwardOn(event) + self.dispose() + } + } + +} + +final private class TakeCount: Producer { + fileprivate let _source: Observable + fileprivate let _count: Int + + init(source: Observable, count: Int) { + if count < 0 { + rxFatalError("count can't be negative") + } + self._source = source + self._count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} + +// time version + +final private class TakeTimeSink + : Sink + , LockOwnerType + , ObserverType + , SynchronizedOnType where O.E == ElementType { + typealias Parent = TakeTime + typealias E = ElementType + + fileprivate let _parent: Parent + + let _lock = RecursiveLock() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let value): + self.forwardOn(.next(value)) + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self.forwardOn(event) + self.dispose() + } + } + + func tick() { + self._lock.lock(); defer { self._lock.unlock() } + + self.forwardOn(.completed) + self.dispose() + } + + func run() -> Disposable { + let disposeTimer = self._parent._scheduler.scheduleRelative((), dueTime: self._parent._duration) { _ in + self.tick() + return Disposables.create() + } + + let disposeSubscription = self._parent._source.subscribe(self) + + return Disposables.create(disposeTimer, disposeSubscription) + } +} + +final private class TakeTime: Producer { + typealias TimeInterval = RxTimeInterval + + fileprivate let _source: Observable + fileprivate let _duration: TimeInterval + fileprivate let _scheduler: SchedulerType + + init(source: Observable, duration: TimeInterval, scheduler: SchedulerType) { + self._source = source + self._scheduler = scheduler + self._duration = duration + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeTimeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift new file mode 100644 index 000000000000..22672964282d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeLast.swift @@ -0,0 +1,78 @@ +// +// TakeLast.swift +// RxSwift +// +// Created by Tomi Koskinen on 25/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns a specified number of contiguous elements from the end of an observable sequence. + + This operator accumulates a buffer with a length enough to store elements count elements. Upon completion of the source sequence, this buffer is drained on the result sequence. This causes the elements to be delayed. + + - seealso: [takeLast operator on reactivex.io](http://reactivex.io/documentation/operators/takelast.html) + + - parameter count: Number of elements to take from the end of the source sequence. + - returns: An observable sequence containing the specified number of elements from the end of the source sequence. + */ + public func takeLast(_ count: Int) + -> Observable { + return TakeLast(source: self.asObservable(), count: count) + } +} + +final private class TakeLastSink: Sink, ObserverType { + typealias E = O.E + typealias Parent = TakeLast + + private let _parent: Parent + + private var _elements: Queue + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._elements = Queue(capacity: parent._count + 1) + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + self._elements.enqueue(value) + if self._elements.count > self._parent._count { + _ = self._elements.dequeue() + } + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + for e in self._elements { + self.forwardOn(.next(e)) + } + self.forwardOn(.completed) + self.dispose() + } + } +} + +final private class TakeLast: Producer { + fileprivate let _source: Observable + fileprivate let _count: Int + + init(source: Observable, count: Int) { + if count < 0 { + rxFatalError("count can't be negative") + } + self._source = source + self._count = count + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeLastSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift new file mode 100644 index 000000000000..b0d6927c9683 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeUntil.swift @@ -0,0 +1,227 @@ +// +// TakeUntil.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns the elements from the source observable sequence until the other observable sequence produces an element. + + - seealso: [takeUntil operator on reactivex.io](http://reactivex.io/documentation/operators/takeuntil.html) + + - parameter other: Observable sequence that terminates propagation of elements of the source sequence. + - returns: An observable sequence containing the elements of the source sequence up to the point the other sequence interrupted further propagation. + */ + public func takeUntil(_ other: O) + -> Observable { + return TakeUntil(source: self.asObservable(), other: other.asObservable()) + } + + /** + Returns elements from an observable sequence until the specified condition is true. + + - seealso: [takeUntil operator on reactivex.io](http://reactivex.io/documentation/operators/takeuntil.html) + + - parameter behavior: Whether or not to include the last element matching the predicate. + - parameter predicate: A function to test each element for a condition. + - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test passes. + */ + public func takeUntil(_ behavior: TakeUntilBehavior, + predicate: @escaping (E) throws -> Bool) + -> Observable { + return TakeUntilPredicate(source: self.asObservable(), + behavior: behavior, + predicate: predicate) + } +} + +/// Behaviors for the `takeUntil(_ behavior:predicate:)` operator. +public enum TakeUntilBehavior { + /// Include the last element matching the predicate. + case inclusive + + /// Exclude the last element matching the predicate. + case exclusive +} + +// MARK: - TakeUntil Observable +final private class TakeUntilSinkOther + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Parent = TakeUntilSink + typealias E = Other + + fileprivate let _parent: Parent + + var _lock: RecursiveLock { + return self._parent._lock + } + + fileprivate let _subscription = SingleAssignmentDisposable() + + init(parent: Parent) { + self._parent = parent +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + self._parent.forwardOn(.completed) + self._parent.dispose() + case .error(let e): + self._parent.forwardOn(.error(e)) + self._parent.dispose() + case .completed: + self._subscription.dispose() + } + } + +#if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } +#endif +} + +final private class TakeUntilSink + : Sink + , LockOwnerType + , ObserverType + , SynchronizedOnType { + typealias E = O.E + typealias Parent = TakeUntil + + fileprivate let _parent: Parent + + let _lock = RecursiveLock() + + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next: + self.forwardOn(event) + case .error: + self.forwardOn(event) + self.dispose() + case .completed: + self.forwardOn(event) + self.dispose() + } + } + + func run() -> Disposable { + let otherObserver = TakeUntilSinkOther(parent: self) + let otherSubscription = self._parent._other.subscribe(otherObserver) + otherObserver._subscription.setDisposable(otherSubscription) + let sourceSubscription = self._parent._source.subscribe(self) + + return Disposables.create(sourceSubscription, otherObserver._subscription) + } +} + +final private class TakeUntil: Producer { + + fileprivate let _source: Observable + fileprivate let _other: Observable + + init(source: Observable, other: Observable) { + self._source = source + self._other = other + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeUntilSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + +// MARK: - TakeUntil Predicate +final private class TakeUntilPredicateSink + : Sink, ObserverType { + typealias Element = O.E + typealias Parent = TakeUntilPredicate + + fileprivate let _parent: Parent + fileprivate var _running = true + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !self._running { + return + } + + do { + self._running = try !self._parent._predicate(value) + } catch let e { + self.forwardOn(.error(e)) + self.dispose() + return + } + + if self._running { + self.forwardOn(.next(value)) + } else { + if self._parent._behavior == .inclusive { + self.forwardOn(.next(value)) + } + + self.forwardOn(.completed) + self.dispose() + } + case .error, .completed: + self.forwardOn(event) + self.dispose() + } + } + +} + +final private class TakeUntilPredicate: Producer { + typealias Predicate = (Element) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate + fileprivate let _behavior: TakeUntilBehavior + + init(source: Observable, + behavior: TakeUntilBehavior, + predicate: @escaping Predicate) { + self._source = source + self._behavior = behavior + self._predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeUntilPredicateSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift new file mode 100644 index 000000000000..1e866f88c0f3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/TakeWhile.swift @@ -0,0 +1,85 @@ +// +// TakeWhile.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Returns elements from an observable sequence as long as a specified condition is true. + + - seealso: [takeWhile operator on reactivex.io](http://reactivex.io/documentation/operators/takewhile.html) + + - parameter predicate: A function to test each element for a condition. + - returns: An observable sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. + */ + public func takeWhile(_ predicate: @escaping (E) throws -> Bool) + -> Observable { + return TakeWhile(source: self.asObservable(), predicate: predicate) + } +} + +final private class TakeWhileSink + : Sink + , ObserverType { + typealias Element = O.E + typealias Parent = TakeWhile + + fileprivate let _parent: Parent + + fileprivate var _running = true + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + if !self._running { + return + } + + do { + self._running = try self._parent._predicate(value) + } catch let e { + self.forwardOn(.error(e)) + self.dispose() + return + } + + if self._running { + self.forwardOn(.next(value)) + } else { + self.forwardOn(.completed) + self.dispose() + } + case .error, .completed: + self.forwardOn(event) + self.dispose() + } + } + +} + +final private class TakeWhile: Producer { + typealias Predicate = (Element) throws -> Bool + + fileprivate let _source: Observable + fileprivate let _predicate: Predicate + + init(source: Observable, predicate: @escaping Predicate) { + self._source = source + self._predicate = predicate + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TakeWhileSink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift new file mode 100644 index 000000000000..c31ae7469912 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Throttle.swift @@ -0,0 +1,162 @@ +// +// Throttle.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date + +extension ObservableType { + + /** + Returns an Observable that emits the first and the latest item emitted by the source Observable during sequential time windows of a specified duration. + + This operator makes sure that no two elements are emitted in less then dueTime. + + - seealso: [debounce operator on reactivex.io](http://reactivex.io/documentation/operators/debounce.html) + + - parameter dueTime: Throttling duration for each element. + - parameter latest: Should latest element received in a dueTime wide time window since last element emission be emitted. + - parameter scheduler: Scheduler to run the throttle timers on. + - returns: The throttled sequence. + */ + public func throttle(_ dueTime: RxTimeInterval, latest: Bool = true, scheduler: SchedulerType) + -> Observable { + return Throttle(source: self.asObservable(), dueTime: dueTime, latest: latest, scheduler: scheduler) + } +} + +final private class ThrottleSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias Element = O.E + typealias ParentType = Throttle + + private let _parent: ParentType + + let _lock = RecursiveLock() + + // state + private var _lastUnsentElement: Element? + private var _lastSentTime: Date? + private var _completed: Bool = false + + let cancellable = SerialDisposable() + + init(parent: ParentType, observer: O, cancel: Cancelable) { + self._parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let subscription = self._parent._source.subscribe(self) + + return Disposables.create(subscription, cancellable) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case .next(let element): + let now = self._parent._scheduler.now + + let timeIntervalSinceLast: RxTimeInterval + + if let lastSendingTime = self._lastSentTime { + timeIntervalSinceLast = now.timeIntervalSince(lastSendingTime) + } + else { + timeIntervalSinceLast = self._parent._dueTime + } + + let couldSendNow = timeIntervalSinceLast >= self._parent._dueTime + + if couldSendNow { + self.sendNow(element: element) + return + } + + if !self._parent._latest { + return + } + + let isThereAlreadyInFlightRequest = self._lastUnsentElement != nil + + self._lastUnsentElement = element + + if isThereAlreadyInFlightRequest { + return + } + + let scheduler = self._parent._scheduler + let dueTime = self._parent._dueTime + + let d = SingleAssignmentDisposable() + self.cancellable.disposable = d + + d.setDisposable(scheduler.scheduleRelative(0, dueTime: dueTime - timeIntervalSinceLast, action: self.propagate)) + case .error: + self._lastUnsentElement = nil + self.forwardOn(event) + self.dispose() + case .completed: + if self._lastUnsentElement != nil { + self._completed = true + } + else { + self.forwardOn(.completed) + self.dispose() + } + } + } + + private func sendNow(element: Element) { + self._lastUnsentElement = nil + self.forwardOn(.next(element)) + // in case element processing takes a while, this should give some more room + self._lastSentTime = self._parent._scheduler.now + } + + func propagate(_: Int) -> Disposable { + self._lock.lock(); defer { self._lock.unlock() } // { + if let lastUnsentElement = self._lastUnsentElement { + self.sendNow(element: lastUnsentElement) + } + + if self._completed { + self.forwardOn(.completed) + self.dispose() + } + // } + return Disposables.create() + } +} + +final private class Throttle: Producer { + fileprivate let _source: Observable + fileprivate let _dueTime: RxTimeInterval + fileprivate let _latest: Bool + fileprivate let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, latest: Bool, scheduler: SchedulerType) { + self._source = source + self._dueTime = dueTime + self._latest = latest + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = ThrottleSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift new file mode 100644 index 000000000000..f37bf7620630 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timeout.swift @@ -0,0 +1,151 @@ +// +// Timeout.swift +// RxSwift +// +// Created by Tomi Koskinen on 13/11/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Applies a timeout policy for each element in the observable sequence. If the next element isn't received within the specified timeout duration starting from its predecessor, a TimeoutError is propagated to the observer. + + - seealso: [timeout operator on reactivex.io](http://reactivex.io/documentation/operators/timeout.html) + + - parameter dueTime: Maximum duration between values before a timeout occurs. + - parameter scheduler: Scheduler to run the timeout timer on. + - returns: An observable sequence with a `RxError.timeout` in case of a timeout. + */ + public func timeout(_ dueTime: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Timeout(source: self.asObservable(), dueTime: dueTime, other: Observable.error(RxError.timeout), scheduler: scheduler) + } + + /** + Applies a timeout policy for each element in the observable sequence, using the specified scheduler to run timeout timers. If the next element isn't received within the specified timeout duration starting from its predecessor, the other observable sequence is used to produce future messages from that point on. + + - seealso: [timeout operator on reactivex.io](http://reactivex.io/documentation/operators/timeout.html) + + - parameter dueTime: Maximum duration between values before a timeout occurs. + - parameter other: Sequence to return in case of a timeout. + - parameter scheduler: Scheduler to run the timeout timer on. + - returns: The source sequence switching to the other sequence in case of a timeout. + */ + public func timeout(_ dueTime: RxTimeInterval, other: O, scheduler: SchedulerType) + -> Observable where E == O.E { + return Timeout(source: self.asObservable(), dueTime: dueTime, other: other.asObservable(), scheduler: scheduler) + } +} + +final private class TimeoutSink: Sink, LockOwnerType, ObserverType { + typealias E = O.E + typealias Parent = Timeout + + private let _parent: Parent + + let _lock = RecursiveLock() + + private let _timerD = SerialDisposable() + private let _subscription = SerialDisposable() + + private var _id = 0 + private var _switched = false + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let original = SingleAssignmentDisposable() + self._subscription.disposable = original + + self._createTimeoutTimer() + + original.setDisposable(self._parent._source.subscribe(self)) + + return Disposables.create(_subscription, _timerD) + } + + func on(_ event: Event) { + switch event { + case .next: + var onNextWins = false + + self._lock.performLocked { + onNextWins = !self._switched + if onNextWins { + self._id = self._id &+ 1 + } + } + + if onNextWins { + self.forwardOn(event) + self._createTimeoutTimer() + } + case .error, .completed: + var onEventWins = false + + self._lock.performLocked { + onEventWins = !self._switched + if onEventWins { + self._id = self._id &+ 1 + } + } + + if onEventWins { + self.forwardOn(event) + self.dispose() + } + } + } + + private func _createTimeoutTimer() { + if self._timerD.isDisposed { + return + } + + let nextTimer = SingleAssignmentDisposable() + self._timerD.disposable = nextTimer + + let disposeSchedule = self._parent._scheduler.scheduleRelative(self._id, dueTime: self._parent._dueTime) { state in + + var timerWins = false + + self._lock.performLocked { + self._switched = (state == self._id) + timerWins = self._switched + } + + if timerWins { + self._subscription.disposable = self._parent._other.subscribe(self.forwarder()) + } + + return Disposables.create() + } + + nextTimer.setDisposable(disposeSchedule) + } +} + + +final private class Timeout: Producer { + fileprivate let _source: Observable + fileprivate let _dueTime: RxTimeInterval + fileprivate let _other: Observable + fileprivate let _scheduler: SchedulerType + + init(source: Observable, dueTime: RxTimeInterval, other: Observable, scheduler: SchedulerType) { + self._source = source + self._dueTime = dueTime + self._other = other + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Element { + let sink = TimeoutSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift new file mode 100644 index 000000000000..1715e1ec5e9e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Timer.swift @@ -0,0 +1,116 @@ +// +// Timer.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType where E : RxAbstractInteger { + /** + Returns an observable sequence that produces a value after each period, using the specified scheduler to run timers and to send out observer messages. + + - seealso: [interval operator on reactivex.io](http://reactivex.io/documentation/operators/interval.html) + + - parameter period: Period for producing the values in the resulting sequence. + - parameter scheduler: Scheduler to run the timer on. + - returns: An observable sequence that produces a value after each period. + */ + public static func interval(_ period: RxTimeInterval, scheduler: SchedulerType) + -> Observable { + return Timer( + dueTime: period, + period: period, + scheduler: scheduler + ) + } +} + +extension ObservableType where E: RxAbstractInteger { + /** + Returns an observable sequence that periodically produces a value after the specified initial relative due time has elapsed, using the specified scheduler to run timers. + + - seealso: [timer operator on reactivex.io](http://reactivex.io/documentation/operators/timer.html) + + - parameter dueTime: Relative time at which to produce the first value. + - parameter period: Period to produce subsequent values. + - parameter scheduler: Scheduler to run timers on. + - returns: An observable sequence that produces a value after due time has elapsed and then each period. + */ + public static func timer(_ dueTime: RxTimeInterval, period: RxTimeInterval? = nil, scheduler: SchedulerType) + -> Observable { + return Timer( + dueTime: dueTime, + period: period, + scheduler: scheduler + ) + } +} + +import Foundation + +final private class TimerSink : Sink where O.E : RxAbstractInteger { + typealias Parent = Timer + + private let _parent: Parent + private let _lock = RecursiveLock() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.schedulePeriodic(0 as O.E, startAfter: self._parent._dueTime, period: self._parent._period!) { state in + self._lock.lock(); defer { self._lock.unlock() } + self.forwardOn(.next(state)) + return state &+ 1 + } + } +} + +final private class TimerOneOffSink: Sink where O.E: RxAbstractInteger { + typealias Parent = Timer + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + return self._parent._scheduler.scheduleRelative(self, dueTime: self._parent._dueTime) { [unowned self] _ -> Disposable in + self.forwardOn(.next(0)) + self.forwardOn(.completed) + self.dispose() + + return Disposables.create() + } + } +} + +final private class Timer: Producer { + fileprivate let _scheduler: SchedulerType + fileprivate let _dueTime: RxTimeInterval + fileprivate let _period: RxTimeInterval? + + init(dueTime: RxTimeInterval, period: RxTimeInterval?, scheduler: SchedulerType) { + self._scheduler = scheduler + self._dueTime = dueTime + self._period = period + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + if self._period != nil { + let sink = TimerSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + else { + let sink = TimerOneOffSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift new file mode 100644 index 000000000000..5cf1aa431fde --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/ToArray.swift @@ -0,0 +1,66 @@ +// +// ToArray.swift +// RxSwift +// +// Created by Junior B. on 20/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + + +extension ObservableType { + + /** + Converts an Observable into another Observable that emits the whole sequence as a single array and then terminates. + + For aggregation behavior see `reduce`. + + - seealso: [toArray operator on reactivex.io](http://reactivex.io/documentation/operators/to.html) + + - returns: An observable sequence containing all the emitted elements as array. + */ + public func toArray() + -> Observable<[E]> { + return ToArray(source: self.asObservable()) + } +} + +final private class ToArraySink: Sink, ObserverType where O.E == [SourceType] { + typealias Parent = ToArray + + let _parent: Parent + var _list = [SourceType]() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event) { + switch event { + case .next(let value): + self._list.append(value) + case .error(let e): + self.forwardOn(.error(e)) + self.dispose() + case .completed: + self.forwardOn(.next(self._list)) + self.forwardOn(.completed) + self.dispose() + } + } +} + +final private class ToArray: Producer<[SourceType]> { + let _source: Observable + + init(source: Observable) { + self._source = source + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == [SourceType] { + let sink = ToArraySink(parent: self, observer: observer, cancel: cancel) + let subscription = self._source.subscribe(sink) + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift new file mode 100644 index 000000000000..3651dc9a005d --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Using.swift @@ -0,0 +1,90 @@ +// +// Using.swift +// RxSwift +// +// Created by Yury Korolev on 10/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. + + - seealso: [using operator on reactivex.io](http://reactivex.io/documentation/operators/using.html) + + - parameter resourceFactory: Factory function to obtain a resource object. + - parameter observableFactory: Factory function to obtain an observable sequence that depends on the obtained resource. + - returns: An observable sequence whose lifetime controls the lifetime of the dependent resource object. + */ + public static func using(_ resourceFactory: @escaping () throws -> Resource, observableFactory: @escaping (Resource) throws -> Observable) -> Observable { + return Using(resourceFactory: resourceFactory, observableFactory: observableFactory) + } +} + +final private class UsingSink: Sink, ObserverType { + typealias SourceType = O.E + typealias Parent = Using + + private let _parent: Parent + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + var disposable = Disposables.create() + + do { + let resource = try self._parent._resourceFactory() + disposable = resource + let source = try self._parent._observableFactory(resource) + + return Disposables.create( + source.subscribe(self), + disposable + ) + } catch let error { + return Disposables.create( + Observable.error(error).subscribe(self), + disposable + ) + } + } + + func on(_ event: Event) { + switch event { + case let .next(value): + self.forwardOn(.next(value)) + case let .error(error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self.forwardOn(.completed) + self.dispose() + } + } +} + +final private class Using: Producer { + + typealias E = SourceType + + typealias ResourceFactory = () throws -> ResourceType + typealias ObservableFactory = (ResourceType) throws -> Observable + + fileprivate let _resourceFactory: ResourceFactory + fileprivate let _observableFactory: ObservableFactory + + + init(resourceFactory: @escaping ResourceFactory, observableFactory: @escaping ObservableFactory) { + self._resourceFactory = resourceFactory + self._observableFactory = observableFactory + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == E { + let sink = UsingSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift new file mode 100644 index 000000000000..5de452cabf32 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Window.swift @@ -0,0 +1,169 @@ +// +// Window.swift +// RxSwift +// +// Created by Junior B. on 29/10/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Projects each element of an observable sequence into a window that is completed when either it’s full or a given amount of time has elapsed. + + - seealso: [window operator on reactivex.io](http://reactivex.io/documentation/operators/window.html) + + - parameter timeSpan: Maximum time length of a window. + - parameter count: Maximum element count of a window. + - parameter scheduler: Scheduler to run windowing timers on. + - returns: An observable sequence of windows (instances of `Observable`). + */ + public func window(timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) + -> Observable> { + return WindowTimeCount(source: self.asObservable(), timeSpan: timeSpan, count: count, scheduler: scheduler) + } +} + +final private class WindowTimeCountSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType where O.E == Observable { + typealias Parent = WindowTimeCount + typealias E = Element + + private let _parent: Parent + + let _lock = RecursiveLock() + + private var _subject = PublishSubject() + private var _count = 0 + private var _windowId = 0 + + private let _timerD = SerialDisposable() + private let _refCountDisposable: RefCountDisposable + private let _groupDisposable = CompositeDisposable() + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + + _ = self._groupDisposable.insert(self._timerD) + + self._refCountDisposable = RefCountDisposable(disposable: self._groupDisposable) + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + + self.forwardOn(.next(AddRef(source: self._subject, refCount: self._refCountDisposable).asObservable())) + self.createTimer(self._windowId) + + _ = self._groupDisposable.insert(self._parent._source.subscribe(self)) + return self._refCountDisposable + } + + func startNewWindowAndCompleteCurrentOne() { + self._subject.on(.completed) + self._subject = PublishSubject() + + self.forwardOn(.next(AddRef(source: self._subject, refCount: self._refCountDisposable).asObservable())) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + var newWindow = false + var newId = 0 + + switch event { + case .next(let element): + self._subject.on(.next(element)) + + do { + _ = try incrementChecked(&self._count) + } catch let e { + self._subject.on(.error(e as Swift.Error)) + self.dispose() + } + + if self._count == self._parent._count { + newWindow = true + self._count = 0 + self._windowId += 1 + newId = self._windowId + self.startNewWindowAndCompleteCurrentOne() + } + + case .error(let error): + self._subject.on(.error(error)) + self.forwardOn(.error(error)) + self.dispose() + case .completed: + self._subject.on(.completed) + self.forwardOn(.completed) + self.dispose() + } + + if newWindow { + self.createTimer(newId) + } + } + + func createTimer(_ windowId: Int) { + if self._timerD.isDisposed { + return + } + + if self._windowId != windowId { + return + } + + let nextTimer = SingleAssignmentDisposable() + + self._timerD.disposable = nextTimer + + let scheduledRelative = self._parent._scheduler.scheduleRelative(windowId, dueTime: self._parent._timeSpan) { previousWindowId in + + var newId = 0 + + self._lock.performLocked { + if previousWindowId != self._windowId { + return + } + + self._count = 0 + self._windowId = self._windowId &+ 1 + newId = self._windowId + self.startNewWindowAndCompleteCurrentOne() + } + + self.createTimer(newId) + + return Disposables.create() + } + + nextTimer.setDisposable(scheduledRelative) + } +} + +final private class WindowTimeCount: Producer> { + fileprivate let _timeSpan: RxTimeInterval + fileprivate let _count: Int + fileprivate let _scheduler: SchedulerType + fileprivate let _source: Observable + + init(source: Observable, timeSpan: RxTimeInterval, count: Int, scheduler: SchedulerType) { + self._source = source + self._timeSpan = timeSpan + self._count = count + self._scheduler = scheduler + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == Observable { + let sink = WindowTimeCountSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift new file mode 100644 index 000000000000..1a1b5949845f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/WithLatestFrom.swift @@ -0,0 +1,149 @@ +// +// WithLatestFrom.swift +// RxSwift +// +// Created by Yury Korolev on 10/19/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + + /** + Merges two observable sequences into one observable sequence by combining each element from self with the latest element from the second source, if any. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter second: Second observable source. + - parameter resultSelector: Function to invoke for each element from the self combined with the latest element from the second source, if any. + - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. + */ + public func withLatestFrom(_ second: SecondO, resultSelector: @escaping (E, SecondO.E) throws -> ResultType) -> Observable { + return WithLatestFrom(first: self.asObservable(), second: second.asObservable(), resultSelector: resultSelector) + } + + /** + Merges two observable sequences into one observable sequence by using latest element from the second sequence every time when `self` emits an element. + + - seealso: [combineLatest operator on reactivex.io](http://reactivex.io/documentation/operators/combinelatest.html) + + - parameter second: Second observable source. + - returns: An observable sequence containing the result of combining each element of the self with the latest element from the second source, if any, using the specified result selector function. + */ + public func withLatestFrom(_ second: SecondO) -> Observable { + return WithLatestFrom(first: self.asObservable(), second: second.asObservable(), resultSelector: { $1 }) + } +} + +final private class WithLatestFromSink + : Sink + , ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias ResultType = O.E + typealias Parent = WithLatestFrom + typealias E = FirstType + + fileprivate let _parent: Parent + + var _lock = RecursiveLock() + fileprivate var _latest: SecondType? + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + + super.init(observer: observer, cancel: cancel) + } + + func run() -> Disposable { + let sndSubscription = SingleAssignmentDisposable() + let sndO = WithLatestFromSecond(parent: self, disposable: sndSubscription) + + sndSubscription.setDisposable(self._parent._second.subscribe(sndO)) + let fstSubscription = self._parent._first.subscribe(self) + + return Disposables.create(fstSubscription, sndSubscription) + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case let .next(value): + guard let latest = self._latest else { return } + do { + let res = try self._parent._resultSelector(value, latest) + + self.forwardOn(.next(res)) + } catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + case .completed: + self.forwardOn(.completed) + self.dispose() + case let .error(error): + self.forwardOn(.error(error)) + self.dispose() + } + } +} + +final private class WithLatestFromSecond + : ObserverType + , LockOwnerType + , SynchronizedOnType { + + typealias ResultType = O.E + typealias Parent = WithLatestFromSink + typealias E = SecondType + + private let _parent: Parent + private let _disposable: Disposable + + var _lock: RecursiveLock { + return self._parent._lock + } + + init(parent: Parent, disposable: Disposable) { + self._parent = parent + self._disposable = disposable + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + switch event { + case let .next(value): + self._parent._latest = value + case .completed: + self._disposable.dispose() + case let .error(error): + self._parent.forwardOn(.error(error)) + self._parent.dispose() + } + } +} + +final private class WithLatestFrom: Producer { + typealias ResultSelector = (FirstType, SecondType) throws -> ResultType + + fileprivate let _first: Observable + fileprivate let _second: Observable + fileprivate let _resultSelector: ResultSelector + + init(first: Observable, second: Observable, resultSelector: @escaping ResultSelector) { + self._first = first + self._second = second + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == ResultType { + let sink = WithLatestFromSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift new file mode 100644 index 000000000000..c2b5819a6c20 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+Collection.swift @@ -0,0 +1,169 @@ +// +// Zip+Collection.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip(_ collection: C, _ resultSelector: @escaping ([C.Iterator.Element.E]) throws -> E) -> Observable + where C.Iterator.Element: ObservableType { + return ZipCollectionType(sources: collection, resultSelector: resultSelector) + } + + /** + Merges the specified observable sequences into one observable sequence whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip(_ collection: C) -> Observable<[E]> + where C.Iterator.Element: ObservableType, C.Iterator.Element.E == E { + return ZipCollectionType(sources: collection, resultSelector: { $0 }) + } + +} + +final private class ZipCollectionTypeSink + : Sink where C.Iterator.Element: ObservableConvertibleType { + typealias R = O.E + typealias Parent = ZipCollectionType + typealias SourceElement = C.Iterator.Element.E + + private let _parent: Parent + + private let _lock = RecursiveLock() + + // state + private var _numberOfValues = 0 + private var _values: [Queue] + private var _isDone: [Bool] + private var _numberOfDone = 0 + private var _subscriptions: [SingleAssignmentDisposable] + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + self._values = [Queue](repeating: Queue(capacity: 4), count: parent.count) + self._isDone = [Bool](repeating: false, count: parent.count) + self._subscriptions = [SingleAssignmentDisposable]() + self._subscriptions.reserveCapacity(parent.count) + + for _ in 0 ..< parent.count { + self._subscriptions.append(SingleAssignmentDisposable()) + } + + super.init(observer: observer, cancel: cancel) + } + + func on(_ event: Event, atIndex: Int) { + self._lock.lock(); defer { self._lock.unlock() } // { + switch event { + case .next(let element): + self._values[atIndex].enqueue(element) + + if self._values[atIndex].count == 1 { + self._numberOfValues += 1 + } + + if self._numberOfValues < self._parent.count { + if self._numberOfDone == self._parent.count - 1 { + self.forwardOn(.completed) + self.dispose() + } + return + } + + do { + var arguments = [SourceElement]() + arguments.reserveCapacity(self._parent.count) + + // recalculate number of values + self._numberOfValues = 0 + + for i in 0 ..< self._values.count { + arguments.append(self._values[i].dequeue()!) + if !self._values[i].isEmpty { + self._numberOfValues += 1 + } + } + + let result = try self._parent.resultSelector(arguments) + self.forwardOn(.next(result)) + } + catch let error { + self.forwardOn(.error(error)) + self.dispose() + } + + case .error(let error): + self.forwardOn(.error(error)) + self.dispose() + case .completed: + if self._isDone[atIndex] { + return + } + + self._isDone[atIndex] = true + self._numberOfDone += 1 + + if self._numberOfDone == self._parent.count { + self.forwardOn(.completed) + self.dispose() + } + else { + self._subscriptions[atIndex].dispose() + } + } + // } + } + + func run() -> Disposable { + var j = 0 + for i in self._parent.sources { + let index = j + let source = i.asObservable() + + let disposable = source.subscribe(AnyObserver { event in + self.on(event, atIndex: index) + }) + self._subscriptions[j].setDisposable(disposable) + j += 1 + } + + if self._parent.sources.isEmpty { + self.forwardOn(.completed) + } + + return Disposables.create(_subscriptions) + } +} + +final private class ZipCollectionType: Producer where C.Iterator.Element: ObservableConvertibleType { + typealias ResultSelector = ([C.Iterator.Element.E]) throws -> R + + let sources: C + let resultSelector: ResultSelector + let count: Int + + init(sources: C, resultSelector: @escaping ResultSelector) { + self.sources = sources + self.resultSelector = resultSelector + self.count = Int(Int64(self.sources.count)) + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipCollectionTypeSink(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift new file mode 100644 index 000000000000..01992f432d87 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip+arity.swift @@ -0,0 +1,990 @@ +// This file is autogenerated. Take a look at `Preprocessor` target in RxSwift project +// +// Zip+arity.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + + + +// 2 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, resultSelector: @escaping (O1.E, O2.E) throws -> E) + -> Observable { + return Zip2( + source1: source1.asObservable(), source2: source2.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2) + -> Observable<(O1.E, O2.E)> { + return Zip2( + source1: source1.asObservable(), source2: source2.asObservable(), + resultSelector: { ($0, $1) } + ) + } +} + +final class ZipSink2_ : ZipSink { + typealias R = O.E + typealias Parent = Zip2 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 2, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + + return Disposables.create([ + subscription1, + subscription2 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!) + } +} + +final class Zip2 : Producer { + typealias ResultSelector = (E1, E2) throws -> R + + let source1: Observable + let source2: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink2_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 3 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, resultSelector: @escaping (O1.E, O2.E, O3.E) throws -> E) + -> Observable { + return Zip3( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3) + -> Observable<(O1.E, O2.E, O3.E)> { + return Zip3( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), + resultSelector: { ($0, $1, $2) } + ) + } +} + +final class ZipSink3_ : ZipSink { + typealias R = O.E + typealias Parent = Zip3 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 3, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + case 2: return !self._values3.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + subscription3.setDisposable(self._parent.source3.subscribe(observer3)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!) + } +} + +final class Zip3 : Producer { + typealias ResultSelector = (E1, E2, E3) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink3_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 4 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E) throws -> E) + -> Observable { + return Zip4( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4) + -> Observable<(O1.E, O2.E, O3.E, O4.E)> { + return Zip4( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), + resultSelector: { ($0, $1, $2, $3) } + ) + } +} + +final class ZipSink4_ : ZipSink { + typealias R = O.E + typealias Parent = Zip4 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 4, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + case 2: return !self._values3.isEmpty + case 3: return !self._values4.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + subscription3.setDisposable(self._parent.source3.subscribe(observer3)) + subscription4.setDisposable(self._parent.source4.subscribe(observer4)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!) + } +} + +final class Zip4 : Producer { + typealias ResultSelector = (E1, E2, E3, E4) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink4_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 5 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E) throws -> E) + -> Observable { + return Zip5( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E)> { + return Zip5( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4) } + ) + } +} + +final class ZipSink5_ : ZipSink { + typealias R = O.E + typealias Parent = Zip5 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 5, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + case 2: return !self._values3.isEmpty + case 3: return !self._values4.isEmpty + case 4: return !self._values5.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + subscription3.setDisposable(self._parent.source3.subscribe(observer3)) + subscription4.setDisposable(self._parent.source4.subscribe(observer4)) + subscription5.setDisposable(self._parent.source5.subscribe(observer5)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!) + } +} + +final class Zip5 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink5_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 6 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E) throws -> E) + -> Observable { + return Zip6( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E)> { + return Zip6( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4, $5) } + ) + } +} + +final class ZipSink6_ : ZipSink { + typealias R = O.E + typealias Parent = Zip6 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + var _values6: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 6, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + case 2: return !self._values3.isEmpty + case 3: return !self._values4.isEmpty + case 4: return !self._values5.isEmpty + case 5: return !self._values6.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + let observer6 = ZipObserver(lock: self._lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + subscription3.setDisposable(self._parent.source3.subscribe(observer3)) + subscription4.setDisposable(self._parent.source4.subscribe(observer4)) + subscription5.setDisposable(self._parent.source5.subscribe(observer5)) + subscription6.setDisposable(self._parent.source6.subscribe(observer6)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!, self._values6.dequeue()!) + } +} + +final class Zip6 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + let source6: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + self.source6 = source6 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink6_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 7 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E) throws -> E) + -> Observable { + return Zip7( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E)> { + return Zip7( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4, $5, $6) } + ) + } +} + +final class ZipSink7_ : ZipSink { + typealias R = O.E + typealias Parent = Zip7 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + var _values6: Queue = Queue(capacity: 2) + var _values7: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 7, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + case 2: return !self._values3.isEmpty + case 3: return !self._values4.isEmpty + case 4: return !self._values5.isEmpty + case 5: return !self._values6.isEmpty + case 6: return !self._values7.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + let observer6 = ZipObserver(lock: self._lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) + let observer7 = ZipObserver(lock: self._lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + subscription3.setDisposable(self._parent.source3.subscribe(observer3)) + subscription4.setDisposable(self._parent.source4.subscribe(observer4)) + subscription5.setDisposable(self._parent.source5.subscribe(observer5)) + subscription6.setDisposable(self._parent.source6.subscribe(observer6)) + subscription7.setDisposable(self._parent.source7.subscribe(observer7)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!, self._values6.dequeue()!, self._values7.dequeue()!) + } +} + +final class Zip7 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + let source6: Observable + let source7: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + self.source6 = source6 + self.source7 = source7 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink7_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + + +// 8 + +extension ObservableType { + /** + Merges the specified observable sequences into one observable sequence by using the selector function whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - parameter resultSelector: Function to invoke for each series of elements at corresponding indexes in the sources. + - returns: An observable sequence containing the result of combining elements of the sources using the specified result selector function. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8, resultSelector: @escaping (O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E) throws -> E) + -> Observable { + return Zip8( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), + resultSelector: resultSelector + ) + } +} + +extension ObservableType where E == Any { + /** + Merges the specified observable sequences into one observable sequence of tuples whenever all of the observable sequences have produced an element at a corresponding index. + + - seealso: [zip operator on reactivex.io](http://reactivex.io/documentation/operators/zip.html) + + - returns: An observable sequence containing the result of combining elements of the sources. + */ + public static func zip + (_ source1: O1, _ source2: O2, _ source3: O3, _ source4: O4, _ source5: O5, _ source6: O6, _ source7: O7, _ source8: O8) + -> Observable<(O1.E, O2.E, O3.E, O4.E, O5.E, O6.E, O7.E, O8.E)> { + return Zip8( + source1: source1.asObservable(), source2: source2.asObservable(), source3: source3.asObservable(), source4: source4.asObservable(), source5: source5.asObservable(), source6: source6.asObservable(), source7: source7.asObservable(), source8: source8.asObservable(), + resultSelector: { ($0, $1, $2, $3, $4, $5, $6, $7) } + ) + } +} + +final class ZipSink8_ : ZipSink { + typealias R = O.E + typealias Parent = Zip8 + + let _parent: Parent + + var _values1: Queue = Queue(capacity: 2) + var _values2: Queue = Queue(capacity: 2) + var _values3: Queue = Queue(capacity: 2) + var _values4: Queue = Queue(capacity: 2) + var _values5: Queue = Queue(capacity: 2) + var _values6: Queue = Queue(capacity: 2) + var _values7: Queue = Queue(capacity: 2) + var _values8: Queue = Queue(capacity: 2) + + init(parent: Parent, observer: O, cancel: Cancelable) { + self._parent = parent + super.init(arity: 8, observer: observer, cancel: cancel) + } + + override func hasElements(_ index: Int) -> Bool { + switch index { + case 0: return !self._values1.isEmpty + case 1: return !self._values2.isEmpty + case 2: return !self._values3.isEmpty + case 3: return !self._values4.isEmpty + case 4: return !self._values5.isEmpty + case 5: return !self._values6.isEmpty + case 6: return !self._values7.isEmpty + case 7: return !self._values8.isEmpty + + default: + rxFatalError("Unhandled case (Function)") + } + + #if swift(>=4.2) + #if !compiler(>=5.0) + return false + #endif + #else + return false + #endif + } + + func run() -> Disposable { + let subscription1 = SingleAssignmentDisposable() + let subscription2 = SingleAssignmentDisposable() + let subscription3 = SingleAssignmentDisposable() + let subscription4 = SingleAssignmentDisposable() + let subscription5 = SingleAssignmentDisposable() + let subscription6 = SingleAssignmentDisposable() + let subscription7 = SingleAssignmentDisposable() + let subscription8 = SingleAssignmentDisposable() + + let observer1 = ZipObserver(lock: self._lock, parent: self, index: 0, setNextValue: { self._values1.enqueue($0) }, this: subscription1) + let observer2 = ZipObserver(lock: self._lock, parent: self, index: 1, setNextValue: { self._values2.enqueue($0) }, this: subscription2) + let observer3 = ZipObserver(lock: self._lock, parent: self, index: 2, setNextValue: { self._values3.enqueue($0) }, this: subscription3) + let observer4 = ZipObserver(lock: self._lock, parent: self, index: 3, setNextValue: { self._values4.enqueue($0) }, this: subscription4) + let observer5 = ZipObserver(lock: self._lock, parent: self, index: 4, setNextValue: { self._values5.enqueue($0) }, this: subscription5) + let observer6 = ZipObserver(lock: self._lock, parent: self, index: 5, setNextValue: { self._values6.enqueue($0) }, this: subscription6) + let observer7 = ZipObserver(lock: self._lock, parent: self, index: 6, setNextValue: { self._values7.enqueue($0) }, this: subscription7) + let observer8 = ZipObserver(lock: self._lock, parent: self, index: 7, setNextValue: { self._values8.enqueue($0) }, this: subscription8) + + subscription1.setDisposable(self._parent.source1.subscribe(observer1)) + subscription2.setDisposable(self._parent.source2.subscribe(observer2)) + subscription3.setDisposable(self._parent.source3.subscribe(observer3)) + subscription4.setDisposable(self._parent.source4.subscribe(observer4)) + subscription5.setDisposable(self._parent.source5.subscribe(observer5)) + subscription6.setDisposable(self._parent.source6.subscribe(observer6)) + subscription7.setDisposable(self._parent.source7.subscribe(observer7)) + subscription8.setDisposable(self._parent.source8.subscribe(observer8)) + + return Disposables.create([ + subscription1, + subscription2, + subscription3, + subscription4, + subscription5, + subscription6, + subscription7, + subscription8 + ]) + } + + override func getResult() throws -> R { + return try self._parent._resultSelector(self._values1.dequeue()!, self._values2.dequeue()!, self._values3.dequeue()!, self._values4.dequeue()!, self._values5.dequeue()!, self._values6.dequeue()!, self._values7.dequeue()!, self._values8.dequeue()!) + } +} + +final class Zip8 : Producer { + typealias ResultSelector = (E1, E2, E3, E4, E5, E6, E7, E8) throws -> R + + let source1: Observable + let source2: Observable + let source3: Observable + let source4: Observable + let source5: Observable + let source6: Observable + let source7: Observable + let source8: Observable + + let _resultSelector: ResultSelector + + init(source1: Observable, source2: Observable, source3: Observable, source4: Observable, source5: Observable, source6: Observable, source7: Observable, source8: Observable, resultSelector: @escaping ResultSelector) { + self.source1 = source1 + self.source2 = source2 + self.source3 = source3 + self.source4 = source4 + self.source5 = source5 + self.source6 = source6 + self.source7 = source7 + self.source8 = source8 + + self._resultSelector = resultSelector + } + + override func run(_ observer: O, cancel: Cancelable) -> (sink: Disposable, subscription: Disposable) where O.E == R { + let sink = ZipSink8_(parent: self, observer: observer, cancel: cancel) + let subscription = sink.run() + return (sink: sink, subscription: subscription) + } +} + + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift new file mode 100644 index 000000000000..50edf8481dae --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observables/Zip.swift @@ -0,0 +1,153 @@ +// +// Zip.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol ZipSinkProtocol : class +{ + func next(_ index: Int) + func fail(_ error: Swift.Error) + func done(_ index: Int) +} + +class ZipSink : Sink, ZipSinkProtocol { + typealias Element = O.E + + let _arity: Int + + let _lock = RecursiveLock() + + // state + private var _isDone: [Bool] + + init(arity: Int, observer: O, cancel: Cancelable) { + self._isDone = [Bool](repeating: false, count: arity) + self._arity = arity + + super.init(observer: observer, cancel: cancel) + } + + func getResult() throws -> Element { + rxAbstractMethod() + } + + func hasElements(_ index: Int) -> Bool { + rxAbstractMethod() + } + + func next(_ index: Int) { + var hasValueAll = true + + for i in 0 ..< self._arity { + if !self.hasElements(i) { + hasValueAll = false + break + } + } + + if hasValueAll { + do { + let result = try self.getResult() + self.forwardOn(.next(result)) + } + catch let e { + self.forwardOn(.error(e)) + self.dispose() + } + } + else { + var allOthersDone = true + + let arity = self._isDone.count + for i in 0 ..< arity { + if i != index && !self._isDone[i] { + allOthersDone = false + break + } + } + + if allOthersDone { + self.forwardOn(.completed) + self.dispose() + } + } + } + + func fail(_ error: Swift.Error) { + self.forwardOn(.error(error)) + self.dispose() + } + + func done(_ index: Int) { + self._isDone[index] = true + + var allDone = true + + for done in self._isDone where !done { + allDone = false + break + } + + if allDone { + self.forwardOn(.completed) + self.dispose() + } + } +} + +final class ZipObserver + : ObserverType + , LockOwnerType + , SynchronizedOnType { + typealias E = ElementType + typealias ValueSetter = (ElementType) -> Void + + private var _parent: ZipSinkProtocol? + + let _lock: RecursiveLock + + // state + private let _index: Int + private let _this: Disposable + private let _setNextValue: ValueSetter + + init(lock: RecursiveLock, parent: ZipSinkProtocol, index: Int, setNextValue: @escaping ValueSetter, this: Disposable) { + self._lock = lock + self._parent = parent + self._index = index + self._this = this + self._setNextValue = setNextValue + } + + func on(_ event: Event) { + self.synchronizedOn(event) + } + + func _synchronized_on(_ event: Event) { + if self._parent != nil { + switch event { + case .next: + break + case .error: + self._this.dispose() + case .completed: + self._this.dispose() + } + } + + if let parent = self._parent { + switch event { + case .next(let value): + self._setNextValue(value) + parent.next(self._index) + case .error(let error): + parent.fail(error) + case .completed: + parent.done(self._index) + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift new file mode 100644 index 000000000000..908941ff17cd --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/ObserverType.swift @@ -0,0 +1,40 @@ +// +// ObserverType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Supports push-style iteration over an observable sequence. +public protocol ObserverType { + /// The type of elements in sequence that observer can observe. + associatedtype E + + /// Notify observer about sequence event. + /// + /// - parameter event: Event that occurred. + func on(_ event: Event) +} + +/// Convenience API extensions to provide alternate next, error, completed events +extension ObserverType { + + /// Convenience method equivalent to `on(.next(element: E))` + /// + /// - parameter element: Next element to send to observer(s) + public func onNext(_ element: E) { + self.on(.next(element)) + } + + /// Convenience method equivalent to `on(.completed)` + public func onCompleted() { + self.on(.completed) + } + + /// Convenience method equivalent to `on(.error(Swift.Error))` + /// - parameter error: Swift.Error to send to observer(s) + public func onError(_ error: Swift.Error) { + self.on(.error(error)) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift new file mode 100644 index 000000000000..765cf1168d3c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/AnonymousObserver.swift @@ -0,0 +1,32 @@ +// +// AnonymousObserver.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +final class AnonymousObserver : ObserverBase { + typealias Element = ElementType + + typealias EventHandler = (Event) -> Void + + private let _eventHandler : EventHandler + + init(_ eventHandler: @escaping EventHandler) { +#if TRACE_RESOURCES + _ = Resources.incrementTotal() +#endif + self._eventHandler = eventHandler + } + + override func onCore(_ event: Event) { + return self._eventHandler(event) + } + +#if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } +#endif +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift new file mode 100644 index 000000000000..65d05ec0f982 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/ObserverBase.swift @@ -0,0 +1,34 @@ +// +// ObserverBase.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/15/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +class ObserverBase : Disposable, ObserverType { + typealias E = ElementType + + private let _isStopped = AtomicInt(0) + + func on(_ event: Event) { + switch event { + case .next: + if load(self._isStopped) == 0 { + self.onCore(event) + } + case .error, .completed: + if fetchOr(self._isStopped, 1) == 0 { + self.onCore(event) + } + } + } + + func onCore(_ event: Event) { + rxAbstractMethod() + } + + func dispose() { + fetchOr(self._isStopped, 1) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift new file mode 100644 index 000000000000..e75a38012e7c --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Observers/TailRecursiveSink.swift @@ -0,0 +1,151 @@ +// +// TailRecursiveSink.swift +// RxSwift +// +// Created by Krunoslav Zaher on 3/21/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +enum TailRecursiveSinkCommand { + case moveNext + case dispose +} + +#if DEBUG || TRACE_RESOURCES + public var maxTailRecursiveSinkStackSize = 0 +#endif + +/// This class is usually used with `Generator` version of the operators. +class TailRecursiveSink + : Sink + , InvocableWithValueType where S.Iterator.Element: ObservableConvertibleType, S.Iterator.Element.E == O.E { + typealias Value = TailRecursiveSinkCommand + typealias E = O.E + typealias SequenceGenerator = (generator: S.Iterator, remaining: IntMax?) + + var _generators: [SequenceGenerator] = [] + var _isDisposed = false + var _subscription = SerialDisposable() + + // this is thread safe object + var _gate = AsyncLock>>() + + override init(observer: O, cancel: Cancelable) { + super.init(observer: observer, cancel: cancel) + } + + func run(_ sources: SequenceGenerator) -> Disposable { + self._generators.append(sources) + + self.schedule(.moveNext) + + return self._subscription + } + + func invoke(_ command: TailRecursiveSinkCommand) { + switch command { + case .dispose: + self.disposeCommand() + case .moveNext: + self.moveNextCommand() + } + } + + // simple implementation for now + func schedule(_ command: TailRecursiveSinkCommand) { + self._gate.invoke(InvocableScheduledItem(invocable: self, state: command)) + } + + func done() { + self.forwardOn(.completed) + self.dispose() + } + + func extract(_ observable: Observable) -> SequenceGenerator? { + rxAbstractMethod() + } + + // should be done on gate locked + + private func moveNextCommand() { + var next: Observable? + + repeat { + guard let (g, left) = self._generators.last else { + break + } + + if self._isDisposed { + return + } + + self._generators.removeLast() + + var e = g + + guard let nextCandidate = e.next()?.asObservable() else { + continue + } + + // `left` is a hint of how many elements are left in generator. + // In case this is the last element, then there is no need to push + // that generator on stack. + // + // This is an optimization used to make sure in tail recursive case + // there is no memory leak in case this operator is used to generate non terminating + // sequence. + + if let knownOriginalLeft = left { + // `- 1` because generator.next() has just been called + if knownOriginalLeft - 1 >= 1 { + self._generators.append((e, knownOriginalLeft - 1)) + } + } + else { + self._generators.append((e, nil)) + } + + let nextGenerator = self.extract(nextCandidate) + + if let nextGenerator = nextGenerator { + self._generators.append(nextGenerator) + #if DEBUG || TRACE_RESOURCES + if maxTailRecursiveSinkStackSize < self._generators.count { + maxTailRecursiveSinkStackSize = self._generators.count + } + #endif + } + else { + next = nextCandidate + } + } while next == nil + + guard let existingNext = next else { + self.done() + return + } + + let disposable = SingleAssignmentDisposable() + self._subscription.disposable = disposable + disposable.setDisposable(self.subscribeToNext(existingNext)) + } + + func subscribeToNext(_ source: Observable) -> Disposable { + rxAbstractMethod() + } + + func disposeCommand() { + self._isDisposed = true + self._generators.removeAll(keepingCapacity: false) + } + + override func dispose() { + super.dispose() + + self._subscription.dispose() + self._gate.dispose() + + self.schedule(.dispose) + } +} + diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Reactive.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Reactive.swift new file mode 100644 index 000000000000..b87399664f3e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Reactive.swift @@ -0,0 +1,74 @@ +// +// Reactive.swift +// RxSwift +// +// Created by Yury Korolev on 5/2/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +/** + Use `Reactive` proxy as customization point for constrained protocol extensions. + + General pattern would be: + + // 1. Extend Reactive protocol with constrain on Base + // Read as: Reactive Extension where Base is a SomeType + extension Reactive where Base: SomeType { + // 2. Put any specific reactive extension for SomeType here + } + + With this approach we can have more specialized methods and properties using + `Base` and not just specialized on common base type. + + */ + +public struct Reactive { + /// Base object to extend. + public let base: Base + + /// Creates extensions with base object. + /// + /// - parameter base: Base object. + public init(_ base: Base) { + self.base = base + } +} + +/// A type that has reactive extensions. +public protocol ReactiveCompatible { + /// Extended type + associatedtype CompatibleType + + /// Reactive extensions. + static var rx: Reactive.Type { get set } + + /// Reactive extensions. + var rx: Reactive { get set } +} + +extension ReactiveCompatible { + /// Reactive extensions. + public static var rx: Reactive.Type { + get { + return Reactive.self + } + set { + // this enables using Reactive to "mutate" base type + } + } + + /// Reactive extensions. + public var rx: Reactive { + get { + return Reactive(self) + } + set { + // this enables using Reactive to "mutate" base object + } + } +} + +import class Foundation.NSObject + +/// Extend NSObject with `rx` proxy. +extension NSObject: ReactiveCompatible { } diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift new file mode 100644 index 000000000000..a547a8f98cd2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Rx.swift @@ -0,0 +1,141 @@ +// +// Rx.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +#if TRACE_RESOURCES + fileprivate let resourceCount = AtomicInt(0) + + /// Resource utilization information + public struct Resources { + /// Counts internal Rx resource allocations (Observables, Observers, Disposables, etc.). This provides a simple way to detect leaks during development. + public static var total: Int32 { + return load(resourceCount) + } + + /// Increments `Resources.total` resource count. + /// + /// - returns: New resource count + public static func incrementTotal() -> Int32 { + return increment(resourceCount) + } + + /// Decrements `Resources.total` resource count + /// + /// - returns: New resource count + public static func decrementTotal() -> Int32 { + return decrement(resourceCount) + } + } +#endif + +/// Swift does not implement abstract methods. This method is used as a runtime check to ensure that methods which intended to be abstract (i.e., they should be implemented in subclasses) are not called directly on the superclass. +func rxAbstractMethod(file: StaticString = #file, line: UInt = #line) -> Swift.Never { + rxFatalError("Abstract method", file: file, line: line) +} + +func rxFatalError(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) -> Swift.Never { + fatalError(lastMessage(), file: file, line: line) +} + +func rxFatalErrorInDebug(_ lastMessage: @autoclosure () -> String, file: StaticString = #file, line: UInt = #line) { + #if DEBUG + fatalError(lastMessage(), file: file, line: line) + #else + print("\(file):\(line): \(lastMessage())") + #endif +} + +func incrementChecked(_ i: inout Int) throws -> Int { + if i == Int.max { + throw RxError.overflow + } + defer { i += 1 } + return i +} + +func decrementChecked(_ i: inout Int) throws -> Int { + if i == Int.min { + throw RxError.overflow + } + defer { i -= 1 } + return i +} + +#if DEBUG + import class Foundation.Thread + final class SynchronizationTracker { + private let _lock = RecursiveLock() + + public enum SynchronizationErrorMessages: String { + case variable = "Two different threads are trying to assign the same `Variable.value` unsynchronized.\n This is undefined behavior because the end result (variable value) is nondeterministic and depends on the \n operating system thread scheduler. This will cause random behavior of your program.\n" + case `default` = "Two different unsynchronized threads are trying to send some event simultaneously.\n This is undefined behavior because the ordering of the effects caused by these events is nondeterministic and depends on the \n operating system thread scheduler. This will result in a random behavior of your program.\n" + } + + private var _threads = [UnsafeMutableRawPointer: Int]() + + private func synchronizationError(_ message: String) { + #if FATAL_SYNCHRONIZATION + rxFatalError(message) + #else + print(message) + #endif + } + + func register(synchronizationErrorMessage: SynchronizationErrorMessages) { + self._lock.lock(); defer { self._lock.unlock() } + let pointer = Unmanaged.passUnretained(Thread.current).toOpaque() + let count = (self._threads[pointer] ?? 0) + 1 + + if count > 1 { + self.synchronizationError( + "⚠️ Reentrancy anomaly was detected.\n" + + " > Debugging: To debug this issue you can set a breakpoint in \(#file):\(#line) and observe the call stack.\n" + + " > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`\n" + + " This behavior breaks the grammar because there is overlapping between sequence events.\n" + + " Observable sequence is trying to send an event before sending of previous event has finished.\n" + + " > Interpretation: This could mean that there is some kind of unexpected cyclic dependency in your code,\n" + + " or that the system is not behaving in the expected way.\n" + + " > Remedy: If this is the expected behavior this message can be suppressed by adding `.observeOn(MainScheduler.asyncInstance)`\n" + + " or by enqueuing sequence events in some other way.\n" + ) + } + + self._threads[pointer] = count + + if self._threads.count > 1 { + self.synchronizationError( + "⚠️ Synchronization anomaly was detected.\n" + + " > Debugging: To debug this issue you can set a breakpoint in \(#file):\(#line) and observe the call stack.\n" + + " > Problem: This behavior is breaking the observable sequence grammar. `next (error | completed)?`\n" + + " This behavior breaks the grammar because there is overlapping between sequence events.\n" + + " Observable sequence is trying to send an event before sending of previous event has finished.\n" + + " > Interpretation: " + synchronizationErrorMessage.rawValue + + " > Remedy: If this is the expected behavior this message can be suppressed by adding `.observeOn(MainScheduler.asyncInstance)`\n" + + " or by synchronizing sequence events in some other way.\n" + ) + } + } + + func unregister() { + self._lock.lock(); defer { self._lock.unlock() } + let pointer = Unmanaged.passUnretained(Thread.current).toOpaque() + self._threads[pointer] = (self._threads[pointer] ?? 1) - 1 + if self._threads[pointer] == 0 { + self._threads[pointer] = nil + } + } + } + +#endif + +/// RxSwift global hooks +public enum Hooks { + + // Should capture call stack + public static var recordCallStackOnError: Bool = false + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift new file mode 100644 index 000000000000..7f3c333baa65 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/RxMutableBox.swift @@ -0,0 +1,27 @@ +// +// RxMutableBox.swift +// RxSwift +// +// Created by Krunoslav Zaher on 5/22/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Creates mutable reference wrapper for any type. +final class RxMutableBox : CustomDebugStringConvertible { + /// Wrapped value + var value : T + + /// Creates reference wrapper for `value`. + /// + /// - parameter value: Value to wrap. + init (_ value: T) { + self.value = value + } +} + +extension RxMutableBox { + /// - returns: Box description. + var debugDescription: String { + return "MutatingBox(\(self.value))" + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift new file mode 100644 index 000000000000..e09c499de265 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/SchedulerType.swift @@ -0,0 +1,71 @@ +// +// SchedulerType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.TimeInterval +import struct Foundation.Date + +// Type that represents time interval in the context of RxSwift. +public typealias RxTimeInterval = TimeInterval + +/// Type that represents absolute time in the context of RxSwift. +public typealias RxTime = Date + +/// Represents an object that schedules units of work. +public protocol SchedulerType: ImmediateSchedulerType { + + /// - returns: Current time. + var now : RxTime { + get + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable +} + +extension SchedulerType { + + /** + Periodic task will be emulated using recursive scheduling. + + - parameter state: Initial state passed to the action upon the first iteration. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - returns: The disposable object used to cancel the scheduled recurring action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + let schedule = SchedulePeriodicRecursive(scheduler: self, startAfter: startAfter, period: period, action: action, state: state) + + return schedule.start() + } + + func scheduleRecursive(_ state: State, dueTime: RxTimeInterval, action: @escaping (State, AnyRecursiveScheduler) -> Void) -> Disposable { + let scheduler = AnyRecursiveScheduler(scheduler: self, action: action) + + scheduler.schedule(state, dueTime: dueTime) + + return Disposables.create(with: scheduler.dispose) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift new file mode 100644 index 000000000000..ed2efbb16b5e --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentDispatchQueueScheduler.swift @@ -0,0 +1,84 @@ +// +// ConcurrentDispatchQueueScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/5/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date +import struct Foundation.TimeInterval +import Dispatch + +/// Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. You can also pass a serial dispatch queue, it shouldn't cause any problems. +/// +/// This scheduler is suitable when some work needs to be performed in background. +public class ConcurrentDispatchQueueScheduler: SchedulerType { + public typealias TimeInterval = Foundation.TimeInterval + public typealias Time = Date + + public var now : Date { + return Date() + } + + let configuration: DispatchQueueConfiguration + + /// Constructs new `ConcurrentDispatchQueueScheduler` that wraps `queue`. + /// + /// - parameter queue: Target dispatch queue. + /// - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. + public init(queue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + self.configuration = DispatchQueueConfiguration(queue: queue, leeway: leeway) + } + + /// Convenience init for scheduler that wraps one of the global concurrent dispatch queues. + /// + /// - parameter qos: Target global dispatch queue, by quality of service class. + /// - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. + @available(iOS 8, OSX 10.10, *) + public convenience init(qos: DispatchQoS, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + self.init(queue: DispatchQueue( + label: "rxswift.queue.\(qos)", + qos: qos, + attributes: [DispatchQueue.Attributes.concurrent], + target: nil), + leeway: leeway + ) + } + + /** + Schedules an action to be executed immediately. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.schedule(state, action: action) + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.scheduleRelative(state, dueTime: dueTime, action: action) + } + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift new file mode 100644 index 000000000000..0d65b6cabd20 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/ConcurrentMainScheduler.swift @@ -0,0 +1,88 @@ +// +// ConcurrentMainScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 10/17/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date +import struct Foundation.TimeInterval +import Dispatch + +/** +Abstracts work that needs to be performed on `MainThread`. In case `schedule` methods are called from main thread, it will perform action immediately without scheduling. + +This scheduler is optimized for `subscribeOn` operator. If you want to observe observable sequence elements on main thread using `observeOn` operator, +`MainScheduler` is more suitable for that purpose. +*/ +public final class ConcurrentMainScheduler : SchedulerType { + public typealias TimeInterval = Foundation.TimeInterval + public typealias Time = Date + + private let _mainScheduler: MainScheduler + private let _mainQueue: DispatchQueue + + /// - returns: Current time. + public var now: Date { + return self._mainScheduler.now as Date + } + + private init(mainScheduler: MainScheduler) { + self._mainQueue = DispatchQueue.main + self._mainScheduler = mainScheduler + } + + /// Singleton instance of `ConcurrentMainScheduler` + public static let instance = ConcurrentMainScheduler(mainScheduler: MainScheduler.instance) + + /** + Schedules an action to be executed immediately. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + if DispatchQueue.isMain { + return action(state) + } + + let cancel = SingleAssignmentDisposable() + + self._mainQueue.async { + if cancel.isDisposed { + return + } + + cancel.setDisposable(action(state)) + } + + return cancel + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + return self._mainScheduler.scheduleRelative(state, dueTime: dueTime, action: action) + } + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + return self._mainScheduler.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift new file mode 100644 index 000000000000..c7f6b1730ccc --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/CurrentThreadScheduler.swift @@ -0,0 +1,144 @@ +// +// CurrentThreadScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 8/30/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import class Foundation.NSObject +import protocol Foundation.NSCopying +import class Foundation.Thread +import Dispatch + +#if os(Linux) + import struct Foundation.pthread_key_t + import func Foundation.pthread_setspecific + import func Foundation.pthread_getspecific + import func Foundation.pthread_key_create + + fileprivate enum CurrentThreadSchedulerQueueKey { + fileprivate static let instance = "RxSwift.CurrentThreadScheduler.Queue" + } +#else + private class CurrentThreadSchedulerQueueKey: NSObject, NSCopying { + static let instance = CurrentThreadSchedulerQueueKey() + private override init() { + super.init() + } + + override var hash: Int { + return 0 + } + + public func copy(with zone: NSZone? = nil) -> Any { + return self + } + } +#endif + +/// Represents an object that schedules units of work on the current thread. +/// +/// This is the default scheduler for operators that generate elements. +/// +/// This scheduler is also sometimes called `trampoline scheduler`. +public class CurrentThreadScheduler : ImmediateSchedulerType { + typealias ScheduleQueue = RxMutableBox> + + /// The singleton instance of the current thread scheduler. + public static let instance = CurrentThreadScheduler() + + private static var isScheduleRequiredKey: pthread_key_t = { () -> pthread_key_t in + let key = UnsafeMutablePointer.allocate(capacity: 1) + defer { +#if swift(>=4.1) + key.deallocate() +#else + key.deallocate(capacity: 1) +#endif + } + + guard pthread_key_create(key, nil) == 0 else { + rxFatalError("isScheduleRequired key creation failed") + } + + return key.pointee + }() + + private static var scheduleInProgressSentinel: UnsafeRawPointer = { () -> UnsafeRawPointer in + return UnsafeRawPointer(UnsafeMutablePointer.allocate(capacity: 1)) + }() + + static var queue : ScheduleQueue? { + get { + return Thread.getThreadLocalStorageValueForKey(CurrentThreadSchedulerQueueKey.instance) + } + set { + Thread.setThreadLocalStorageValue(newValue, forKey: CurrentThreadSchedulerQueueKey.instance) + } + } + + /// Gets a value that indicates whether the caller must call a `schedule` method. + public static fileprivate(set) var isScheduleRequired: Bool { + get { + return pthread_getspecific(CurrentThreadScheduler.isScheduleRequiredKey) == nil + } + set(isScheduleRequired) { + if pthread_setspecific(CurrentThreadScheduler.isScheduleRequiredKey, isScheduleRequired ? nil : scheduleInProgressSentinel) != 0 { + rxFatalError("pthread_setspecific failed") + } + } + } + + /** + Schedules an action to be executed as soon as possible on current thread. + + If this method is called on some thread that doesn't have `CurrentThreadScheduler` installed, scheduler will be + automatically installed and uninstalled after all work is performed. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + if CurrentThreadScheduler.isScheduleRequired { + CurrentThreadScheduler.isScheduleRequired = false + + let disposable = action(state) + + defer { + CurrentThreadScheduler.isScheduleRequired = true + CurrentThreadScheduler.queue = nil + } + + guard let queue = CurrentThreadScheduler.queue else { + return disposable + } + + while let latest = queue.value.dequeue() { + if latest.isDisposed { + continue + } + latest.invoke() + } + + return disposable + } + + let existingQueue = CurrentThreadScheduler.queue + + let queue: RxMutableBox> + if let existingQueue = existingQueue { + queue = existingQueue + } + else { + queue = RxMutableBox(Queue(capacity: 1)) + CurrentThreadScheduler.queue = queue + } + + let scheduledItem = ScheduledItem(action: action, state: state) + queue.value.enqueue(scheduledItem) + + return scheduledItem + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift new file mode 100644 index 000000000000..11af238a3b1f --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalScheduler.swift @@ -0,0 +1,22 @@ +// +// HistoricalScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date + +/// Provides a virtual time scheduler that uses `Date` for absolute time and `NSTimeInterval` for relative time. +public class HistoricalScheduler : VirtualTimeScheduler { + + /** + Creates a new historical scheduler with initial clock value. + + - parameter initialClock: Initial value for virtual clock. + */ + public init(initialClock: RxTime = Date(timeIntervalSince1970: 0)) { + super.init(initialClock: initialClock, converter: HistoricalSchedulerTimeConverter()) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift new file mode 100644 index 000000000000..930ca37762ba --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/HistoricalSchedulerTimeConverter.swift @@ -0,0 +1,67 @@ +// +// HistoricalSchedulerTimeConverter.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/27/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.Date + +/// Converts historical virtual time into real time. +/// +/// Since historical virtual time is also measured in `Date`, this converter is identity function. +public struct HistoricalSchedulerTimeConverter : VirtualTimeConverterType { + /// Virtual time unit used that represents ticks of virtual clock. + public typealias VirtualTimeUnit = RxTime + + /// Virtual time unit used to represent differences of virtual times. + public typealias VirtualTimeIntervalUnit = RxTimeInterval + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime { + return virtualTime + } + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit { + return time + } + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval { + return virtualTimeInterval + } + + /// Returns identical value of argument passed because historical virtual time is equal to real time, just + /// decoupled from local machine clock. + public func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit { + return timeInterval + } + + /** + Offsets `Date` by time interval. + + - parameter time: Time. + - parameter timeInterval: Time interval offset. + - returns: Time offsetted by time interval. + */ + public func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit { + return time.addingTimeInterval(offset) + } + + /// Compares two `Date`s. + public func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison { + switch lhs.compare(rhs as Date) { + case .orderedAscending: + return .lessThan + case .orderedSame: + return .equal + case .orderedDescending: + return .greaterThan + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift new file mode 100644 index 000000000000..792a0be29e39 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/DispatchQueueConfiguration.swift @@ -0,0 +1,104 @@ +// +// DispatchQueueConfiguration.swift +// RxSwift +// +// Created by Krunoslav Zaher on 7/23/16. +// Copyright © 2016 Krunoslav Zaher. All rights reserved. +// + +import Dispatch +import struct Foundation.TimeInterval + +struct DispatchQueueConfiguration { + let queue: DispatchQueue + let leeway: DispatchTimeInterval +} + +private func dispatchInterval(_ interval: Foundation.TimeInterval) -> DispatchTimeInterval { + precondition(interval >= 0.0) + // TODO: Replace 1000 with something that actually works + // NSEC_PER_MSEC returns 1000000 + return DispatchTimeInterval.milliseconds(Int(interval * 1000.0)) +} + +extension DispatchQueueConfiguration { + func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let cancel = SingleAssignmentDisposable() + + self.queue.async { + if cancel.isDisposed { + return + } + + + cancel.setDisposable(action(state)) + } + + return cancel + } + + func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + let deadline = DispatchTime.now() + dispatchInterval(dueTime) + + let compositeDisposable = CompositeDisposable() + + let timer = DispatchSource.makeTimerSource(queue: self.queue) + timer.schedule(deadline: deadline, leeway: self.leeway) + + // TODO: + // This looks horrible, and yes, it is. + // It looks like Apple has made a conceputal change here, and I'm unsure why. + // Need more info on this. + // It looks like just setting timer to fire and not holding a reference to it + // until deadline causes timer cancellation. + var timerReference: DispatchSourceTimer? = timer + let cancelTimer = Disposables.create { + timerReference?.cancel() + timerReference = nil + } + + timer.setEventHandler(handler: { + if compositeDisposable.isDisposed { + return + } + _ = compositeDisposable.insert(action(state)) + cancelTimer.dispose() + }) + timer.resume() + + _ = compositeDisposable.insert(cancelTimer) + + return compositeDisposable + } + + func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + let initial = DispatchTime.now() + dispatchInterval(startAfter) + + var timerState = state + + let timer = DispatchSource.makeTimerSource(queue: self.queue) + timer.schedule(deadline: initial, repeating: dispatchInterval(period), leeway: self.leeway) + + // TODO: + // This looks horrible, and yes, it is. + // It looks like Apple has made a conceputal change here, and I'm unsure why. + // Need more info on this. + // It looks like just setting timer to fire and not holding a reference to it + // until deadline causes timer cancellation. + var timerReference: DispatchSourceTimer? = timer + let cancelTimer = Disposables.create { + timerReference?.cancel() + timerReference = nil + } + + timer.setEventHandler(handler: { + if cancelTimer.isDisposed { + return + } + timerState = action(timerState) + }) + timer.resume() + + return cancelTimer + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift new file mode 100644 index 000000000000..f31469e00650 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableScheduledItem.swift @@ -0,0 +1,22 @@ +// +// InvocableScheduledItem.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +struct InvocableScheduledItem : InvocableType { + + let _invocable: I + let _state: I.Value + + init(invocable: I, state: I.Value) { + self._invocable = invocable + self._state = state + } + + func invoke() { + self._invocable.invoke(self._state) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift new file mode 100644 index 000000000000..0dba4336a743 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/InvocableType.swift @@ -0,0 +1,17 @@ +// +// InvocableType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol InvocableType { + func invoke() +} + +protocol InvocableWithValueType { + associatedtype Value + + func invoke(_ value: Value) +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift new file mode 100644 index 000000000000..6e7a0c1a86ca --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItem.swift @@ -0,0 +1,35 @@ +// +// ScheduledItem.swift +// RxSwift +// +// Created by Krunoslav Zaher on 9/2/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +struct ScheduledItem + : ScheduledItemType + , InvocableType { + typealias Action = (T) -> Disposable + + private let _action: Action + private let _state: T + + private let _disposable = SingleAssignmentDisposable() + + var isDisposed: Bool { + return self._disposable.isDisposed + } + + init(action: @escaping Action, state: T) { + self._action = action + self._state = state + } + + func invoke() { + self._disposable.setDisposable(self._action(self._state)) + } + + func dispose() { + self._disposable.dispose() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift new file mode 100644 index 000000000000..d2b16cab7007 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/Internal/ScheduledItemType.swift @@ -0,0 +1,13 @@ +// +// ScheduledItemType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 11/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +protocol ScheduledItemType + : Cancelable + , InvocableType { + func invoke() +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift new file mode 100644 index 000000000000..8fb09071d5c3 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/MainScheduler.swift @@ -0,0 +1,80 @@ +// +// MainScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import Dispatch +#if !os(Linux) + import Foundation +#endif + +/** +Abstracts work that needs to be performed on `DispatchQueue.main`. In case `schedule` methods are called from `DispatchQueue.main`, it will perform action immediately without scheduling. + +This scheduler is usually used to perform UI work. + +Main scheduler is a specialization of `SerialDispatchQueueScheduler`. + +This scheduler is optimized for `observeOn` operator. To ensure observable sequence is subscribed on main thread using `subscribeOn` +operator please use `ConcurrentMainScheduler` because it is more optimized for that purpose. +*/ +public final class MainScheduler : SerialDispatchQueueScheduler { + + private let _mainQueue: DispatchQueue + + let numberEnqueued = AtomicInt(0) + + /// Initializes new instance of `MainScheduler`. + public init() { + self._mainQueue = DispatchQueue.main + super.init(serialQueue: self._mainQueue) + } + + /// Singleton instance of `MainScheduler` + public static let instance = MainScheduler() + + /// Singleton instance of `MainScheduler` that always schedules work asynchronously + /// and doesn't perform optimizations for calls scheduled from main queue. + public static let asyncInstance = SerialDispatchQueueScheduler(serialQueue: DispatchQueue.main) + + /// In case this method is called on a background thread it will throw an exception. + public class func ensureExecutingOnScheduler(errorMessage: String? = nil) { + if !DispatchQueue.isMain { + rxFatalError(errorMessage ?? "Executing on background thread. Please use `MainScheduler.instance.schedule` to schedule work on main thread.") + } + } + + /// In case this method is running on a background thread it will throw an exception. + public class func ensureRunningOnMainThread(errorMessage: String? = nil) { + #if !os(Linux) // isMainThread is not implemented in Linux Foundation + guard Thread.isMainThread else { + rxFatalError(errorMessage ?? "Running on background thread.") + } + #endif + } + + override func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let previousNumberEnqueued = increment(self.numberEnqueued) + + if DispatchQueue.isMain && previousNumberEnqueued == 0 { + let disposable = action(state) + decrement(self.numberEnqueued) + return disposable + } + + let cancel = SingleAssignmentDisposable() + + self._mainQueue.async { + if !cancel.isDisposed { + _ = action(state) + } + + decrement(self.numberEnqueued) + } + + return cancel + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift new file mode 100644 index 000000000000..81ba59f34e47 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/OperationQueueScheduler.swift @@ -0,0 +1,56 @@ +// +// OperationQueueScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 4/4/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import class Foundation.Operation +import class Foundation.OperationQueue +import class Foundation.BlockOperation +import Dispatch + +/// Abstracts the work that needs to be performed on a specific `NSOperationQueue`. +/// +/// This scheduler is suitable for cases when there is some bigger chunk of work that needs to be performed in background and you want to fine tune concurrent processing using `maxConcurrentOperationCount`. +public class OperationQueueScheduler: ImmediateSchedulerType { + public let operationQueue: OperationQueue + public let queuePriority: Operation.QueuePriority + + /// Constructs new instance of `OperationQueueScheduler` that performs work on `operationQueue`. + /// + /// - parameter operationQueue: Operation queue targeted to perform work on. + /// - parameter queuePriority: Queue priority which will be assigned to new operations. + public init(operationQueue: OperationQueue, queuePriority: Operation.QueuePriority = .normal) { + self.operationQueue = operationQueue + self.queuePriority = queuePriority + } + + /** + Schedules an action to be executed recursively. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to execute recursively. The last parameter passed to the action is used to trigger recursive scheduling of the action, passing in recursive invocation state. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + let cancel = SingleAssignmentDisposable() + + let operation = BlockOperation { + if cancel.isDisposed { + return + } + + + cancel.setDisposable(action(state)) + } + + operation.queuePriority = self.queuePriority + + self.operationQueue.addOperation(operation) + + return cancel + } + +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift new file mode 100644 index 000000000000..9e9b4ffd11b2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/RecursiveScheduler.swift @@ -0,0 +1,220 @@ +// +// RecursiveScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/7/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +private enum ScheduleState { + case initial + case added(CompositeDisposable.DisposeKey) + case done +} + +/// Type erased recursive scheduler. +final class AnyRecursiveScheduler { + + typealias Action = (State, AnyRecursiveScheduler) -> Void + + private let _lock = RecursiveLock() + + // state + private let _group = CompositeDisposable() + + private var _scheduler: SchedulerType + private var _action: Action? + + init(scheduler: SchedulerType, action: @escaping Action) { + self._action = action + self._scheduler = scheduler + } + + /** + Schedules an action to be executed recursively. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the recursive action. + */ + func schedule(_ state: State, dueTime: RxTimeInterval) { + var scheduleState: ScheduleState = .initial + + let d = self._scheduler.scheduleRelative(state, dueTime: dueTime) { state -> Disposable in + // best effort + if self._group.isDisposed { + return Disposables.create() + } + + let action = self._lock.calculateLocked { () -> Action? in + switch scheduleState { + case let .added(removeKey): + self._group.remove(for: removeKey) + case .initial: + break + case .done: + break + } + + scheduleState = .done + + return self._action + } + + if let action = action { + action(state, self) + } + + return Disposables.create() + } + + self._lock.performLocked { + switch scheduleState { + case .added: + rxFatalError("Invalid state") + case .initial: + if let removeKey = self._group.insert(d) { + scheduleState = .added(removeKey) + } + else { + scheduleState = .done + } + case .done: + break + } + } + } + + /// Schedules an action to be executed recursively. + /// + /// - parameter state: State passed to the action to be executed. + func schedule(_ state: State) { + var scheduleState: ScheduleState = .initial + + let d = self._scheduler.schedule(state) { state -> Disposable in + // best effort + if self._group.isDisposed { + return Disposables.create() + } + + let action = self._lock.calculateLocked { () -> Action? in + switch scheduleState { + case let .added(removeKey): + self._group.remove(for: removeKey) + case .initial: + break + case .done: + break + } + + scheduleState = .done + + return self._action + } + + if let action = action { + action(state, self) + } + + return Disposables.create() + } + + self._lock.performLocked { + switch scheduleState { + case .added: + rxFatalError("Invalid state") + case .initial: + if let removeKey = self._group.insert(d) { + scheduleState = .added(removeKey) + } + else { + scheduleState = .done + } + case .done: + break + } + } + } + + func dispose() { + self._lock.performLocked { + self._action = nil + } + self._group.dispose() + } +} + +/// Type erased recursive scheduler. +final class RecursiveImmediateScheduler { + typealias Action = (_ state: State, _ recurse: (State) -> Void) -> Void + + private var _lock = SpinLock() + private let _group = CompositeDisposable() + + private var _action: Action? + private let _scheduler: ImmediateSchedulerType + + init(action: @escaping Action, scheduler: ImmediateSchedulerType) { + self._action = action + self._scheduler = scheduler + } + + // immediate scheduling + + /// Schedules an action to be executed recursively. + /// + /// - parameter state: State passed to the action to be executed. + func schedule(_ state: State) { + var scheduleState: ScheduleState = .initial + + let d = self._scheduler.schedule(state) { state -> Disposable in + // best effort + if self._group.isDisposed { + return Disposables.create() + } + + let action = self._lock.calculateLocked { () -> Action? in + switch scheduleState { + case let .added(removeKey): + self._group.remove(for: removeKey) + case .initial: + break + case .done: + break + } + + scheduleState = .done + + return self._action + } + + if let action = action { + action(state, self.schedule) + } + + return Disposables.create() + } + + self._lock.performLocked { + switch scheduleState { + case .added: + rxFatalError("Invalid state") + case .initial: + if let removeKey = self._group.insert(d) { + scheduleState = .added(removeKey) + } + else { + scheduleState = .done + } + case .done: + break + } + } + } + + func dispose() { + self._lock.performLocked { + self._action = nil + } + self._group.dispose() + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift new file mode 100644 index 000000000000..5b7b840b74e2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SchedulerServices+Emulation.swift @@ -0,0 +1,61 @@ +// +// SchedulerServices+Emulation.swift +// RxSwift +// +// Created by Krunoslav Zaher on 6/6/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +enum SchedulePeriodicRecursiveCommand { + case tick + case dispatchStart +} + +final class SchedulePeriodicRecursive { + typealias RecursiveAction = (State) -> State + typealias RecursiveScheduler = AnyRecursiveScheduler + + private let _scheduler: SchedulerType + private let _startAfter: RxTimeInterval + private let _period: RxTimeInterval + private let _action: RecursiveAction + + private var _state: State + private let _pendingTickCount = AtomicInt(0) + + init(scheduler: SchedulerType, startAfter: RxTimeInterval, period: RxTimeInterval, action: @escaping RecursiveAction, state: State) { + self._scheduler = scheduler + self._startAfter = startAfter + self._period = period + self._action = action + self._state = state + } + + func start() -> Disposable { + return self._scheduler.scheduleRecursive(SchedulePeriodicRecursiveCommand.tick, dueTime: self._startAfter, action: self.tick) + } + + func tick(_ command: SchedulePeriodicRecursiveCommand, scheduler: RecursiveScheduler) { + // Tries to emulate periodic scheduling as best as possible. + // The problem that could arise is if handling periodic ticks take too long, or + // tick interval is short. + switch command { + case .tick: + scheduler.schedule(.tick, dueTime: self._period) + + // The idea is that if on tick there wasn't any item enqueued, schedule to perform work immediately. + // Else work will be scheduled after previous enqueued work completes. + if increment(self._pendingTickCount) == 0 { + self.tick(.dispatchStart, scheduler: scheduler) + } + + case .dispatchStart: + self._state = self._action(self._state) + // Start work and schedule check is this last batch of work + if decrement(self._pendingTickCount) > 1 { + // This gives priority to scheduler emulation, it's not perfect, but helps + scheduler.schedule(SchedulePeriodicRecursiveCommand.dispatchStart) + } + } + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift new file mode 100644 index 000000000000..8adb57b309f2 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/SerialDispatchQueueScheduler.swift @@ -0,0 +1,132 @@ +// +// SerialDispatchQueueScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/8/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +import struct Foundation.TimeInterval +import struct Foundation.Date +import Dispatch + +/** +Abstracts the work that needs to be performed on a specific `dispatch_queue_t`. It will make sure +that even if concurrent dispatch queue is passed, it's transformed into a serial one. + +It is extremely important that this scheduler is serial, because +certain operator perform optimizations that rely on that property. + +Because there is no way of detecting is passed dispatch queue serial or +concurrent, for every queue that is being passed, worst case (concurrent) +will be assumed, and internal serial proxy dispatch queue will be created. + +This scheduler can also be used with internal serial queue alone. + +In case some customization need to be made on it before usage, +internal serial queue can be customized using `serialQueueConfiguration` +callback. +*/ +public class SerialDispatchQueueScheduler : SchedulerType { + public typealias TimeInterval = Foundation.TimeInterval + public typealias Time = Date + + /// - returns: Current time. + public var now : Date { + return Date() + } + + let configuration: DispatchQueueConfiguration + + /** + Constructs new `SerialDispatchQueueScheduler` that wraps `serialQueue`. + + - parameter serialQueue: Target dispatch queue. + - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. + */ + init(serialQueue: DispatchQueue, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + self.configuration = DispatchQueueConfiguration(queue: serialQueue, leeway: leeway) + } + + /** + Constructs new `SerialDispatchQueueScheduler` with internal serial queue named `internalSerialQueueName`. + + Additional dispatch queue properties can be set after dispatch queue is created using `serialQueueConfiguration`. + + - parameter internalSerialQueueName: Name of internal serial dispatch queue. + - parameter serialQueueConfiguration: Additional configuration of internal serial dispatch queue. + - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. + */ + public convenience init(internalSerialQueueName: String, serialQueueConfiguration: ((DispatchQueue) -> Void)? = nil, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + let queue = DispatchQueue(label: internalSerialQueueName, attributes: []) + serialQueueConfiguration?(queue) + self.init(serialQueue: queue, leeway: leeway) + } + + /** + Constructs new `SerialDispatchQueueScheduler` named `internalSerialQueueName` that wraps `queue`. + + - parameter queue: Possibly concurrent dispatch queue used to perform work. + - parameter internalSerialQueueName: Name of internal serial dispatch queue proxy. + - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. + */ + public convenience init(queue: DispatchQueue, internalSerialQueueName: String, leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + // Swift 3.0 IUO + let serialQueue = DispatchQueue(label: internalSerialQueueName, + attributes: [], + target: queue) + self.init(serialQueue: serialQueue, leeway: leeway) + } + + /** + Constructs new `SerialDispatchQueueScheduler` that wraps on of the global concurrent dispatch queues. + + - parameter qos: Identifier for global dispatch queue with specified quality of service class. + - parameter internalSerialQueueName: Custom name for internal serial dispatch queue proxy. + - parameter leeway: The amount of time, in nanoseconds, that the system will defer the timer. + */ + @available(iOS 8, OSX 10.10, *) + public convenience init(qos: DispatchQoS, internalSerialQueueName: String = "rx.global_dispatch_queue.serial", leeway: DispatchTimeInterval = DispatchTimeInterval.nanoseconds(0)) { + self.init(queue: DispatchQueue.global(qos: qos.qosClass), internalSerialQueueName: internalSerialQueueName, leeway: leeway) + } + + /** + Schedules an action to be executed immediately. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.scheduleInternal(state, action: action) + } + + func scheduleInternal(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.schedule(state, action: action) + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public final func scheduleRelative(_ state: StateType, dueTime: Foundation.TimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.configuration.scheduleRelative(state, dueTime: dueTime, action: action) + } + + /** + Schedules a periodic piece of work. + + - parameter state: State passed to the action to be executed. + - parameter startAfter: Period after which initial work should be run. + - parameter period: Period for running the work periodically. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedulePeriodic(_ state: StateType, startAfter: TimeInterval, period: TimeInterval, action: @escaping (StateType) -> StateType) -> Disposable { + return self.configuration.schedulePeriodic(state, startAfter: startAfter, period: period, action: action) + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift new file mode 100644 index 000000000000..a17475ab86dd --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeConverterType.swift @@ -0,0 +1,95 @@ +// +// VirtualTimeConverterType.swift +// RxSwift +// +// Created by Krunoslav Zaher on 12/23/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Parametrization for virtual time used by `VirtualTimeScheduler`s. +public protocol VirtualTimeConverterType { + /// Virtual time unit used that represents ticks of virtual clock. + associatedtype VirtualTimeUnit + + /// Virtual time unit used to represent differences of virtual times. + associatedtype VirtualTimeIntervalUnit + + /** + Converts virtual time to real time. + + - parameter virtualTime: Virtual time to convert to `Date`. + - returns: `Date` corresponding to virtual time. + */ + func convertFromVirtualTime(_ virtualTime: VirtualTimeUnit) -> RxTime + + /** + Converts real time to virtual time. + + - parameter time: `Date` to convert to virtual time. + - returns: Virtual time corresponding to `Date`. + */ + func convertToVirtualTime(_ time: RxTime) -> VirtualTimeUnit + + /** + Converts from virtual time interval to `NSTimeInterval`. + + - parameter virtualTimeInterval: Virtual time interval to convert to `NSTimeInterval`. + - returns: `NSTimeInterval` corresponding to virtual time interval. + */ + func convertFromVirtualTimeInterval(_ virtualTimeInterval: VirtualTimeIntervalUnit) -> RxTimeInterval + + /** + Converts from `NSTimeInterval` to virtual time interval. + + - parameter timeInterval: `NSTimeInterval` to convert to virtual time interval. + - returns: Virtual time interval corresponding to time interval. + */ + func convertToVirtualTimeInterval(_ timeInterval: RxTimeInterval) -> VirtualTimeIntervalUnit + + /** + Offsets virtual time by virtual time interval. + + - parameter time: Virtual time. + - parameter offset: Virtual time interval. + - returns: Time corresponding to time offsetted by virtual time interval. + */ + func offsetVirtualTime(_ time: VirtualTimeUnit, offset: VirtualTimeIntervalUnit) -> VirtualTimeUnit + + /** + This is additional abstraction because `Date` is unfortunately not comparable. + Extending `Date` with `Comparable` would be too risky because of possible collisions with other libraries. + */ + func compareVirtualTime(_ lhs: VirtualTimeUnit, _ rhs: VirtualTimeUnit) -> VirtualTimeComparison +} + +/** + Virtual time comparison result. + + This is additional abstraction because `Date` is unfortunately not comparable. + Extending `Date` with `Comparable` would be too risky because of possible collisions with other libraries. +*/ +public enum VirtualTimeComparison { + /// lhs < rhs. + case lessThan + /// lhs == rhs. + case equal + /// lhs > rhs. + case greaterThan +} + +extension VirtualTimeComparison { + /// lhs < rhs. + var lessThen: Bool { + return self == .lessThan + } + + /// lhs > rhs + var greaterThan: Bool { + return self == .greaterThan + } + + /// lhs == rhs + var equal: Bool { + return self == .equal + } +} diff --git a/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift new file mode 100644 index 000000000000..037df95a0474 --- /dev/null +++ b/CI/samples.ci/client/petstore/swift4/rxswift/SwaggerClientTests/Pods/RxSwift/RxSwift/Schedulers/VirtualTimeScheduler.swift @@ -0,0 +1,269 @@ +// +// VirtualTimeScheduler.swift +// RxSwift +// +// Created by Krunoslav Zaher on 2/14/15. +// Copyright © 2015 Krunoslav Zaher. All rights reserved. +// + +/// Base class for virtual time schedulers using a priority queue for scheduled items. +open class VirtualTimeScheduler + : SchedulerType { + + public typealias VirtualTime = Converter.VirtualTimeUnit + public typealias VirtualTimeInterval = Converter.VirtualTimeIntervalUnit + + private var _running : Bool + + private var _clock: VirtualTime + + fileprivate var _schedulerQueue : PriorityQueue> + private var _converter: Converter + + private var _nextId = 0 + + /// - returns: Current time. + public var now: RxTime { + return self._converter.convertFromVirtualTime(self.clock) + } + + /// - returns: Scheduler's absolute time clock value. + public var clock: VirtualTime { + return self._clock + } + + /// Creates a new virtual time scheduler. + /// + /// - parameter initialClock: Initial value for the clock. + public init(initialClock: VirtualTime, converter: Converter) { + self._clock = initialClock + self._running = false + self._converter = converter + self._schedulerQueue = PriorityQueue(hasHigherPriority: { + switch converter.compareVirtualTime($0.time, $1.time) { + case .lessThan: + return true + case .equal: + return $0.id < $1.id + case .greaterThan: + return false + } + }, isEqual: { $0 === $1 }) + #if TRACE_RESOURCES + _ = Resources.incrementTotal() + #endif + } + + /** + Schedules an action to be executed immediately. + + - parameter state: State passed to the action to be executed. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func schedule(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { + return self.scheduleRelative(state, dueTime: 0.0) { a in + return action(a) + } + } + + /** + Schedules an action to be executed. + + - parameter state: State passed to the action to be executed. + - parameter dueTime: Relative time after which to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleRelative(_ state: StateType, dueTime: RxTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + let time = self.now.addingTimeInterval(dueTime) + let absoluteTime = self._converter.convertToVirtualTime(time) + let adjustedTime = self.adjustScheduledTime(absoluteTime) + return self.scheduleAbsoluteVirtual(state, time: adjustedTime, action: action) + } + + /** + Schedules an action to be executed after relative time has passed. + + - parameter state: State passed to the action to be executed. + - parameter time: Absolute time when to execute the action. If this is less or equal then `now`, `now + 1` will be used. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleRelativeVirtual(_ state: StateType, dueTime: VirtualTimeInterval, action: @escaping (StateType) -> Disposable) -> Disposable { + let time = self._converter.offsetVirtualTime(self.clock, offset: dueTime) + return self.scheduleAbsoluteVirtual(state, time: time, action: action) + } + + /** + Schedules an action to be executed at absolute virtual time. + + - parameter state: State passed to the action to be executed. + - parameter time: Absolute time when to execute the action. + - parameter action: Action to be executed. + - returns: The disposable object used to cancel the scheduled action (best effort). + */ + public func scheduleAbsoluteVirtual(_ state: StateType, time: Converter.VirtualTimeUnit, action: @escaping (StateType) -> Disposable) -> Disposable { + MainScheduler.ensureExecutingOnScheduler() + + let compositeDisposable = CompositeDisposable() + + let item = VirtualSchedulerItem(action: { + let dispose = action(state) + return dispose + }, time: time, id: self._nextId) + + self._nextId += 1 + + self._schedulerQueue.enqueue(item) + + _ = compositeDisposable.insert(item) + + return compositeDisposable + } + + /// Adjusts time of scheduling before adding item to schedule queue. + open func adjustScheduledTime(_ time: Converter.VirtualTimeUnit) -> Converter.VirtualTimeUnit { + return time + } + + /// Starts the virtual time scheduler. + public func start() { + MainScheduler.ensureExecutingOnScheduler() + + if self._running { + return + } + + self._running = true + repeat { + guard let next = self.findNext() else { + break + } + + if self._converter.compareVirtualTime(next.time, self.clock).greaterThan { + self._clock = next.time + } + + next.invoke() + self._schedulerQueue.remove(next) + } while self._running + + self._running = false + } + + func findNext() -> VirtualSchedulerItem? { + while let front = self._schedulerQueue.peek() { + if front.isDisposed { + self._schedulerQueue.remove(front) + continue + } + + return front + } + + return nil + } + + /// Advances the scheduler's clock to the specified time, running all work till that point. + /// + /// - parameter virtualTime: Absolute time to advance the scheduler's clock to. + public func advanceTo(_ virtualTime: VirtualTime) { + MainScheduler.ensureExecutingOnScheduler() + + if self._running { + fatalError("Scheduler is already running") + } + + self._running = true + repeat { + guard let next = self.findNext() else { + break + } + + if self._converter.compareVirtualTime(next.time, virtualTime).greaterThan { + break + } + + if self._converter.compareVirtualTime(next.time, self.clock).greaterThan { + self._clock = next.time + } + + next.invoke() + self._schedulerQueue.remove(next) + } while self._running + + self._clock = virtualTime + self._running = false + } + + /// Advances the scheduler's clock by the specified relative time. + public func sleep(_ virtualInterval: VirtualTimeInterval) { + MainScheduler.ensureExecutingOnScheduler() + + let sleepTo = self._converter.offsetVirtualTime(self.clock, offset: virtualInterval) + if self._converter.compareVirtualTime(sleepTo, self.clock).lessThen { + fatalError("Can't sleep to past.") + } + + self._clock = sleepTo + } + + /// Stops the virtual time scheduler. + public func stop() { + MainScheduler.ensureExecutingOnScheduler() + + self._running = false + } + + #if TRACE_RESOURCES + deinit { + _ = Resources.decrementTotal() + } + #endif +} + +// MARK: description + +extension VirtualTimeScheduler: CustomDebugStringConvertible { + /// A textual representation of `self`, suitable for debugging. + public var debugDescription: String { + return self._schedulerQueue.debugDescription + } +} + +final class VirtualSchedulerItem -## Enum: StatusEnum -Name | Value ----- | ----- - - - diff --git a/samples/client/petstore/android/httpclient/docs/Pet.md b/samples/client/petstore/android/httpclient/docs/Pet.md deleted file mode 100644 index a4daa24feb60..000000000000 --- a/samples/client/petstore/android/httpclient/docs/Pet.md +++ /dev/null @@ -1,21 +0,0 @@ - -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- - - - diff --git a/samples/client/petstore/android/httpclient/docs/PetApi.md b/samples/client/petstore/android/httpclient/docs/PetApi.md deleted file mode 100644 index 7cf076f29c58..000000000000 --- a/samples/client/petstore/android/httpclient/docs/PetApi.md +++ /dev/null @@ -1,356 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(pet) - -Add a new pet to the store - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.addPet(pet); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -Long petId = null; // Long | Pet id to delete -String apiKey = null; // String | -try { - apiInstance.deletePet(petId, apiKey); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | [default to null] - **apiKey** | **String**| | [optional] [default to null] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **findPetsByStatus** -> List<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -List status = null; // List | Status values that need to be considered for filter -try { - List result = apiInstance.findPetsByStatus(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -List tags = null; // List | Tags to filter by -try { - List result = apiInstance.findPetsByTags(tags); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -Long petId = null; // Long | ID of pet to return -try { - Pet result = apiInstance.getPetById(petId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | [default to null] - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(pet) - -Update an existing pet - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.updatePet(pet); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -Long petId = null; // Long | ID of pet that needs to be updated -String name = null; // String | Updated name of the pet -String status = null; // String | Updated status of the pet -try { - apiInstance.updatePetWithForm(petId, name, status); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | [default to null] - **name** | **String**| Updated name of the pet | [optional] [default to null] - **status** | **String**| Updated status of the pet | [optional] [default to null] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined - - -# **uploadFile** -> ApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - -### Example -```java -// Import classes: -//import org.openapitools.client.api.PetApi; - -PetApi apiInstance = new PetApi(); -Long petId = null; // Long | ID of pet to update -String additionalMetadata = null; // String | Additional data to pass to server -File file = null; // File | file to upload -try { - ApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | [default to null] - **additionalMetadata** | **String**| Additional data to pass to server | [optional] [default to null] - **file** | **File**| file to upload | [optional] [default to null] - -### Return type - -[**ApiResponse**](ApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/android/httpclient/docs/StoreApi.md b/samples/client/petstore/android/httpclient/docs/StoreApi.md deleted file mode 100644 index b768ad5ba986..000000000000 --- a/samples/client/petstore/android/httpclient/docs/StoreApi.md +++ /dev/null @@ -1,177 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```java -// Import classes: -//import org.openapitools.client.api.StoreApi; - -StoreApi apiInstance = new StoreApi(); -String orderId = null; // String | ID of the order that needs to be deleted -try { - apiInstance.deleteOrder(orderId); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | [default to null] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -// Import classes: -//import org.openapitools.client.api.StoreApi; - -StoreApi apiInstance = new StoreApi(); -try { - Map result = apiInstance.getInventory(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map<String, Integer>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -// Import classes: -//import org.openapitools.client.api.StoreApi; - -StoreApi apiInstance = new StoreApi(); -Long orderId = null; // Long | ID of pet that needs to be fetched -try { - Order result = apiInstance.getOrderById(orderId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(order) - -Place an order for a pet - -### Example -```java -// Import classes: -//import org.openapitools.client.api.StoreApi; - -StoreApi apiInstance = new StoreApi(); -Order order = new Order(); // Order | order placed for purchasing the pet -try { - Order result = apiInstance.placeOrder(order); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/android/httpclient/docs/Tag.md b/samples/client/petstore/android/httpclient/docs/Tag.md deleted file mode 100644 index de6814b55d57..000000000000 --- a/samples/client/petstore/android/httpclient/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/android/httpclient/docs/User.md b/samples/client/petstore/android/httpclient/docs/User.md deleted file mode 100644 index 8b6753dd284a..000000000000 --- a/samples/client/petstore/android/httpclient/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] - - - diff --git a/samples/client/petstore/android/httpclient/docs/UserApi.md b/samples/client/petstore/android/httpclient/docs/UserApi.md deleted file mode 100644 index e5a16428112e..000000000000 --- a/samples/client/petstore/android/httpclient/docs/UserApi.md +++ /dev/null @@ -1,344 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(user) - -Create user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -User user = new User(); // User | Created user object -try { - apiInstance.createUser(user); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) - -Creates list of users with given input array - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object -try { - apiInstance.createUsersWithArrayInput(user); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **createUsersWithListInput** -> createUsersWithListInput(user) - -Creates list of users with given input array - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object -try { - apiInstance.createUsersWithListInput(user); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -String username = null; // String | The name that needs to be deleted -try { - apiInstance.deleteUser(username); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | [default to null] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -String username = null; // String | The name that needs to be fetched. Use user1 for testing. -try { - User result = apiInstance.getUserByName(username); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -String username = null; // String | The user name for login -String password = null; // String | The password for login in clear text -try { - String result = apiInstance.loginUser(username, password); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | [default to null] - **password** | **String**| The password for login in clear text | [default to null] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -try { - apiInstance.logoutUser(); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **updateUser** -> updateUser(username, user) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import org.openapitools.client.api.UserApi; - -UserApi apiInstance = new UserApi(); -String username = null; // String | name that need to be deleted -User user = new User(); // User | Updated user object -try { - apiInstance.updateUser(username, user); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - diff --git a/samples/client/petstore/android/httpclient/git_push.sh b/samples/client/petstore/android/httpclient/git_push.sh deleted file mode 100644 index 20057f67ade4..000000000000 --- a/samples/client/petstore/android/httpclient/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index e496c054f693..000000000000 --- a/samples/client/petstore/android/httpclient/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,5 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/samples/client/petstore/android/httpclient/gradlew b/samples/client/petstore/android/httpclient/gradlew deleted file mode 100755 index af6708ff229f..000000000000 --- a/samples/client/petstore/android/httpclient/gradlew +++ /dev/null @@ -1,172 +0,0 @@ -#!/usr/bin/env sh - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - -exec "$JAVACMD" "$@" diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml deleted file mode 100644 index 455f6be5ff8c..000000000000 --- a/samples/client/petstore/android/httpclient/pom.xml +++ /dev/null @@ -1,181 +0,0 @@ - - 4.0.0 - org.openapitools - openapi-android-client - jar - openapi-android-client - 1.0.0 - - scm:git:git@github.com:openapitools/openapi-generator.git - scm:git:git@github.com:openapitools/openapi-generator.git - https://openapi-generator.tech - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.0.0-M1 - - - enforce-maven - - enforce - - - - - 2.2.0 - - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - 2.12 - - - - loggerPath - conf/log4j.properties - - - -Xms512m -Xmx1500m - methods - pertest - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - jar - test-jar - - - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add_sources - generate-sources - - add-source - - - - - src/main/java - - - - - add_test_sources - generate-test-sources - - add-test-source - - - - - src/test/java - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.google.code.gson - gson - ${gson-version} - - - org.apache.httpcomponents - httpclient - ${httpclient-version} - compile - - - org.apache.httpcomponents - httpmime - ${httpclient-version} - compile - - - - - junit - junit - ${junit-version} - test - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - - - UTF-8 - 1.5.18 - 2.3.1 - 4.8.1 - 1.0.0 - 4.8.1 - 4.3.6 - - diff --git a/samples/client/petstore/android/httpclient/settings.gradle b/samples/client/petstore/android/httpclient/settings.gradle deleted file mode 100644 index 666307984ab5..000000000000 --- a/samples/client/petstore/android/httpclient/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "openapi-android-client" diff --git a/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml b/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml deleted file mode 100644 index 5b701913d244..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java deleted file mode 100644 index 7e9a6ef4d562..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiException.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client; - -public class ApiException extends Exception { - int code = 0; - String message = null; - - public ApiException() {} - - public ApiException(int code, String message) { - this.code = code; - this.message = message; - } - - public int getCode() { - return code; - } - - public void setCode(int code) { - this.code = code; - } - - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java deleted file mode 100644 index 18403b1972c6..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/ApiInvoker.java +++ /dev/null @@ -1,467 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client; - -import org.apache.http.*; -import org.apache.http.client.*; -import org.apache.http.client.methods.*; -import org.apache.http.conn.*; -import org.apache.http.conn.scheme.*; -import org.apache.http.conn.ssl.*; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.*; -import org.apache.http.impl.conn.*; -import org.apache.http.impl.conn.tsccm.*; -import org.apache.http.params.*; -import org.apache.http.util.EntityUtils; - -import java.io.File; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.Socket; -import java.net.UnknownHostException; -import java.net.URLEncoder; - -import java.util.Collection; -import java.util.Map; -import java.util.HashMap; -import java.util.List; -import java.util.ArrayList; - -import java.security.GeneralSecurityException; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.cert.*; - -import java.text.DateFormat; -import java.text.SimpleDateFormat; - -import java.util.Date; -import java.util.TimeZone; -import java.util.Random; -import java.util.logging.Level; -import java.util.logging.Logger; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; - -import com.google.gson.JsonParseException; - -public class ApiInvoker { - private static ApiInvoker INSTANCE = new ApiInvoker(); - private Map defaultHeaderMap = new HashMap(); - - private HttpClient client = null; - - private boolean ignoreSSLCertificates = false; - - private ClientConnectionManager ignoreSSLConnectionManager; - - /** Content type "text/plain" with UTF-8 encoding. */ - public static final ContentType TEXT_PLAIN_UTF8 = ContentType.create("text/plain", Consts.UTF_8); - - /** - * ISO 8601 date time format. - * @see https://en.wikipedia.org/wiki/ISO_8601 - */ - public static final SimpleDateFormat DATE_TIME_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); - - /** - * ISO 8601 date format. - * @see https://en.wikipedia.org/wiki/ISO_8601 - */ - public static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); - - static { - // Use UTC as the default time zone. - DATE_TIME_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); - DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("UTC")); - - // Set default User-Agent. - setUserAgent("OpenAPI-Generator/1.0.0/android"); - } - - public static void setUserAgent(String userAgent) { - INSTANCE.addDefaultHeader("User-Agent", userAgent); - } - - public static Date parseDateTime(String str) { - try { - return DATE_TIME_FORMAT.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } - } - - public static Date parseDate(String str) { - try { - return DATE_FORMAT.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } - } - - public static String formatDateTime(Date datetime) { - return DATE_TIME_FORMAT.format(datetime); - } - - public static String formatDate(Date date) { - return DATE_FORMAT.format(date); - } - - public static String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDateTime((Date) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(","); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /* - Format to {@code Pair} objects. - */ - public static List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null) return params; - - Collection valueCollection = null; - if (value instanceof Collection) { - valueCollection = (Collection) value; - } else { - params.add(new Pair(name, parameterToString(value))); - return params; - } - - if (valueCollection.isEmpty()){ - return params; - } - - // get the collection format - collectionFormat = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // default: csv - - // create the params based on the collection format - if (collectionFormat.equals("multi")) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } - - return params; - } - - String delimiter = ","; - - if (collectionFormat.equals("csv")) { - delimiter = ","; - } else if (collectionFormat.equals("ssv")) { - delimiter = " "; - } else if (collectionFormat.equals("tsv")) { - delimiter = "\t"; - } else if (collectionFormat.equals("pipes")) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - params.add(new Pair(name, sb.substring(1))); - - return params; - } - - public ApiInvoker() { - initConnectionManager(); - } - - public static ApiInvoker getInstance() { - return INSTANCE; - } - - public void ignoreSSLCertificates(boolean ignoreSSLCertificates) { - this.ignoreSSLCertificates = ignoreSSLCertificates; - } - - public void addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - } - - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "UTF-8"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - public static Object deserialize(String json, String containerType, Class cls) throws ApiException { - try{ - if("list".equalsIgnoreCase(containerType) || "array".equalsIgnoreCase(containerType)) { - return JsonUtil.deserializeToList(json, cls); - } - else if(String.class.equals(cls)) { - if(json != null && json.startsWith("\"") && json.endsWith("\"") && json.length() > 1) - return json.substring(1, json.length() - 1); - else - return json; - } - else { - return JsonUtil.deserializeToObject(json, cls); - } - } - catch (JsonParseException e) { - throw new ApiException(500, e.getMessage()); - } - } - - public static String serialize(Object obj) throws ApiException { - try { - if (obj != null) - return JsonUtil.serialize(obj); - else - return null; - } - catch (Exception e) { - throw new ApiException(500, e.getMessage()); - } - } - - public String invokeAPI(String host, String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String contentType) throws ApiException { - HttpClient client = getClient(host); - - StringBuilder b = new StringBuilder(); - b.append("?"); - if (queryParams != null){ - for (Pair queryParam : queryParams){ - if (!queryParam.getName().isEmpty()) { - b.append(escapeString(queryParam.getName())); - b.append("="); - b.append(escapeString(queryParam.getValue())); - b.append("&"); - } - } - } - - String querystring = b.substring(0, b.length() - 1); - String url = host + path + querystring; - - HashMap headers = new HashMap(); - - for(String key : headerParams.keySet()) { - headers.put(key, headerParams.get(key)); - } - - for(String key : defaultHeaderMap.keySet()) { - if(!headerParams.containsKey(key)) { - headers.put(key, defaultHeaderMap.get(key)); - } - } - headers.put("Accept", "application/json"); - - // URL encoded string from form parameters - String formParamStr = null; - - // for form data - if ("application/x-www-form-urlencoded".equals(contentType)) { - StringBuilder formParamBuilder = new StringBuilder(); - - // encode the form params - for (String key : formParams.keySet()) { - String value = formParams.get(key); - if (value != null && !"".equals(value.trim())) { - if (formParamBuilder.length() > 0) { - formParamBuilder.append("&"); - } - try { - formParamBuilder.append(URLEncoder.encode(key, "utf8")).append("=").append(URLEncoder.encode(value, "utf8")); - } - catch (Exception e) { - // move on to next - } - } - } - formParamStr = formParamBuilder.toString(); - } - - HttpResponse response = null; - try { - if ("GET".equals(method)) { - HttpGet get = new HttpGet(url); - get.addHeader("Accept", "application/json"); - for(String key : headers.keySet()) { - get.setHeader(key, headers.get(key)); - } - response = client.execute(get); - } - else if ("POST".equals(method)) { - HttpPost post = new HttpPost(url); - if (formParamStr != null) { - post.setHeader("Content-Type", contentType); - post.setEntity(new StringEntity(formParamStr, "UTF-8")); - } else if (body != null) { - if (body instanceof HttpEntity) { - // this is for file uploading - post.setEntity((HttpEntity) body); - } else { - post.setHeader("Content-Type", contentType); - post.setEntity(new StringEntity(serialize(body), "UTF-8")); - } - } - for(String key : headers.keySet()) { - post.setHeader(key, headers.get(key)); - } - response = client.execute(post); - } - else if ("PUT".equals(method)) { - HttpPut put = new HttpPut(url); - if (formParamStr != null) { - put.setHeader("Content-Type", contentType); - put.setEntity(new StringEntity(formParamStr, "UTF-8")); - } else if (body != null) { - put.setHeader("Content-Type", contentType); - put.setEntity(new StringEntity(serialize(body), "UTF-8")); - } - for(String key : headers.keySet()) { - put.setHeader(key, headers.get(key)); - } - response = client.execute(put); - } - else if ("DELETE".equals(method)) { - HttpDelete delete = new HttpDelete(url); - for(String key : headers.keySet()) { - delete.setHeader(key, headers.get(key)); - } - response = client.execute(delete); - } - else if ("PATCH".equals(method)) { - HttpPatch patch = new HttpPatch(url); - if (formParamStr != null) { - patch.setHeader("Content-Type", contentType); - patch.setEntity(new StringEntity(formParamStr, "UTF-8")); - } else if (body != null) { - patch.setHeader("Content-Type", contentType); - patch.setEntity(new StringEntity(serialize(body), "UTF-8")); - } - for(String key : headers.keySet()) { - patch.setHeader(key, headers.get(key)); - } - response = client.execute(patch); - } - - int code = response.getStatusLine().getStatusCode(); - String responseString = null; - if(code == 204) { - responseString = ""; - return responseString; - } - else if(code >= 200 && code < 300) { - if(response.getEntity() != null) { - HttpEntity resEntity = response.getEntity(); - responseString = EntityUtils.toString(resEntity); - } - return responseString; - } - else { - if(response.getEntity() != null) { - HttpEntity resEntity = response.getEntity(); - responseString = EntityUtils.toString(resEntity); - } - else - responseString = "no data"; - } - throw new ApiException(code, responseString); - } - catch(IOException e) { - throw new ApiException(500, e.getMessage()); - } - } - - private HttpClient getClient(String host) { - if (client == null) { - if (ignoreSSLCertificates && ignoreSSLConnectionManager != null) { - // Trust self signed certificates - client = new DefaultHttpClient(ignoreSSLConnectionManager, new BasicHttpParams()); - } else { - client = new DefaultHttpClient(); - } - } - return client; - } - - private void initConnectionManager() { - try { - final SSLContext sslContext = SSLContext.getInstance("SSL"); - - // set up a TrustManager that trusts everything - TrustManager[] trustManagers = new TrustManager[] { - new X509TrustManager() { - public X509Certificate[] getAcceptedIssuers() { - return null; - } - public void checkClientTrusted(X509Certificate[] certs, String authType) {} - public void checkServerTrusted(X509Certificate[] certs, String authType) {} - }}; - - sslContext.init(null, trustManagers, new SecureRandom()); - - SSLSocketFactory sf = new SSLSocketFactory((KeyStore)null) { - private javax.net.ssl.SSLSocketFactory sslFactory = sslContext.getSocketFactory(); - - public Socket createSocket(Socket socket, String host, int port, boolean autoClose) - throws IOException, UnknownHostException { - return sslFactory.createSocket(socket, host, port, autoClose); - } - - public Socket createSocket() throws IOException { - return sslFactory.createSocket(); - } - }; - - sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); - Scheme httpsScheme = new Scheme("https", sf, 443); - SchemeRegistry schemeRegistry = new SchemeRegistry(); - schemeRegistry.register(httpsScheme); - schemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); - - ignoreSSLConnectionManager = new ThreadSafeClientConnManager(new BasicHttpParams(), schemeRegistry); - } catch (NoSuchAlgorithmException e) { - // This will only be thrown if SSL isn't available for some reason. - } catch (KeyManagementException e) { - // This might be thrown when passing a key into init(), but no key is being passed. - } catch (GeneralSecurityException e) { - // This catches anything else that might go wrong. - // If anything goes wrong we default to the standard connection manager. - } - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java deleted file mode 100644 index 33fd7b63bd2a..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/HttpPatch.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client; - -import org.apache.http.client.methods.*; - -public class HttpPatch extends HttpPost { - public static final String METHOD_PATCH = "PATCH"; - - public HttpPatch(final String url) { - super(url); - } - - @Override - public String getMethod() { - return METHOD_PATCH; - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java deleted file mode 100644 index 624c820ebce9..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/JsonUtil.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openapitools.client; - -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.reflect.TypeToken; -import java.lang.reflect.Type; -import java.util.List; - -public class JsonUtil { - public static GsonBuilder gsonBuilder; - - static { - gsonBuilder = new GsonBuilder(); - gsonBuilder.serializeNulls(); - gsonBuilder.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); - } - - public static Gson getGson() { - return gsonBuilder.create(); - } - - public static String serialize(Object obj){ - return getGson().toJson(obj); - } - - public static T deserializeToList(String jsonString, Class cls){ - return getGson().fromJson(jsonString, getListTypeForDeserialization(cls)); - } - - public static T deserializeToObject(String jsonString, Class cls){ - return getGson().fromJson(jsonString, getTypeForDeserialization(cls)); - } - - public static Type getListTypeForDeserialization(Class cls) { - String className = cls.getSimpleName(); - - if ("ApiResponse".equalsIgnoreCase(className)) { - return new TypeToken>(){}.getType(); - } - - if ("Category".equalsIgnoreCase(className)) { - return new TypeToken>(){}.getType(); - } - - if ("Order".equalsIgnoreCase(className)) { - return new TypeToken>(){}.getType(); - } - - if ("Pet".equalsIgnoreCase(className)) { - return new TypeToken>(){}.getType(); - } - - if ("Tag".equalsIgnoreCase(className)) { - return new TypeToken>(){}.getType(); - } - - if ("User".equalsIgnoreCase(className)) { - return new TypeToken>(){}.getType(); - } - - return new TypeToken>(){}.getType(); - } - - public static Type getTypeForDeserialization(Class cls) { - String className = cls.getSimpleName(); - - if ("ApiResponse".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Category".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Order".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Pet".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("Tag".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - if ("User".equalsIgnoreCase(className)) { - return new TypeToken(){}.getType(); - } - - return new TypeToken(){}.getType(); - } - -}; diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java deleted file mode 100644 index 21a436455a1d..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/Pair.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client; - -public class Pair { - private String name = ""; - private String value = ""; - - public Pair(String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) return; - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) return; - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) return false; - if (arg.trim().isEmpty()) return false; - - return true; - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java deleted file mode 100644 index 10e4466ae0b2..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/PetApi.java +++ /dev/null @@ -1,497 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiInvoker; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.*; - -import java.util.*; - -import org.openapitools.client.model.ApiResponse; -import java.io.File; -import org.openapitools.client.model.Pet; - -import org.apache.http.entity.mime.MultipartEntityBuilder; - -import java.util.Map; -import java.util.HashMap; -import java.io.File; - -public class PetApi { - String basePath = "http://petstore.swagger.io/v2"; - ApiInvoker apiInvoker = ApiInvoker.getInstance(); - - public void addHeader(String key, String value) { - getInvoker().addDefaultHeader(key, value); - } - - public ApiInvoker getInvoker() { - return apiInvoker; - } - - public void setBasePath(String basePath) { - this.basePath = basePath; - } - - public String getBasePath() { - return basePath; - } - - /** - * Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store - * @return void - */ - public void addPet (Pet pet) throws ApiException { - Object localVarPostBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); - } - - // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - "application/json","application/xml" - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Deletes a pet - * - * @param petId Pet id to delete - * @param apiKey - * @return void - */ - public void deletePet (Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - localVarHeaderParams.put("api_key", ApiInvoker.parameterToString(apiKey)); - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter - * @return List - */ - public List findPetsByStatus (List status) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'status' is set - if (status == null) { - throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); - } - - // create path and map variables - String localVarPath = "/pet/findByStatus".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "status", status)); - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by - * @return List - */ - public List findPetsByTags (List tags) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'tags' is set - if (tags == null) { - throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); - } - - // create path and map variables - String localVarPath = "/pet/findByTags".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("csv", "tags", tags)); - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (List) ApiInvoker.deserialize(localVarResponse, "array", Pet.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return - * @return Pet - */ - public Pet getPetById (Long petId) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Pet) ApiInvoker.deserialize(localVarResponse, "", Pet.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Update an existing pet - * - * @param pet Pet object that needs to be added to the store - * @return void - */ - public void updatePet (Pet pet) throws ApiException { - Object localVarPostBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); - } - - // create path and map variables - String localVarPath = "/pet".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - "application/json","application/xml" - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated - * @param name Updated name of the pet - * @param status Updated status of the pet - * @return void - */ - public void updatePetWithForm (Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - if (name != null) { - localVarBuilder.addTextBody("name", ApiInvoker.parameterToString(name), ApiInvoker.TEXT_PLAIN_UTF8); - } - - if (status != null) { - localVarBuilder.addTextBody("status", ApiInvoker.parameterToString(status), ApiInvoker.TEXT_PLAIN_UTF8); - } - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - localVarFormParams.put("name", ApiInvoker.parameterToString(name)); -localVarFormParams.put("status", ApiInvoker.parameterToString(status)); - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * uploads an image - * - * @param petId ID of pet to update - * @param additionalMetadata Additional data to pass to server - * @param file file to upload - * @return ApiResponse - */ - public ApiResponse uploadFile (Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{format\\}","json").replaceAll("\\{" + "petId" + "\\}", apiInvoker.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - "multipart/form-data" - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - if (additionalMetadata != null) { - localVarBuilder.addTextBody("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata), ApiInvoker.TEXT_PLAIN_UTF8); - } - - if (file != null) { - localVarBuilder.addBinaryBody("file", file); - } - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - localVarFormParams.put("additionalMetadata", ApiInvoker.parameterToString(additionalMetadata)); - - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (ApiResponse) ApiInvoker.deserialize(localVarResponse, "", ApiResponse.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java deleted file mode 100644 index 91dadd5646da..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/StoreApi.java +++ /dev/null @@ -1,255 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiInvoker; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.*; - -import java.util.*; - -import java.util.Map; -import org.openapitools.client.model.Order; - -import org.apache.http.entity.mime.MultipartEntityBuilder; - -import java.util.Map; -import java.util.HashMap; -import java.io.File; - -public class StoreApi { - String basePath = "http://petstore.swagger.io/v2"; - ApiInvoker apiInvoker = ApiInvoker.getInstance(); - - public void addHeader(String key, String value) { - getInvoker().addDefaultHeader(key, value); - } - - public ApiInvoker getInvoker() { - return apiInvoker; - } - - public void setBasePath(String basePath) { - this.basePath = basePath; - } - - public String getBasePath() { - return basePath; - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted - * @return void - */ - public void deleteOrder (String orderId) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); - } - - // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map - */ - public Map getInventory () throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Map) ApiInvoker.deserialize(localVarResponse, "map", Integer.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched - * @return Order - */ - public Order getOrderById (Long orderId) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); - } - - // create path and map variables - String localVarPath = "/store/order/{orderId}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "orderId" + "\\}", apiInvoker.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Place an order for a pet - * - * @param order order placed for purchasing the pet - * @return Order - */ - public Order placeOrder (Order order) throws ApiException { - Object localVarPostBody = order; - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); - } - - // create path and map variables - String localVarPath = "/store/order".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (Order) ApiInvoker.deserialize(localVarResponse, "", Order.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java deleted file mode 100644 index 6189aff41a38..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/api/UserApi.java +++ /dev/null @@ -1,475 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * OpenAPI spec version: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -package org.openapitools.client.api; - -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiInvoker; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.*; - -import java.util.*; - -import java.util.*; -import org.openapitools.client.model.User; - -import org.apache.http.entity.mime.MultipartEntityBuilder; - -import java.util.Map; -import java.util.HashMap; -import java.io.File; - -public class UserApi { - String basePath = "http://petstore.swagger.io/v2"; - ApiInvoker apiInvoker = ApiInvoker.getInstance(); - - public void addHeader(String key, String value) { - getInvoker().addDefaultHeader(key, value); - } - - public ApiInvoker getInvoker() { - return apiInvoker; - } - - public void setBasePath(String basePath) { - this.basePath = basePath; - } - - public String getBasePath() { - return basePath; - } - - /** - * Create user - * This can only be done by the logged in user. - * @param user Created user object - * @return void - */ - public void createUser (User user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); - } - - // create path and map variables - String localVarPath = "/user".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Creates list of users with given input array - * - * @param user List of user object - * @return void - */ - public void createUsersWithArrayInput (List user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); - } - - // create path and map variables - String localVarPath = "/user/createWithArray".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Creates list of users with given input array - * - * @param user List of user object - * @return void - */ - public void createUsersWithListInput (List user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); - } - - // create path and map variables - String localVarPath = "/user/createWithList".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted - * @return void - */ - public void deleteUser (String username) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); - } - - // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. - * @return User - */ - public User getUserByName (String username) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); - } - - // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (User) ApiInvoker.deserialize(localVarResponse, "", User.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Logs user into the system - * - * @param username The user name for login - * @param password The password for login in clear text - * @return String - */ - public String loginUser (String username, String password) throws ApiException { - Object localVarPostBody = null; - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); - } - // verify the required parameter 'password' is set - if (password == null) { - throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); - } - - // create path and map variables - String localVarPath = "/user/login".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "username", username)); - localVarQueryParams.addAll(ApiInvoker.parameterToPairs("", "password", password)); - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return (String) ApiInvoker.deserialize(localVarResponse, "", String.class); - } - else { - return null; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Logs out current logged in user session - * - * @return void - */ - public void logoutUser () throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout".replaceAll("\\{format\\}","json"); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted - * @param user Updated user object - * @return void - */ - public void updateUser (String username, User user) throws ApiException { - Object localVarPostBody = user; - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); - } - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); - } - - // create path and map variables - String localVarPath = "/user/{username}".replaceAll("\\{format\\}","json").replaceAll("\\{" + "username" + "\\}", apiInvoker.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - // header params - Map localVarHeaderParams = new HashMap(); - // form params - Map localVarFormParams = new HashMap(); - - - - String[] localVarContentTypes = { - - }; - String localVarContentType = localVarContentTypes.length > 0 ? localVarContentTypes[0] : "application/json"; - - if (localVarContentType.startsWith("multipart/form-data")) { - // file uploading - MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create(); - - - localVarPostBody = localVarBuilder.build(); - } else { - // normal form params - } - - try { - String localVarResponse = apiInvoker.invokeAPI(basePath, localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarContentType); - if(localVarResponse != null){ - return ; - } - else { - return ; - } - } catch (ApiException ex) { - throw ex; - } - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java deleted file mode 100644 index 8c33d47861e7..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/ApiResponse.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.client.model; - - -import io.swagger.annotations.*; -import com.google.gson.annotations.SerializedName; - - -/** - * Describes the result of uploading an image resource - **/ -@ApiModel(description = "Describes the result of uploading an image resource") -public class ApiResponse { - - @SerializedName("code") - private Integer code = null; - @SerializedName("type") - private String type = null; - @SerializedName("message") - private String message = null; - - /** - **/ - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - public void setCode(Integer code) { - this.code = code; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getType() { - return type; - } - public void setType(String type) { - this.type = type; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ApiResponse apiResponse = (ApiResponse) o; - return (this.code == null ? apiResponse.code == null : this.code.equals(apiResponse.code)) && - (this.type == null ? apiResponse.type == null : this.type.equals(apiResponse.type)) && - (this.message == null ? apiResponse.message == null : this.message.equals(apiResponse.message)); - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (this.code == null ? 0: this.code.hashCode()); - result = 31 * result + (this.type == null ? 0: this.type.hashCode()); - result = 31 * result + (this.message == null ? 0: this.message.hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ApiResponse {\n"); - - sb.append(" code: ").append(code).append("\n"); - sb.append(" type: ").append(type).append("\n"); - sb.append(" message: ").append(message).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java deleted file mode 100644 index c6e1176a6c55..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Category.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openapitools.client.model; - - -import io.swagger.annotations.*; -import com.google.gson.annotations.SerializedName; - - -/** - * A category for a pet - **/ -@ApiModel(description = "A category for a pet") -public class Category { - - @SerializedName("id") - private Long id = null; - @SerializedName("name") - private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return (this.id == null ? category.id == null : this.id.equals(category.id)) && - (this.name == null ? category.name == null : this.name.equals(category.name)); - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (this.id == null ? 0: this.id.hashCode()); - result = 31 * result + (this.name == null ? 0: this.name.hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" name: ").append(name).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java deleted file mode 100644 index f029ac3d5f1b..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Order.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.openapitools.client.model; - -import java.util.Date; - -import io.swagger.annotations.*; -import com.google.gson.annotations.SerializedName; - - -/** - * An order for a pets from the pet store - **/ -@ApiModel(description = "An order for a pets from the pet store") -public class Order { - - @SerializedName("id") - private Long id = null; - @SerializedName("petId") - private Long petId = null; - @SerializedName("quantity") - private Integer quantity = null; - @SerializedName("shipDate") - private Date shipDate = null; - public enum StatusEnum { - placed, approved, delivered, - }; - @SerializedName("status") - private StatusEnum status = null; - @SerializedName("complete") - private Boolean complete = false; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - public void setPetId(Long petId) { - this.petId = petId; - } - - /** - **/ - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - /** - **/ - @ApiModelProperty(value = "") - public Date getShipDate() { - return shipDate; - } - public void setShipDate(Date shipDate) { - this.shipDate = shipDate; - } - - /** - * Order Status - **/ - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - /** - **/ - @ApiModelProperty(value = "") - public Boolean getComplete() { - return complete; - } - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return (this.id == null ? order.id == null : this.id.equals(order.id)) && - (this.petId == null ? order.petId == null : this.petId.equals(order.petId)) && - (this.quantity == null ? order.quantity == null : this.quantity.equals(order.quantity)) && - (this.shipDate == null ? order.shipDate == null : this.shipDate.equals(order.shipDate)) && - (this.status == null ? order.status == null : this.status.equals(order.status)) && - (this.complete == null ? order.complete == null : this.complete.equals(order.complete)); - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (this.id == null ? 0: this.id.hashCode()); - result = 31 * result + (this.petId == null ? 0: this.petId.hashCode()); - result = 31 * result + (this.quantity == null ? 0: this.quantity.hashCode()); - result = 31 * result + (this.shipDate == null ? 0: this.shipDate.hashCode()); - result = 31 * result + (this.status == null ? 0: this.status.hashCode()); - result = 31 * result + (this.complete == null ? 0: this.complete.hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" petId: ").append(petId).append("\n"); - sb.append(" quantity: ").append(quantity).append("\n"); - sb.append(" shipDate: ").append(shipDate).append("\n"); - sb.append(" status: ").append(status).append("\n"); - sb.append(" complete: ").append(complete).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java deleted file mode 100644 index a0fa97df1984..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Pet.java +++ /dev/null @@ -1,138 +0,0 @@ -package org.openapitools.client.model; - -import java.util.*; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; - -import io.swagger.annotations.*; -import com.google.gson.annotations.SerializedName; - - -/** - * A pet for sale in the pet store - **/ -@ApiModel(description = "A pet for sale in the pet store") -public class Pet { - - @SerializedName("id") - private Long id = null; - @SerializedName("category") - private Category category = null; - @SerializedName("name") - private String name = null; - @SerializedName("photoUrls") - private List photoUrls = null; - @SerializedName("tags") - private List tags = null; - public enum StatusEnum { - available, pending, sold, - }; - @SerializedName("status") - private StatusEnum status = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - public void setCategory(Category category) { - this.category = category; - } - - /** - **/ - @ApiModelProperty(required = true, value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - /** - **/ - @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { - return photoUrls; - } - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - /** - **/ - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - public void setTags(List tags) { - this.tags = tags; - } - - /** - * pet status in the store - **/ - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - public void setStatus(StatusEnum status) { - this.status = status; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return (this.id == null ? pet.id == null : this.id.equals(pet.id)) && - (this.category == null ? pet.category == null : this.category.equals(pet.category)) && - (this.name == null ? pet.name == null : this.name.equals(pet.name)) && - (this.photoUrls == null ? pet.photoUrls == null : this.photoUrls.equals(pet.photoUrls)) && - (this.tags == null ? pet.tags == null : this.tags.equals(pet.tags)) && - (this.status == null ? pet.status == null : this.status.equals(pet.status)); - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (this.id == null ? 0: this.id.hashCode()); - result = 31 * result + (this.category == null ? 0: this.category.hashCode()); - result = 31 * result + (this.name == null ? 0: this.name.hashCode()); - result = 31 * result + (this.photoUrls == null ? 0: this.photoUrls.hashCode()); - result = 31 * result + (this.tags == null ? 0: this.tags.hashCode()); - result = 31 * result + (this.status == null ? 0: this.status.hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" category: ").append(category).append("\n"); - sb.append(" name: ").append(name).append("\n"); - sb.append(" photoUrls: ").append(photoUrls).append("\n"); - sb.append(" tags: ").append(tags).append("\n"); - sb.append(" status: ").append(status).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java deleted file mode 100644 index b0bcea3dcd5a..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/Tag.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.openapitools.client.model; - - -import io.swagger.annotations.*; -import com.google.gson.annotations.SerializedName; - - -/** - * A tag for a pet - **/ -@ApiModel(description = "A tag for a pet") -public class Tag { - - @SerializedName("id") - private Long id = null; - @SerializedName("name") - private String name = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return (this.id == null ? tag.id == null : this.id.equals(tag.id)) && - (this.name == null ? tag.name == null : this.name.equals(tag.name)); - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (this.id == null ? 0: this.id.hashCode()); - result = 31 * result + (this.name == null ? 0: this.name.hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" name: ").append(name).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java deleted file mode 100644 index e1306e3efcc3..000000000000 --- a/samples/client/petstore/android/httpclient/src/main/java/org/openapitools/client/model/User.java +++ /dev/null @@ -1,162 +0,0 @@ -package org.openapitools.client.model; - - -import io.swagger.annotations.*; -import com.google.gson.annotations.SerializedName; - - -/** - * A User who is purchasing from the pet store - **/ -@ApiModel(description = "A User who is purchasing from the pet store") -public class User { - - @SerializedName("id") - private Long id = null; - @SerializedName("username") - private String username = null; - @SerializedName("firstName") - private String firstName = null; - @SerializedName("lastName") - private String lastName = null; - @SerializedName("email") - private String email = null; - @SerializedName("password") - private String password = null; - @SerializedName("phone") - private String phone = null; - @SerializedName("userStatus") - private Integer userStatus = null; - - /** - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - public void setId(Long id) { - this.id = id; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - public void setUsername(String username) { - this.username = username; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - public void setLastName(String lastName) { - this.lastName = lastName; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - public void setEmail(String email) { - this.email = email; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - public void setPassword(String password) { - this.password = password; - } - - /** - **/ - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - public void setPhone(String phone) { - this.phone = phone; - } - - /** - * User Status - **/ - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return (this.id == null ? user.id == null : this.id.equals(user.id)) && - (this.username == null ? user.username == null : this.username.equals(user.username)) && - (this.firstName == null ? user.firstName == null : this.firstName.equals(user.firstName)) && - (this.lastName == null ? user.lastName == null : this.lastName.equals(user.lastName)) && - (this.email == null ? user.email == null : this.email.equals(user.email)) && - (this.password == null ? user.password == null : this.password.equals(user.password)) && - (this.phone == null ? user.phone == null : this.phone.equals(user.phone)) && - (this.userStatus == null ? user.userStatus == null : this.userStatus.equals(user.userStatus)); - } - - @Override - public int hashCode() { - int result = 17; - result = 31 * result + (this.id == null ? 0: this.id.hashCode()); - result = 31 * result + (this.username == null ? 0: this.username.hashCode()); - result = 31 * result + (this.firstName == null ? 0: this.firstName.hashCode()); - result = 31 * result + (this.lastName == null ? 0: this.lastName.hashCode()); - result = 31 * result + (this.email == null ? 0: this.email.hashCode()); - result = 31 * result + (this.password == null ? 0: this.password.hashCode()); - result = 31 * result + (this.phone == null ? 0: this.phone.hashCode()); - result = 31 * result + (this.userStatus == null ? 0: this.userStatus.hashCode()); - return result; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(id).append("\n"); - sb.append(" username: ").append(username).append("\n"); - sb.append(" firstName: ").append(firstName).append("\n"); - sb.append(" lastName: ").append(lastName).append("\n"); - sb.append(" email: ").append(email).append("\n"); - sb.append(" password: ").append(password).append("\n"); - sb.append(" phone: ").append(phone).append("\n"); - sb.append(" userStatus: ").append(userStatus).append("\n"); - sb.append("}\n"); - return sb.toString(); - } -} diff --git a/samples/client/petstore/android/volley/.openapi-generator/VERSION b/samples/client/petstore/android/volley/.openapi-generator/VERSION index afa636560641..e4955748d3e7 100644 --- a/samples/client/petstore/android/volley/.openapi-generator/VERSION +++ b/samples/client/petstore/android/volley/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/android/volley/README.md b/samples/client/petstore/android/volley/README.md index c2fca9e2b9eb..d4f8c7a7f174 100644 --- a/samples/client/petstore/android/volley/README.md +++ b/samples/client/petstore/android/volley/README.md @@ -49,8 +49,8 @@ At first generate the JAR by executing: Then manually install the following JARs: -* target/petstore-android-volley-1.0.0.jar -* target/lib/*.jar +- target/petstore-android-volley-1.0.0.jar +- target/lib/*.jar ## Getting Started @@ -64,9 +64,9 @@ public class PetApiExample { public static void main(String[] args) { PetApi apiInstance = new PetApi(); - Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store + Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -120,11 +120,13 @@ Authentication schemes defined for the API: ### api_key - **Type**: API key + - **API key parameter name**: api_key - **Location**: HTTP header ### petstore_auth + - **Type**: OAuth - **Flow**: implicit - **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog diff --git a/samples/client/petstore/android/volley/docs/ApiResponse.md b/samples/client/petstore/android/volley/docs/ApiResponse.md index 1c17767c2b72..a169bf232e15 100644 --- a/samples/client/petstore/android/volley/docs/ApiResponse.md +++ b/samples/client/petstore/android/volley/docs/ApiResponse.md @@ -1,7 +1,9 @@ + # ApiResponse ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **code** | **Integer** | | [optional] @@ -10,3 +12,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Category.md b/samples/client/petstore/android/volley/docs/Category.md index e2df08032787..53c9fedc8bc4 100644 --- a/samples/client/petstore/android/volley/docs/Category.md +++ b/samples/client/petstore/android/volley/docs/Category.md @@ -1,7 +1,9 @@ + # Category ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/Order.md b/samples/client/petstore/android/volley/docs/Order.md index 5746ce97fad3..f49e8704e088 100644 --- a/samples/client/petstore/android/volley/docs/Order.md +++ b/samples/client/petstore/android/volley/docs/Order.md @@ -1,7 +1,9 @@ + # Order ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **complete** | **Boolean** | | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/Pet.md b/samples/client/petstore/android/volley/docs/Pet.md index a4daa24feb60..72e3338dfb83 100644 --- a/samples/client/petstore/android/volley/docs/Pet.md +++ b/samples/client/petstore/android/volley/docs/Pet.md @@ -1,7 +1,9 @@ + # Pet ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -12,10 +14,11 @@ Name | Type | Description | Notes **status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - ## Enum: StatusEnum + Name | Value ---- | ----- + diff --git a/samples/client/petstore/android/volley/docs/PetApi.md b/samples/client/petstore/android/volley/docs/PetApi.md index 7cf076f29c58..4f91f08bc476 100644 --- a/samples/client/petstore/android/volley/docs/PetApi.md +++ b/samples/client/petstore/android/volley/docs/PetApi.md @@ -14,21 +14,23 @@ Method | HTTP request | Description [**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - -# **addPet** -> addPet(pet) + +## addPet + +> addPet(body) Add a new pet to the store ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.addPet(pet); + apiInstance.addPet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#addPet"); e.printStackTrace(); @@ -37,9 +39,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -51,16 +54,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## deletePet - -# **deletePet** > deletePet(petId, apiKey) Deletes a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -78,6 +83,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| Pet id to delete | [default to null] @@ -93,11 +99,12 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## findPetsByStatus - -# **findPetsByStatus** > List<Pet> findPetsByStatus(status) Finds Pets by status @@ -105,6 +112,7 @@ Finds Pets by status Multiple status values can be provided with comma separated strings ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -122,6 +130,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold] @@ -136,11 +145,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## findPetsByTags - -# **findPetsByTags** > List<Pet> findPetsByTags(tags) Finds Pets by tags @@ -148,6 +158,7 @@ Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -165,6 +176,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**List<String>**](String.md)| Tags to filter by | [default to null] @@ -179,11 +191,12 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## getPetById - -# **getPetById** > Pet getPetById(petId) Find pet by ID @@ -191,6 +204,7 @@ Find pet by ID Returns a single pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -208,6 +222,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to return | [default to null] @@ -222,24 +237,26 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **updatePet** -> updatePet(pet) + +## updatePet + +> updatePet(body) Update an existing pet ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; PetApi apiInstance = new PetApi(); -Pet pet = new Pet(); // Pet | Pet object that needs to be added to the store +Pet body = new Pet(); // Pet | Pet object that needs to be added to the store try { - apiInstance.updatePet(pet); + apiInstance.updatePet(body); } catch (ApiException e) { System.err.println("Exception when calling PetApi#updatePet"); e.printStackTrace(); @@ -248,9 +265,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -262,16 +280,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/json, application/xml - - **Accept**: Not defined +- **Content-Type**: application/json, application/xml +- **Accept**: Not defined + + +## updatePetWithForm - -# **updatePetWithForm** > updatePetWithForm(petId, name, status) Updates a pet in the store with form data ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -290,6 +310,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet that needs to be updated | [default to null] @@ -306,16 +327,18 @@ null (empty response body) ### HTTP request headers - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: Not defined +- **Content-Type**: application/x-www-form-urlencoded +- **Accept**: Not defined + + +## uploadFile - -# **uploadFile** > ApiResponse uploadFile(petId, additionalMetadata, file) uploads an image ### Example + ```java // Import classes: //import org.openapitools.client.api.PetApi; @@ -335,6 +358,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **Long**| ID of pet to update | [default to null] @@ -351,6 +375,6 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: multipart/form-data - - **Accept**: application/json +- **Content-Type**: multipart/form-data +- **Accept**: application/json diff --git a/samples/client/petstore/android/volley/docs/StoreApi.md b/samples/client/petstore/android/volley/docs/StoreApi.md index b768ad5ba986..d2229bfd71f4 100644 --- a/samples/client/petstore/android/volley/docs/StoreApi.md +++ b/samples/client/petstore/android/volley/docs/StoreApi.md @@ -10,8 +10,9 @@ Method | HTTP request | Description [**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - -# **deleteOrder** + +## deleteOrder + > deleteOrder(orderId) Delete purchase order by ID @@ -19,6 +20,7 @@ Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -35,6 +37,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **String**| ID of the order that needs to be deleted | [default to null] @@ -49,11 +52,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getInventory - -# **getInventory** > Map<String, Integer> getInventory() Returns pet inventories by status @@ -61,6 +65,7 @@ Returns pet inventories by status Returns a map of status codes to quantities ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -76,6 +81,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -88,11 +94,12 @@ This endpoint does not need any parameter. ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/json +- **Content-Type**: Not defined +- **Accept**: application/json + + +## getOrderById - -# **getOrderById** > Order getOrderById(orderId) Find purchase order by ID @@ -100,6 +107,7 @@ Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; @@ -117,6 +125,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **orderId** | **Long**| ID of pet that needs to be fetched | [default to null] @@ -131,24 +140,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json - -# **placeOrder** -> Order placeOrder(order) + +## placeOrder + +> Order placeOrder(body) Place an order for a pet ### Example + ```java // Import classes: //import org.openapitools.client.api.StoreApi; StoreApi apiInstance = new StoreApi(); -Order order = new Order(); // Order | order placed for purchasing the pet +Order body = new Order(); // Order | order placed for purchasing the pet try { - Order result = apiInstance.placeOrder(order); + Order result = apiInstance.placeOrder(body); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling StoreApi#placeOrder"); @@ -158,9 +169,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order** | [**Order**](Order.md)| order placed for purchasing the pet | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type @@ -172,6 +184,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json diff --git a/samples/client/petstore/android/volley/docs/Tag.md b/samples/client/petstore/android/volley/docs/Tag.md index de6814b55d57..b540cab453f0 100644 --- a/samples/client/petstore/android/volley/docs/Tag.md +++ b/samples/client/petstore/android/volley/docs/Tag.md @@ -1,7 +1,9 @@ + # Tag ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -9,3 +11,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/User.md b/samples/client/petstore/android/volley/docs/User.md index 8b6753dd284a..5e51c05150c8 100644 --- a/samples/client/petstore/android/volley/docs/User.md +++ b/samples/client/petstore/android/volley/docs/User.md @@ -1,7 +1,9 @@ + # User ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **Long** | | [optional] @@ -15,3 +17,4 @@ Name | Type | Description | Notes + diff --git a/samples/client/petstore/android/volley/docs/UserApi.md b/samples/client/petstore/android/volley/docs/UserApi.md index e5a16428112e..4c54ee4c77c6 100644 --- a/samples/client/petstore/android/volley/docs/UserApi.md +++ b/samples/client/petstore/android/volley/docs/UserApi.md @@ -14,23 +14,25 @@ Method | HTTP request | Description [**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - -# **createUser** -> createUser(user) + +## createUser + +> createUser(body) Create user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -User user = new User(); // User | Created user object +User body = new User(); // User | Created user object try { - apiInstance.createUser(user); + apiInstance.createUser(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUser"); e.printStackTrace(); @@ -39,9 +41,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**User**](User.md)| Created user object | + **body** | [**User**](User.md)| Created user object | ### Return type @@ -53,24 +56,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(user) + +## createUsersWithArrayInput + +> createUsersWithArrayInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithArrayInput(user); + apiInstance.createUsersWithArrayInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); e.printStackTrace(); @@ -79,9 +84,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -93,24 +99,26 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **createUsersWithListInput** -> createUsersWithListInput(user) + +## createUsersWithListInput + +> createUsersWithListInput(body) Creates list of users with given input array ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); -List user = Arrays.asList(new List()); // List | List of user object +List body = Arrays.asList(new User()); // List | List of user object try { - apiInstance.createUsersWithListInput(user); + apiInstance.createUsersWithListInput(body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#createUsersWithListInput"); e.printStackTrace(); @@ -119,9 +127,10 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **user** | [**List<User>**](List.md)| List of user object | + **body** | [**List<User>**](User.md)| List of user object | ### Return type @@ -133,11 +142,12 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## deleteUser - -# **deleteUser** > deleteUser(username) Delete user @@ -145,6 +155,7 @@ Delete user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -161,6 +172,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be deleted | [default to null] @@ -175,16 +187,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## getUserByName - -# **getUserByName** > User getUserByName(username) Get user by user name ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -202,6 +216,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The name that needs to be fetched. Use user1 for testing. | [default to null] @@ -216,16 +231,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## loginUser - -# **loginUser** > String loginUser(username, password) Logs user into the system ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -244,6 +261,7 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| The user name for login | [default to null] @@ -259,16 +277,18 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + + +## logoutUser - -# **logoutUser** > logoutUser() Logs out current logged in user session ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; @@ -283,6 +303,7 @@ try { ``` ### Parameters + This endpoint does not need any parameter. ### Return type @@ -295,27 +316,29 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined - -# **updateUser** -> updateUser(username, user) + +## updateUser + +> updateUser(username, body) Updated user This can only be done by the logged in user. ### Example + ```java // Import classes: //import org.openapitools.client.api.UserApi; UserApi apiInstance = new UserApi(); String username = null; // String | name that need to be deleted -User user = new User(); // User | Updated user object +User body = new User(); // User | Updated user object try { - apiInstance.updateUser(username, user); + apiInstance.updateUser(username, body); } catch (ApiException e) { System.err.println("Exception when calling UserApi#updateUser"); e.printStackTrace(); @@ -324,10 +347,11 @@ try { ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **String**| name that need to be deleted | [default to null] - **user** | [**User**](User.md)| Updated user object | + **body** | [**User**](User.md)| Updated user object | ### Return type @@ -339,6 +363,6 @@ No authorization required ### HTTP request headers - - **Content-Type**: Not defined - - **Accept**: Not defined +- **Content-Type**: Not defined +- **Accept**: Not defined diff --git a/samples/client/petstore/android/volley/git_push.sh b/samples/client/petstore/android/volley/git_push.sh index 0f406ef78782..ced3be2b0c7b 100644 --- a/samples/client/petstore/android/volley/git_push.sh +++ b/samples/client/petstore/android/volley/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,5 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/client/petstore/android/volley/pom.xml b/samples/client/petstore/android/volley/pom.xml index 800d148e4df3..19765ff2968f 100644 --- a/samples/client/petstore/android/volley/pom.xml +++ b/samples/client/petstore/android/volley/pom.xml @@ -11,6 +11,12 @@ swagger-annotations ${swagger-annotations-version} + + + com.google.code.findbugs + jsr305 + 3.0.2 + org.apache.httpcomponents httpcore diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java index 70f3b77ceead..2f57c83eeb73 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiException.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java index 2e7ab447cf3d..9ff0422de5f9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/ApiInvoker.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java index 3cdc69558e3d..c52b2dcd70d3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/JsonUtil.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java index e8f34f395f89..d358fcf66b45 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/Pair.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java index f90cf9d21e36..a80910cd4c89 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/PetApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -60,15 +60,15 @@ public String getBasePath() { /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void */ - public void addPet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", - new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); + public void addPet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables @@ -124,15 +124,15 @@ public void addPet (Pet pet) throws TimeoutException, ExecutionException, Interr /** * Add a new pet to the store * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public void addPet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = pet; + public void addPet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling addPet", - new ApiException(400, "Missing the required parameter 'pet' when calling addPet")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling addPet", + new ApiException(400, "Missing the required parameter 'body' when calling addPet")); } // create path and map variables @@ -696,15 +696,15 @@ public void onErrorResponse(VolleyError error) { /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store * @return void */ - public void updatePet (Pet pet) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = pet; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", - new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); + public void updatePet (Pet body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables @@ -760,15 +760,15 @@ public void updatePet (Pet pet) throws TimeoutException, ExecutionException, Int /** * Update an existing pet * - * @param pet Pet object that needs to be added to the store + * @param body Pet object that needs to be added to the store */ - public void updatePet (Pet pet, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = pet; + public void updatePet (Pet body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'pet' is set - if (pet == null) { - VolleyError error = new VolleyError("Missing the required parameter 'pet' when calling updatePet", - new ApiException(400, "Missing the required parameter 'pet' when calling updatePet")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updatePet", + new ApiException(400, "Missing the required parameter 'body' when calling updatePet")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java index 3da1f3f76896..fd69b7573487 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/StoreApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -425,15 +425,15 @@ public void onErrorResponse(VolleyError error) { /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet * @return Order */ - public Order placeOrder (Order order) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = order; - // verify the required parameter 'order' is set - if (order == null) { - VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); + public Order placeOrder (Order body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables @@ -487,15 +487,15 @@ public Order placeOrder (Order order) throws TimeoutException, ExecutionExceptio /** * Place an order for a pet * - * @param order order placed for purchasing the pet + * @param body order placed for purchasing the pet */ - public void placeOrder (Order order, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = order; + public void placeOrder (Order body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'order' is set - if (order == null) { - VolleyError error = new VolleyError("Missing the required parameter 'order' when calling placeOrder", - new ApiException(400, "Missing the required parameter 'order' when calling placeOrder")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling placeOrder", + new ApiException(400, "Missing the required parameter 'body' when calling placeOrder")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java index ce88777ae1ca..edec8bce95e9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/api/UserApi.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). @@ -59,15 +59,15 @@ public String getBasePath() { /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object * @return void */ - public void createUser (User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", - new ApiException(400, "Missing the required parameter 'user' when calling createUser")); + public void createUser (User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables @@ -121,15 +121,15 @@ public void createUser (User user) throws TimeoutException, ExecutionException, /** * Create user * This can only be done by the logged in user. - * @param user Created user object + * @param body Created user object */ - public void createUser (User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUser (User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUser", - new ApiException(400, "Missing the required parameter 'user' when calling createUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUser", + new ApiException(400, "Missing the required parameter 'body' when calling createUser")); } // create path and map variables @@ -182,15 +182,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithArrayInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); + public void createUsersWithArrayInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables @@ -244,15 +244,15 @@ public void createUsersWithArrayInput (List user) throws TimeoutException, /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object */ - public void createUsersWithArrayInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUsersWithArrayInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithArrayInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithArrayInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput")); } // create path and map variables @@ -305,15 +305,15 @@ public void onErrorResponse(VolleyError error) { /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object * @return void */ - public void createUsersWithListInput (List user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); + public void createUsersWithListInput (List body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables @@ -367,15 +367,15 @@ public void createUsersWithListInput (List user) throws TimeoutException, /** * Creates list of users with given input array * - * @param user List of user object + * @param body List of user object */ - public void createUsersWithListInput (List user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void createUsersWithListInput (List body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling createUsersWithListInput", - new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling createUsersWithListInput", + new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput")); } // create path and map variables @@ -933,20 +933,20 @@ public void onErrorResponse(VolleyError error) { * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param user Updated user object + * @param body Updated user object * @return void */ - public void updateUser (String username, User user) throws TimeoutException, ExecutionException, InterruptedException, ApiException { - Object postBody = user; + public void updateUser (String username, User body) throws TimeoutException, ExecutionException, InterruptedException, ApiException { + Object postBody = body; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", - new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables @@ -1000,20 +1000,20 @@ public void updateUser (String username, User user) throws TimeoutException, Exe /** * Updated user * This can only be done by the logged in user. - * @param username name that need to be deleted * @param user Updated user object + * @param username name that need to be deleted * @param body Updated user object */ - public void updateUser (String username, User user, final Response.Listener responseListener, final Response.ErrorListener errorListener) { - Object postBody = user; + public void updateUser (String username, User body, final Response.Listener responseListener, final Response.ErrorListener errorListener) { + Object postBody = body; // verify the required parameter 'username' is set if (username == null) { VolleyError error = new VolleyError("Missing the required parameter 'username' when calling updateUser", new ApiException(400, "Missing the required parameter 'username' when calling updateUser")); } - // verify the required parameter 'user' is set - if (user == null) { - VolleyError error = new VolleyError("Missing the required parameter 'user' when calling updateUser", - new ApiException(400, "Missing the required parameter 'user' when calling updateUser")); + // verify the required parameter 'body' is set + if (body == null) { + VolleyError error = new VolleyError("Missing the required parameter 'body' when calling updateUser", + new ApiException(400, "Missing the required parameter 'body' when calling updateUser")); } // create path and map variables diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java index b15bbd4de9d6..fe6364d31729 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/ApiKeyAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java index 7ea7f36402c6..2eec51b72b97 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/Authentication.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java index 8b66fa172161..1226b62d5b2b 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/auth/HttpBasicAuth.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java index 00254f1548aa..82d2c3031356 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/ApiResponse.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java index cd1473811a1c..25016438a568 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Category.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java index 6d4ba799ea4f..b5958b2eb652 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Order.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java index 71026c8fdc40..b8fa5f5b48c3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Pet.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java index dd37b76de2fb..c61264d3c9c3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/Tag.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java index 268f152e1d56..757cc8fed0a3 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/model/User.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java index d4143bbe63d5..387e52f102c0 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/DeleteRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java index 4c87ff45bd7b..dd2c824098c0 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/GetRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java index 909c4ea18a07..4f97af9d06d9 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PatchRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java index 229891e581d3..dd4c40ddc85d 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PostRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java index 70da15b48d96..877d4855c440 100644 --- a/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java +++ b/samples/client/petstore/android/volley/src/main/java/org/openapitools/client/request/PutRequest.java @@ -2,7 +2,7 @@ * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * - * OpenAPI spec version: 1.0.0 + * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). diff --git a/samples/client/petstore/apex/README.md b/samples/client/petstore/apex/README.md index a1481aea0758..45720bb0ab34 100644 --- a/samples/client/petstore/apex/README.md +++ b/samples/client/petstore/apex/README.md @@ -1,12 +1,12 @@ # OpenAPI Petstore API Client + This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. ## Requirements - [Salesforce DX](https://www.salesforce.com/products/platform/products/salesforce-dx/) - If everything is set correctly: - Running `sfdx version` in a command prompt should output something like: @@ -15,28 +15,28 @@ If everything is set correctly: sfdx-cli/5.7.5-05549de (darwin-amd64) go1.7.5 sfdxstable ``` - ## Installation 1. Copy the output into your Salesforce DX folder - or alternatively deploy the output directly into the workspace. 2. Deploy the code via Salesforce DX to your Scratch Org ```bash - $ sfdx force:source:push + sfdx force:source:push ``` + 3. If the API needs authentication update the Named Credential in Setup. 4. Run your Apex tests using - ```bash - $ sfdx sfdx force:apex:test:run - ``` + ```bash + sfdx sfdx force:apex:test:run + ``` + 5. Retrieve the job id from the console and check the test results. ```bash - $ sfdx force:apex:test:report -i theJobId + sfdx force:apex:test:report -i theJobId ``` - ## Getting Started Please follow the [installation](#installation) instruction and execute the following Apex code: @@ -47,7 +47,7 @@ OASClient client = api.getClient(); Map params = new Map{ - 'oaSPet' => OASPet.getExample() + 'body' => '' }; try { @@ -101,6 +101,7 @@ Class | Method | HTTP request | Description Authentication schemes defined for the API: ### api_key + - **Type**: API key - **API key parameter name**: api_key - **Location**: HTTP header diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls index 1eaf5a3ad2bc..672d97f89233 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASPetApiTest.cls @@ -13,7 +13,7 @@ private class OASPetApiTest { Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'oaSPet' => OASPet.getExample() + 'body' => '' }; OASClient client; @@ -189,7 +189,7 @@ private class OASPetApiTest { Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'oaSPet' => OASPet.getExample() + 'body' => '' }; OASClient client; diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls index 548c228a6512..e4962a57771c 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASStoreApiTest.cls @@ -102,7 +102,7 @@ private class OASStoreApiTest { Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'oaSOrder' => OASOrder.getExample() + 'body' => '' }; OASClient client; diff --git a/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls index 3d797e07982b..fea5c48c8c86 100644 --- a/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls +++ b/samples/client/petstore/apex/force-app/main/default/classes/OASUserApiTest.cls @@ -13,7 +13,7 @@ private class OASUserApiTest { Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'oaSUser' => OASUser.getExample() + 'body' => '' }; OASClient client; @@ -38,7 +38,7 @@ private class OASUserApiTest { Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'oaSUser' => new List{OASUser.getExample()} + 'body' => new List{OASUser.getExample()} }; OASClient client; @@ -63,7 +63,7 @@ private class OASUserApiTest { Test.setMock(HttpCalloutMock.class, new OASResponseMock(res)); Map params = new Map{ - 'oaSUser' => new List{OASUser.getExample()} + 'body' => new List{OASUser.getExample()} }; OASClient client; @@ -202,7 +202,7 @@ private class OASUserApiTest { Map params = new Map{ 'username' => 'null', - 'oaSUser' => OASUser.getExample() + 'body' => '' }; OASClient client; diff --git a/samples/client/petstore/async-scala/.openapi-generator/VERSION b/samples/client/petstore/async-scala/.openapi-generator/VERSION deleted file mode 100644 index 7fea99011a6f..000000000000 --- a/samples/client/petstore/async-scala/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/async-scala/build.sbt b/samples/client/petstore/async-scala/build.sbt deleted file mode 100644 index e612d5937ea8..000000000000 --- a/samples/client/petstore/async-scala/build.sbt +++ /dev/null @@ -1,12 +0,0 @@ -organization := "" - -name := "-client" - -libraryDependencies ++= Seq( - "com.wordnik.swagger" %% "swagger-async-httpclient" % "0.3.5", - "joda-time" % "joda-time" % "2.3", - "org.joda" % "joda-convert" % "1.3.1", - "ch.qos.logback" % "logback-classic" % "1.0.13" % "provided", - "org.scalatest" %% "scalatest" % "2.2.1" % "test", - "junit" % "junit" % "4.11" % "test" -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala deleted file mode 100644 index 7c4afb20e093..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/SwaggerClient.scala +++ /dev/null @@ -1,28 +0,0 @@ -package io.swagger.client - -import io.swagger.client.api._ - -import com.wordnik.swagger.client._ - -import java.io.Closeable - -class SwaggerClient(config: SwaggerConfig) extends Closeable { - val locator = config.locator - val name = config.name - - private[this] val client = transportClient - - protected def transportClient: TransportClient = new RestClient(config) - - val pet = new PetApi(client, config) - - val store = new StoreApi(client, config) - - val user = new UserApi(client, config) - - - def close() { - client.close() - } -} - diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/PetApi.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/PetApi.scala deleted file mode 100644 index f11d2aaa1b56..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/PetApi.scala +++ /dev/null @@ -1,155 +0,0 @@ -package io.swagger.client.api - -import io.swagger.client.model.ApiResponse -import java.io.File -import io.swagger.client.model.Pet -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -class PetApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - def addPet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->addPet") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def deletePet(petId: Long, - apiKey: Option[String] = None - )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet/{petId}") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - apiKey match { - case Some(param) => headerParams += "api_key" -> param.toString - case _ => headerParams - } - - val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def findPetsByStatus(status: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { - // create path and map variables - val path = (addFmt("/pet/findByStatus")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (status == null) throw new Exception("Missing required parameter 'status' when calling PetApi->findPetsByStatus") - queryParams += "status" -> status.toString - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def findPetsByTags(tags: List[String])(implicit reader: ClientResponseReader[List[Pet]]): Future[List[Pet]] = { - // create path and map variables - val path = (addFmt("/pet/findByTags")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (tags == null) throw new Exception("Missing required parameter 'tags' when calling PetApi->findPetsByTags") - queryParams += "tags" -> tags.toString - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getPetById(petId: Long)(implicit reader: ClientResponseReader[Pet]): Future[Pet] = { - // create path and map variables - val path = (addFmt("/pet/{petId}") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def updatePet(body: Pet)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[Pet]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling PetApi->updatePet") - - val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def updatePetWithForm(petId: Long, - name: Option[String] = None, - status: Option[String] = None - )(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/pet/{petId}") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def uploadFile(petId: Long, - additionalMetadata: Option[String] = None, - file: Option[File] = None - )(implicit reader: ClientResponseReader[ApiResponse]): Future[ApiResponse] = { - // create path and map variables - val path = (addFmt("/pet/{petId}/uploadImage") - replaceAll ("\\{" + "petId" + "\\}",petId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - -} diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/StoreApi.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/StoreApi.scala deleted file mode 100644 index 22fb37067129..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/StoreApi.scala +++ /dev/null @@ -1,76 +0,0 @@ -package io.swagger.client.api - -import io.swagger.client.model.Order -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -class StoreApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - def deleteOrder(orderId: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/store/order/{orderId}") - replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (orderId == null) throw new Exception("Missing required parameter 'orderId' when calling StoreApi->deleteOrder") - - - val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getInventory()(implicit reader: ClientResponseReader[Map[String, Integer]]): Future[Map[String, Integer]] = { - // create path and map variables - val path = (addFmt("/store/inventory")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getOrderById(orderId: Long)(implicit reader: ClientResponseReader[Order]): Future[Order] = { - // create path and map variables - val path = (addFmt("/store/order/{orderId}") - replaceAll ("\\{" + "orderId" + "\\}",orderId.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def placeOrder(body: Order)(implicit reader: ClientResponseReader[Order], writer: RequestWriter[Order]): Future[Order] = { - // create path and map variables - val path = (addFmt("/store/order")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling StoreApi->placeOrder") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - -} diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/UserApi.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/UserApi.scala deleted file mode 100644 index 025c9f26925b..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/api/UserApi.scala +++ /dev/null @@ -1,152 +0,0 @@ -package io.swagger.client.api - -import io.swagger.client.model.User -import com.wordnik.swagger.client._ -import scala.concurrent.Future -import collection.mutable - -class UserApi(client: TransportClient, config: SwaggerConfig) extends ApiClient(client, config) { - - def createUser(body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUser") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def createUsersWithArrayInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/createWithArray")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithArrayInput") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def createUsersWithListInput(body: List[User])(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[List[User]]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/createWithList")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->createUsersWithListInput") - - val resFuture = client.submit("POST", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def deleteUser(username: String)(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/{username}") - replaceAll ("\\{" + "username" + "\\}",username.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->deleteUser") - - - val resFuture = client.submit("DELETE", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def getUserByName(username: String)(implicit reader: ClientResponseReader[User]): Future[User] = { - // create path and map variables - val path = (addFmt("/user/{username}") - replaceAll ("\\{" + "username" + "\\}",username.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->getUserByName") - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def loginUser(username: String, - password: String)(implicit reader: ClientResponseReader[String]): Future[String] = { - // create path and map variables - val path = (addFmt("/user/login")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->loginUser") - - if (password == null) throw new Exception("Missing required parameter 'password' when calling UserApi->loginUser") - - queryParams += "username" -> username.toString - queryParams += "password" -> password.toString - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def logoutUser()(implicit reader: ClientResponseReader[Unit]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/logout")) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - - val resFuture = client.submit("GET", path, queryParams.toMap, headerParams.toMap, "") - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - def updateUser(username: String, - body: User)(implicit reader: ClientResponseReader[Unit], writer: RequestWriter[User]): Future[Unit] = { - // create path and map variables - val path = (addFmt("/user/{username}") - replaceAll ("\\{" + "username" + "\\}",username.toString)) - - // query params - val queryParams = new mutable.HashMap[String, String] - val headerParams = new mutable.HashMap[String, String] - - if (username == null) throw new Exception("Missing required parameter 'username' when calling UserApi->updateUser") - - if (body == null) throw new Exception("Missing required parameter 'body' when calling UserApi->updateUser") - - val resFuture = client.submit("PUT", path, queryParams.toMap, headerParams.toMap, writer.write(body)) - resFuture flatMap { resp => - process(reader.read(resp)) - } - } - - -} diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala deleted file mode 100644 index d1d2c29d5887..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/ApiResponse.scala +++ /dev/null @@ -1,11 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class ApiResponse ( - code: Option[Integer], -_type: Option[String], -message: Option[String] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Category.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Category.scala deleted file mode 100644 index afd533df15ef..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Category.scala +++ /dev/null @@ -1,10 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Category ( - id: Option[Long], -name: Option[String] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Order.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Order.scala deleted file mode 100644 index 42f4859e2e3a..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Order.scala +++ /dev/null @@ -1,14 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Order ( - id: Option[Long], -petId: Option[Long], -quantity: Option[Integer], -shipDate: Option[DateTime], -status: Option[String], // Order Status -complete: Option[Boolean] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Pet.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Pet.scala deleted file mode 100644 index f296c7f7146b..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Pet.scala +++ /dev/null @@ -1,14 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Pet ( - id: Option[Long], -category: Option[Category], -name: String, -photoUrls: List[String], -tags: Option[List[Tag]], -status: Option[String] // pet status in the store -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Tag.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Tag.scala deleted file mode 100644 index 3d7772c56590..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/Tag.scala +++ /dev/null @@ -1,10 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class Tag ( - id: Option[Long], -name: Option[String] -) diff --git a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/User.scala b/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/User.scala deleted file mode 100644 index e016b7a88dd2..000000000000 --- a/samples/client/petstore/async-scala/src/main/scala/io/swagger/client/model/User.scala +++ /dev/null @@ -1,16 +0,0 @@ -package io.swagger.client.model - -import org.joda.time.DateTime -import java.util.UUID - - -case class User ( - id: Option[Long], -username: Option[String], -firstName: Option[String], -lastName: Option[String], -email: Option[String], -password: Option[String], -phone: Option[String], -userStatus: Option[Integer] // User Status -) diff --git a/samples/client/petstore/async-scala/src/test/scala/Test.scala b/samples/client/petstore/async-scala/src/test/scala/Test.scala deleted file mode 100644 index 796c96ca8224..000000000000 --- a/samples/client/petstore/async-scala/src/test/scala/Test.scala +++ /dev/null @@ -1,36 +0,0 @@ -import java.net.URI - -import com.wordnik.swagger.client.ClientResponseReaders.Json4sFormatsReader._ -import com.wordnik.swagger.client.RequestWriters.Json4sFormatsWriter._ -import com.wordnik.swagger.client.SwaggerConfig -import io.swagger.client.SwaggerClient -import org.junit.runner.RunWith -import org.scalatest._ -import org.scalatest.junit.JUnitRunner - -import scala.concurrent.ExecutionContext.Implicits.global -import scala.concurrent._ -import scala.concurrent.duration._ -import scala.util.{Failure, Success} - -@RunWith(classOf[JUnitRunner]) -class SimpleTest extends FlatSpec with Matchers { - implicit val formats = org.json4s.DefaultFormats - implicit val reader = JsonFormatsReader - implicit val writer = JsonFormatsWriter - - it should "call the api" in { - val config = SwaggerConfig.forUrl(new URI("http://petstore.swagger.io/v2")) - val client = new SwaggerClient(config) - - val future = client.pet.getPetById(3) - val await = Await.ready(future, Duration.Inf) - - await onComplete { - case Success(pet) => { - println(pet) - } - case Failure(t) => println("failed " + t.getMessage) - } - } -} diff --git a/samples/client/petstore/bash/.openapi-generator/VERSION b/samples/client/petstore/bash/.openapi-generator/VERSION index c3a2c7076fa8..e4955748d3e7 100644 --- a/samples/client/petstore/bash/.openapi-generator/VERSION +++ b/samples/client/petstore/bash/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/bash/_client.sh b/samples/client/petstore/bash/_client.sh deleted file mode 100644 index 8be68229c3db..000000000000 --- a/samples/client/petstore/bash/_client.sh +++ /dev/null @@ -1,594 +0,0 @@ -#compdef - -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# ! -# ! Note: -# ! -# ! THIS SCRIPT HAS BEEN AUTOMATICALLY GENERATED USING -# ! openapi-generator (https://openapi-generator.tech) -# ! FROM OPENAPI SPECIFICATION IN JSON. -# ! -# ! Based on: https://github.com/Valodim/zsh-curl-completion/blob/master/_curl -# ! -# ! -# ! -# ! Installation: -# ! -# ! Copy the _ file to any directory under FPATH -# ! environment variable (echo $FPATH) -# ! -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - -local curcontext="$curcontext" state line ret=1 -typeset -A opt_args - -typeset -A mime_type_abbreviations -# text/* -mime_type_abbreviations[text]="text/plain" -mime_type_abbreviations[html]="text/html" -mime_type_abbreviations[md]="text/x-markdown" -mime_type_abbreviations[csv]="text/csv" -mime_type_abbreviations[css]="text/css" -mime_type_abbreviations[rtf]="text/rtf" -# application/* -mime_type_abbreviations[json]="application/json" -mime_type_abbreviations[xml]="application/xml" -mime_type_abbreviations[yaml]="application/yaml" -mime_type_abbreviations[js]="application/javascript" -mime_type_abbreviations[bin]="application/octet-stream" -mime_type_abbreviations[rdf]="application/rdf+xml" -# image/* -mime_type_abbreviations[jpg]="image/jpeg" -mime_type_abbreviations[png]="image/png" -mime_type_abbreviations[gif]="image/gif" -mime_type_abbreviations[bmp]="image/bmp" -mime_type_abbreviations[tiff]="image/tiff" - -# -# Generate zsh completion string list for abbreviated mime types -# -get_mime_type_completions() { - typeset -a result - result=() - for k in "${(@k)mime_type_abbreviations}"; do - value=$mime_type_abbreviations[${k}] - #echo $value - result+=( "${k}[${value}]" ) - #echo $result - done - echo "$result" -} - -# -# cURL crypto engines completion function -# -_curl_crypto_engine() { - local vals - vals=( ${${(f)"$(curl --engine list)":gs/ /}[2,$]} ) - _describe -t outputs 'engines' vals && return 0 -} - -# -# cURL post data completion functions= -# -_curl_post_data() { - - # don't do anything further if this is raw content - compset -P '=' && _message 'raw content' && return 0 - - # complete filename or stdin for @ syntax - compset -P '*@' && { - local expl - _description files expl stdin - compadd "$expl[@]" - "-" - _files - return 0 - } - - # got a name already? expecting data. - compset -P '*=' && _message 'data value' && return 0 - - # otherwise, name (or @ or =) should be specified - _message 'data name' && return 0 - -} - - -local arg_http arg_ftp arg_other arg_proxy arg_crypto arg_connection arg_auth arg_input arg_output - -# HTTP Arguments -arg_http=(''\ - {-0,--http1.0}'[force use of use http 1.0 instead of 1.1]' \ - {-b,--cookie}'[pass data to http server as cookie]:data or file' \ - {-c,--cookie-jar}'[specify cookie file]:file name:_files' \ - {-d,--data}'[send specified data as HTTP POST data]:data:{_curl_post_data}' \ - '--data-binary[post HTTP POST data without any processing]:data:{_curl_post_data}' \ - '--data-urlencode[post HTTP POST data, with url encoding]:data:{_curl_post_data}' \ - {-f,--fail}'[enable failfast behavior for server errors]' \ - '*'{-F,--form}'[add POST form data]:name=content' \ - {-G,--get}'[use HTTP GET even with data (-d, --data, --data-binary)]' \ - '*'{-H,--header}'[specify an extra header]:header' \ - '--ignore-content-length[ignore Content-Length header]' \ - {-i,--include}'[include HTTP header in the output]' \ - {-j,--junk-session-cookies}'[discard all session cookies]' \ - {-e,--referer}'[send url as referer]:referer url:_urls' \ - {-L,--location}'[follow Location headers on http 3XX response]' \ - '--location-trusted[like --location, but allows sending of auth data to redirected hosts]' \ - '--max-redirs[set maximum number of redirection followings allowed]:number' \ - {-J,--remote-header-name}'[use Content-Disposition for output file name]' \ - {-O,--remote-name}'[write to filename parsed from url instead of stdout]' \ - '--post301[do not convert POST to GET after following 301 Location response (follow RFC 2616/10.3.2)]' \ - '--post302[do not convert POST to GET after following 302 Location response (follow RFC 2616/10.3.2)]' \ - ) - -# FTP arguments -arg_ftp=(\ - {-a,--append}'[append to target file instead of overwriting (FTP/SFTP)]' \ - '--crlf[convert LF to CRLF in upload]' \ - '--disable-eprt[disable use of EPRT and LPRT for active FTP transfers]' \ - '--disable-epsv[disable use of EPSV for passive FTP transfers]' \ - '--ftp-account[account data (FTP)]:data' \ - '--ftp-alternative-to-user[command to send when USER and PASS commands fail (FTP)]:command' \ - '--ftp-create-dirs[create paths remotely if it does not exist]' \ - '--ftp-method[ftp method to use to reach a file (FTP)]:method:(multicwd ocwd singlecwd)' \ - '--ftp-pasv[use passive mode for the data connection (FTP)]' \ - '--ftp-skip-pasv-ip[do not use the ip the server suggests for PASV]' \ - '--form-string[like --form, but do not parse content]:name=string' \ - '--ftp-pret[send PRET before PASV]' \ - '--ftp-ssl-ccc[use clear command channel (CCC) after authentication (FTP)]' \ - '--ftp-ssl-ccc-mode[sets the CCC mode (FTP)]:mode:(active passive)' \ - '--ftp-ssl-control[require SSL/TLS for FTP login, clear for transfer]' \ - {-l,--list-only}'[list names only when listing directories (FTP)]' \ - {-P,--ftp-port}'[use active mode, tell server to connect to specified address or interface (FTP]:address' \ - '*'{-Q,--quote}'[send arbitrary command to the remote server before transfer (FTP/SFTP)]:command' \ - ) - -# Other Protocol arguments -arg_other=(\ - '--mail-from[specify From: address]:address' \ - '--mail-rcpt[specify email recipient for SMTP, may be given multiple times]:address' \ - {-t,--telnet-option}'[pass options to telnet protocol]:opt=val' \ - '--tftp-blksize[set tftp BLKSIZE option]:value' \ - ) - -# Proxy arguments -arg_proxy=(\ - '--noproxy[list of hosts to connect directly to instead of through proxy]:no-proxy-list' \ - {-p,--proxytunnel}'[tunnel non-http protocols through http proxy]' \ - {-U,--proxy-user}'[specify the user name and password to use for proxy authentication]:user:password' \ - '--proxy-anyauth[use any authentication method for proxy, default to most secure]' \ - '--proxy-basic[use HTTP Basic authentication for proxy]' \ - '--proxy-digest[use http digest authentication for proxy]' \ - '--proxy-negotiate[enable GSS-Negotiate authentication for proxy]' \ - '--proxy-ntlm[enable ntlm authentication for proxy]' \ - '--proxy1.0[use http 1.0 proxy]:proxy url' \ - {-x,--proxy}'[use specified proxy]:proxy url' \ - '--socks5-gssapi-service[change service name for socks server]:servicename' \ - '--socks5-gssapi-nec[allow unprotected exchange of protection mode negotiation]' \ - ) - -# Crypto arguments -arg_crypto=(\ - {-1,--tlsv1}'[Forces curl to use TLS version 1 when negotiating with a remote TLS server.]' \ - {-2,--sslv2}'[Forces curl to use SSL version 2 when negotiating with a remote SSL server.]' \ - {-3,--sslv3}'[Forces curl to use SSL version 3 when negotiating with a remote SSL server.]' \ - '--ciphers[specifies which cipher to use for the ssl connection]:list of ciphers' \ - '--crlfile[specify file with revoked certificates]:file' \ - '--delegation[set delegation policy to use with GSS/kerberos]:delegation policy:(none policy always)' \ - {-E,--cert}'[use specified client certificate]:certificate file:_files' \ - '--engine[use selected OpenSSL crypto engine]:ssl crypto engine:{_curl_crypto_engine}' \ - '--egd-file[set ssl entropy gathering daemon socket]:entropy socket:_files' \ - '--cert-type[specify certificate type (PEM, DER, ENG)]:certificate type:(PEM DER ENG)' \ - '--cacert[specify certificate file to verify the peer with]:CA certificate:_files' \ - '--capath[specify a search path for certificate files]:CA certificate directory:_directories' \ - '--hostpubmd5[check remote hosts public key]:md5 hash' \ - {-k,--insecure}'[allow ssl to perform insecure ssl connections (ie, ignore certificate)]' \ - '--key[ssl/ssh private key file name]:key file:_files' \ - '--key-type[ssl/ssh private key file type]:file type:(PEM DER ENG)' \ - '--pubkey[ssh public key file]:pubkey file:_files' \ - '--random-file[set source of random data for ssl]:random source:_files' \ - '--no-sessionid[disable caching of ssl session ids]' \ - '--pass:phrase[passphrase for ssl/ssh private key]' \ - '--ssl[try to use ssl/tls for connection, if available]' \ - '--ssl-reqd[try to use ssl/tls for connection, fail if unavailable]' \ - '--tlsauthtype[set TLS authentication type (only SRP supported!)]:authtype' \ - '--tlsuser[set username for TLS authentication]:user' \ - '--tlspassword[set password for TLS authentication]:password' \ - ) - -# Connection arguments -arg_connection=(\ - {-4,--ipv4}'[prefer ipv4]' \ - {-6,--ipv6}'[prefer ipv6, if available]' \ - {-B,--use-ascii}'[use ascii mode]' \ - '--compressed[request a compressed transfer]' \ - '--connect-timeout[timeout for connection phase]:seconds' \ - {-I,--head}'[fetch http HEAD only (HTTP/FTP/FILE]' \ - '--interface[work on a specific interface]:name' \ - '--keepalive-time[set time to wait before sending keepalive probes]:seconds' \ - '--limit-rate[specify maximum transfer rate]:speed' \ - '--local-port[set preferred number or range of local ports to use]:num' \ - {-N,--no-buffer}'[disable buffering of the output stream]' \ - '--no-keepalive[disable use of keepalive messages in TCP connections]' \ - '--raw[disable all http decoding and pass raw data]' \ - '--resolve[provide a custom address for a specific host and port pair]:host\:port\:address' \ - '--retry[specify maximum number of retries for transient errors]:num' \ - '--retry-delay[specify delay between retries]:seconds' \ - '--retry-max-time[maximum time to spend on retries]:seconds' \ - '--tcp-nodelay[turn on TCP_NODELAY option]' \ - {-y,--speed-time}'[specify time to abort after if download is slower than speed-limit]:time' \ - {-Y,--speed-limit}'[specify minimum speed for --speed-time]:speed' \ - ) - -# Authentication arguments -arg_auth=(\ - '--anyauth[use any authentication method, default to most secure]' \ - '--basic[use HTTP Basic authentication]' \ - '--ntlm[enable ntlm authentication]' \ - '--digest[use http digest authentication]' \ - '--krb[use kerberos authentication]:auth:(clear safe confidential private)' \ - '--negotiate[enable GSS-Negotiate authentication]' \ - {-n,--netrc}'[scan ~/.netrc for login data]' \ - '--netrc-optional[like --netrc, but does not make .netrc usage mandatory]' \ - '--netrc-file[like --netrc, but specify file to use]:netrc file:_files' \ - '--tr-encoding[request compressed transfer-encoding]' \ - {-u,--user}'[specify user name and password for server authentication]:user\:password' \ - ) - -# Input arguments -arg_input=(\ - {-C,--continue-at}'[resume at offset ]:offset' \ - {-g,--globoff}'[do not glob {}\[\] letters]' \ - '--max-filesize[maximum filesize to download, fail for bigger files]:bytes' \ - '--proto[specify allowed protocols for transfer]:protocols' \ - '--proto-redir[specify allowed protocols for transfer after a redirect]:protocols' \ - {-r,--range}'[set range of bytes to request (HTTP/FTP/SFTP/FILE)]:range' \ - {-R,--remote-time}'[use timestamp of remote file for local file]' \ - {-T,--upload-file}'[transfer file to remote url (using PUT for HTTP)]:file to upload:_files' \ - '--url[specify a URL to fetch (multi)]:url:_urls' \ - {-z,--time-cond}'[request downloaded file to be newer than date or given reference file]:date expression' \ - ) - -# Output arguments -arg_output=(\ - '--create-dirs[create local directory hierarchy as needed]' \ - {-D,--dump-header}'[write protocol headers to file]:dump file:_files' \ - {-o,--output}'[write to specified file instead of stdout]:output file:_files' \ - {--progress-bar,-\#}'[display progress as a simple progress bar]' \ - {-\#,--progress-bar}'[Make curl display progress as a simple progress bar instead of the standard, more informational, meter.]' \ - {-R,--remote-time}'[use timestamp of remote file for local file]' \ - '--raw[disable all http decoding and pass raw data]' \ - {-s,--silent}'[silent mode, do not show progress meter or error messages]' \ - {-S,--show-error}'[show errors in silent mode]' \ - '--stderr[redirect stderr to specified file]:output file:_files' \ - '--trace[enable full trace dump of all incoming and outgoing data]:trace file:_files' \ - '--trace-ascii[enable full trace dump of all incoming and outgoing data, without hex data]:trace file:_files' \ - '--trace-time[prepends a time stamp to each trace or verbose line that curl displays]' \ - {-v,--verbose}'[output debug info]' \ - {-w,--write-out}'[specify message to output on successful operation]:format string' \ - '--xattr[store some file metadata in extended file attributes]' \ - {-X,--request}'[specifies request method for HTTP server]:method:(GET POST PUT DELETE HEAD OPTIONS TRACE CONNECT PATCH LINK UNLINK)' \ - ) - -_arguments -C -s $arg_http $arg_ftp $arg_other $arg_crypto $arg_connection $arg_auth $arg_input $arg_output \ - {-M,--manual}'[Print manual]' \ - '*'{-K,--config}'[Use other config file to read arguments from]:config file:_files' \ - '--libcurl[output libcurl code for the operation to file]:output file:_files' \ - {-m,--max-time}'[Limit total time of operation]:seconds' \ - {-s,--silent}'[Silent mode, do not show progress meter or error messages]' \ - {-S,--show-error}'[Show errors in silent mode]' \ - '--stderr[Redirect stderr to specified file]:output file:_files' \ - '-q[Do not read settings from .curlrc (must be first option)]' \ - {-h,--help}'[Print help and list of operations]' \ - {-V,--version}'[Print service API version]' \ - '--about[Print the information about service]' \ - '--host[Specify the host URL]':URL:_urls \ - '--dry-run[Print out the cURL command without executing it]' \ - {-ac,--accept}'[Set the Accept header in the request]: :{_values "Accept mime type" $(get_mime_type_completions)}' \ - {-ct,--content-type}'[Set the Content-type header in request]: :{_values "Content mime type" $(get_mime_type_completions)}' \ - '1: :->ops' \ - '*:: :->args' \ - && ret=0 - - -case $state in - ops) - # Operations - _values "Operations" \ - "123Test@$%SpecialTags[To test special tags]" "fooGet[]" "fakeHealthGet[Health check endpoint]" \ - "fakeOuterBooleanSerialize[]" \ - "fakeOuterCompositeSerialize[]" \ - "fakeOuterNumberSerialize[]" \ - "fakeOuterStringSerialize[]" \ - "testBodyWithFileSchema[]" \ - "testBodyWithQueryParams[]" \ - "testClientModel[To test \"client\" model]" \ - "testEndpointParameters[Fake endpoint for testing various parameters -假端點 -偽のエンドポイント -가짜 엔드 포인트]" \ - "testEnumParameters[To test enum parameters]" \ - "testGroupParameters[Fake endpoint to test group parameters (optional)]" \ - "testInlineAdditionalProperties[test inline additionalProperties]" \ - "testJsonFormData[test json serialization of form data]" "testClassname[To test class name in snake case]" "addPet[Add a new pet to the store]" \ - "deletePet[Deletes a pet]" \ - "findPetsByStatus[Finds Pets by status]" \ - "findPetsByTags[Finds Pets by tags]" \ - "getPetById[Find pet by ID]" \ - "updatePet[Update an existing pet]" \ - "updatePetWithForm[Updates a pet in the store with form data]" \ - "uploadFile[uploads an image]" \ - "uploadFileWithRequiredFile[uploads an image (required)]" "deleteOrder[Delete purchase order by ID]" \ - "getInventory[Returns pet inventories by status]" \ - "getOrderById[Find purchase order by ID]" \ - "placeOrder[Place an order for a pet]" "createUser[Create user]" \ - "createUsersWithArrayInput[Creates list of users with given input array]" \ - "createUsersWithListInput[Creates list of users with given input array]" \ - "deleteUser[Delete user]" \ - "getUserByName[Get user by user name]" \ - "loginUser[Logs user into the system]" \ - "logoutUser[Logs out current logged in user session]" \ - "updateUser[Updated user]" - _arguments "(--help)--help[Print information about operation]" - - ret=0 - ;; - args) - case $line[1] in - 123Test@$%SpecialTags) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fooGet) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fakeHealthGet) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fakeOuterBooleanSerialize) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fakeOuterCompositeSerialize) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fakeOuterNumberSerialize) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - fakeOuterStringSerialize) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testBodyWithFileSchema) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testBodyWithQueryParams) - local -a _op_arguments - _op_arguments=( - "query=:[QUERY] " - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testClientModel) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testEndpointParameters) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testEnumParameters) - local -a _op_arguments - _op_arguments=( - "enum_query_string_array=:[QUERY] Query parameter enum test (string array)" -"enum_query_string=:[QUERY] Query parameter enum test (string)" -"enum_query_integer=:[QUERY] Query parameter enum test (double)" -"enum_query_double=:[QUERY] Query parameter enum test (double)" - "enum_header_string_array\::[HEADER] Header parameter enum test (string array)" -"enum_header_string\::[HEADER] Header parameter enum test (string)" -) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testGroupParameters) - local -a _op_arguments - _op_arguments=( - "required_string_group=:[QUERY] Required String in group parameters" -"required_int64_group=:[QUERY] Required Integer in group parameters" -"string_group=:[QUERY] String in group parameters" -"int64_group=:[QUERY] Integer in group parameters" - "required_boolean_group\::[HEADER] Required Boolean in group parameters" -"boolean_group\::[HEADER] Boolean in group parameters" -) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testInlineAdditionalProperties) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testJsonFormData) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - testClassname) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - addPet) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - deletePet) - local -a _op_arguments - _op_arguments=( - "petId=:[PATH] Pet id to delete" - "api_key\::[HEADER] " -) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - findPetsByStatus) - local -a _op_arguments - _op_arguments=( - "status=:[QUERY] Status values that need to be considered for filter" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - findPetsByTags) - local -a _op_arguments - _op_arguments=( - "tags=:[QUERY] Tags to filter by" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - getPetById) - local -a _op_arguments - _op_arguments=( - "petId=:[PATH] ID of pet to return" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - updatePet) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - updatePetWithForm) - local -a _op_arguments - _op_arguments=( - "petId=:[PATH] ID of pet that needs to be updated" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - uploadFile) - local -a _op_arguments - _op_arguments=( - "petId=:[PATH] ID of pet to update" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - uploadFileWithRequiredFile) - local -a _op_arguments - _op_arguments=( - "petId=:[PATH] ID of pet to update" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - deleteOrder) - local -a _op_arguments - _op_arguments=( - "order_id=:[PATH] ID of the order that needs to be deleted" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - getInventory) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - getOrderById) - local -a _op_arguments - _op_arguments=( - "order_id=:[PATH] ID of pet that needs to be fetched" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - placeOrder) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - createUser) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - createUsersWithArrayInput) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - createUsersWithListInput) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - deleteUser) - local -a _op_arguments - _op_arguments=( - "username=:[PATH] The name that needs to be deleted" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - getUserByName) - local -a _op_arguments - _op_arguments=( - "username=:[PATH] The name that needs to be fetched. Use user1 for testing." - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - loginUser) - local -a _op_arguments - _op_arguments=( - "username=:[QUERY] The user name for login" -"password=:[QUERY] The password for login in clear text" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - logoutUser) - local -a _op_arguments - _op_arguments=( - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - updateUser) - local -a _op_arguments - _op_arguments=( - "username=:[PATH] name that need to be deleted" - ) - _describe -t actions 'operations' _op_arguments -S '' && ret=0 - ;; - esac - ;; - -esac - -return ret diff --git a/samples/client/petstore/bash/client.sh b/samples/client/petstore/bash/client.sh deleted file mode 100644 index c43fb5804e6c..000000000000 --- a/samples/client/petstore/bash/client.sh +++ /dev/null @@ -1,4003 +0,0 @@ -#!/usr/bin/env bash - -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# ! -# ! Note: -# ! -# ! THIS SCRIPT HAS BEEN AUTOMATICALLY GENERATED USING -# ! openapi-generator (https://openapi-generator.tech) -# ! FROM OPENAPI SPECIFICATION IN JSON. -# ! -# ! -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -# -# This is a Bash client for OpenAPI Petstore. -# -# LICENSE: -# http://www.apache.org/licenses/LICENSE-2.0.html -# -# CONTACT: -# -# -# MORE INFORMATION: -# -# - -# For improved pattern matching in case statemets -shopt -s extglob - -############################################################################### -# -# Make sure Bash is at least in version 4.3 -# -############################################################################### -if ! ( (("${BASH_VERSION:0:1}" == "4")) && (("${BASH_VERSION:2:1}" >= "3")) ) \ - && ! (("${BASH_VERSION:0:1}" >= "5")); then - echo "" - echo "Sorry - your Bash version is ${BASH_VERSION}" - echo "" - echo "You need at least Bash 4.3 to run this script." - echo "" - exit 1 -fi - -############################################################################### -# -# Global variables -# -############################################################################### - -## -# The filename of this script for help messages -script_name=$(basename "$0") - -## -# Map for headers passed after operation as KEY:VALUE -declare -A header_arguments - - -## -# Map for operation parameters passed after operation as PARAMETER=VALUE -# These will be mapped to appropriate path or query parameters -# The values in operation_parameters are arrays, so that multiple values -# can be provided for the same parameter if allowed by API specification -declare -A operation_parameters - -## -# Declare colors with autodection if output is terminal -if [ -t 1 ]; then - RED="$(tput setaf 1)" - GREEN="$(tput setaf 2)" - YELLOW="$(tput setaf 3)" - BLUE="$(tput setaf 4)" - MAGENTA="$(tput setaf 5)" - CYAN="$(tput setaf 6)" - WHITE="$(tput setaf 7)" - BOLD="$(tput bold)" - OFF="$(tput sgr0)" -else - RED="" - GREEN="" - YELLOW="" - BLUE="" - MAGENTA="" - CYAN="" - WHITE="" - BOLD="" - OFF="" -fi - -declare -a result_color_table=( "$WHITE" "$WHITE" "$GREEN" "$YELLOW" "$WHITE" "$MAGENTA" "$WHITE" ) - -## -# This array stores the minimum number of required occurrences for parameter -# 0 - optional -# 1 - required -declare -A operation_parameters_minimum_occurrences -operation_parameters_minimum_occurrences["123Test@$%SpecialTags:::Client"]=1 -operation_parameters_minimum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_minimum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 -operation_parameters_minimum_occurrences["fakeOuterNumberSerialize:::body"]=0 -operation_parameters_minimum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_minimum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=1 -operation_parameters_minimum_occurrences["testBodyWithQueryParams:::query"]=1 -operation_parameters_minimum_occurrences["testBodyWithQueryParams:::User"]=1 -operation_parameters_minimum_occurrences["testClientModel:::Client"]=1 -operation_parameters_minimum_occurrences["testEndpointParameters:::number"]=1 -operation_parameters_minimum_occurrences["testEndpointParameters:::double"]=1 -operation_parameters_minimum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=1 -operation_parameters_minimum_occurrences["testEndpointParameters:::byte"]=1 -operation_parameters_minimum_occurrences["testEndpointParameters:::integer"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::int32"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::int64"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::float"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::string"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::binary"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::date"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::dateTime"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::password"]=0 -operation_parameters_minimum_occurrences["testEndpointParameters:::callback"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_header_string_array"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_header_string"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_string_array"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_string"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_integer"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_query_double"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_form_string_array"]=0 -operation_parameters_minimum_occurrences["testEnumParameters:::enum_form_string"]=0 -operation_parameters_minimum_occurrences["testGroupParameters:::required_string_group"]=1 -operation_parameters_minimum_occurrences["testGroupParameters:::required_boolean_group"]=1 -operation_parameters_minimum_occurrences["testGroupParameters:::required_int64_group"]=1 -operation_parameters_minimum_occurrences["testGroupParameters:::string_group"]=0 -operation_parameters_minimum_occurrences["testGroupParameters:::boolean_group"]=0 -operation_parameters_minimum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_minimum_occurrences["testInlineAdditionalProperties:::request_body"]=1 -operation_parameters_minimum_occurrences["testJsonFormData:::param"]=1 -operation_parameters_minimum_occurrences["testJsonFormData:::param2"]=1 -operation_parameters_minimum_occurrences["testClassname:::Client"]=1 -operation_parameters_minimum_occurrences["addPet:::Pet"]=1 -operation_parameters_minimum_occurrences["deletePet:::petId"]=1 -operation_parameters_minimum_occurrences["deletePet:::api_key"]=0 -operation_parameters_minimum_occurrences["findPetsByStatus:::status"]=1 -operation_parameters_minimum_occurrences["findPetsByTags:::tags"]=1 -operation_parameters_minimum_occurrences["getPetById:::petId"]=1 -operation_parameters_minimum_occurrences["updatePet:::Pet"]=1 -operation_parameters_minimum_occurrences["updatePetWithForm:::petId"]=1 -operation_parameters_minimum_occurrences["updatePetWithForm:::name"]=0 -operation_parameters_minimum_occurrences["updatePetWithForm:::status"]=0 -operation_parameters_minimum_occurrences["uploadFile:::petId"]=1 -operation_parameters_minimum_occurrences["uploadFile:::additionalMetadata"]=0 -operation_parameters_minimum_occurrences["uploadFile:::file"]=0 -operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::petId"]=1 -operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::requiredFile"]=1 -operation_parameters_minimum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 -operation_parameters_minimum_occurrences["deleteOrder:::order_id"]=1 -operation_parameters_minimum_occurrences["getOrderById:::order_id"]=1 -operation_parameters_minimum_occurrences["placeOrder:::Order"]=1 -operation_parameters_minimum_occurrences["createUser:::User"]=1 -operation_parameters_minimum_occurrences["createUsersWithArrayInput:::User"]=1 -operation_parameters_minimum_occurrences["createUsersWithListInput:::User"]=1 -operation_parameters_minimum_occurrences["deleteUser:::username"]=1 -operation_parameters_minimum_occurrences["getUserByName:::username"]=1 -operation_parameters_minimum_occurrences["loginUser:::username"]=1 -operation_parameters_minimum_occurrences["loginUser:::password"]=1 -operation_parameters_minimum_occurrences["updateUser:::username"]=1 -operation_parameters_minimum_occurrences["updateUser:::User"]=1 - -## -# This array stores the maximum number of allowed occurrences for parameter -# 1 - single value -# 2 - 2 values -# N - N values -# 0 - unlimited -declare -A operation_parameters_maximum_occurrences -operation_parameters_maximum_occurrences["123Test@$%SpecialTags:::Client"]=0 -operation_parameters_maximum_occurrences["fakeOuterBooleanSerialize:::body"]=0 -operation_parameters_maximum_occurrences["fakeOuterCompositeSerialize:::OuterComposite"]=0 -operation_parameters_maximum_occurrences["fakeOuterNumberSerialize:::body"]=0 -operation_parameters_maximum_occurrences["fakeOuterStringSerialize:::body"]=0 -operation_parameters_maximum_occurrences["testBodyWithFileSchema:::FileSchemaTestClass"]=0 -operation_parameters_maximum_occurrences["testBodyWithQueryParams:::query"]=0 -operation_parameters_maximum_occurrences["testBodyWithQueryParams:::User"]=0 -operation_parameters_maximum_occurrences["testClientModel:::Client"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::number"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::double"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::pattern_without_delimiter"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::byte"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::integer"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::int32"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::int64"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::float"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::string"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::binary"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::date"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::dateTime"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::password"]=0 -operation_parameters_maximum_occurrences["testEndpointParameters:::callback"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_header_string_array"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_header_string"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_string_array"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_string"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_integer"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_query_double"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_form_string_array"]=0 -operation_parameters_maximum_occurrences["testEnumParameters:::enum_form_string"]=0 -operation_parameters_maximum_occurrences["testGroupParameters:::required_string_group"]=0 -operation_parameters_maximum_occurrences["testGroupParameters:::required_boolean_group"]=0 -operation_parameters_maximum_occurrences["testGroupParameters:::required_int64_group"]=0 -operation_parameters_maximum_occurrences["testGroupParameters:::string_group"]=0 -operation_parameters_maximum_occurrences["testGroupParameters:::boolean_group"]=0 -operation_parameters_maximum_occurrences["testGroupParameters:::int64_group"]=0 -operation_parameters_maximum_occurrences["testInlineAdditionalProperties:::request_body"]=0 -operation_parameters_maximum_occurrences["testJsonFormData:::param"]=0 -operation_parameters_maximum_occurrences["testJsonFormData:::param2"]=0 -operation_parameters_maximum_occurrences["testClassname:::Client"]=0 -operation_parameters_maximum_occurrences["addPet:::Pet"]=0 -operation_parameters_maximum_occurrences["deletePet:::petId"]=0 -operation_parameters_maximum_occurrences["deletePet:::api_key"]=0 -operation_parameters_maximum_occurrences["findPetsByStatus:::status"]=0 -operation_parameters_maximum_occurrences["findPetsByTags:::tags"]=0 -operation_parameters_maximum_occurrences["getPetById:::petId"]=0 -operation_parameters_maximum_occurrences["updatePet:::Pet"]=0 -operation_parameters_maximum_occurrences["updatePetWithForm:::petId"]=0 -operation_parameters_maximum_occurrences["updatePetWithForm:::name"]=0 -operation_parameters_maximum_occurrences["updatePetWithForm:::status"]=0 -operation_parameters_maximum_occurrences["uploadFile:::petId"]=0 -operation_parameters_maximum_occurrences["uploadFile:::additionalMetadata"]=0 -operation_parameters_maximum_occurrences["uploadFile:::file"]=0 -operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::petId"]=0 -operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::requiredFile"]=0 -operation_parameters_maximum_occurrences["uploadFileWithRequiredFile:::additionalMetadata"]=0 -operation_parameters_maximum_occurrences["deleteOrder:::order_id"]=0 -operation_parameters_maximum_occurrences["getOrderById:::order_id"]=0 -operation_parameters_maximum_occurrences["placeOrder:::Order"]=0 -operation_parameters_maximum_occurrences["createUser:::User"]=0 -operation_parameters_maximum_occurrences["createUsersWithArrayInput:::User"]=0 -operation_parameters_maximum_occurrences["createUsersWithListInput:::User"]=0 -operation_parameters_maximum_occurrences["deleteUser:::username"]=0 -operation_parameters_maximum_occurrences["getUserByName:::username"]=0 -operation_parameters_maximum_occurrences["loginUser:::username"]=0 -operation_parameters_maximum_occurrences["loginUser:::password"]=0 -operation_parameters_maximum_occurrences["updateUser:::username"]=0 -operation_parameters_maximum_occurrences["updateUser:::User"]=0 - -## -# The type of collection for specifying multiple values for parameter: -# - multi, csv, ssv, tsv -declare -A operation_parameters_collection_type -operation_parameters_collection_type["123Test@$%SpecialTags:::Client"]="" -operation_parameters_collection_type["fakeOuterBooleanSerialize:::body"]="" -operation_parameters_collection_type["fakeOuterCompositeSerialize:::OuterComposite"]="" -operation_parameters_collection_type["fakeOuterNumberSerialize:::body"]="" -operation_parameters_collection_type["fakeOuterStringSerialize:::body"]="" -operation_parameters_collection_type["testBodyWithFileSchema:::FileSchemaTestClass"]="" -operation_parameters_collection_type["testBodyWithQueryParams:::query"]="" -operation_parameters_collection_type["testBodyWithQueryParams:::User"]="" -operation_parameters_collection_type["testClientModel:::Client"]="" -operation_parameters_collection_type["testEndpointParameters:::number"]="" -operation_parameters_collection_type["testEndpointParameters:::double"]="" -operation_parameters_collection_type["testEndpointParameters:::pattern_without_delimiter"]="" -operation_parameters_collection_type["testEndpointParameters:::byte"]="" -operation_parameters_collection_type["testEndpointParameters:::integer"]="" -operation_parameters_collection_type["testEndpointParameters:::int32"]="" -operation_parameters_collection_type["testEndpointParameters:::int64"]="" -operation_parameters_collection_type["testEndpointParameters:::float"]="" -operation_parameters_collection_type["testEndpointParameters:::string"]="" -operation_parameters_collection_type["testEndpointParameters:::binary"]="" -operation_parameters_collection_type["testEndpointParameters:::date"]="" -operation_parameters_collection_type["testEndpointParameters:::dateTime"]="" -operation_parameters_collection_type["testEndpointParameters:::password"]="" -operation_parameters_collection_type["testEndpointParameters:::callback"]="" -operation_parameters_collection_type["testEnumParameters:::enum_header_string_array"]="csv" -operation_parameters_collection_type["testEnumParameters:::enum_header_string"]="" -operation_parameters_collection_type["testEnumParameters:::enum_query_string_array"]="multi" -operation_parameters_collection_type["testEnumParameters:::enum_query_string"]="" -operation_parameters_collection_type["testEnumParameters:::enum_query_integer"]="" -operation_parameters_collection_type["testEnumParameters:::enum_query_double"]="" -operation_parameters_collection_type["testEnumParameters:::enum_form_string_array"]= -operation_parameters_collection_type["testEnumParameters:::enum_form_string"]="" -operation_parameters_collection_type["testGroupParameters:::required_string_group"]="" -operation_parameters_collection_type["testGroupParameters:::required_boolean_group"]="" -operation_parameters_collection_type["testGroupParameters:::required_int64_group"]="" -operation_parameters_collection_type["testGroupParameters:::string_group"]="" -operation_parameters_collection_type["testGroupParameters:::boolean_group"]="" -operation_parameters_collection_type["testGroupParameters:::int64_group"]="" -operation_parameters_collection_type["testInlineAdditionalProperties:::request_body"]= -operation_parameters_collection_type["testJsonFormData:::param"]="" -operation_parameters_collection_type["testJsonFormData:::param2"]="" -operation_parameters_collection_type["testClassname:::Client"]="" -operation_parameters_collection_type["addPet:::Pet"]="" -operation_parameters_collection_type["deletePet:::petId"]="" -operation_parameters_collection_type["deletePet:::api_key"]="" -operation_parameters_collection_type["findPetsByStatus:::status"]="csv" -operation_parameters_collection_type["findPetsByTags:::tags"]="csv" -operation_parameters_collection_type["getPetById:::petId"]="" -operation_parameters_collection_type["updatePet:::Pet"]="" -operation_parameters_collection_type["updatePetWithForm:::petId"]="" -operation_parameters_collection_type["updatePetWithForm:::name"]="" -operation_parameters_collection_type["updatePetWithForm:::status"]="" -operation_parameters_collection_type["uploadFile:::petId"]="" -operation_parameters_collection_type["uploadFile:::additionalMetadata"]="" -operation_parameters_collection_type["uploadFile:::file"]="" -operation_parameters_collection_type["uploadFileWithRequiredFile:::petId"]="" -operation_parameters_collection_type["uploadFileWithRequiredFile:::requiredFile"]="" -operation_parameters_collection_type["uploadFileWithRequiredFile:::additionalMetadata"]="" -operation_parameters_collection_type["deleteOrder:::order_id"]="" -operation_parameters_collection_type["getOrderById:::order_id"]="" -operation_parameters_collection_type["placeOrder:::Order"]="" -operation_parameters_collection_type["createUser:::User"]="" -operation_parameters_collection_type["createUsersWithArrayInput:::User"]= -operation_parameters_collection_type["createUsersWithListInput:::User"]= -operation_parameters_collection_type["deleteUser:::username"]="" -operation_parameters_collection_type["getUserByName:::username"]="" -operation_parameters_collection_type["loginUser:::username"]="" -operation_parameters_collection_type["loginUser:::password"]="" -operation_parameters_collection_type["updateUser:::username"]="" -operation_parameters_collection_type["updateUser:::User"]="" - - -## -# Map for body parameters passed after operation as -# PARAMETER==STRING_VALUE or PARAMETER:=NUMERIC_VALUE -# These will be mapped to top level json keys ( { "PARAMETER": "VALUE" }) -declare -A body_parameters - -## -# These arguments will be directly passed to cURL -curl_arguments="" - -## -# The host for making the request -host="" - -## -# The user credentials for basic authentication -basic_auth_credential="" - -## -# The user API key -apikey_auth_credential="" - -## -# If true, the script will only output the actual cURL command that would be -# used -print_curl=false - -## -# The operation ID passed on the command line -operation="" - -## -# The provided Accept header value -header_accept="" - -## -# The provided Content-type header value -header_content_type="" - -## -# If there is any body content on the stdin pass it to the body of the request -body_content_temp_file="" - -## -# If this variable is set to true, the request will be performed even -# if parameters for required query, header or body values are not provided -# (path parameters are still required). -force=false - -## -# Declare some mime types abbreviations for easier content-type and accepts -# headers specification -declare -A mime_type_abbreviations -# text/* -mime_type_abbreviations["text"]="text/plain" -mime_type_abbreviations["html"]="text/html" -mime_type_abbreviations["md"]="text/x-markdown" -mime_type_abbreviations["csv"]="text/csv" -mime_type_abbreviations["css"]="text/css" -mime_type_abbreviations["rtf"]="text/rtf" -# application/* -mime_type_abbreviations["json"]="application/json" -mime_type_abbreviations["xml"]="application/xml" -mime_type_abbreviations["yaml"]="application/yaml" -mime_type_abbreviations["js"]="application/javascript" -mime_type_abbreviations["bin"]="application/octet-stream" -mime_type_abbreviations["rdf"]="application/rdf+xml" -# image/* -mime_type_abbreviations["jpg"]="image/jpeg" -mime_type_abbreviations["png"]="image/png" -mime_type_abbreviations["gif"]="image/gif" -mime_type_abbreviations["bmp"]="image/bmp" -mime_type_abbreviations["tiff"]="image/tiff" - - -############################################################################## -# -# Escape special URL characters -# Based on table at http://www.w3schools.com/tags/ref_urlencode.asp -# -############################################################################## -url_escape() { - local raw_url="$1" - - value=$(sed -e 's/ /%20/g' \ - -e 's/!/%21/g' \ - -e 's/"/%22/g' \ - -e 's/#/%23/g' \ - -e 's/\&/%26/g' \ - -e 's/'\''/%28/g' \ - -e 's/(/%28/g' \ - -e 's/)/%29/g' \ - -e 's/:/%3A/g' \ - -e 's/\t/%09/g' \ - -e 's/?/%3F/g' <<<"$raw_url"); - - echo "$value" -} - -############################################################################## -# -# Lookup the mime type abbreviation in the mime_type_abbreviations array. -# If not present assume the user provided a valid mime type -# -############################################################################## -lookup_mime_type() { - local mime_type="$1" - - if [[ ${mime_type_abbreviations[$mime_type]} ]]; then - echo "${mime_type_abbreviations[$mime_type]}" - else - echo "$mime_type" - fi -} - -############################################################################## -# -# Converts an associative array into a list of cURL header -# arguments (-H "KEY: VALUE") -# -############################################################################## -header_arguments_to_curl() { - local headers_curl="" - local api_key_header="" - local api_key_header_in_cli="" - api_key_header="api_key" - - for key in "${!header_arguments[@]}"; do - headers_curl+="-H \"${key}: ${header_arguments[${key}]}\" " - if [[ "${key}XX" == "${api_key_header}XX" ]]; then - api_key_header_in_cli="YES" - fi - done - # - # If the api_key was not provided in the header, try one from the - # environment variable - # - if [[ -z $api_key_header_in_cli && -n $apikey_auth_credential ]]; then - headers_curl+="-H \"${api_key_header}: ${apikey_auth_credential}\"" - fi - headers_curl+=" " - - echo "${headers_curl}" -} - -############################################################################## -# -# Converts an associative array into a simple JSON with keys as top -# level object attributes -# -# \todo Add conversion of more complex attributes using paths -# -############################################################################## -body_parameters_to_json() { - local body_json="-d '{" - local count=0 - for key in "${!body_parameters[@]}"; do - if [[ $((count++)) -gt 0 ]]; then - body_json+=", " - fi - body_json+="\"${key}\": ${body_parameters[${key}]}" - done - body_json+="}'" - - if [[ "${#body_parameters[@]}" -eq 0 ]]; then - echo "" - else - echo "${body_json}" - fi -} - -############################################################################## -# -# Helper method for showing error because for example echo in -# build_request_path() is evaluated as part of command line not printed on -# output. Anyway better idea for resource clean up ;-). -# -############################################################################## -ERROR_MSG="" -function finish { - if [[ -n "$ERROR_MSG" ]]; then - echo >&2 "${OFF}${RED}$ERROR_MSG" - echo >&2 "${OFF}Check usage: '${script_name} --help'" - fi -} -trap finish EXIT - - -############################################################################## -# -# Validate and build request path including query parameters -# -############################################################################## -build_request_path() { - local path_template=$1 - local -n path_params=$2 - local -n query_params=$3 - - - # - # Check input parameters count against minimum and maximum required - # - if [[ "$force" = false ]]; then - local was_error="" - for qparam in "${query_params[@]}" "${path_params[@]}"; do - local parameter_values - mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") - - # - # Check if the number of provided values is not less than minimum required - # - if [[ ${#parameter_values[@]} -lt ${operation_parameters_minimum_occurrences["${operation}:::${qparam}"]} ]]; then - echo "ERROR: Too few values provided for '${qparam}' parameter." - was_error=true - fi - - # - # Check if the number of provided values is not more than maximum - # - if [[ ${operation_parameters_maximum_occurrences["${operation}:::${qparam}"]} -gt 0 \ - && ${#parameter_values[@]} -gt ${operation_parameters_maximum_occurrences["${operation}:::${qparam}"]} ]]; then - echo "ERROR: Too many values provided for '${qparam}' parameter" - was_error=true - fi - done - if [[ -n "$was_error" ]]; then - exit 1 - fi - fi - - # First replace all path parameters in the path - for pparam in "${path_params[@]}"; do - local path_regex="(.*)(\\{$pparam\\})(.*)" - if [[ $path_template =~ $path_regex ]]; then - path_template=${BASH_REMATCH[1]}${operation_parameters[$pparam]}${BASH_REMATCH[3]} - fi - done - - local query_request_part="" - - for qparam in "${query_params[@]}"; do - if [[ "${operation_parameters[$qparam]}" == "" ]]; then - continue - fi - - # Get the array of parameter values - local parameter_value="" - local parameter_values - mapfile -t parameter_values < <(sed -e 's/'":::"'/\n/g' <<<"${operation_parameters[$qparam]}") - - - if [[ ${qparam} == "api_key_query" ]]; then - if [[ -n "${parameter_values[*]}" ]]; then - parameter_value+="${qparam}=${parameter_values}" - else - echo "Missing ApiKey!!! You have to provide on command line option 'api_key_query=...'" - exit 1 - fi - continue - fi - - # - # Append parameters without specific cardinality - # - local collection_type="${operation_parameters_collection_type["${operation}:::${qparam}"]}" - if [[ "${collection_type}" == "" ]]; then - local vcount=0 - for qvalue in "${parameter_values[@]}"; do - if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+="&" - fi - parameter_value+="${qparam}=${qvalue}" - done - # - # Append parameters specified as 'mutli' collections i.e. param=value1¶m=value2&... - # - elif [[ "${collection_type}" == "multi" ]]; then - local vcount=0 - for qvalue in "${parameter_values[@]}"; do - if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+="&" - fi - parameter_value+="${qparam}=${qvalue}" - done - # - # Append parameters specified as 'csv' collections i.e. param=value1,value2,... - # - elif [[ "${collection_type}" == "csv" ]]; then - parameter_value+="${qparam}=" - local vcount=0 - for qvalue in "${parameter_values[@]}"; do - if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+="," - fi - parameter_value+="${qvalue}" - done - # - # Append parameters specified as 'ssv' collections i.e. param="value1 value2 ..." - # - elif [[ "${collection_type}" == "ssv" ]]; then - parameter_value+="${qparam}=" - local vcount=0 - for qvalue in "${parameter_values[@]}"; do - if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+=" " - fi - parameter_value+="${qvalue}" - done - # - # Append parameters specified as 'tsv' collections i.e. param="value1\tvalue2\t..." - # - elif [[ "${collection_type}" == "tsv" ]]; then - parameter_value+="${qparam}=" - local vcount=0 - for qvalue in "${parameter_values[@]}"; do - if [[ $((vcount++)) -gt 0 ]]; then - parameter_value+="\\t" - fi - parameter_value+="${qvalue}" - done - else - echo "Unsupported collection format \"${collection_type}\"" - exit 1 - fi - - if [[ -n "${parameter_value}" ]]; then - if [[ -n "${query_request_part}" ]]; then - query_request_part+="&" - fi - query_request_part+="${parameter_value}" - fi - - done - - - # Now append query parameters - if any - if [[ -n "${query_request_part}" ]]; then - path_template+="?${query_request_part}" - fi - - echo "$path_template" -} - - - -############################################################################### -# -# Print main help message -# -############################################################################### -print_help() { -cat <${OFF}] - [-ac|--accept ${GREEN}${OFF}] [-ct,--content-type ${GREEN}${OFF}] - [--host ${CYAN}${OFF}] [--dry-run] [-nc|--no-colors] ${YELLOW}${OFF} [-h|--help] - [${BLUE}${OFF}] [${MAGENTA}${OFF}] [${MAGENTA}${OFF}] - - - ${CYAN}${OFF} - endpoint of the REST service without basepath - - - ${RED}${OFF} - any valid cURL options can be passed before ${YELLOW}${OFF} - - ${GREEN}${OFF} - either full mime-type or one of supported abbreviations: - (text, html, md, csv, css, rtf, json, xml, yaml, js, bin, - rdf, jpg, png, gif, bmp, tiff) - - ${BLUE}${OFF} - HTTP headers can be passed in the form ${YELLOW}HEADER${OFF}:${BLUE}VALUE${OFF} - - ${MAGENTA}${OFF} - REST operation parameters can be passed in the following - forms: - * ${YELLOW}KEY${OFF}=${BLUE}VALUE${OFF} - path or query parameters - - ${MAGENTA}${OFF} - simple JSON body content (first level only) can be build - using the following arguments: - * ${YELLOW}KEY${OFF}==${BLUE}VALUE${OFF} - body parameters which will be added to body - JSON as '{ ..., "${YELLOW}KEY${OFF}": "${BLUE}VALUE${OFF}", ... }' - * ${YELLOW}KEY${OFF}:=${BLUE}VALUE${OFF} - body parameters which will be added to body - JSON as '{ ..., "${YELLOW}KEY${OFF}": ${BLUE}VALUE${OFF}, ... }' - -EOF - echo -e "${BOLD}${WHITE}Authentication methods${OFF}" - echo -e "" - echo -e " - ${BLUE}Api-key${OFF} - add '${RED}api_key:${OFF}' after ${YELLOW}${OFF}" - - echo -e " - ${BLUE}Api-key${OFF} - add '${RED}api_key_query=${OFF}' after ${YELLOW}${OFF}" - - echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" - - echo -e " - ${BLUE}Basic AUTH${OFF} - add '-u :' before ${YELLOW}${OFF}" - - echo -e " - ${MAGENTA}OAuth2 (flow: implicit)${OFF}" - echo -e " Authorization URL: " - echo -e " * http://petstore.swagger.io/api/oauth/dialog" - echo -e " Scopes:" - echo -e " * write:pets - modify pets in your account" - echo -e " * read:pets - read your pets" - echo "" - echo -e "${BOLD}${WHITE}Operations (grouped by tags)${OFF}" - echo "" - echo -e "${BOLD}${WHITE}[anotherFake]${OFF}" -read -r -d '' ops <${OFF}\\t\\t\\t\\tSpecify the host URL " -echo -e " \\t\\t\\t\\t(e.g. 'https://petstore.swagger.io')" - - echo -e " --force\\t\\t\\t\\tForce command invocation in spite of missing" - echo -e " \\t\\t\\t\\trequired parameters or wrong content type" - echo -e " --dry-run\\t\\t\\t\\tPrint out the cURL command without" - echo -e " \\t\\t\\t\\texecuting it" - echo -e " -nc,--no-colors\\t\\t\\tEnforce print without colors, otherwise autodected" - echo -e " -ac,--accept ${YELLOW}${OFF}\\t\\tSet the 'Accept' header in the request" - echo -e " -ct,--content-type ${YELLOW}${OFF}\\tSet the 'Content-type' header in " - echo -e " \\tthe request" - echo "" -} - - -############################################################################## -# -# Print REST service description -# -############################################################################## -print_about() { - echo "" - echo -e "${BOLD}${WHITE}OpenAPI Petstore command line client (API version 1.0.0)${OFF}" - echo "" - echo -e "License: Apache-2.0" - echo -e "Contact: " - echo "" -read -r -d '' appdescription < 10. Other values will generated exceptions" | paste -sd' ' | fold -sw 80 - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}order_id${OFF} ${BLUE}[integer]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - ID of pet that needs to be fetched ${YELLOW}Specify as: order_id=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=200 - echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=400 - echo -e "${result_color_table[${code:0:1}]} 400;Invalid ID supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=404 - echo -e "${result_color_table[${code:0:1}]} 404;Order not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for placeOrder operation -# -############################################################################## -print_placeOrder_help() { - echo "" - echo -e "${BOLD}${WHITE}placeOrder - Place an order for a pet${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - order placed for purchasing the pet" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=200 - echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=400 - echo -e "${result_color_table[${code:0:1}]} 400;Invalid Order${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for createUser operation -# -############################################################################## -print_createUser_help() { - echo "" - echo -e "${BOLD}${WHITE}createUser - Create user${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Created user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=0 - echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for createUsersWithArrayInput operation -# -############################################################################## -print_createUsersWithArrayInput_help() { - echo "" - echo -e "${BOLD}${WHITE}createUsersWithArrayInput - Creates list of users with given input array${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=0 - echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for createUsersWithListInput operation -# -############################################################################## -print_createUsersWithListInput_help() { - echo "" - echo -e "${BOLD}${WHITE}createUsersWithListInput - Creates list of users with given input array${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - List of user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=0 - echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for deleteUser operation -# -############################################################################## -print_deleteUser_help() { - echo "" - echo -e "${BOLD}${WHITE}deleteUser - Delete user${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The name that needs to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=400 - echo -e "${result_color_table[${code:0:1}]} 400;Invalid username supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=404 - echo -e "${result_color_table[${code:0:1}]} 404;User not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for getUserByName operation -# -############################################################################## -print_getUserByName_help() { - echo "" - echo -e "${BOLD}${WHITE}getUserByName - Get user by user name${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The name that needs to be fetched. Use user1 for testing. ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=200 - echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=400 - echo -e "${result_color_table[${code:0:1}]} 400;Invalid username supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=404 - echo -e "${result_color_table[${code:0:1}]} 404;User not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for loginUser operation -# -############################################################################## -print_loginUser_help() { - echo "" - echo -e "${BOLD}${WHITE}loginUser - Logs user into the system${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The user name for login${YELLOW} Specify as: username=value${OFF}" \ - | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}password${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - The password for login in clear text${YELLOW} Specify as: password=value${OFF}" \ - | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=200 - echo -e "${result_color_table[${code:0:1}]} 200;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " ${BOLD}${WHITE}Response headers${OFF}" - echo -e " ${BLUE}X-Rate-Limit${OFF} - calls per hour allowed by the user" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " ${BLUE}X-Expires-After${OFF} - date in UTC when token expires" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - code=400 - echo -e "${result_color_table[${code:0:1}]} 400;Invalid username/password supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for logoutUser operation -# -############################################################################## -print_logoutUser_help() { - echo "" - echo -e "${BOLD}${WHITE}logoutUser - Logs out current logged in user session${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=0 - echo -e "${result_color_table[${code:0:1}]} 0;successful operation${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} -############################################################################## -# -# Print help for updateUser operation -# -############################################################################## -print_updateUser_help() { - echo "" - echo -e "${BOLD}${WHITE}updateUser - Updated user${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo -e "This can only be done by the logged in user." | paste -sd' ' | fold -sw 80 - echo -e "" - echo -e "${BOLD}${WHITE}Parameters${OFF}" - echo -e " * ${GREEN}username${OFF} ${BLUE}[string]${OFF} ${RED}(required)${OFF} ${CYAN}(default: null)${OFF} - name that need to be deleted ${YELLOW}Specify as: username=value${OFF}" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e " * ${GREEN}body${OFF} ${BLUE}[application/json]${OFF} ${RED}(required)${OFF}${OFF} - Updated user object" | paste -sd' ' | fold -sw 80 | sed '2,$s/^/ /' - echo -e "" - echo "" - echo -e "${BOLD}${WHITE}Responses${OFF}" - code=400 - echo -e "${result_color_table[${code:0:1}]} 400;Invalid user supplied${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' - code=404 - echo -e "${result_color_table[${code:0:1}]} 404;User not found${OFF}" | paste -sd' ' | column -t -s ';' | fold -sw 80 | sed '2,$s/^/ /' -} - - -############################################################################## -# -# Call 123Test@$%SpecialTags operation -# -############################################################################## -call_123Test@$%SpecialTags() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/another-fake/dummy" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PATCH" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call fooGet operation -# -############################################################################## -call_fooGet() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/foo" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call fakeHealthGet operation -# -############################################################################## -call_fakeHealthGet() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/health" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call fakeOuterBooleanSerialize operation -# -############################################################################## -call_fakeOuterBooleanSerialize() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/outer/boolean" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call fakeOuterCompositeSerialize operation -# -############################################################################## -call_fakeOuterCompositeSerialize() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/outer/composite" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call fakeOuterNumberSerialize operation -# -############################################################################## -call_fakeOuterNumberSerialize() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/outer/number" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call fakeOuterStringSerialize operation -# -############################################################################## -call_fakeOuterStringSerialize() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/outer/string" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call testBodyWithFileSchema operation -# -############################################################################## -call_testBodyWithFileSchema() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/body-with-file-schema" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PUT" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call testBodyWithQueryParams operation -# -############################################################################## -call_testBodyWithQueryParams() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=(query) - local path - - if ! path=$(build_request_path "/v2/fake/body-with-query-params" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PUT" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call testClientModel operation -# -############################################################################## -call_testClientModel() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PATCH" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call testEndpointParameters operation -# -############################################################################## -call_testEndpointParameters() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call testEnumParameters operation -# -############################################################################## -call_testEnumParameters() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=(enum_query_string_array enum_query_string enum_query_integer enum_query_double) - local path - - if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call testGroupParameters operation -# -############################################################################## -call_testGroupParameters() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=(required_string_group required_int64_group string_group int64_group ) - local path - - if ! path=$(build_request_path "/v2/fake" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="DELETE" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call testInlineAdditionalProperties operation -# -############################################################################## -call_testInlineAdditionalProperties() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/inline-additionalProperties" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call testJsonFormData operation -# -############################################################################## -call_testJsonFormData() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/fake/jsonFormData" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call testClassname operation -# -############################################################################## -call_testClassname() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( api_key_query ) - local path - - if ! path=$(build_request_path "/v2/fake_classname_test" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PATCH" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call addPet operation -# -############################################################################## -call_addPet() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/pet" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo -e "\\t- application/xml" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call deletePet operation -# -############################################################################## -call_deletePet() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(petId) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/pet/{petId}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="DELETE" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call findPetsByStatus operation -# -############################################################################## -call_findPetsByStatus() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=(status ) - local path - - if ! path=$(build_request_path "/v2/pet/findByStatus" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call findPetsByTags operation -# -############################################################################## -call_findPetsByTags() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=(tags ) - local path - - if ! path=$(build_request_path "/v2/pet/findByTags" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call getPetById operation -# -############################################################################## -call_getPetById() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(petId) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/pet/{petId}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call updatePet operation -# -############################################################################## -call_updatePet() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/pet" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PUT" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo -e "\\t- application/xml" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call updatePetWithForm operation -# -############################################################################## -call_updatePetWithForm() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(petId) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/pet/{petId}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call uploadFile operation -# -############################################################################## -call_uploadFile() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(petId) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/pet/{petId}/uploadImage" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call uploadFileWithRequiredFile operation -# -############################################################################## -call_uploadFileWithRequiredFile() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(petId) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/fake/{petId}/uploadImageWithRequiredFile" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call deleteOrder operation -# -############################################################################## -call_deleteOrder() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(order_id) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="DELETE" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call getInventory operation -# -############################################################################## -call_getInventory() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=( ) - local path - - if ! path=$(build_request_path "/v2/store/inventory" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call getOrderById operation -# -############################################################################## -call_getOrderById() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(order_id) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/store/order/{order_id}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call placeOrder operation -# -############################################################################## -call_placeOrder() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/store/order" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call createUser operation -# -############################################################################## -call_createUser() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call createUsersWithArrayInput operation -# -############################################################################## -call_createUsersWithArrayInput() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user/createWithArray" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call createUsersWithListInput operation -# -############################################################################## -call_createUsersWithListInput() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user/createWithList" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="POST" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - -############################################################################## -# -# Call deleteUser operation -# -############################################################################## -call_deleteUser() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(username) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user/{username}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="DELETE" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call getUserByName operation -# -############################################################################## -call_getUserByName() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(username) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user/{username}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call loginUser operation -# -############################################################################## -call_loginUser() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=(username password) - local path - - if ! path=$(build_request_path "/v2/user/login" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call logoutUser operation -# -############################################################################## -call_logoutUser() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=() - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user/logout" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="GET" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\"" - fi -} - -############################################################################## -# -# Call updateUser operation -# -############################################################################## -call_updateUser() { - # ignore error about 'path_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local path_parameter_names=(username) - # ignore error about 'query_parameter_names' being unused; passed by reference - # shellcheck disable=SC2034 - local query_parameter_names=() - local path - - if ! path=$(build_request_path "/v2/user/{username}" path_parameter_names query_parameter_names); then - ERROR_MSG=$path - exit 1 - fi - local method="PUT" - local headers_curl - headers_curl=$(header_arguments_to_curl) - if [[ -n $header_accept ]]; then - headers_curl="${headers_curl} -H 'Accept: ${header_accept}'" - fi - - local basic_auth_option="" - if [[ -n $basic_auth_credential ]]; then - basic_auth_option="-u ${basic_auth_credential}" - fi - local body_json_curl="" - - # - # Check if the user provided 'Content-type' headers in the - # command line. If not try to set them based on the OpenAPI specification - # if values produces and consumes are defined unambigously - # - if [[ -z $header_content_type ]]; then - header_content_type="application/json" - fi - - - if [[ -z $header_content_type && "$force" = false ]]; then - : - echo "ERROR: Request's content-type not specified!!!" - echo "This operation expects content-type in one of the following formats:" - echo -e "\\t- application/json" - echo "" - echo "Use '--content-type' to set proper content type" - exit 1 - else - headers_curl="${headers_curl} -H 'Content-type: ${header_content_type}'" - fi - - - # - # If we have received some body content over pipe, pass it from the - # temporary file to cURL - # - if [[ -n $body_content_temp_file ]]; then - if [[ "$print_curl" = true ]]; then - echo "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - else - eval "cat ${body_content_temp_file} | curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} \"${host}${path}\" -d @-" - fi - rm "${body_content_temp_file}" - # - # If not, try to build the content body from arguments KEY==VALUE and KEY:=VALUE - # - else - body_json_curl=$(body_parameters_to_json) - if [[ "$print_curl" = true ]]; then - echo "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - else - eval "curl ${basic_auth_option} ${curl_arguments} ${headers_curl} -X ${method} ${body_json_curl} \"${host}${path}\"" - fi - fi -} - - - -############################################################################## -# -# Main -# -############################################################################## - - -# Check dependencies -type curl >/dev/null 2>&1 || { echo >&2 "ERROR: You do not have 'cURL' installed."; exit 1; } -type sed >/dev/null 2>&1 || { echo >&2 "ERROR: You do not have 'sed' installed."; exit 1; } -type column >/dev/null 2>&1 || { echo >&2 "ERROR: You do not have 'bsdmainutils' installed."; exit 1; } - -# -# Process command line -# -# Pass all arguments before 'operation' to cURL except the ones we override -# -take_user=false -take_host=false -take_accept_header=false -take_contenttype_header=false - -for key in "$@"; do -# Take the value of -u|--user argument -if [[ "$take_user" = true ]]; then - basic_auth_credential="$key" - take_user=false - continue -fi -# Take the value of --host argument -if [[ "$take_host" = true ]]; then - host="$key" - take_host=false - continue -fi -# Take the value of --accept argument -if [[ "$take_accept_header" = true ]]; then - header_accept=$(lookup_mime_type "$key") - take_accept_header=false - continue -fi -# Take the value of --content-type argument -if [[ "$take_contenttype_header" = true ]]; then - header_content_type=$(lookup_mime_type "$key") - take_contenttype_header=false - continue -fi -case $key in - -h|--help) - if [[ "x$operation" == "x" ]]; then - print_help - exit 0 - else - eval "print_${operation}_help" - exit 0 - fi - ;; - -V|--version) - print_version - exit 0 - ;; - --about) - print_about - exit 0 - ;; - -u|--user) - take_user=true - ;; - --host) - take_host=true - ;; - --force) - force=true - ;; - -ac|--accept) - take_accept_header=true - ;; - -ct|--content-type) - take_contenttype_header=true - ;; - --dry-run) - print_curl=true - ;; - -nc|--no-colors) - RED="" - GREEN="" - YELLOW="" - BLUE="" - MAGENTA="" - CYAN="" - WHITE="" - BOLD="" - OFF="" - result_color_table=( "" "" "" "" "" "" "" ) - ;; - 123Test@$%SpecialTags) - operation="123Test@$%SpecialTags" - ;; - fooGet) - operation="fooGet" - ;; - fakeHealthGet) - operation="fakeHealthGet" - ;; - fakeOuterBooleanSerialize) - operation="fakeOuterBooleanSerialize" - ;; - fakeOuterCompositeSerialize) - operation="fakeOuterCompositeSerialize" - ;; - fakeOuterNumberSerialize) - operation="fakeOuterNumberSerialize" - ;; - fakeOuterStringSerialize) - operation="fakeOuterStringSerialize" - ;; - testBodyWithFileSchema) - operation="testBodyWithFileSchema" - ;; - testBodyWithQueryParams) - operation="testBodyWithQueryParams" - ;; - testClientModel) - operation="testClientModel" - ;; - testEndpointParameters) - operation="testEndpointParameters" - ;; - testEnumParameters) - operation="testEnumParameters" - ;; - testGroupParameters) - operation="testGroupParameters" - ;; - testInlineAdditionalProperties) - operation="testInlineAdditionalProperties" - ;; - testJsonFormData) - operation="testJsonFormData" - ;; - testClassname) - operation="testClassname" - ;; - addPet) - operation="addPet" - ;; - deletePet) - operation="deletePet" - ;; - findPetsByStatus) - operation="findPetsByStatus" - ;; - findPetsByTags) - operation="findPetsByTags" - ;; - getPetById) - operation="getPetById" - ;; - updatePet) - operation="updatePet" - ;; - updatePetWithForm) - operation="updatePetWithForm" - ;; - uploadFile) - operation="uploadFile" - ;; - uploadFileWithRequiredFile) - operation="uploadFileWithRequiredFile" - ;; - deleteOrder) - operation="deleteOrder" - ;; - getInventory) - operation="getInventory" - ;; - getOrderById) - operation="getOrderById" - ;; - placeOrder) - operation="placeOrder" - ;; - createUser) - operation="createUser" - ;; - createUsersWithArrayInput) - operation="createUsersWithArrayInput" - ;; - createUsersWithListInput) - operation="createUsersWithListInput" - ;; - deleteUser) - operation="deleteUser" - ;; - getUserByName) - operation="getUserByName" - ;; - loginUser) - operation="loginUser" - ;; - logoutUser) - operation="logoutUser" - ;; - updateUser) - operation="updateUser" - ;; - *==*) - # Parse body arguments and convert them into top level - # JSON properties passed in the body content as strings - if [[ "$operation" ]]; then - IFS='==' read -r body_key sep body_value <<< "$key" - body_parameters[${body_key}]="\"${body_value}\"" - fi - ;; - *:=*) - # Parse body arguments and convert them into top level - # JSON properties passed in the body content without qoutes - if [[ "$operation" ]]; then - # ignore error about 'sep' being unused - # shellcheck disable=SC2034 - IFS=':=' read -r body_key sep body_value <<< "$key" - body_parameters[${body_key}]=${body_value} - fi - ;; - +\([^=]\):*) - # Parse header arguments and convert them into curl - # only after the operation argument - if [[ "$operation" ]]; then - IFS=':' read -r header_name header_value <<< "$key" - # - # If the header key is the same as the api_key expected by API in the - # header, override the ${apikey_auth_credential} variable - # - if [[ $header_name == "api_key" ]]; then - apikey_auth_credential=$header_value - fi - header_arguments[$header_name]=$header_value - else - curl_arguments+=" $key" - fi - ;; - -) - body_content_temp_file=$(mktemp) - cat - > "$body_content_temp_file" - ;; - *=*) - # Parse operation arguments and convert them into curl - # only after the operation argument - if [[ "$operation" ]]; then - IFS='=' read -r parameter_name parameter_value <<< "$key" - if [[ -z "${operation_parameters[$parameter_name]+foo}" ]]; then - operation_parameters[$parameter_name]=$(url_escape "${parameter_value}") - else - operation_parameters[$parameter_name]+=":::"$(url_escape "${parameter_value}") - fi - else - curl_arguments+=" $key" - fi - ;; - *) - # If we are before the operation, treat the arguments as cURL arguments - if [[ "x$operation" == "x" ]]; then - # Maintain quotes around cURL arguments if necessary - space_regexp="[[:space:]]" - if [[ $key =~ $space_regexp ]]; then - curl_arguments+=" \"$key\"" - else - curl_arguments+=" $key" - fi - fi - ;; -esac -done - - -# Check if user provided host name -if [[ -z "$host" ]]; then - ERROR_MSG="ERROR: No hostname provided!!! You have to provide on command line option '--host ...'" - exit 1 -fi - -# Check if user specified operation ID -if [[ -z "$operation" ]]; then - ERROR_MSG="ERROR: No operation specified!!!" - exit 1 -fi - - -# Run cURL command based on the operation ID -case $operation in - 123Test@$%SpecialTags) - call_123Test@$%SpecialTags - ;; - fooGet) - call_fooGet - ;; - fakeHealthGet) - call_fakeHealthGet - ;; - fakeOuterBooleanSerialize) - call_fakeOuterBooleanSerialize - ;; - fakeOuterCompositeSerialize) - call_fakeOuterCompositeSerialize - ;; - fakeOuterNumberSerialize) - call_fakeOuterNumberSerialize - ;; - fakeOuterStringSerialize) - call_fakeOuterStringSerialize - ;; - testBodyWithFileSchema) - call_testBodyWithFileSchema - ;; - testBodyWithQueryParams) - call_testBodyWithQueryParams - ;; - testClientModel) - call_testClientModel - ;; - testEndpointParameters) - call_testEndpointParameters - ;; - testEnumParameters) - call_testEnumParameters - ;; - testGroupParameters) - call_testGroupParameters - ;; - testInlineAdditionalProperties) - call_testInlineAdditionalProperties - ;; - testJsonFormData) - call_testJsonFormData - ;; - testClassname) - call_testClassname - ;; - addPet) - call_addPet - ;; - deletePet) - call_deletePet - ;; - findPetsByStatus) - call_findPetsByStatus - ;; - findPetsByTags) - call_findPetsByTags - ;; - getPetById) - call_getPetById - ;; - updatePet) - call_updatePet - ;; - updatePetWithForm) - call_updatePetWithForm - ;; - uploadFile) - call_uploadFile - ;; - uploadFileWithRequiredFile) - call_uploadFileWithRequiredFile - ;; - deleteOrder) - call_deleteOrder - ;; - getInventory) - call_getInventory - ;; - getOrderById) - call_getOrderById - ;; - placeOrder) - call_placeOrder - ;; - createUser) - call_createUser - ;; - createUsersWithArrayInput) - call_createUsersWithArrayInput - ;; - createUsersWithListInput) - call_createUsersWithListInput - ;; - deleteUser) - call_deleteUser - ;; - getUserByName) - call_getUserByName - ;; - loginUser) - call_loginUser - ;; - logoutUser) - call_logoutUser - ;; - updateUser) - call_updateUser - ;; - *) - ERROR_MSG="ERROR: Unknown operation: $operation" - exit 1 -esac diff --git a/samples/client/petstore/bash/client.sh.bash-completion b/samples/client/petstore/bash/client.sh.bash-completion deleted file mode 100644 index f099fa5897a6..000000000000 --- a/samples/client/petstore/bash/client.sh.bash-completion +++ /dev/null @@ -1,326 +0,0 @@ -# completion -*- shell-script -*- - -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# ! -# ! Note: -# ! -# ! THIS SCRIPT HAS BEEN AUTOMATICALLY GENERATED USING -# ! openapi-generator (https://openapi-generator.tech) -# ! FROM OPENAPI SPECIFICATION IN JSON. -# ! -# ! -# ! -# ! System wide installation: -# ! -# ! $ sudo cp .bash-completion /etc/bash-completion.d/ -# ! -# ! -# ! User home installation (add this line to .bash_profile): -# ! -# ! [ -r ~/.bash-completion ] && source ~/.bash-completion -# ! -# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -declare -A mime_type_abbreviations -# text/* -mime_type_abbreviations["text"]="text/plain" -mime_type_abbreviations["html"]="text/html" -mime_type_abbreviations["md"]="text/x-markdown" -mime_type_abbreviations["csv"]="text/csv" -mime_type_abbreviations["css"]="text/css" -mime_type_abbreviations["rtf"]="text/rtf" -# application/* -mime_type_abbreviations["json"]="application/json" -mime_type_abbreviations["xml"]="application/xml" -mime_type_abbreviations["yaml"]="application/yaml" -mime_type_abbreviations["js"]="application/javascript" -mime_type_abbreviations["bin"]="application/octet-stream" -mime_type_abbreviations["rdf"]="application/rdf+xml" -# image/* -mime_type_abbreviations["jpg"]="image/jpeg" -mime_type_abbreviations["png"]="image/png" -mime_type_abbreviations["gif"]="image/gif" -mime_type_abbreviations["bmp"]="image/bmp" -mime_type_abbreviations["tiff"]="image/tiff" - - -# -# Check if this is OSX, if so defined custom init_completion -# -if [[ `uname` =~ "Darwin" ]]; then - __osx_init_completion() - { - COMPREPLY=() - _get_comp_words_by_ref cur prev words cword - } -fi - -_() -{ - local cur - local prev - local words - local cword - - # The reference of currently selected REST operation - local operation="" - - # The list of available operation in the REST service - # It's modelled as an associative array for efficient key lookup - declare -A operations - operations["123Test@$%SpecialTags"]=1 - operations["fooGet"]=1 - operations["fakeHealthGet"]=1 - operations["fakeOuterBooleanSerialize"]=1 - operations["fakeOuterCompositeSerialize"]=1 - operations["fakeOuterNumberSerialize"]=1 - operations["fakeOuterStringSerialize"]=1 - operations["testBodyWithFileSchema"]=1 - operations["testBodyWithQueryParams"]=1 - operations["testClientModel"]=1 - operations["testEndpointParameters"]=1 - operations["testEnumParameters"]=1 - operations["testGroupParameters"]=1 - operations["testInlineAdditionalProperties"]=1 - operations["testJsonFormData"]=1 - operations["testClassname"]=1 - operations["addPet"]=1 - operations["deletePet"]=1 - operations["findPetsByStatus"]=1 - operations["findPetsByTags"]=1 - operations["getPetById"]=1 - operations["updatePet"]=1 - operations["updatePetWithForm"]=1 - operations["uploadFile"]=1 - operations["uploadFileWithRequiredFile"]=1 - operations["deleteOrder"]=1 - operations["getInventory"]=1 - operations["getOrderById"]=1 - operations["placeOrder"]=1 - operations["createUser"]=1 - operations["createUsersWithArrayInput"]=1 - operations["createUsersWithListInput"]=1 - operations["deleteUser"]=1 - operations["getUserByName"]=1 - operations["loginUser"]=1 - operations["logoutUser"]=1 - operations["updateUser"]=1 - - # An associative array of operations to their parameters - # Only include path, query and header parameters - declare -A operation_parameters - operation_parameters["123Test@$%SpecialTags"]="" - operation_parameters["fooGet"]="" - operation_parameters["fakeHealthGet"]="" - operation_parameters["fakeOuterBooleanSerialize"]="" - operation_parameters["fakeOuterCompositeSerialize"]="" - operation_parameters["fakeOuterNumberSerialize"]="" - operation_parameters["fakeOuterStringSerialize"]="" - operation_parameters["testBodyWithFileSchema"]="" - operation_parameters["testBodyWithQueryParams"]="query= " - operation_parameters["testClientModel"]="" - operation_parameters["testEndpointParameters"]="" - operation_parameters["testEnumParameters"]="enum_query_string_array= enum_query_string= enum_query_integer= enum_query_double= enum_header_string_array: enum_header_string: " - operation_parameters["testGroupParameters"]="required_string_group= required_int64_group= string_group= int64_group= required_boolean_group: boolean_group: " - operation_parameters["testInlineAdditionalProperties"]="" - operation_parameters["testJsonFormData"]="" - operation_parameters["testClassname"]="" - operation_parameters["addPet"]="" - operation_parameters["deletePet"]="petId= api_key: " - operation_parameters["findPetsByStatus"]="status= " - operation_parameters["findPetsByTags"]="tags= " - operation_parameters["getPetById"]="petId= " - operation_parameters["updatePet"]="" - operation_parameters["updatePetWithForm"]="petId= " - operation_parameters["uploadFile"]="petId= " - operation_parameters["uploadFileWithRequiredFile"]="petId= " - operation_parameters["deleteOrder"]="order_id= " - operation_parameters["getInventory"]="" - operation_parameters["getOrderById"]="order_id= " - operation_parameters["placeOrder"]="" - operation_parameters["createUser"]="" - operation_parameters["createUsersWithArrayInput"]="" - operation_parameters["createUsersWithListInput"]="" - operation_parameters["deleteUser"]="username= " - operation_parameters["getUserByName"]="username= " - operation_parameters["loginUser"]="username= password= " - operation_parameters["logoutUser"]="" - operation_parameters["updateUser"]="username= " - - # An associative array of possible values for enum parameters - declare -A operation_parameters_enum_values - operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::required_boolean_group"]="true false" - operation_parameters_enum_values["testGroupParameters::boolean_group"]="true false" - - # - # Check if this is OSX and use special __osx_init_completion function - # - if [[ `uname` =~ "Darwin" ]]; then - __osx_init_completion || return - else - _init_completion -s || return - fi - - - # Check if operation is already in the command line provided - for word in "${words[@]}"; do - if [[ -n $word && ${operations[$word]} ]]; then - operation="${word}" - fi - done - - if [[ -z $operation ]]; then - case $prev in - --ciphers|--connect-timeout|-C|--continue-at|-F|--form|--form-string|\ - --ftp-account|--ftp-alternative-to-user|-P|--ftp-port|-H|--header|-h|\ - --help|--hostpubmd5|--keepalive-time|--krb|--limit-rate|--local-port|\ - --mail-from|--mail-rcpt|--max-filesize|--max-redirs|-m|--max-time|\ - --pass|--proto|--proto-redir|--proxy-user|--proxy1.0|-Q|--quote|-r|\ - --range|-X|--request|--retry|--retry-delay|--retry-max-time|\ - --socks5-gssapi-service|-t|--telnet-option|--tftp-blksize|-z|\ - --time-cond|--url|-u|--user|-A|--user-agent|-V|--version|-w|\ - --write-out|--resolve|--tlsuser|--tlspassword|--about) - return - ;; - -K|--config|-b|--cookie|-c|--cookie-jar|-D|--dump-header|--egd-file|\ - --key|--libcurl|-o|--output|--random-file|-T|--upload-file|--trace|\ - --trace-ascii|--netrc-file) - _filedir - return - ;; - --cacert|-E|--cert) - _filedir '@(c?(e)rt|cer|pem|der)' - return - ;; - --capath) - _filedir -d - return - ;; - --cert-type|--key-type) - COMPREPLY=( $( compgen -W 'DER PEM ENG' -- "$cur" ) ) - return - ;; - --crlfile) - _filedir crl - return - ;; - -d|--data|--data-ascii|--data-binary|--data-urlencode) - if [[ $cur == \@* ]]; then - cur=${cur:1} - _filedir - COMPREPLY=( "${COMPREPLY[@]/#/@}" ) - fi - return - ;; - --delegation) - COMPREPLY=( $( compgen -W 'none policy always' -- "$cur" ) ) - return - ;; - --engine) - COMPREPLY=( $( compgen -W 'list' -- "$cur" ) ) - return - ;; - --ftp-method) - COMPREPLY=( $( compgen -W 'multicwd nocwd singlecwd' -- "$cur" ) ) - return - ;; - --ftp-ssl-ccc-mode) - COMPREPLY=( $( compgen -W 'active passive' -- "$cur" ) ) - return - ;; - --interface) - _available_interfaces -a - return - ;; - -x|--proxy|--socks4|--socks4a|--socks5|--socks5-hostname) - _known_hosts_real - return - ;; - --pubkey) - _filedir pub - return - ;; - --stderr) - COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) - _filedir - return - ;; - --tlsauthtype) - COMPREPLY=( $( compgen -W 'SRP' -- "$cur" ) ) - return - ;; - --host) - COMPREPLY=( $( compgen -W 'http:// https://' -- "$cur" ) ) - return - ;; - -ct|--content-type|-ac|--accept) - COMPREPLY=( $( compgen -W '${!mime_type_abbreviations[*]}' -- "$cur" ) ) - return - ;; - esac - fi - - # - # Complete the server address based on ~/.ssh/known_hosts - # and ~/.ssh/config - # - local prefix=${COMP_WORDS[COMP_CWORD-2]} - local colon=${COMP_WORDS[COMP_CWORD-1]} - if [[ "$colon" == ":" && ( $prefix == "https" || $prefix == "http" ) ]]; then - COMPREPLY=() - local comp_ssh_hosts=`[[ -f ~/.ssh/known_hosts ]] && \ - ( cat ~/.ssh/known_hosts | \ - grep '^[a-zA-Z0-9]' | \ - cut -f 1 -d ' ' | \ - sed -e s/,.*//g | \ - grep -v ^# | \ - uniq | \ - grep -v "\[" ) ; - [[ -f ~/.ssh/config ]] && \ - ( cat ~/.ssh/config | \ - grep "^Host " | \ - awk '{print $2}' )` - COMPREPLY=( $( compgen -P '//' -W '${comp_ssh_hosts}' -- "${cur:2}") ) - return - fi - - # - # Complete the and cURL's arguments - # - if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$(_parse_help curl) $(_parse_help $1)' -- "$cur" ) ) - return - fi - - # - # If the argument starts with a letter this could be either an operation - # or an operation parameter - # When $cur is empty, suggest the list of operations by default - # - if [[ $cur =~ ^[A-Za-z_0-9]* ]]; then - # If operation has not been yet selected, suggest the list of operations - # otherwise suggest arguments of this operation as declared in the - # OpenAPI specification - if [[ -z $operation ]]; then - COMPREPLY=( $(compgen -W '${!operations[*]}' -- ${cur}) ) - else - COMPREPLY=( $(compgen -W '${operation_parameters[$operation]}' -- ${cur}) ) - compopt -o nospace - fi - return - fi - -} && -complete -F _ - -# ex: ts=4 sw=4 et filetype=sh diff --git a/samples/client/petstore/bash/docs/$special[model.name].md b/samples/client/petstore/bash/docs/$special[model.name].md deleted file mode 100644 index 2b02e4cece0f..000000000000 --- a/samples/client/petstore/bash/docs/$special[model.name].md +++ /dev/null @@ -1,10 +0,0 @@ -# $special[model.name] - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**$special[property.name]** | **integer** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/200_response.md b/samples/client/petstore/bash/docs/200_response.md deleted file mode 100644 index b575df6f2eb0..000000000000 --- a/samples/client/petstore/bash/docs/200_response.md +++ /dev/null @@ -1,11 +0,0 @@ -# 200_response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **integer** | | [optional] [default to null] -**class** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/AnimalFarm.md b/samples/client/petstore/bash/docs/AnimalFarm.md deleted file mode 100644 index df6bab21dae8..000000000000 --- a/samples/client/petstore/bash/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/DefaultApi.md b/samples/client/petstore/bash/docs/DefaultApi.md deleted file mode 100644 index 5ef9511145b3..000000000000 --- a/samples/client/petstore/bash/docs/DefaultApi.md +++ /dev/null @@ -1,39 +0,0 @@ -# DefaultApi - -All URIs are relative to */v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo | - - - -## fooGet - - - -### Example - -```bash - fooGet -``` - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**InlineResponseDefault**](InlineResponseDefault.md) - -### Authorization - -No authorization required - -### HTTP request headers - -- **Content-Type**: Not Applicable -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/samples/client/petstore/bash/docs/Enum_Test.md b/samples/client/petstore/bash/docs/Enum_Test.md deleted file mode 100644 index 1dcdb0d28888..000000000000 --- a/samples/client/petstore/bash/docs/Enum_Test.md +++ /dev/null @@ -1,14 +0,0 @@ -# Enum_Test - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enum_string** | **string** | | [optional] [default to null] -**enum_string_required** | **string** | | [default to null] -**enum_integer** | **integer** | | [optional] [default to null] -**enum_number** | **float** | | [optional] [default to null] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/Foo.md b/samples/client/petstore/bash/docs/Foo.md deleted file mode 100644 index 69ef867a7979..000000000000 --- a/samples/client/petstore/bash/docs/Foo.md +++ /dev/null @@ -1,10 +0,0 @@ -# Foo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **string** | | [optional] [default to bar] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/Format_test.md b/samples/client/petstore/bash/docs/Format_test.md deleted file mode 100644 index 8f73bb59bbcf..000000000000 --- a/samples/client/petstore/bash/docs/Format_test.md +++ /dev/null @@ -1,22 +0,0 @@ -# format_test - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **integer** | | [optional] [default to null] -**int32** | **integer** | | [optional] [default to null] -**int64** | **integer** | | [optional] [default to null] -**number** | **integer** | | [default to null] -**float** | **float** | | [optional] [default to null] -**double** | **float** | | [optional] [default to null] -**string** | **string** | | [optional] [default to null] -**byte** | **string** | | [default to null] -**binary** | **binary** | | [optional] [default to null] -**date** | **string** | | [default to null] -**dateTime** | **string** | | [optional] [default to null] -**uuid** | **string** | | [optional] [default to null] -**password** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/HealthCheckResult.md b/samples/client/petstore/bash/docs/HealthCheckResult.md deleted file mode 100644 index fcfa835d21e8..000000000000 --- a/samples/client/petstore/bash/docs/HealthCheckResult.md +++ /dev/null @@ -1,10 +0,0 @@ -# HealthCheckResult - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**NullableMessage** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineObject.md b/samples/client/petstore/bash/docs/InlineObject.md deleted file mode 100644 index 4606c5489206..000000000000 --- a/samples/client/petstore/bash/docs/InlineObject.md +++ /dev/null @@ -1,11 +0,0 @@ -# inline_object - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **string** | | [optional] [default to null] -**status** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineObject1.md b/samples/client/petstore/bash/docs/InlineObject1.md deleted file mode 100644 index 13ab3ed546d7..000000000000 --- a/samples/client/petstore/bash/docs/InlineObject1.md +++ /dev/null @@ -1,11 +0,0 @@ -# inline_object_1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | **string** | | [optional] [default to null] -**file** | **binary** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineObject2.md b/samples/client/petstore/bash/docs/InlineObject2.md deleted file mode 100644 index 3ad0a1d2e0c8..000000000000 --- a/samples/client/petstore/bash/docs/InlineObject2.md +++ /dev/null @@ -1,11 +0,0 @@ -# inline_object_2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumUnderscoreformUnderscorestringUnderscorearray** | **array[string]** | | [optional] [default to null] -**enumUnderscoreformUnderscorestring** | **string** | | [optional] [default to -efg] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineObject3.md b/samples/client/petstore/bash/docs/InlineObject3.md deleted file mode 100644 index 080c4051cc4f..000000000000 --- a/samples/client/petstore/bash/docs/InlineObject3.md +++ /dev/null @@ -1,23 +0,0 @@ -# inline_object_3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **integer** | | [optional] [default to null] -**int32** | **integer** | | [optional] [default to null] -**int64** | **integer** | | [optional] [default to null] -**number** | **integer** | | [default to null] -**float** | **float** | | [optional] [default to null] -**double** | **float** | | [default to null] -**string** | **string** | | [optional] [default to null] -**patternUnderscorewithoutUnderscoredelimiter** | **string** | | [default to null] -**byte** | **string** | | [default to null] -**binary** | **binary** | | [optional] [default to null] -**date** | **string** | | [optional] [default to null] -**dateTime** | **string** | | [optional] [default to null] -**password** | **string** | | [optional] [default to null] -**callback** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineObject4.md b/samples/client/petstore/bash/docs/InlineObject4.md deleted file mode 100644 index a75f87f5fefe..000000000000 --- a/samples/client/petstore/bash/docs/InlineObject4.md +++ /dev/null @@ -1,11 +0,0 @@ -# inline_object_4 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**param** | **string** | | [default to null] -**param2** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineObject5.md b/samples/client/petstore/bash/docs/InlineObject5.md deleted file mode 100644 index 89121b040e25..000000000000 --- a/samples/client/petstore/bash/docs/InlineObject5.md +++ /dev/null @@ -1,11 +0,0 @@ -# inline_object_5 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**additionalMetadata** | **string** | | [optional] [default to null] -**requiredFile** | **binary** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/InlineResponseDefault.md b/samples/client/petstore/bash/docs/InlineResponseDefault.md deleted file mode 100644 index ef6d219bac4c..000000000000 --- a/samples/client/petstore/bash/docs/InlineResponseDefault.md +++ /dev/null @@ -1,10 +0,0 @@ -# inline_response_default - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**string** | [**Foo**](Foo.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/NullableClass.md b/samples/client/petstore/bash/docs/NullableClass.md deleted file mode 100644 index 8b85103f58f1..000000000000 --- a/samples/client/petstore/bash/docs/NullableClass.md +++ /dev/null @@ -1,21 +0,0 @@ -# NullableClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integerUnderscoreprop** | **integer** | | [optional] [default to null] -**numberUnderscoreprop** | **integer** | | [optional] [default to null] -**booleanUnderscoreprop** | **boolean** | | [optional] [default to null] -**stringUnderscoreprop** | **string** | | [optional] [default to null] -**dateUnderscoreprop** | **string** | | [optional] [default to null] -**datetimeUnderscoreprop** | **string** | | [optional] [default to null] -**arrayUnderscorenullableUnderscoreprop** | **array[map]** | | [optional] [default to null] -**arrayUnderscoreandUnderscoreitemsUnderscorenullableUnderscoreprop** | **array[map]** | | [optional] [default to null] -**arrayUnderscoreitemsUnderscorenullable** | **array[map]** | | [optional] [default to null] -**objectUnderscorenullableUnderscoreprop** | **map[String, map]** | | [optional] [default to null] -**objectUnderscoreandUnderscoreitemsUnderscorenullableUnderscoreprop** | **map[String, map]** | | [optional] [default to null] -**objectUnderscoreitemsUnderscorenullable** | **map[String, map]** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/OuterBoolean.md b/samples/client/petstore/bash/docs/OuterBoolean.md deleted file mode 100644 index 8b2433994745..000000000000 --- a/samples/client/petstore/bash/docs/OuterBoolean.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterBoolean - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/OuterEnumDefaultValue.md b/samples/client/petstore/bash/docs/OuterEnumDefaultValue.md deleted file mode 100644 index 1487a7103934..000000000000 --- a/samples/client/petstore/bash/docs/OuterEnumDefaultValue.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnumDefaultValue - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/OuterEnumInteger.md b/samples/client/petstore/bash/docs/OuterEnumInteger.md deleted file mode 100644 index 8be15eee6a2c..000000000000 --- a/samples/client/petstore/bash/docs/OuterEnumInteger.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnumInteger - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md b/samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md deleted file mode 100644 index 27d962f106e1..000000000000 --- a/samples/client/petstore/bash/docs/OuterEnumIntegerDefaultValue.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterEnumIntegerDefaultValue - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/OuterNumber.md b/samples/client/petstore/bash/docs/OuterNumber.md deleted file mode 100644 index 8aa37f329bd4..000000000000 --- a/samples/client/petstore/bash/docs/OuterNumber.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterNumber - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/OuterString.md b/samples/client/petstore/bash/docs/OuterString.md deleted file mode 100644 index 9ccaadaf98df..000000000000 --- a/samples/client/petstore/bash/docs/OuterString.md +++ /dev/null @@ -1,9 +0,0 @@ -# OuterString - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/docs/SpecialModelName.md b/samples/client/petstore/bash/docs/SpecialModelName.md deleted file mode 100644 index 0ba2b4da02d0..000000000000 --- a/samples/client/petstore/bash/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ -# _special_model.name_ - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DollarspecialLeft_Square_BracketpropertyPeriodnameRight_Square_Bracket** | **integer** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/bash/petstore-cli b/samples/client/petstore/bash/petstore-cli old mode 100755 new mode 100644 index 17891dc77b4a..de7efc9b69d6 --- a/samples/client/petstore/bash/petstore-cli +++ b/samples/client/petstore/bash/petstore-cli @@ -1,4 +1,5 @@ #!/usr/bin/env bash + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! # ! # ! Note: @@ -9,6 +10,7 @@ # ! # ! # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # # This is a Bash client for OpenAPI Petstore. # diff --git a/samples/client/petstore/bash/tests/petstore_test.sh b/samples/client/petstore/bash/tests/petstore_test.sh index 8136bc76556e..38c9456af86f 100644 --- a/samples/client/petstore/bash/tests/petstore_test.sh +++ b/samples/client/petstore/bash/tests/petstore_test.sh @@ -9,9 +9,8 @@ export PETSTORE_HOST="http://petstore.swagger.io" # Bash syntax check # @test "Generated script should pass Bash syntax check" { - bash -n $PETSTORE_CLI - result=$? - [ $result -eq 0 ] + result="$(bash -n $PETSTORE_CLI)" + [ "$result" -eq 0 ] } # @@ -21,13 +20,13 @@ export PETSTORE_HOST="http://petstore.swagger.io" unset PETSTORE_HOST run bash $PETSTORE_CLI -ac xml -ct json \ addPet id:=123321 name==lucky status==available - [[ "$output" =~ "ERROR: No hostname provided!!!" ]] + [[ "$output" =~ "Error: No hostname provided!!!" ]] } @test "addPet without content type" { run bash $PETSTORE_CLI -ac xml --host $PETSTORE_HOST \ addPet id:=123321 name==lucky status==available - [[ "$output" =~ "ERROR: Request's content-type not specified!" ]] + [[ "$output" =~ "Error: Request's content-type not specified!" ]] } @test "addPet abbreviated content type" { @@ -45,7 +44,7 @@ export PETSTORE_HOST="http://petstore.swagger.io" @test "fakeOperation invalid operation name" { run bash \ -c "bash $PETSTORE_CLI --host http://petstore.swagger.io fakeOperation" - [[ "$output" =~ "ERROR: No operation specified!!!" ]] + [[ "$output" =~ "Error: No operation specified!" ]] } @test "findPetsByStatus basic auth" { @@ -54,12 +53,11 @@ export PETSTORE_HOST="http://petstore.swagger.io" [[ "$output" =~ "-u alice:secret" ]] } - -#@test "getPetById api key" { -# run bash \ -# -c "bash $PETSTORE_CLI --host http://petstore.swagger.io getPetById petId=51 api_key:1234 --dry-run" -# [[ "$output" =~ "-H \"api_key: 1234\"" ]] -#} +@test "findPetsByStatus api key" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus status=s1 api_key:1234 --dry-run" + [[ "$output" =~ "-H \"api_key: 1234\"" ]] +} @test "findPetsByStatus empty api key" { run bash \ @@ -73,38 +71,38 @@ export PETSTORE_HOST="http://petstore.swagger.io" [[ ! "$output" =~ " -Ss " ]] } -#@test "findPetsByStatus too few values" { -# run bash \ -# -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus" -# [[ "$output" =~ "ERROR: Too few values" ]] -#} -# -#@test "findPetsByTags too few values" { -# run bash \ -# -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags" -# [[ "$output" =~ "ERROR: Too few values" ]] -#} -# -#@test "findPetsByStatus status with space" { -# run bash \ -# -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus \ -# status=available status=\"gone test\" --dry-run" -# [[ "$output" =~ "status=available,gone%20test" ]] -#} -# -#@test "findPetsByStatus collection csv" { -# run bash \ -# -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags \ -# tags=TAG1 tags=TAG2 --dry-run" -# [[ "$output" =~ "tags=TAG1,TAG2" ]] -#} -# -#@test "findPetsByStatus collection csv with space and question mark" { -# run bash \ -# -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags \ -# tags=TAG1 tags=\"TAG2 TEST\" tags=\"TAG3?TEST\" --dry-run" -# [[ "$output" =~ "tags=TAG1,TAG2%20TEST,TAG3%3FTEST" ]] -#} +@test "findPetsByStatus too few values" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus" + [[ "$output" =~ "Error: Too few values" ]] +} + +@test "findPetsByTags too few values" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags" + [[ "$output" =~ "Error: Too few values" ]] +} + +@test "findPetsByStatus status with space" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByStatus \ + status=available status=\"gone test\" --dry-run" + [[ "$output" =~ "status=available,gone%20test" ]] +} + +@test "findPetsByStatus collection csv" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags \ + tags=TAG1 tags=TAG2 --dry-run" + [[ "$output" =~ "tags=TAG1,TAG2" ]] +} + +@test "findPetsByStatus collection csv with space and question mark" { + run bash \ + -c "bash $PETSTORE_CLI --host http://petstore.swagger.io findPetsByTags \ + tags=TAG1 tags=\"TAG2 TEST\" tags=TAG3?TEST --dry-run" + [[ "$output" =~ "tags=TAG1,TAG2%20TEST,TAG3%3FTEST" ]] +} # # Operations calling the service and checking result diff --git a/samples/client/petstore/c/.openapi-generator-ignore b/samples/client/petstore/c/.openapi-generator-ignore index f574e0daf8fe..7484ee590a38 100644 --- a/samples/client/petstore/c/.openapi-generator-ignore +++ b/samples/client/petstore/c/.openapi-generator-ignore @@ -21,4 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md -CMakeLists.txt diff --git a/samples/client/petstore/c/.openapi-generator/VERSION b/samples/client/petstore/c/.openapi-generator/VERSION index d168f1d8bdaa..e4955748d3e7 100644 --- a/samples/client/petstore/c/.openapi-generator/VERSION +++ b/samples/client/petstore/c/.openapi-generator/VERSION @@ -1 +1 @@ -4.2.1-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/c/CMakeLists.txt b/samples/client/petstore/c/CMakeLists.txt index 1de992031da6..90941f812fa4 100644 --- a/samples/client/petstore/c/CMakeLists.txt +++ b/samples/client/petstore/c/CMakeLists.txt @@ -63,27 +63,27 @@ install(TARGETS ${pkgName} DESTINATION ${CMAKE_INSTALL_PREFIX}) set(SRCS "") set(HDRS "") -# This section shows how to use the above compiled libary to compile the source files -# set source files -set(SRCS - unit-tests/manual-PetAPI.c - unit-tests/manual-StoreAPI.c - unit-tests/manual-UserAPI.c - unit-tests/manual-order.c - unit-tests/manual-user.c) -#set header files -set(HDRS -) +## This section shows how to use the above compiled libary to compile the source files +## set source files +#set(SRCS +# unit-tests/manual-PetAPI.c +# unit-tests/manual-StoreAPI.c +# unit-tests/manual-UserAPI.c +#) + +##set header files +#set(HDRS +#) -# loop over all files in SRCS variable -foreach(SOURCE_FILE ${SRCS}) - # Get only the file name from the file as add_executable doesnot support executable with slash("/") - get_filename_component(FILE_NAME_ONLY ${SOURCE_FILE} NAME_WE) - # Remove .c from the file name and set it as executable name - string( REPLACE ".c" "" EXECUTABLE_FILE ${FILE_NAME_ONLY}) - # Add executable for every source file in SRCS - add_executable(unit-${EXECUTABLE_FILE} ${SOURCE_FILE}) - # Link above created libary to executable and dependent libary curl - target_link_libraries(unit-${EXECUTABLE_FILE} ${CURL_LIBRARIES} ${pkgName} ) -endforeach(SOURCE_FILE ${SRCS}) +## loop over all files in SRCS variable +#foreach(SOURCE_FILE ${SRCS}) +# # Get only the file name from the file as add_executable doesnot support executable with slash("/") +# get_filename_component(FILE_NAME_ONLY ${SOURCE_FILE} NAME_WE) +# # Remove .c from the file name and set it as executable name +# string( REPLACE ".c" "" EXECUTABLE_FILE ${FILE_NAME_ONLY}) +# # Add executable for every source file in SRCS +# add_executable(unit-${EXECUTABLE_FILE} ${SOURCE_FILE}) +# # Link above created libary to executable and dependent libary curl +# target_link_libraries(unit-${EXECUTABLE_FILE} ${CURL_LIBRARIES} ${pkgName} ) +#endforeach(SOURCE_FILE ${SRCS}) diff --git a/samples/client/petstore/c/api/PetAPI.c b/samples/client/petstore/c/api/PetAPI.c index cc7bc440c849..593839286420 100644 --- a/samples/client/petstore/c/api/PetAPI.c +++ b/samples/client/petstore/c/api/PetAPI.c @@ -6,630 +6,643 @@ #define MAX_BUFFER_LENGTH 4096 #define intToStr(dst, src) \ - do { \ - char dst[256]; \ - snprintf(dst, 256, "%ld", (long int) (src)); \ - } while(0) + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) // Add a new pet to the store // -void PetAPI_addPet(apiClient_t *apiClient, pet_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = pet_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarContentType, "application/json"); // consumes - list_addElement(localVarContentType, "application/xml"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 405) { - printf("%s\n", "Invalid input"); - } - // No return type +void +PetAPI_addPet(apiClient_t *apiClient ,pet_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = pet_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + list_addElement(localVarContentType,"application/json"); //consumes + list_addElement(localVarContentType,"application/xml"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 405) { + printf("%s\n","Invalid input"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + list_free(localVarContentType); + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - - list_free(localVarContentType); - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } // Deletes a pet // -void PetAPI_deletePet(apiClient_t *apiClient, long petId, char *api_key) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = list_create(); - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - - // header parameters - char *keyHeader_api_key; - char *valueHeader_api_key; - keyValuePair_t *keyPairHeader_api_key = 0; - if(api_key) { - keyHeader_api_key = strdup("api_key"); - valueHeader_api_key = strdup((api_key)); - keyPairHeader_api_key = keyValuePair_create(keyHeader_api_key, - valueHeader_api_key); - list_addElement(localVarHeaderParameters, - keyPairHeader_api_key); - } - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid pet value"); - } - // No return type +void +PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = list_create(); + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + + // header parameters + char *keyHeader_api_key; + char * valueHeader_api_key; + keyValuePair_t *keyPairHeader_api_key = 0; + if (api_key) { + keyHeader_api_key = strdup("api_key"); + valueHeader_api_key = strdup((api_key)); + keyPairHeader_api_key = keyValuePair_create(keyHeader_api_key, valueHeader_api_key); + list_addElement(localVarHeaderParameters,keyPairHeader_api_key); + } + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "DELETE"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid pet value"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - list_free(localVarHeaderParameters); + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + list_free(localVarHeaderParameters); + + + + free(localVarPath); + free(localVarToReplace_petId); + free(keyHeader_api_key); + free(valueHeader_api_key); + free(keyPairHeader_api_key); - - - free(localVarPath); - free(localVarToReplace_petId); - free(keyHeader_api_key); - free(valueHeader_api_key); - free(keyPairHeader_api_key); } // Finds Pets by status // // Multiple status values can be provided with comma separated strings // -list_t *PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t *status) { - list_t *localVarQueryParameters = list_create(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/findByStatus") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/findByStatus"); - - - - - // query parameters - if(status) { - list_addElement(localVarQueryParameters, status); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid status value"); - } - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - if(!cJSON_IsArray(PetAPIlocalVarJSON)) { - return 0; // nonprimitive container - } - list_t *elementToReturn = list_create(); - cJSON *VarJSON; - cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) - { - if(!cJSON_IsObject(VarJSON)) { - // return 0; - } - char *localVarJSONToChar = cJSON_Print(VarJSON); - list_addElement(elementToReturn, localVarJSONToChar); - } - - cJSON_Delete(PetAPIlocalVarJSON); - cJSON_Delete(VarJSON); - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - list_free(localVarQueryParameters); - - - list_free(localVarHeaderType); - - free(localVarPath); - return elementToReturn; +list_t* +PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status) +{ + list_t *localVarQueryParameters = list_create(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/findByStatus")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/findByStatus"); + + + + + // query parameters + if (status) + { + list_addElement(localVarQueryParameters,status); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid status value"); + } + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + if(!cJSON_IsArray(PetAPIlocalVarJSON)) { + return 0;//nonprimitive container + } + list_t *elementToReturn = list_create(); + cJSON *VarJSON; + cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) + { + if(!cJSON_IsObject(VarJSON)) + { + // return 0; + } + char *localVarJSONToChar = cJSON_Print(VarJSON); + list_addElement(elementToReturn , localVarJSONToChar); + } + + cJSON_Delete( PetAPIlocalVarJSON); + cJSON_Delete( VarJSON); + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + list_free(localVarQueryParameters); + + + list_free(localVarHeaderType); + + free(localVarPath); + return elementToReturn; end: - return NULL; + return NULL; + } // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // -list_t *PetAPI_findPetsByTags(apiClient_t *apiClient, list_t *tags) { - list_t *localVarQueryParameters = list_create(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/findByTags") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/findByTags"); - - - - - // query parameters - if(tags) { - list_addElement(localVarQueryParameters, tags); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid tag value"); - } - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - if(!cJSON_IsArray(PetAPIlocalVarJSON)) { - return 0; // nonprimitive container - } - list_t *elementToReturn = list_create(); - cJSON *VarJSON; - cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) - { - if(!cJSON_IsObject(VarJSON)) { - // return 0; - } - char *localVarJSONToChar = cJSON_Print(VarJSON); - list_addElement(elementToReturn, localVarJSONToChar); - } - - cJSON_Delete(PetAPIlocalVarJSON); - cJSON_Delete(VarJSON); - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - list_free(localVarQueryParameters); - - - list_free(localVarHeaderType); - - free(localVarPath); - return elementToReturn; +list_t* +PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags) +{ + list_t *localVarQueryParameters = list_create(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/findByTags")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/findByTags"); + + + + + // query parameters + if (tags) + { + list_addElement(localVarQueryParameters,tags); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid tag value"); + } + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + if(!cJSON_IsArray(PetAPIlocalVarJSON)) { + return 0;//nonprimitive container + } + list_t *elementToReturn = list_create(); + cJSON *VarJSON; + cJSON_ArrayForEach(VarJSON, PetAPIlocalVarJSON) + { + if(!cJSON_IsObject(VarJSON)) + { + // return 0; + } + char *localVarJSONToChar = cJSON_Print(VarJSON); + list_addElement(elementToReturn , localVarJSONToChar); + } + + cJSON_Delete( PetAPIlocalVarJSON); + cJSON_Delete( VarJSON); + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + list_free(localVarQueryParameters); + + + list_free(localVarHeaderType); + + free(localVarPath); + return elementToReturn; end: - return NULL; + return NULL; + } // Find pet by ID // // Returns a single pet // -pet_t *PetAPI_getPetById(apiClient_t *apiClient, long petId) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Pet not found"); - } - // nonprimitive not container - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - pet_t *elementToReturn = pet_parseFromJSON(PetAPIlocalVarJSON); - cJSON_Delete(PetAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_petId); - return elementToReturn; +pet_t* +PetAPI_getPetById(apiClient_t *apiClient ,long petId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Pet not found"); + } + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + pet_t *elementToReturn = pet_parseFromJSON(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_petId); + return elementToReturn; end: - return NULL; + return NULL; + } // Update an existing pet // -void PetAPI_updatePet(apiClient_t *apiClient, pet_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = pet_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarContentType, "application/json"); // consumes - list_addElement(localVarContentType, "application/xml"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Pet not found"); - } - if(apiClient->response_code == 405) { - printf("%s\n", "Validation exception"); - } - // No return type +void +PetAPI_updatePet(apiClient_t *apiClient ,pet_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = pet_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + list_addElement(localVarContentType,"application/json"); //consumes + list_addElement(localVarContentType,"application/xml"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "PUT"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Pet not found"); + } + if (apiClient->response_code == 405) { + printf("%s\n","Validation exception"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + list_free(localVarContentType); + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - list_free(localVarContentType); - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } // Updates a pet in the store with form data // -void PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char *name, - char *status) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - - // form parameters - char *keyForm_name; - char *valueForm_name; - keyValuePair_t *keyPairForm_name = 0; - if(name != NULL) { - keyForm_name = strdup("name"); - valueForm_name = strdup((name)); - keyPairForm_name = keyValuePair_create(keyForm_name, - valueForm_name); - list_addElement(localVarFormParameters, keyPairForm_name); - } - - // form parameters - char *keyForm_status; - char *valueForm_status; - keyValuePair_t *keyPairForm_status = 0; - if(status != NULL) { - keyForm_status = strdup("status"); - valueForm_status = strdup((status)); - keyPairForm_status = keyValuePair_create(keyForm_status, - valueForm_status); - list_addElement(localVarFormParameters, keyPairForm_status); - } - list_addElement(localVarContentType, - "application/x-www-form-urlencoded"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 405) { - printf("%s\n", "Invalid input"); - } - // No return type +void +PetAPI_updatePetWithForm(apiClient_t *apiClient ,long petId ,char * name ,char * status) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = list_create(); + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + + // form parameters + char *keyForm_name; + char * valueForm_name; + keyValuePair_t *keyPairForm_name = 0; + if (name != NULL) + { + keyForm_name = strdup("name"); + valueForm_name = strdup((name)); + keyPairForm_name = keyValuePair_create(keyForm_name,valueForm_name); + list_addElement(localVarFormParameters,keyPairForm_name); + } + + // form parameters + char *keyForm_status; + char * valueForm_status; + keyValuePair_t *keyPairForm_status = 0; + if (status != NULL) + { + keyForm_status = strdup("status"); + valueForm_status = strdup((status)); + keyPairForm_status = keyValuePair_create(keyForm_status,valueForm_status); + list_addElement(localVarFormParameters,keyPairForm_status); + } + list_addElement(localVarContentType,"application/x-www-form-urlencoded"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 405) { + printf("%s\n","Invalid input"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - list_free(localVarFormParameters); - - list_free(localVarContentType); - free(localVarPath); - free(localVarToReplace_petId); - free(keyForm_name); - free(valueForm_name); - keyValuePair_free(keyPairForm_name); - free(keyForm_status); - free(valueForm_status); - keyValuePair_free(keyPairForm_status); + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + list_free(localVarFormParameters); + + list_free(localVarContentType); + free(localVarPath); + free(localVarToReplace_petId); + free(keyForm_name); + free(valueForm_name); + keyValuePair_free(keyPairForm_name); + free(keyForm_status); + free(valueForm_status); + keyValuePair_free(keyPairForm_status); + } // uploads an image // -api_response_t *PetAPI_uploadFile(apiClient_t *apiClient, long petId, - char *additionalMetadata, binary_t *file) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = list_create(); - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = list_create(); - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/pet/{petId}/uploadImage") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/pet/{petId}/uploadImage"); - - - // Path Params - long sizeOfPathParams_petId = sizeof(petId) + 3 + strlen("{ petId }"); - if(petId == 0) { - goto end; - } - char *localVarToReplace_petId = malloc(sizeOfPathParams_petId); - snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", - "petId"); - - char localVarBuff_petId[256]; - intToStr(localVarBuff_petId, petId); - - localVarPath = strReplace(localVarPath, localVarToReplace_petId, - localVarBuff_petId); - - - - - // form parameters - char *keyForm_additionalMetadata; - char *valueForm_additionalMetadata; - keyValuePair_t *keyPairForm_additionalMetadata = 0; - if(additionalMetadata != NULL) { - keyForm_additionalMetadata = strdup("additionalMetadata"); - valueForm_additionalMetadata = strdup((additionalMetadata)); - keyPairForm_additionalMetadata = keyValuePair_create( - keyForm_additionalMetadata, - valueForm_additionalMetadata); - list_addElement(localVarFormParameters, - keyPairForm_additionalMetadata); - } - - // form parameters - char *keyForm_file; - binary_t *valueForm_file; - keyValuePair_t *keyPairForm_file = 0; - if(file != NULL) { - keyForm_file = strdup("file"); - valueForm_file = file; - keyPairForm_file = keyValuePair_create(keyForm_file, - &valueForm_file); - list_addElement(localVarFormParameters, keyPairForm_file); // file adding - } - list_addElement(localVarHeaderType, "application/json"); // produces - list_addElement(localVarContentType, "multipart/form-data"); // consumes - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - // nonprimitive not container - cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - api_response_t *elementToReturn = api_response_parseFromJSON( - PetAPIlocalVarJSON); - cJSON_Delete(PetAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - list_free(localVarFormParameters); - list_free(localVarHeaderType); - list_free(localVarContentType); - free(localVarPath); - free(localVarToReplace_petId); - free(keyForm_additionalMetadata); - free(valueForm_additionalMetadata); - free(keyPairForm_additionalMetadata); - free(keyForm_file); -// free(fileVar_file->data); -// free(fileVar_file); - free(keyPairForm_file); - return elementToReturn; +api_response_t* +PetAPI_uploadFile(apiClient_t *apiClient ,long petId ,char * additionalMetadata ,binary_t* file) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = list_create(); + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = list_create(); + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/pet/{petId}/uploadImage")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/pet/{petId}/uploadImage"); + + + // Path Params + long sizeOfPathParams_petId = sizeof(petId)+3 + strlen("{ petId }"); + if(petId == 0){ + goto end; + } + char* localVarToReplace_petId = malloc(sizeOfPathParams_petId); + snprintf(localVarToReplace_petId, sizeOfPathParams_petId, "{%s}", "petId"); + + char localVarBuff_petId[256]; + intToStr(localVarBuff_petId, petId); + + localVarPath = strReplace(localVarPath, localVarToReplace_petId, localVarBuff_petId); + + + + + // form parameters + char *keyForm_additionalMetadata; + char * valueForm_additionalMetadata; + keyValuePair_t *keyPairForm_additionalMetadata = 0; + if (additionalMetadata != NULL) + { + keyForm_additionalMetadata = strdup("additionalMetadata"); + valueForm_additionalMetadata = strdup((additionalMetadata)); + keyPairForm_additionalMetadata = keyValuePair_create(keyForm_additionalMetadata,valueForm_additionalMetadata); + list_addElement(localVarFormParameters,keyPairForm_additionalMetadata); + } + + // form parameters + char *keyForm_file; + binary_t* valueForm_file; + keyValuePair_t *keyPairForm_file = 0; + if (file != NULL) + { + keyForm_file = strdup("file"); + valueForm_file = file; + keyPairForm_file = keyValuePair_create(keyForm_file, &valueForm_file); + list_addElement(localVarFormParameters,keyPairForm_file); //file adding + } + list_addElement(localVarHeaderType,"application/json"); //produces + list_addElement(localVarContentType,"multipart/form-data"); //consumes + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + //nonprimitive not container + cJSON *PetAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + api_response_t *elementToReturn = api_response_parseFromJSON(PetAPIlocalVarJSON); + cJSON_Delete(PetAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + list_free(localVarFormParameters); + list_free(localVarHeaderType); + list_free(localVarContentType); + free(localVarPath); + free(localVarToReplace_petId); + free(keyForm_additionalMetadata); + free(valueForm_additionalMetadata); + free(keyPairForm_additionalMetadata); + free(keyForm_file); +// free(fileVar_file->data); +// free(fileVar_file); + free(keyPairForm_file); + return elementToReturn; end: - return NULL; + return NULL; + } + diff --git a/samples/client/petstore/c/api/PetAPI.h b/samples/client/petstore/c/api/PetAPI.h index be1693168a19..5cb6c9de2c65 100644 --- a/samples/client/petstore/c/api/PetAPI.h +++ b/samples/client/petstore/c/api/PetAPI.h @@ -10,47 +10,55 @@ // Add a new pet to the store // -void PetAPI_addPet(apiClient_t *apiClient, pet_t *body); +void +PetAPI_addPet(apiClient_t *apiClient ,pet_t * body); // Deletes a pet // -void PetAPI_deletePet(apiClient_t *apiClient, long petId, char *api_key); +void +PetAPI_deletePet(apiClient_t *apiClient ,long petId ,char * api_key); // Finds Pets by status // // Multiple status values can be provided with comma separated strings // -list_t *PetAPI_findPetsByStatus(apiClient_t *apiClient, list_t *status); +list_t* +PetAPI_findPetsByStatus(apiClient_t *apiClient ,list_t * status); // Finds Pets by tags // // Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. // -list_t *PetAPI_findPetsByTags(apiClient_t *apiClient, list_t *tags); +list_t* +PetAPI_findPetsByTags(apiClient_t *apiClient ,list_t * tags); // Find pet by ID // // Returns a single pet // -pet_t *PetAPI_getPetById(apiClient_t *apiClient, long petId); +pet_t* +PetAPI_getPetById(apiClient_t *apiClient ,long petId); // Update an existing pet // -void PetAPI_updatePet(apiClient_t *apiClient, pet_t *body); +void +PetAPI_updatePet(apiClient_t *apiClient ,pet_t * body); // Updates a pet in the store with form data // -void PetAPI_updatePetWithForm(apiClient_t *apiClient, long petId, char *name, - char *status); +void +PetAPI_updatePetWithForm(apiClient_t *apiClient ,long petId ,char * name ,char * status); // uploads an image // -api_response_t *PetAPI_uploadFile(apiClient_t *apiClient, long petId, - char *additionalMetadata, binary_t *file); +api_response_t* +PetAPI_uploadFile(apiClient_t *apiClient ,long petId ,char * additionalMetadata ,binary_t* file); + + diff --git a/samples/client/petstore/c/api/StoreAPI.c b/samples/client/petstore/c/api/StoreAPI.c index 11dabde964f8..0a4a3a37fedb 100644 --- a/samples/client/petstore/c/api/StoreAPI.c +++ b/samples/client/petstore/c/api/StoreAPI.c @@ -6,278 +6,283 @@ #define MAX_BUFFER_LENGTH 4096 #define intToStr(dst, src) \ - do { \ - char dst[256]; \ - snprintf(dst, 256, "%ld", (long int) (src)); \ - } while(0) + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) // Delete purchase order by ID // // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // -void StoreAPI_deleteOrder(apiClient_t *apiClient, char *orderId) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/order/{orderId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); - - - // Path Params - long sizeOfPathParams_orderId = strlen(orderId) + 3 + strlen( - "{ orderId }"); - if(orderId == NULL) { - goto end; - } - char *localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); - sprintf(localVarToReplace_orderId, "{%s}", "orderId"); - - localVarPath = strReplace(localVarPath, localVarToReplace_orderId, - orderId); - - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Order not found"); - } - // No return type +void +StoreAPI_deleteOrder(apiClient_t *apiClient ,char * orderId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/order/{orderId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); + + + // Path Params + long sizeOfPathParams_orderId = strlen(orderId)+3 + strlen("{ orderId }"); + if(orderId == NULL) { + goto end; + } + char* localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); + sprintf(localVarToReplace_orderId, "{%s}", "orderId"); + + localVarPath = strReplace(localVarPath, localVarToReplace_orderId, orderId); + + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "DELETE"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Order not found"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + free(localVarToReplace_orderId); - - - - - free(localVarPath); - free(localVarToReplace_orderId); } // Returns pet inventories by status // // Returns a map of status codes to quantities // -list_t *StoreAPI_getInventory(apiClient_t *apiClient) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/inventory") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/inventory"); - - - - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - // primitive reutrn type not simple - cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); - cJSON *VarJSON; - list_t *elementToReturn = list_create(); - cJSON_ArrayForEach(VarJSON, localVarJSON) { - keyValuePair_t *keyPair = - keyValuePair_create(strdup( - VarJSON->string), cJSON_Print( - VarJSON)); - list_addElement(elementToReturn, keyPair); - } - cJSON_Delete(localVarJSON); - - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - return elementToReturn; +list_t* +StoreAPI_getInventory(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/inventory")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/inventory"); + + + + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + //primitive reutrn type not simple + cJSON *localVarJSON = cJSON_Parse(apiClient->dataReceived); + cJSON *VarJSON; + list_t *elementToReturn = list_create(); + cJSON_ArrayForEach(VarJSON, localVarJSON){ + keyValuePair_t *keyPair = keyValuePair_create(strdup(VarJSON->string), cJSON_Print(VarJSON)); + list_addElement(elementToReturn, keyPair); + } + cJSON_Delete(localVarJSON); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + return elementToReturn; end: - return NULL; + return NULL; + } // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // -order_t *StoreAPI_getOrderById(apiClient_t *apiClient, long orderId) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/order/{orderId}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); - - - // Path Params - long sizeOfPathParams_orderId = sizeof(orderId) + 3 + strlen( - "{ orderId }"); - if(orderId == 0) { - goto end; - } - char *localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); - snprintf(localVarToReplace_orderId, sizeOfPathParams_orderId, "{%s}", - "orderId"); - - char localVarBuff_orderId[256]; - intToStr(localVarBuff_orderId, orderId); - - localVarPath = strReplace(localVarPath, localVarToReplace_orderId, - localVarBuff_orderId); - - - - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid ID supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "Order not found"); - } - // nonprimitive not container - cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); - cJSON_Delete(StoreAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_orderId); - return elementToReturn; +order_t* +StoreAPI_getOrderById(apiClient_t *apiClient ,long orderId) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/order/{orderId}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/order/{orderId}"); + + + // Path Params + long sizeOfPathParams_orderId = sizeof(orderId)+3 + strlen("{ orderId }"); + if(orderId == 0){ + goto end; + } + char* localVarToReplace_orderId = malloc(sizeOfPathParams_orderId); + snprintf(localVarToReplace_orderId, sizeOfPathParams_orderId, "{%s}", "orderId"); + + char localVarBuff_orderId[256]; + intToStr(localVarBuff_orderId, orderId); + + localVarPath = strReplace(localVarPath, localVarToReplace_orderId, localVarBuff_orderId); + + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid ID supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","Order not found"); + } + //nonprimitive not container + cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); + cJSON_Delete(StoreAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_orderId); + return elementToReturn; end: - return NULL; + return NULL; + } // Place an order for a pet // -order_t *StoreAPI_placeOrder(apiClient_t *apiClient, order_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/store/order") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/store/order"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = order_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid Order"); - } - // nonprimitive not container - cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); - cJSON_Delete(StoreAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); - return elementToReturn; +order_t* +StoreAPI_placeOrder(apiClient_t *apiClient ,order_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/store/order")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/store/order"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = order_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid Order"); + } + //nonprimitive not container + cJSON *StoreAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + order_t *elementToReturn = order_parseFromJSON(StoreAPIlocalVarJSON); + cJSON_Delete(StoreAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); + return elementToReturn; end: - return NULL; + return NULL; + } + diff --git a/samples/client/petstore/c/api/StoreAPI.h b/samples/client/petstore/c/api/StoreAPI.h index 81d68528f1f0..cba13a977d55 100644 --- a/samples/client/petstore/c/api/StoreAPI.h +++ b/samples/client/petstore/c/api/StoreAPI.h @@ -11,23 +11,29 @@ // // For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors // -void StoreAPI_deleteOrder(apiClient_t *apiClient, char *orderId); +void +StoreAPI_deleteOrder(apiClient_t *apiClient ,char * orderId); // Returns pet inventories by status // // Returns a map of status codes to quantities // -list_t *StoreAPI_getInventory(apiClient_t *apiClient); +list_t* +StoreAPI_getInventory(apiClient_t *apiClient); // Find purchase order by ID // // For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions // -order_t *StoreAPI_getOrderById(apiClient_t *apiClient, long orderId); +order_t* +StoreAPI_getOrderById(apiClient_t *apiClient ,long orderId); // Place an order for a pet // -order_t *StoreAPI_placeOrder(apiClient_t *apiClient, order_t *body); +order_t* +StoreAPI_placeOrder(apiClient_t *apiClient ,order_t * body); + + diff --git a/samples/client/petstore/c/api/UserAPI.c b/samples/client/petstore/c/api/UserAPI.c index 9170293951ec..1656b4472bcd 100644 --- a/samples/client/petstore/c/api/UserAPI.c +++ b/samples/client/petstore/c/api/UserAPI.c @@ -6,546 +6,566 @@ #define MAX_BUFFER_LENGTH 4096 #define intToStr(dst, src) \ - do { \ - char dst[256]; \ - snprintf(dst, 256, "%ld", (long int) (src)); \ - } while(0) + do {\ + char dst[256];\ + snprintf(dst, 256, "%ld", (long int)(src));\ +}while(0) // Create user // // This can only be done by the logged in user. // -void UserAPI_createUser(apiClient_t *apiClient, user_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user"); - - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = user_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_createUser(apiClient_t *apiClient ,user_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user"); + + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = user_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - - - free(localVarPath); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } // Creates list of users with given input array // -void UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/createWithArray") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/createWithArray"); - - - - - // Body Param - // notstring - cJSON *localVar_body; - cJSON *localVarItemJSON_body; - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - localVarItemJSON_body = cJSON_CreateObject(); - localVarSingleItemJSON_body = cJSON_AddArrayToObject( - localVarItemJSON_body, "body"); - if(localVarSingleItemJSON_body == NULL) { - // nonprimitive container - - goto end; - } - } - - listEntry_t *bodyBodyListEntry; - list_ForEach(bodyBodyListEntry, body) - { - localVar_body = user_convertToJSON(bodyBodyListEntry->data); - if(localVar_body == NULL) { - goto end; - } - cJSON_AddItemToArray(localVarSingleItemJSON_body, - localVar_body); - localVarBodyParameters = cJSON_Print(localVarItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_createUsersWithArrayInput(apiClient_t *apiClient ,list_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/createWithArray")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/createWithArray"); + + + + + // Body Param + //notstring + cJSON *localVar_body; + cJSON *localVarItemJSON_body; + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + localVarItemJSON_body = cJSON_CreateObject(); + localVarSingleItemJSON_body = cJSON_AddArrayToObject(localVarItemJSON_body, "body"); + if (localVarSingleItemJSON_body == NULL) + { + // nonprimitive container + + goto end; + } + } + + listEntry_t *bodyBodyListEntry; + list_ForEach(bodyBodyListEntry, body) + { + localVar_body = user_convertToJSON(bodyBodyListEntry->data); + if(localVar_body == NULL) + { + goto end; + } + cJSON_AddItemToArray(localVarSingleItemJSON_body, localVar_body); + localVarBodyParameters = cJSON_Print(localVarItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + cJSON_Delete(localVarItemJSON_body); + cJSON_Delete(localVarSingleItemJSON_body); + cJSON_Delete(localVar_body); + free(localVarBodyParameters); - - free(localVarPath); - cJSON_Delete(localVarItemJSON_body); - cJSON_Delete(localVarSingleItemJSON_body); - cJSON_Delete(localVar_body); - free(localVarBodyParameters); } // Creates list of users with given input array // -void UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/createWithList") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/createWithList"); - - - - - // Body Param - // notstring - cJSON *localVar_body; - cJSON *localVarItemJSON_body; - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - localVarItemJSON_body = cJSON_CreateObject(); - localVarSingleItemJSON_body = cJSON_AddArrayToObject( - localVarItemJSON_body, "body"); - if(localVarSingleItemJSON_body == NULL) { - // nonprimitive container - - goto end; - } - } - - listEntry_t *bodyBodyListEntry; - list_ForEach(bodyBodyListEntry, body) - { - localVar_body = user_convertToJSON(bodyBodyListEntry->data); - if(localVar_body == NULL) { - goto end; - } - cJSON_AddItemToArray(localVarSingleItemJSON_body, - localVar_body); - localVarBodyParameters = cJSON_Print(localVarItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "POST"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_createUsersWithListInput(apiClient_t *apiClient ,list_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/createWithList")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/createWithList"); + + + + + // Body Param + //notstring + cJSON *localVar_body; + cJSON *localVarItemJSON_body; + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + localVarItemJSON_body = cJSON_CreateObject(); + localVarSingleItemJSON_body = cJSON_AddArrayToObject(localVarItemJSON_body, "body"); + if (localVarSingleItemJSON_body == NULL) + { + // nonprimitive container + + goto end; + } + } + + listEntry_t *bodyBodyListEntry; + list_ForEach(bodyBodyListEntry, body) + { + localVar_body = user_convertToJSON(bodyBodyListEntry->data); + if(localVar_body == NULL) + { + goto end; + } + cJSON_AddItemToArray(localVarSingleItemJSON_body, localVar_body); + localVarBodyParameters = cJSON_Print(localVarItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "POST"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + cJSON_Delete(localVarItemJSON_body); + cJSON_Delete(localVarSingleItemJSON_body); + cJSON_Delete(localVar_body); + free(localVarBodyParameters); - - free(localVarPath); - cJSON_Delete(localVarItemJSON_body); - cJSON_Delete(localVarSingleItemJSON_body); - cJSON_Delete(localVar_body); - free(localVarBodyParameters); } // Delete user // // This can only be done by the logged in user. // -void UserAPI_deleteUser(apiClient_t *apiClient, char *username) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/{username}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/{username}"); - - - // Path Params - long sizeOfPathParams_username = strlen(username) + 3 + strlen( - "{ username }"); - if(username == NULL) { - goto end; - } - char *localVarToReplace_username = malloc(sizeOfPathParams_username); - sprintf(localVarToReplace_username, "{%s}", "username"); - - localVarPath = strReplace(localVarPath, localVarToReplace_username, - username); - - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "DELETE"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid username supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "User not found"); - } - // No return type +void +UserAPI_deleteUser(apiClient_t *apiClient ,char * username) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/{username}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/{username}"); + + + // Path Params + long sizeOfPathParams_username = strlen(username)+3 + strlen("{ username }"); + if(username == NULL) { + goto end; + } + char* localVarToReplace_username = malloc(sizeOfPathParams_username); + sprintf(localVarToReplace_username, "{%s}", "username"); + + localVarPath = strReplace(localVarPath, localVarToReplace_username, username); + + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "DELETE"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid username supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","User not found"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + free(localVarToReplace_username); - - - free(localVarPath); - free(localVarToReplace_username); } // Get user by user name // -user_t *UserAPI_getUserByName(apiClient_t *apiClient, char *username) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/{username}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/{username}"); - - - // Path Params - long sizeOfPathParams_username = strlen(username) + 3 + strlen( - "{ username }"); - if(username == NULL) { - goto end; - } - char *localVarToReplace_username = malloc(sizeOfPathParams_username); - sprintf(localVarToReplace_username, "{%s}", "username"); - - localVarPath = strReplace(localVarPath, localVarToReplace_username, - username); - - - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid username supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "User not found"); - } - // nonprimitive not container - cJSON *UserAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); - user_t *elementToReturn = user_parseFromJSON(UserAPIlocalVarJSON); - cJSON_Delete(UserAPIlocalVarJSON); - if(elementToReturn == NULL) { - // return 0; - } - - // return type - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - - list_free(localVarHeaderType); - - free(localVarPath); - free(localVarToReplace_username); - return elementToReturn; +user_t* +UserAPI_getUserByName(apiClient_t *apiClient ,char * username) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/{username}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/{username}"); + + + // Path Params + long sizeOfPathParams_username = strlen(username)+3 + strlen("{ username }"); + if(username == NULL) { + goto end; + } + char* localVarToReplace_username = malloc(sizeOfPathParams_username); + sprintf(localVarToReplace_username, "{%s}", "username"); + + localVarPath = strReplace(localVarPath, localVarToReplace_username, username); + + + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid username supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","User not found"); + } + //nonprimitive not container + cJSON *UserAPIlocalVarJSON = cJSON_Parse(apiClient->dataReceived); + user_t *elementToReturn = user_parseFromJSON(UserAPIlocalVarJSON); + cJSON_Delete(UserAPIlocalVarJSON); + if(elementToReturn == NULL) { + // return 0; + } + + //return type + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + list_free(localVarHeaderType); + + free(localVarPath); + free(localVarToReplace_username); + return elementToReturn; end: - return NULL; + return NULL; + } // Logs user into the system // -char *UserAPI_loginUser(apiClient_t *apiClient, char *username, - char *password) { - list_t *localVarQueryParameters = list_create(); - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = list_create(); - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/login") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/login"); - - - - - // query parameters - char *keyQuery_username; - char *valueQuery_username; - keyValuePair_t *keyPairQuery_username = 0; - if(username) { - keyQuery_username = strdup("username"); - valueQuery_username = strdup((username)); - keyPairQuery_username = keyValuePair_create(keyQuery_username, - valueQuery_username); - list_addElement(localVarQueryParameters, keyPairQuery_username); - } - - // query parameters - char *keyQuery_password; - char *valueQuery_password; - keyValuePair_t *keyPairQuery_password = 0; - if(password) { - keyQuery_password = strdup("password"); - valueQuery_password = strdup((password)); - keyPairQuery_password = keyValuePair_create(keyQuery_password, - valueQuery_password); - list_addElement(localVarQueryParameters, keyPairQuery_password); - } - list_addElement(localVarHeaderType, "application/xml"); // produces - list_addElement(localVarHeaderType, "application/json"); // produces - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 200) { - printf("%s\n", "successful operation"); - } - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid username/password supplied"); - } - // primitive reutrn type simple - char *elementToReturn = strdup((char *) apiClient->dataReceived); - - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - list_free(localVarQueryParameters); - - - list_free(localVarHeaderType); - - free(localVarPath); - free(keyQuery_username); - free(valueQuery_username); - keyValuePair_free(keyPairQuery_username); - free(keyQuery_password); - free(valueQuery_password); - keyValuePair_free(keyPairQuery_password); - return elementToReturn; +char* +UserAPI_loginUser(apiClient_t *apiClient ,char * username ,char * password) +{ + list_t *localVarQueryParameters = list_create(); + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = list_create(); + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/login")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/login"); + + + + + // query parameters + char *keyQuery_username; + char * valueQuery_username; + keyValuePair_t *keyPairQuery_username = 0; + if (username) + { + keyQuery_username = strdup("username"); + valueQuery_username = strdup((username)); + keyPairQuery_username = keyValuePair_create(keyQuery_username, valueQuery_username); + list_addElement(localVarQueryParameters,keyPairQuery_username); + } + + // query parameters + char *keyQuery_password; + char * valueQuery_password; + keyValuePair_t *keyPairQuery_password = 0; + if (password) + { + keyQuery_password = strdup("password"); + valueQuery_password = strdup((password)); + keyPairQuery_password = keyValuePair_create(keyQuery_password, valueQuery_password); + list_addElement(localVarQueryParameters,keyPairQuery_password); + } + list_addElement(localVarHeaderType,"application/xml"); //produces + list_addElement(localVarHeaderType,"application/json"); //produces + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 200) { + printf("%s\n","successful operation"); + } + if (apiClient->response_code == 400) { + printf("%s\n","Invalid username/password supplied"); + } + //primitive reutrn type simple + char* elementToReturn = strdup((char*)apiClient->dataReceived); + + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + list_free(localVarQueryParameters); + + + list_free(localVarHeaderType); + + free(localVarPath); + free(keyQuery_username); + free(valueQuery_username); + keyValuePair_free(keyPairQuery_username); + free(keyQuery_password); + free(valueQuery_password); + keyValuePair_free(keyPairQuery_password); + return elementToReturn; end: - return NULL; + return NULL; + } // Logs out current logged in user session // -void UserAPI_logoutUser(apiClient_t *apiClient) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/logout") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/logout"); - - - - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "GET"); - - if(apiClient->response_code == 0) { - printf("%s\n", "successful operation"); - } - // No return type +void +UserAPI_logoutUser(apiClient_t *apiClient) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/logout")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/logout"); + + + + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "GET"); + + if (apiClient->response_code == 0) { + printf("%s\n","successful operation"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); - - free(localVarPath); } // Updated user // // This can only be done by the logged in user. // -void UserAPI_updateUser(apiClient_t *apiClient, char *username, user_t *body) { - list_t *localVarQueryParameters = NULL; - list_t *localVarHeaderParameters = NULL; - list_t *localVarFormParameters = NULL; - list_t *localVarHeaderType = NULL; - list_t *localVarContentType = NULL; - char *localVarBodyParameters = NULL; - - // create the path - long sizeOfPath = strlen("/user/{username}") + 1; - char *localVarPath = malloc(sizeOfPath); - snprintf(localVarPath, sizeOfPath, "/user/{username}"); - - - // Path Params - long sizeOfPathParams_username = strlen(username) + 3 + strlen( - "{ username }"); - if(username == NULL) { - goto end; - } - char *localVarToReplace_username = malloc(sizeOfPathParams_username); - sprintf(localVarToReplace_username, "{%s}", "username"); - - localVarPath = strReplace(localVarPath, localVarToReplace_username, - username); - - - - // Body Param - cJSON *localVarSingleItemJSON_body; - if(body != NULL) { - // string - localVarSingleItemJSON_body = user_convertToJSON(body); - localVarBodyParameters = - cJSON_Print(localVarSingleItemJSON_body); - } - apiClient_invoke(apiClient, - localVarPath, - localVarQueryParameters, - localVarHeaderParameters, - localVarFormParameters, - localVarHeaderType, - localVarContentType, - localVarBodyParameters, - "PUT"); - - if(apiClient->response_code == 400) { - printf("%s\n", "Invalid user supplied"); - } - if(apiClient->response_code == 404) { - printf("%s\n", "User not found"); - } - // No return type +void +UserAPI_updateUser(apiClient_t *apiClient ,char * username ,user_t * body) +{ + list_t *localVarQueryParameters = NULL; + list_t *localVarHeaderParameters = NULL; + list_t *localVarFormParameters = NULL; + list_t *localVarHeaderType = NULL; + list_t *localVarContentType = NULL; + char *localVarBodyParameters = NULL; + + // create the path + long sizeOfPath = strlen("/user/{username}")+1; + char *localVarPath = malloc(sizeOfPath); + snprintf(localVarPath, sizeOfPath, "/user/{username}"); + + + // Path Params + long sizeOfPathParams_username = strlen(username)+3 + strlen("{ username }"); + if(username == NULL) { + goto end; + } + char* localVarToReplace_username = malloc(sizeOfPathParams_username); + sprintf(localVarToReplace_username, "{%s}", "username"); + + localVarPath = strReplace(localVarPath, localVarToReplace_username, username); + + + + // Body Param + cJSON *localVarSingleItemJSON_body; + if (body != NULL) + { + //string + localVarSingleItemJSON_body = user_convertToJSON(body); + localVarBodyParameters = cJSON_Print(localVarSingleItemJSON_body); + } + apiClient_invoke(apiClient, + localVarPath, + localVarQueryParameters, + localVarHeaderParameters, + localVarFormParameters, + localVarHeaderType, + localVarContentType, + localVarBodyParameters, + "PUT"); + + if (apiClient->response_code == 400) { + printf("%s\n","Invalid user supplied"); + } + if (apiClient->response_code == 404) { + printf("%s\n","User not found"); + } + //No return type end: - if(apiClient->dataReceived) { - free(apiClient->dataReceived); - } - - + if (apiClient->dataReceived) { + free(apiClient->dataReceived); + } + + + + + + free(localVarPath); + free(localVarToReplace_username); + cJSON_Delete(localVarSingleItemJSON_body); + free(localVarBodyParameters); - - - free(localVarPath); - free(localVarToReplace_username); - cJSON_Delete(localVarSingleItemJSON_body); - free(localVarBodyParameters); } + diff --git a/samples/client/petstore/c/api/UserAPI.h b/samples/client/petstore/c/api/UserAPI.h index c9475c2e55d3..57f04a721940 100644 --- a/samples/client/petstore/c/api/UserAPI.h +++ b/samples/client/petstore/c/api/UserAPI.h @@ -11,43 +11,53 @@ // // This can only be done by the logged in user. // -void UserAPI_createUser(apiClient_t *apiClient, user_t *body); +void +UserAPI_createUser(apiClient_t *apiClient ,user_t * body); // Creates list of users with given input array // -void UserAPI_createUsersWithArrayInput(apiClient_t *apiClient, list_t *body); +void +UserAPI_createUsersWithArrayInput(apiClient_t *apiClient ,list_t * body); // Creates list of users with given input array // -void UserAPI_createUsersWithListInput(apiClient_t *apiClient, list_t *body); +void +UserAPI_createUsersWithListInput(apiClient_t *apiClient ,list_t * body); // Delete user // // This can only be done by the logged in user. // -void UserAPI_deleteUser(apiClient_t *apiClient, char *username); +void +UserAPI_deleteUser(apiClient_t *apiClient ,char * username); // Get user by user name // -user_t *UserAPI_getUserByName(apiClient_t *apiClient, char *username); +user_t* +UserAPI_getUserByName(apiClient_t *apiClient ,char * username); // Logs user into the system // -char *UserAPI_loginUser(apiClient_t *apiClient, char *username, char *password); +char* +UserAPI_loginUser(apiClient_t *apiClient ,char * username ,char * password); // Logs out current logged in user session // -void UserAPI_logoutUser(apiClient_t *apiClient); +void +UserAPI_logoutUser(apiClient_t *apiClient); // Updated user // // This can only be done by the logged in user. // -void UserAPI_updateUser(apiClient_t *apiClient, char *username, user_t *body); +void +UserAPI_updateUser(apiClient_t *apiClient ,char * username ,user_t * body); + + diff --git a/samples/client/petstore/c/build-and-test.bash b/samples/client/petstore/c/build-and-test.bash index e10052bb5576..28256027f84d 100755 --- a/samples/client/petstore/c/build-and-test.bash +++ b/samples/client/petstore/c/build-and-test.bash @@ -16,7 +16,6 @@ cmake . make -if [ -f unit-manual-PetAPI ]; then ./unit-manual-PetAPI; fi -if [ -f unit-manual-UserAPI ]; then ./unit-manual-UserAPI; fi -if [ -f unit-manual-StoreAPI ]; then ./unit-manual-StoreAPI; fi - +./unit-manual-PetAPI +./unit-manual-UserAPI +./unit-manual-StoreAPI diff --git a/samples/client/petstore/c/external/cJSON.c b/samples/client/petstore/c/external/cJSON.c index 78b3ecfec6f9..cbdec4132f10 100644 --- a/samples/client/petstore/c/external/cJSON.c +++ b/samples/client/petstore/c/external/cJSON.c @@ -1,31 +1,30 @@ /* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ /* cJSON */ /* JSON parser in C. */ /* disable warnings about old C89 functions in MSVC */ -#if !defined(_CRT_SECURE_NO_DEPRECATE) && \ - defined(_MSC_VER) +#if !defined(_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) #define _CRT_SECURE_NO_DEPRECATE #endif @@ -59,85 +58,85 @@ #include "cJSON.h" /* define our own boolean type */ -#define true ((cJSON_bool) 1) -#define false ((cJSON_bool) 0) +#define true ((cJSON_bool)1) +#define false ((cJSON_bool)0) typedef struct { - const unsigned char *json; - size_t position; + const unsigned char *json; + size_t position; } error; static error global_error = { NULL, 0 }; CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void) { - return (const char *) (global_error.json + global_error.position); + return (const char*) (global_error.json + global_error.position); } -CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON * item) { - if(!cJSON_IsString(item)) { - return NULL; - } +CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item) { + if (!cJSON_IsString(item)) { + return NULL; + } - return item->valuestring; + return item->valuestring; } /* This is a safeguard to prevent copy-pasters from using incompatible C and header files */ -#if (CJSON_VERSION_MAJOR != 1) || \ - (CJSON_VERSION_MINOR != 7) || \ - (CJSON_VERSION_PATCH != 7) - #error \ - cJSON.h and cJSON.c have different versions. Make sure that both have the same. +#if (CJSON_VERSION_MAJOR != 1) || (CJSON_VERSION_MINOR != 7) || (CJSON_VERSION_PATCH != 7) + #error cJSON.h and cJSON.c have different versions. Make sure that both have the same. #endif -CJSON_PUBLIC(const char *) cJSON_Version(void) +CJSON_PUBLIC(const char*) cJSON_Version(void) { - static char version[15]; - sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, - CJSON_VERSION_PATCH); + static char version[15]; + sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); - return version; + return version; } /* Case insensitive string comparison, doesn't consider two NULL pointers equal though */ -static int case_insensitive_strcmp(const unsigned char *string1, - const unsigned char *string2) { - if((string1 == NULL) || - (string2 == NULL)) - { - return 1; - } - - if(string1 == string2) { - return 0; - } - - for( ; tolower(*string1) == tolower(*string2); - (void) string1++, string2++) - { - if(*string1 == '\0') { - return 0; - } - } - - return tolower(*string1) - tolower(*string2); -} - -typedef struct internal_hooks { - void *(*allocate)(size_t size); - void (*deallocate)(void *pointer); - void *(*reallocate)(void *pointer, size_t size); +static int case_insensitive_strcmp(const unsigned char *string1, const unsigned char *string2) +{ + if ((string1 == NULL) || (string2 == NULL)) + { + return 1; + } + + if (string1 == string2) + { + return 0; + } + + for(; tolower(*string1) == tolower(*string2); (void)string1++, string2++) + { + if (*string1 == '\0') + { + return 0; + } + } + + return tolower(*string1) - tolower(*string2); +} + +typedef struct internal_hooks +{ + void *(*allocate)(size_t size); + void (*deallocate)(void *pointer); + void *(*reallocate)(void *pointer, size_t size); } internal_hooks; #if defined(_MSC_VER) /* work around MSVC error C2322: '...' address of dillimport '...' is not static */ -static void *internal_malloc(size_t size) { - return malloc(size); +static void *internal_malloc(size_t size) +{ + return malloc(size); } -static void internal_free(void *pointer) { - free(pointer); +static void internal_free(void *pointer) +{ + free(pointer); } -static void *internal_realloc(void *pointer, size_t size) { - return realloc(pointer, size); +static void *internal_realloc(void *pointer, size_t size) +{ + return realloc(pointer, size); } #else #define internal_malloc malloc @@ -145,2711 +144,2789 @@ static void *internal_realloc(void *pointer, size_t size) { #define internal_realloc realloc #endif -static internal_hooks global_hooks = -{ internal_malloc, internal_free, internal_realloc }; +static internal_hooks global_hooks = { internal_malloc, internal_free, internal_realloc }; -static unsigned char *cJSON_strdup(const unsigned char *string, - const internal_hooks *const hooks) { - size_t length = 0; - unsigned char *copy = NULL; +static unsigned char* cJSON_strdup(const unsigned char* string, const internal_hooks * const hooks) +{ + size_t length = 0; + unsigned char *copy = NULL; - if(string == NULL) { - return NULL; - } + if (string == NULL) + { + return NULL; + } - length = strlen((const char *) string) + sizeof(""); - copy = (unsigned char *) hooks->allocate(length); - if(copy == NULL) { - return NULL; - } - memcpy(copy, string, length); + length = strlen((const char*)string) + sizeof(""); + copy = (unsigned char*)hooks->allocate(length); + if (copy == NULL) + { + return NULL; + } + memcpy(copy, string, length); - return copy; + return copy; } -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks * hooks) +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks) { - if(hooks == NULL) { - /* Reset hooks */ - global_hooks.allocate = malloc; - global_hooks.deallocate = free; - global_hooks.reallocate = realloc; - return; - } + if (hooks == NULL) + { + /* Reset hooks */ + global_hooks.allocate = malloc; + global_hooks.deallocate = free; + global_hooks.reallocate = realloc; + return; + } - global_hooks.allocate = malloc; - if(hooks->malloc_fn != NULL) { - global_hooks.allocate = hooks->malloc_fn; - } + global_hooks.allocate = malloc; + if (hooks->malloc_fn != NULL) + { + global_hooks.allocate = hooks->malloc_fn; + } - global_hooks.deallocate = free; - if(hooks->free_fn != NULL) { - global_hooks.deallocate = hooks->free_fn; - } + global_hooks.deallocate = free; + if (hooks->free_fn != NULL) + { + global_hooks.deallocate = hooks->free_fn; + } - /* use realloc only if both free and malloc are used */ - global_hooks.reallocate = NULL; - if((global_hooks.allocate == malloc) && - (global_hooks.deallocate == free)) - { - global_hooks.reallocate = realloc; - } + /* use realloc only if both free and malloc are used */ + global_hooks.reallocate = NULL; + if ((global_hooks.allocate == malloc) && (global_hooks.deallocate == free)) + { + global_hooks.reallocate = realloc; + } } /* Internal constructor. */ -static cJSON *cJSON_New_Item(const internal_hooks *const hooks) { - cJSON *node = (cJSON *) hooks->allocate(sizeof(cJSON)); - if(node) { - memset(node, '\0', sizeof(cJSON)); - } +static cJSON *cJSON_New_Item(const internal_hooks * const hooks) +{ + cJSON* node = (cJSON*)hooks->allocate(sizeof(cJSON)); + if (node) + { + memset(node, '\0', sizeof(cJSON)); + } - return node; + return node; } /* Delete a cJSON structure. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON * item) -{ - cJSON *next = NULL; - while(item != NULL) { - next = item->next; - if(!(item->type & cJSON_IsReference) && - (item->child != NULL)) - { - cJSON_Delete(item->child); - } - if(!(item->type & cJSON_IsReference) && - (item->valuestring != NULL)) - { - global_hooks.deallocate(item->valuestring); - } - if(!(item->type & cJSON_StringIsConst) && - (item->string != NULL)) - { - global_hooks.deallocate(item->string); - } - global_hooks.deallocate(item); - item = next; - } +CJSON_PUBLIC(void) cJSON_Delete(cJSON *item) +{ + cJSON *next = NULL; + while (item != NULL) + { + next = item->next; + if (!(item->type & cJSON_IsReference) && (item->child != NULL)) + { + cJSON_Delete(item->child); + } + if (!(item->type & cJSON_IsReference) && (item->valuestring != NULL)) + { + global_hooks.deallocate(item->valuestring); + } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + global_hooks.deallocate(item->string); + } + global_hooks.deallocate(item); + item = next; + } } /* get the decimal point character of the current locale */ -static unsigned char get_decimal_point(void) { +static unsigned char get_decimal_point(void) +{ #ifdef ENABLE_LOCALES - struct lconv *lconv = localeconv(); - return (unsigned char) lconv->decimal_point[0]; + struct lconv *lconv = localeconv(); + return (unsigned char) lconv->decimal_point[0]; #else - return '.'; + return '.'; #endif } -typedef struct { - const unsigned char *content; - size_t length; - size_t offset; - size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ - internal_hooks hooks; +typedef struct +{ + const unsigned char *content; + size_t length; + size_t offset; + size_t depth; /* How deeply nested (in arrays/objects) is the input at the current offset. */ + internal_hooks hooks; } parse_buffer; /* check if the given size is left to read in a given parse buffer (starting with 1) */ -#define can_read(buffer, size) ((buffer != NULL) && \ - (((buffer)->offset + size) <= (buffer)->length)) +#define can_read(buffer, size) ((buffer != NULL) && (((buffer)->offset + size) <= (buffer)->length)) /* check if the buffer can be accessed at the given index (starting with 0) */ -#define can_access_at_index(buffer, index) ((buffer != NULL) && \ - (((buffer)->offset + index) < \ - (buffer)->length)) -#define cannot_access_at_index(buffer, \ - index) (!can_access_at_index(buffer, index)) +#define can_access_at_index(buffer, index) ((buffer != NULL) && (((buffer)->offset + index) < (buffer)->length)) +#define cannot_access_at_index(buffer, index) (!can_access_at_index(buffer, index)) /* get a pointer to the buffer at the position */ #define buffer_at_offset(buffer) ((buffer)->content + (buffer)->offset) /* Parse the input text to generate a number, and populate the result into item. */ -static cJSON_bool parse_number(cJSON *const item, - parse_buffer *const input_buffer) { - double number = 0; - unsigned char *after_end = NULL; - unsigned char number_c_string[64]; - unsigned char decimal_point = get_decimal_point(); - size_t i = 0; - - if((input_buffer == NULL) || - (input_buffer->content == NULL)) - { - return false; - } - - /* copy the number into a temporary buffer and replace '.' with the decimal point - * of the current locale (for strtod) - * This also takes care of '\0' not necessarily being available for marking the end of the input */ - for(i = 0; (i < (sizeof(number_c_string) - 1)) && - can_access_at_index(input_buffer, i); i++) - { - switch(buffer_at_offset(input_buffer)[i]) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '+': - case '-': - case 'e': - case 'E': - number_c_string[i] = buffer_at_offset(input_buffer)[i]; - break; - - case '.': - number_c_string[i] = decimal_point; - break; - - default: - goto loop_end; - } - } +static cJSON_bool parse_number(cJSON * const item, parse_buffer * const input_buffer) +{ + double number = 0; + unsigned char *after_end = NULL; + unsigned char number_c_string[64]; + unsigned char decimal_point = get_decimal_point(); + size_t i = 0; + + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; + } + + /* copy the number into a temporary buffer and replace '.' with the decimal point + * of the current locale (for strtod) + * This also takes care of '\0' not necessarily being available for marking the end of the input */ + for (i = 0; (i < (sizeof(number_c_string) - 1)) && can_access_at_index(input_buffer, i); i++) + { + switch (buffer_at_offset(input_buffer)[i]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case '+': + case '-': + case 'e': + case 'E': + number_c_string[i] = buffer_at_offset(input_buffer)[i]; + break; + + case '.': + number_c_string[i] = decimal_point; + break; + + default: + goto loop_end; + } + } loop_end: - number_c_string[i] = '\0'; + number_c_string[i] = '\0'; - number = strtod((const char *) number_c_string, (char **) &after_end); - if(number_c_string == after_end) { - return false; /* parse_error */ - } + number = strtod((const char*)number_c_string, (char**)&after_end); + if (number_c_string == after_end) + { + return false; /* parse_error */ + } - item->valuedouble = number; + item->valuedouble = number; - /* use saturation in case of overflow */ - if(number >= INT_MAX) { - item->valueint = INT_MAX; - } else if(number <= INT_MIN) { - item->valueint = INT_MIN; - } else { - item->valueint = (int) number; - } + /* use saturation in case of overflow */ + if (number >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)number; + } - item->type = cJSON_Number; + item->type = cJSON_Number; - input_buffer->offset += (size_t) (after_end - number_c_string); - return true; + input_buffer->offset += (size_t)(after_end - number_c_string); + return true; } /* don't ask me, but the original cJSON_SetNumberValue returns an integer or double */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON * object, double number) -{ - if(number >= INT_MAX) { - object->valueint = INT_MAX; - } else if(number <= INT_MIN) { - object->valueint = INT_MIN; - } else { - object->valueint = (int) number; - } - - return object->valuedouble = number; -} - -typedef struct { - unsigned char *buffer; - size_t length; - size_t offset; - size_t depth; /* current nesting depth (for formatted printing) */ - cJSON_bool noalloc; - cJSON_bool format; /* is this print a formatted print */ - internal_hooks hooks; +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number) +{ + if (number >= INT_MAX) + { + object->valueint = INT_MAX; + } + else if (number <= INT_MIN) + { + object->valueint = INT_MIN; + } + else + { + object->valueint = (int)number; + } + + return object->valuedouble = number; +} + +typedef struct +{ + unsigned char *buffer; + size_t length; + size_t offset; + size_t depth; /* current nesting depth (for formatted printing) */ + cJSON_bool noalloc; + cJSON_bool format; /* is this print a formatted print */ + internal_hooks hooks; } printbuffer; /* realloc printbuffer if necessary to have at least "needed" bytes more */ -static unsigned char *ensure(printbuffer *const p, size_t needed) { - unsigned char *newbuffer = NULL; - size_t newsize = 0; - - if((p == NULL) || - (p->buffer == NULL)) - { - return NULL; - } - - if((p->length > 0) && - (p->offset >= p->length)) - { - /* make sure that offset is valid */ - return NULL; - } - - if(needed > INT_MAX) { - /* sizes bigger than INT_MAX are currently not supported */ - return NULL; - } - - needed += p->offset + 1; - if(needed <= p->length) { - return p->buffer + p->offset; - } - - if(p->noalloc) { - return NULL; - } - - /* calculate new buffer size */ - if(needed > (INT_MAX / 2)) { - /* overflow of int, use INT_MAX if possible */ - if(needed <= INT_MAX) { - newsize = INT_MAX; - } else { - return NULL; - } - } else { - newsize = needed * 2; - } - - if(p->hooks.reallocate != NULL) { - /* reallocate with realloc if available */ - newbuffer = (unsigned char *) p->hooks.reallocate(p->buffer, - newsize); - if(newbuffer == NULL) { - p->hooks.deallocate(p->buffer); - p->length = 0; - p->buffer = NULL; - - return NULL; - } - } else { - /* otherwise reallocate manually */ - newbuffer = (unsigned char *) p->hooks.allocate(newsize); - if(!newbuffer) { - p->hooks.deallocate(p->buffer); - p->length = 0; - p->buffer = NULL; - - return NULL; - } - if(newbuffer) { - memcpy(newbuffer, p->buffer, p->offset + 1); - } - p->hooks.deallocate(p->buffer); - } - p->length = newsize; - p->buffer = newbuffer; - - return newbuffer + p->offset; +static unsigned char* ensure(printbuffer * const p, size_t needed) +{ + unsigned char *newbuffer = NULL; + size_t newsize = 0; + + if ((p == NULL) || (p->buffer == NULL)) + { + return NULL; + } + + if ((p->length > 0) && (p->offset >= p->length)) + { + /* make sure that offset is valid */ + return NULL; + } + + if (needed > INT_MAX) + { + /* sizes bigger than INT_MAX are currently not supported */ + return NULL; + } + + needed += p->offset + 1; + if (needed <= p->length) + { + return p->buffer + p->offset; + } + + if (p->noalloc) { + return NULL; + } + + /* calculate new buffer size */ + if (needed > (INT_MAX / 2)) + { + /* overflow of int, use INT_MAX if possible */ + if (needed <= INT_MAX) + { + newsize = INT_MAX; + } + else + { + return NULL; + } + } + else + { + newsize = needed * 2; + } + + if (p->hooks.reallocate != NULL) + { + /* reallocate with realloc if available */ + newbuffer = (unsigned char*)p->hooks.reallocate(p->buffer, newsize); + if (newbuffer == NULL) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + } + else + { + /* otherwise reallocate manually */ + newbuffer = (unsigned char*)p->hooks.allocate(newsize); + if (!newbuffer) + { + p->hooks.deallocate(p->buffer); + p->length = 0; + p->buffer = NULL; + + return NULL; + } + if (newbuffer) + { + memcpy(newbuffer, p->buffer, p->offset + 1); + } + p->hooks.deallocate(p->buffer); + } + p->length = newsize; + p->buffer = newbuffer; + + return newbuffer + p->offset; } /* calculate the new length of the string in a printbuffer and update the offset */ -static void update_offset(printbuffer *const buffer) { - const unsigned char *buffer_pointer = NULL; - if((buffer == NULL) || - (buffer->buffer == NULL)) - { - return; - } - buffer_pointer = buffer->buffer + buffer->offset; +static void update_offset(printbuffer * const buffer) +{ + const unsigned char *buffer_pointer = NULL; + if ((buffer == NULL) || (buffer->buffer == NULL)) + { + return; + } + buffer_pointer = buffer->buffer + buffer->offset; - buffer->offset += strlen((const char *) buffer_pointer); + buffer->offset += strlen((const char*)buffer_pointer); } /* Render the number nicely from the given item into a string. */ -static cJSON_bool print_number(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output_pointer = NULL; - double d = item->valuedouble; - int length = 0; - size_t i = 0; - unsigned char number_buffer[26]; /* temporary buffer to print the number into */ - unsigned char decimal_point = get_decimal_point(); - double test; - - if(output_buffer == NULL) { - return false; - } - - /* This checks for NaN and Infinity */ - if((d * 0) != 0) { - length = sprintf((char *) number_buffer, "null"); - } else { - /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ - length = sprintf((char *) number_buffer, "%1.15g", d); - - /* Check whether the original double can be recovered */ - if((sscanf((char *) number_buffer, "%lg", &test) != 1) || - ((double) test != d)) - { - /* If not, print with 17 decimal places of precision */ - length = sprintf((char *) number_buffer, "%1.17g", d); - } - } - - /* sprintf failed or buffer overrun occured */ - if((length < 0) || - (length > (int) (sizeof(number_buffer) - 1))) - { - return false; - } - - /* reserve appropriate space in the output */ - output_pointer = ensure(output_buffer, (size_t) length + sizeof("")); - if(output_pointer == NULL) { - return false; - } - - /* copy the printed number to the output and replace locale - * dependent decimal point with '.' */ - for(i = 0; i < ((size_t) length); i++) { - if(number_buffer[i] == decimal_point) { - output_pointer[i] = '.'; - continue; - } - - output_pointer[i] = number_buffer[i]; - } - output_pointer[i] = '\0'; - - output_buffer->offset += (size_t) length; - - return true; +static cJSON_bool print_number(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + double d = item->valuedouble; + int length = 0; + size_t i = 0; + unsigned char number_buffer[26]; /* temporary buffer to print the number into */ + unsigned char decimal_point = get_decimal_point(); + double test; + + if (output_buffer == NULL) + { + return false; + } + + /* This checks for NaN and Infinity */ + if ((d * 0) != 0) + { + length = sprintf((char*)number_buffer, "null"); + } + else + { + /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ + length = sprintf((char*)number_buffer, "%1.15g", d); + + /* Check whether the original double can be recovered */ + if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || ((double)test != d)) + { + /* If not, print with 17 decimal places of precision */ + length = sprintf((char*)number_buffer, "%1.17g", d); + } + } + + /* sprintf failed or buffer overrun occured */ + if ((length < 0) || (length > (int)(sizeof(number_buffer) - 1))) + { + return false; + } + + /* reserve appropriate space in the output */ + output_pointer = ensure(output_buffer, (size_t)length + sizeof("")); + if (output_pointer == NULL) + { + return false; + } + + /* copy the printed number to the output and replace locale + * dependent decimal point with '.' */ + for (i = 0; i < ((size_t)length); i++) + { + if (number_buffer[i] == decimal_point) + { + output_pointer[i] = '.'; + continue; + } + + output_pointer[i] = number_buffer[i]; + } + output_pointer[i] = '\0'; + + output_buffer->offset += (size_t)length; + + return true; } /* parse 4 digit hexadecimal number */ -static unsigned parse_hex4(const unsigned char *const input) { - unsigned int h = 0; - size_t i = 0; - - for(i = 0; i < 4; i++) { - /* parse digit */ - if((input[i] >= '0') && - (input[i] <= '9')) - { - h += (unsigned int) input[i] - '0'; - } else if((input[i] >= 'A') && - (input[i] <= 'F')) - { - h += (unsigned int) 10 + input[i] - 'A'; - } else if((input[i] >= 'a') && - (input[i] <= 'f')) - { - h += (unsigned int) 10 + input[i] - 'a'; - } else { /* invalid */ - return 0; - } - - if(i < 3) { - /* shift left to make place for the next nibble */ - h = h << 4; - } - } - - return h; +static unsigned parse_hex4(const unsigned char * const input) +{ + unsigned int h = 0; + size_t i = 0; + + for (i = 0; i < 4; i++) + { + /* parse digit */ + if ((input[i] >= '0') && (input[i] <= '9')) + { + h += (unsigned int) input[i] - '0'; + } + else if ((input[i] >= 'A') && (input[i] <= 'F')) + { + h += (unsigned int) 10 + input[i] - 'A'; + } + else if ((input[i] >= 'a') && (input[i] <= 'f')) + { + h += (unsigned int) 10 + input[i] - 'a'; + } + else /* invalid */ + { + return 0; + } + + if (i < 3) + { + /* shift left to make place for the next nibble */ + h = h << 4; + } + } + + return h; } /* converts a UTF-16 literal to UTF-8 * A literal can be one or two sequences of the form \uXXXX */ -static unsigned char utf16_literal_to_utf8( - const unsigned char *const input_pointer, - const unsigned char *const input_end, unsigned char **output_pointer) { - long unsigned int codepoint = 0; - unsigned int first_code = 0; - const unsigned char *first_sequence = input_pointer; - unsigned char utf8_length = 0; - unsigned char utf8_position = 0; - unsigned char sequence_length = 0; - unsigned char first_byte_mark = 0; - - if((input_end - first_sequence) < 6) { - /* input ends unexpectedly */ - goto fail; - } - - /* get the first utf16 sequence */ - first_code = parse_hex4(first_sequence + 2); - - /* check that the code is valid */ - if(((first_code >= 0xDC00) && - (first_code <= 0xDFFF))) - { - goto fail; - } - - /* UTF16 surrogate pair */ - if((first_code >= 0xD800) && - (first_code <= 0xDBFF)) - { - const unsigned char *second_sequence = first_sequence + 6; - unsigned int second_code = 0; - sequence_length = 12; /* \uXXXX\uXXXX */ - - if((input_end - second_sequence) < 6) { - /* input ends unexpectedly */ - goto fail; - } - - if((second_sequence[0] != '\\') || - (second_sequence[1] != 'u')) - { - /* missing second half of the surrogate pair */ - goto fail; - } - - /* get the second utf16 sequence */ - second_code = parse_hex4(second_sequence + 2); - /* check that the code is valid */ - if((second_code < 0xDC00) || - (second_code > 0xDFFF)) - { - /* invalid second half of the surrogate pair */ - goto fail; - } - - - /* calculate the unicode codepoint from the surrogate pair */ - codepoint = 0x10000 + - (((first_code & 0x3FF) << 10) | - (second_code & 0x3FF)); - } else { - sequence_length = 6; /* \uXXXX */ - codepoint = first_code; - } - - /* encode as UTF-8 - * takes at maximum 4 bytes to encode: - * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ - if(codepoint < 0x80) { - /* normal ascii, encoding 0xxxxxxx */ - utf8_length = 1; - } else if(codepoint < 0x800) { - /* two bytes, encoding 110xxxxx 10xxxxxx */ - utf8_length = 2; - first_byte_mark = 0xC0; /* 11000000 */ - } else if(codepoint < 0x10000) { - /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ - utf8_length = 3; - first_byte_mark = 0xE0; /* 11100000 */ - } else if(codepoint <= 0x10FFFF) { - /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ - utf8_length = 4; - first_byte_mark = 0xF0; /* 11110000 */ - } else { - /* invalid unicode codepoint */ - goto fail; - } - - /* encode as utf8 */ - for(utf8_position = - (unsigned char) (utf8_length - 1); utf8_position > 0; - utf8_position--) { - /* 10xxxxxx */ - (*output_pointer)[utf8_position] = - (unsigned char) ((codepoint | 0x80) & 0xBF); - codepoint >>= 6; - } - /* encode first byte */ - if(utf8_length > 1) { - (*output_pointer)[0] = - (unsigned char) ((codepoint | first_byte_mark) & 0xFF); - } else { - (*output_pointer)[0] = (unsigned char) (codepoint & 0x7F); - } - - *output_pointer += utf8_length; - - return sequence_length; +static unsigned char utf16_literal_to_utf8(const unsigned char * const input_pointer, const unsigned char * const input_end, unsigned char **output_pointer) +{ + long unsigned int codepoint = 0; + unsigned int first_code = 0; + const unsigned char *first_sequence = input_pointer; + unsigned char utf8_length = 0; + unsigned char utf8_position = 0; + unsigned char sequence_length = 0; + unsigned char first_byte_mark = 0; + + if ((input_end - first_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + /* get the first utf16 sequence */ + first_code = parse_hex4(first_sequence + 2); + + /* check that the code is valid */ + if (((first_code >= 0xDC00) && (first_code <= 0xDFFF))) + { + goto fail; + } + + /* UTF16 surrogate pair */ + if ((first_code >= 0xD800) && (first_code <= 0xDBFF)) + { + const unsigned char *second_sequence = first_sequence + 6; + unsigned int second_code = 0; + sequence_length = 12; /* \uXXXX\uXXXX */ + + if ((input_end - second_sequence) < 6) + { + /* input ends unexpectedly */ + goto fail; + } + + if ((second_sequence[0] != '\\') || (second_sequence[1] != 'u')) + { + /* missing second half of the surrogate pair */ + goto fail; + } + + /* get the second utf16 sequence */ + second_code = parse_hex4(second_sequence + 2); + /* check that the code is valid */ + if ((second_code < 0xDC00) || (second_code > 0xDFFF)) + { + /* invalid second half of the surrogate pair */ + goto fail; + } + + + /* calculate the unicode codepoint from the surrogate pair */ + codepoint = 0x10000 + (((first_code & 0x3FF) << 10) | (second_code & 0x3FF)); + } + else + { + sequence_length = 6; /* \uXXXX */ + codepoint = first_code; + } + + /* encode as UTF-8 + * takes at maximum 4 bytes to encode: + * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx */ + if (codepoint < 0x80) + { + /* normal ascii, encoding 0xxxxxxx */ + utf8_length = 1; + } + else if (codepoint < 0x800) + { + /* two bytes, encoding 110xxxxx 10xxxxxx */ + utf8_length = 2; + first_byte_mark = 0xC0; /* 11000000 */ + } + else if (codepoint < 0x10000) + { + /* three bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx */ + utf8_length = 3; + first_byte_mark = 0xE0; /* 11100000 */ + } + else if (codepoint <= 0x10FFFF) + { + /* four bytes, encoding 1110xxxx 10xxxxxx 10xxxxxx 10xxxxxx */ + utf8_length = 4; + first_byte_mark = 0xF0; /* 11110000 */ + } + else + { + /* invalid unicode codepoint */ + goto fail; + } + + /* encode as utf8 */ + for (utf8_position = (unsigned char)(utf8_length - 1); utf8_position > 0; utf8_position--) + { + /* 10xxxxxx */ + (*output_pointer)[utf8_position] = (unsigned char)((codepoint | 0x80) & 0xBF); + codepoint >>= 6; + } + /* encode first byte */ + if (utf8_length > 1) + { + (*output_pointer)[0] = (unsigned char)((codepoint | first_byte_mark) & 0xFF); + } + else + { + (*output_pointer)[0] = (unsigned char)(codepoint & 0x7F); + } + + *output_pointer += utf8_length; + + return sequence_length; fail: - return 0; + return 0; } /* Parse the input text into an unescaped cinput, and populate item. */ -static cJSON_bool parse_string(cJSON *const item, - parse_buffer *const input_buffer) { - const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; - const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; - unsigned char *output_pointer = NULL; - unsigned char *output = NULL; - - /* not a string */ - if(buffer_at_offset(input_buffer)[0] != '\"') { - goto fail; - } - - { - /* calculate approximate size of the output (overestimate) */ - size_t allocation_length = 0; - size_t skipped_bytes = 0; - while(((size_t) (input_end - input_buffer->content) < - input_buffer->length) && - (*input_end != '\"')) - { - /* is escape sequence */ - if(input_end[0] == '\\') { - if((size_t) (input_end + 1 - - input_buffer->content) >= - input_buffer->length) { - /* prevent buffer overflow when last input character is a backslash */ - goto fail; - } - skipped_bytes++; - input_end++; - } - input_end++; - } - if(((size_t) (input_end - input_buffer->content) >= - input_buffer->length) || - (*input_end != '\"')) - { - goto fail; /* string ended unexpectedly */ - } - - /* This is at most how much we need for the output */ - allocation_length = - (size_t) (input_end - buffer_at_offset(input_buffer)) - - skipped_bytes; - output = (unsigned char *) input_buffer->hooks.allocate( - allocation_length + sizeof("")); - if(output == NULL) { - goto fail; /* allocation failure */ - } - } - - output_pointer = output; - /* loop through the string literal */ - while(input_pointer < input_end) { - if(*input_pointer != '\\') { - *output_pointer++ = *input_pointer++; - } - /* escape sequence */ - else { - unsigned char sequence_length = 2; - if((input_end - input_pointer) < 1) { - goto fail; - } - - switch(input_pointer[1]) { - case 'b': - *output_pointer++ = '\b'; - break; - - case 'f': - *output_pointer++ = '\f'; - break; - - case 'n': - *output_pointer++ = '\n'; - break; - - case 'r': - *output_pointer++ = '\r'; - break; - - case 't': - *output_pointer++ = '\t'; - break; - - case '\"': - case '\\': - case '/': - *output_pointer++ = input_pointer[1]; - break; - - /* UTF-16 literal */ - case 'u': - sequence_length = utf16_literal_to_utf8( - input_pointer, input_end, - &output_pointer); - if(sequence_length == 0) { - /* failed to convert UTF16-literal to UTF-8 */ - goto fail; - } - break; - - default: - goto fail; - } - input_pointer += sequence_length; - } - } - - /* zero terminate the output */ - *output_pointer = '\0'; - - item->type = cJSON_String; - item->valuestring = (char *) output; - - input_buffer->offset = (size_t) (input_end - input_buffer->content); - input_buffer->offset++; - - return true; +static cJSON_bool parse_string(cJSON * const item, parse_buffer * const input_buffer) +{ + const unsigned char *input_pointer = buffer_at_offset(input_buffer) + 1; + const unsigned char *input_end = buffer_at_offset(input_buffer) + 1; + unsigned char *output_pointer = NULL; + unsigned char *output = NULL; + + /* not a string */ + if (buffer_at_offset(input_buffer)[0] != '\"') + { + goto fail; + } + + { + /* calculate approximate size of the output (overestimate) */ + size_t allocation_length = 0; + size_t skipped_bytes = 0; + while (((size_t)(input_end - input_buffer->content) < input_buffer->length) && (*input_end != '\"')) + { + /* is escape sequence */ + if (input_end[0] == '\\') + { + if ((size_t)(input_end + 1 - input_buffer->content) >= input_buffer->length) + { + /* prevent buffer overflow when last input character is a backslash */ + goto fail; + } + skipped_bytes++; + input_end++; + } + input_end++; + } + if (((size_t)(input_end - input_buffer->content) >= input_buffer->length) || (*input_end != '\"')) + { + goto fail; /* string ended unexpectedly */ + } + + /* This is at most how much we need for the output */ + allocation_length = (size_t) (input_end - buffer_at_offset(input_buffer)) - skipped_bytes; + output = (unsigned char*)input_buffer->hooks.allocate(allocation_length + sizeof("")); + if (output == NULL) + { + goto fail; /* allocation failure */ + } + } + + output_pointer = output; + /* loop through the string literal */ + while (input_pointer < input_end) + { + if (*input_pointer != '\\') + { + *output_pointer++ = *input_pointer++; + } + /* escape sequence */ + else + { + unsigned char sequence_length = 2; + if ((input_end - input_pointer) < 1) + { + goto fail; + } + + switch (input_pointer[1]) + { + case 'b': + *output_pointer++ = '\b'; + break; + case 'f': + *output_pointer++ = '\f'; + break; + case 'n': + *output_pointer++ = '\n'; + break; + case 'r': + *output_pointer++ = '\r'; + break; + case 't': + *output_pointer++ = '\t'; + break; + case '\"': + case '\\': + case '/': + *output_pointer++ = input_pointer[1]; + break; + + /* UTF-16 literal */ + case 'u': + sequence_length = utf16_literal_to_utf8(input_pointer, input_end, &output_pointer); + if (sequence_length == 0) + { + /* failed to convert UTF16-literal to UTF-8 */ + goto fail; + } + break; + + default: + goto fail; + } + input_pointer += sequence_length; + } + } + + /* zero terminate the output */ + *output_pointer = '\0'; + + item->type = cJSON_String; + item->valuestring = (char*)output; + + input_buffer->offset = (size_t) (input_end - input_buffer->content); + input_buffer->offset++; + + return true; fail: - if(output != NULL) { - input_buffer->hooks.deallocate(output); - } + if (output != NULL) + { + input_buffer->hooks.deallocate(output); + } - if(input_pointer != NULL) { - input_buffer->offset = - (size_t) (input_pointer - input_buffer->content); - } + if (input_pointer != NULL) + { + input_buffer->offset = (size_t)(input_pointer - input_buffer->content); + } - return false; + return false; } /* Render the cstring provided to an escaped version that can be printed. */ -static cJSON_bool print_string_ptr(const unsigned char *const input, - printbuffer *const output_buffer) { - const unsigned char *input_pointer = NULL; - unsigned char *output = NULL; - unsigned char *output_pointer = NULL; - size_t output_length = 0; - /* numbers of additional characters needed for escaping */ - size_t escape_characters = 0; - - if(output_buffer == NULL) { - return false; - } - - /* empty string */ - if(input == NULL) { - output = ensure(output_buffer, sizeof("\"\"")); - if(output == NULL) { - return false; - } - strcpy((char *) output, "\"\""); - - return true; - } - - /* set "flag" to 1 if something needs to be escaped */ - for(input_pointer = input; *input_pointer; input_pointer++) { - switch(*input_pointer) { - case '\"': - case '\\': - case '\b': - case '\f': - case '\n': - case '\r': - case '\t': - /* one character escape sequence */ - escape_characters++; - break; - - default: - if(*input_pointer < 32) { - /* UTF-16 escape sequence uXXXX */ - escape_characters += 5; - } - break; - } - } - output_length = (size_t) (input_pointer - input) + escape_characters; - - output = ensure(output_buffer, output_length + sizeof("\"\"")); - if(output == NULL) { - return false; - } - - /* no characters have to be escaped */ - if(escape_characters == 0) { - output[0] = '\"'; - memcpy(output + 1, input, output_length); - output[output_length + 1] = '\"'; - output[output_length + 2] = '\0'; - - return true; - } - - output[0] = '\"'; - output_pointer = output + 1; - /* copy the string */ - for(input_pointer = input; *input_pointer != '\0'; - (void) input_pointer++, output_pointer++) { - if((*input_pointer > 31) && - (*input_pointer != '\"') && - (*input_pointer != '\\')) - { - /* normal character, copy */ - *output_pointer = *input_pointer; - } else { - /* character needs to be escaped */ - *output_pointer++ = '\\'; - switch(*input_pointer) { - case '\\': - *output_pointer = '\\'; - break; - - case '\"': - *output_pointer = '\"'; - break; - - case '\b': - *output_pointer = 'b'; - break; - - case '\f': - *output_pointer = 'f'; - break; - - case '\n': - *output_pointer = 'n'; - break; - - case '\r': - *output_pointer = 'r'; - break; - - case '\t': - *output_pointer = 't'; - break; - - default: - /* escape and print as unicode codepoint */ - sprintf((char *) output_pointer, "u%04x", - *input_pointer); - output_pointer += 4; - break; - } - } - } - output[output_length + 1] = '\"'; - output[output_length + 2] = '\0'; - - return true; +static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffer * const output_buffer) +{ + const unsigned char *input_pointer = NULL; + unsigned char *output = NULL; + unsigned char *output_pointer = NULL; + size_t output_length = 0; + /* numbers of additional characters needed for escaping */ + size_t escape_characters = 0; + + if (output_buffer == NULL) + { + return false; + } + + /* empty string */ + if (input == NULL) + { + output = ensure(output_buffer, sizeof("\"\"")); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "\"\""); + + return true; + } + + /* set "flag" to 1 if something needs to be escaped */ + for (input_pointer = input; *input_pointer; input_pointer++) + { + switch (*input_pointer) + { + case '\"': + case '\\': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + /* one character escape sequence */ + escape_characters++; + break; + default: + if (*input_pointer < 32) + { + /* UTF-16 escape sequence uXXXX */ + escape_characters += 5; + } + break; + } + } + output_length = (size_t)(input_pointer - input) + escape_characters; + + output = ensure(output_buffer, output_length + sizeof("\"\"")); + if (output == NULL) + { + return false; + } + + /* no characters have to be escaped */ + if (escape_characters == 0) + { + output[0] = '\"'; + memcpy(output + 1, input, output_length); + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; + } + + output[0] = '\"'; + output_pointer = output + 1; + /* copy the string */ + for (input_pointer = input; *input_pointer != '\0'; (void)input_pointer++, output_pointer++) + { + if ((*input_pointer > 31) && (*input_pointer != '\"') && (*input_pointer != '\\')) + { + /* normal character, copy */ + *output_pointer = *input_pointer; + } + else + { + /* character needs to be escaped */ + *output_pointer++ = '\\'; + switch (*input_pointer) + { + case '\\': + *output_pointer = '\\'; + break; + case '\"': + *output_pointer = '\"'; + break; + case '\b': + *output_pointer = 'b'; + break; + case '\f': + *output_pointer = 'f'; + break; + case '\n': + *output_pointer = 'n'; + break; + case '\r': + *output_pointer = 'r'; + break; + case '\t': + *output_pointer = 't'; + break; + default: + /* escape and print as unicode codepoint */ + sprintf((char*)output_pointer, "u%04x", *input_pointer); + output_pointer += 4; + break; + } + } + } + output[output_length + 1] = '\"'; + output[output_length + 2] = '\0'; + + return true; } /* Invoke print_string_ptr (which is useful) on an item. */ -static cJSON_bool print_string(const cJSON *const item, printbuffer *const p) { - return print_string_ptr((unsigned char *) item->valuestring, p); +static cJSON_bool print_string(const cJSON * const item, printbuffer * const p) +{ + return print_string_ptr((unsigned char*)item->valuestring, p); } /* Predeclare these prototypes. */ -static cJSON_bool parse_value(cJSON *const item, - parse_buffer *const input_buffer); -static cJSON_bool print_value(const cJSON *const item, - printbuffer *const output_buffer); -static cJSON_bool parse_array(cJSON *const item, - parse_buffer *const input_buffer); -static cJSON_bool print_array(const cJSON *const item, - printbuffer *const output_buffer); -static cJSON_bool parse_object(cJSON *const item, - parse_buffer *const input_buffer); -static cJSON_bool print_object(const cJSON *const item, - printbuffer *const output_buffer); +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer); +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer); +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer); /* Utility to jump whitespace and cr/lf */ -static parse_buffer *buffer_skip_whitespace(parse_buffer *const buffer) { - if((buffer == NULL) || - (buffer->content == NULL)) - { - return NULL; - } +static parse_buffer *buffer_skip_whitespace(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL)) + { + return NULL; + } - while(can_access_at_index(buffer, 0) && - (buffer_at_offset(buffer)[0] <= 32)) - { - buffer->offset++; - } + while (can_access_at_index(buffer, 0) && (buffer_at_offset(buffer)[0] <= 32)) + { + buffer->offset++; + } - if(buffer->offset == buffer->length) { - buffer->offset--; - } + if (buffer->offset == buffer->length) + { + buffer->offset--; + } - return buffer; + return buffer; } /* skip the UTF-8 BOM (byte order mark) if it is at the beginning of a buffer */ -static parse_buffer *skip_utf8_bom(parse_buffer *const buffer) { - if((buffer == NULL) || - (buffer->content == NULL) || - (buffer->offset != 0)) - { - return NULL; - } +static parse_buffer *skip_utf8_bom(parse_buffer * const buffer) +{ + if ((buffer == NULL) || (buffer->content == NULL) || (buffer->offset != 0)) + { + return NULL; + } - if(can_access_at_index(buffer, 4) && - (strncmp((const char *) buffer_at_offset(buffer), "\xEF\xBB\xBF", - 3) == 0)) - { - buffer->offset += 3; - } + if (can_access_at_index(buffer, 4) && (strncmp((const char*)buffer_at_offset(buffer), "\xEF\xBB\xBF", 3) == 0)) + { + buffer->offset += 3; + } - return buffer; + return buffer; } /* Parse an object - create a new root, and populate. */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, - const char **return_parse_end, - cJSON_bool require_null_terminated) -{ - parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; - cJSON *item = NULL; - - /* reset error position */ - global_error.json = NULL; - global_error.position = 0; - - if(value == NULL) { - goto fail; - } - - buffer.content = (const unsigned char *) value; - buffer.length = strlen((const char *) value) + sizeof(""); - buffer.offset = 0; - buffer.hooks = global_hooks; - - item = cJSON_New_Item(&global_hooks); - if(item == NULL) { /* memory fail */ - goto fail; - } - - if(!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) { - /* parse failure. ep is set. */ - goto fail; - } - - /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ - if(require_null_terminated) { - buffer_skip_whitespace(&buffer); - if((buffer.offset >= buffer.length) || - (buffer_at_offset(&buffer)[0] != '\0') ) - { - goto fail; - } - } - if(return_parse_end) { - *return_parse_end = (const char *) buffer_at_offset(&buffer); - } - - return item; +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated) +{ + parse_buffer buffer = { 0, 0, 0, 0, { 0, 0, 0 } }; + cJSON *item = NULL; + + /* reset error position */ + global_error.json = NULL; + global_error.position = 0; + + if (value == NULL) + { + goto fail; + } + + buffer.content = (const unsigned char*)value; + buffer.length = strlen((const char*)value) + sizeof(""); + buffer.offset = 0; + buffer.hooks = global_hooks; + + item = cJSON_New_Item(&global_hooks); + if (item == NULL) /* memory fail */ + { + goto fail; + } + + if (!parse_value(item, buffer_skip_whitespace(skip_utf8_bom(&buffer)))) + { + /* parse failure. ep is set. */ + goto fail; + } + + /* if we require null-terminated JSON without appended garbage, skip and then check for a null terminator */ + if (require_null_terminated) + { + buffer_skip_whitespace(&buffer); + if ((buffer.offset >= buffer.length) || buffer_at_offset(&buffer)[0] != '\0') + { + goto fail; + } + } + if (return_parse_end) + { + *return_parse_end = (const char*)buffer_at_offset(&buffer); + } + + return item; fail: - if(item != NULL) { - cJSON_Delete(item); - } + if (item != NULL) + { + cJSON_Delete(item); + } - if(value != NULL) { - error local_error; - local_error.json = (const unsigned char *) value; - local_error.position = 0; + if (value != NULL) + { + error local_error; + local_error.json = (const unsigned char*)value; + local_error.position = 0; - if(buffer.offset < buffer.length) { - local_error.position = buffer.offset; - } else if(buffer.length > 0) { - local_error.position = buffer.length - 1; - } + if (buffer.offset < buffer.length) + { + local_error.position = buffer.offset; + } + else if (buffer.length > 0) + { + local_error.position = buffer.length - 1; + } - if(return_parse_end != NULL) { - *return_parse_end = (const char *) local_error.json + - local_error.position; - } + if (return_parse_end != NULL) + { + *return_parse_end = (const char*)local_error.json + local_error.position; + } - global_error = local_error; - } + global_error = local_error; + } - return NULL; + return NULL; } /* Default options for cJSON_Parse */ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value) { - return cJSON_ParseWithOpts(value, 0, 0); + return cJSON_ParseWithOpts(value, 0, 0); } #define cjson_min(a, b) ((a < b) ? a : b) -static unsigned char *print(const cJSON *const item, cJSON_bool format, - const internal_hooks *const hooks) { - static const size_t default_buffer_size = 256; - printbuffer buffer[1]; - unsigned char *printed = NULL; - - memset(buffer, 0, sizeof(buffer)); - - /* create buffer */ - buffer->buffer = (unsigned char *) hooks->allocate(default_buffer_size); - buffer->length = default_buffer_size; - buffer->format = format; - buffer->hooks = *hooks; - if(buffer->buffer == NULL) { - goto fail; - } - - /* print the value */ - if(!print_value(item, buffer)) { - goto fail; - } - update_offset(buffer); - - /* check if reallocate is available */ - if(hooks->reallocate != NULL) { - printed = (unsigned char *) hooks->reallocate(buffer->buffer, - buffer->offset + - 1); - if(printed == NULL) { - goto fail; - } - buffer->buffer = NULL; - } else { /* otherwise copy the JSON over to a new buffer */ - printed = (unsigned char *) hooks->allocate(buffer->offset + 1); - if(printed == NULL) { - goto fail; - } - memcpy(printed, buffer->buffer, - cjson_min(buffer->length, buffer->offset + 1)); - printed[buffer->offset] = '\0'; /* just to be sure */ - - /* free the buffer */ - hooks->deallocate(buffer->buffer); - } - - return printed; +static unsigned char *print(const cJSON * const item, cJSON_bool format, const internal_hooks * const hooks) +{ + static const size_t default_buffer_size = 256; + printbuffer buffer[1]; + unsigned char *printed = NULL; + + memset(buffer, 0, sizeof(buffer)); + + /* create buffer */ + buffer->buffer = (unsigned char*) hooks->allocate(default_buffer_size); + buffer->length = default_buffer_size; + buffer->format = format; + buffer->hooks = *hooks; + if (buffer->buffer == NULL) + { + goto fail; + } + + /* print the value */ + if (!print_value(item, buffer)) + { + goto fail; + } + update_offset(buffer); + + /* check if reallocate is available */ + if (hooks->reallocate != NULL) + { + printed = (unsigned char*) hooks->reallocate(buffer->buffer, buffer->offset + 1); + if (printed == NULL) { + goto fail; + } + buffer->buffer = NULL; + } + else /* otherwise copy the JSON over to a new buffer */ + { + printed = (unsigned char*) hooks->allocate(buffer->offset + 1); + if (printed == NULL) + { + goto fail; + } + memcpy(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); + printed[buffer->offset] = '\0'; /* just to be sure */ + + /* free the buffer */ + hooks->deallocate(buffer->buffer); + } + + return printed; fail: - if(buffer->buffer != NULL) { - hooks->deallocate(buffer->buffer); - } + if (buffer->buffer != NULL) + { + hooks->deallocate(buffer->buffer); + } - if(printed != NULL) { - hooks->deallocate(printed); - } + if (printed != NULL) + { + hooks->deallocate(printed); + } - return NULL; + return NULL; } /* Render a cJSON item/entity/structure to text. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON * item) +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item) { - return (char *) print(item, true, &global_hooks); + return (char*)print(item, true, &global_hooks); } -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON * item) +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item) { - return (char *) print(item, false, &global_hooks); + return (char*)print(item, false, &global_hooks); } -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON * item, int prebuffer, - cJSON_bool fmt) +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt) { - printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; - if(prebuffer < 0) { - return NULL; - } + if (prebuffer < 0) + { + return NULL; + } - p.buffer = (unsigned char *) global_hooks.allocate((size_t) prebuffer); - if(!p.buffer) { - return NULL; - } + p.buffer = (unsigned char*)global_hooks.allocate((size_t)prebuffer); + if (!p.buffer) + { + return NULL; + } - p.length = (size_t) prebuffer; - p.offset = 0; - p.noalloc = false; - p.format = fmt; - p.hooks = global_hooks; + p.length = (size_t)prebuffer; + p.offset = 0; + p.noalloc = false; + p.format = fmt; + p.hooks = global_hooks; - if(!print_value(item, &p)) { - global_hooks.deallocate(p.buffer); - return NULL; - } + if (!print_value(item, &p)) + { + global_hooks.deallocate(p.buffer); + return NULL; + } - return (char *) p.buffer; + return (char*)p.buffer; } -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON * item, char *buf, - const int len, - const cJSON_bool fmt) +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buf, const int len, const cJSON_bool fmt) { - printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; + printbuffer p = { 0, 0, 0, 0, 0, 0, { 0, 0, 0 } }; - if((len < 0) || - (buf == NULL)) - { - return false; - } + if ((len < 0) || (buf == NULL)) + { + return false; + } - p.buffer = (unsigned char *) buf; - p.length = (size_t) len; - p.offset = 0; - p.noalloc = true; - p.format = fmt; - p.hooks = global_hooks; + p.buffer = (unsigned char*)buf; + p.length = (size_t)len; + p.offset = 0; + p.noalloc = true; + p.format = fmt; + p.hooks = global_hooks; - return print_value(item, &p); + return print_value(item, &p); } /* Parser core - when encountering text, process appropriately. */ -static cJSON_bool parse_value(cJSON *const item, - parse_buffer *const input_buffer) { - if((input_buffer == NULL) || - (input_buffer->content == NULL)) - { - return false; /* no input */ - } - - /* parse the different types of values */ - /* null */ - if(can_read(input_buffer, 4) && - (strncmp((const char *) buffer_at_offset(input_buffer), "null", - 4) == 0)) - { - item->type = cJSON_NULL; - input_buffer->offset += 4; - return true; - } - /* false */ - if(can_read(input_buffer, 5) && - (strncmp((const char *) buffer_at_offset(input_buffer), "false", - 5) == 0)) - { - item->type = cJSON_False; - input_buffer->offset += 5; - return true; - } - /* true */ - if(can_read(input_buffer, 4) && - (strncmp((const char *) buffer_at_offset(input_buffer), "true", - 4) == 0)) - { - item->type = cJSON_True; - item->valueint = 1; - input_buffer->offset += 4; - return true; - } - /* string */ - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '\"')) - { - return parse_string(item, input_buffer); - } - /* number */ - if(can_access_at_index(input_buffer, 0) && - ((buffer_at_offset(input_buffer)[0] == '-') || - ((buffer_at_offset(input_buffer)[0] >= '0') && - (buffer_at_offset(input_buffer)[0] <= '9')))) - { - return parse_number(item, input_buffer); - } - /* array */ - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '[')) - { - return parse_array(item, input_buffer); - } - /* object */ - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '{')) - { - return parse_object(item, input_buffer); - } - - return false; +static cJSON_bool parse_value(cJSON * const item, parse_buffer * const input_buffer) +{ + if ((input_buffer == NULL) || (input_buffer->content == NULL)) + { + return false; /* no input */ + } + + /* parse the different types of values */ + /* null */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "null", 4) == 0)) + { + item->type = cJSON_NULL; + input_buffer->offset += 4; + return true; + } + /* false */ + if (can_read(input_buffer, 5) && (strncmp((const char*)buffer_at_offset(input_buffer), "false", 5) == 0)) + { + item->type = cJSON_False; + input_buffer->offset += 5; + return true; + } + /* true */ + if (can_read(input_buffer, 4) && (strncmp((const char*)buffer_at_offset(input_buffer), "true", 4) == 0)) + { + item->type = cJSON_True; + item->valueint = 1; + input_buffer->offset += 4; + return true; + } + /* string */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '\"')) + { + return parse_string(item, input_buffer); + } + /* number */ + if (can_access_at_index(input_buffer, 0) && ((buffer_at_offset(input_buffer)[0] == '-') || ((buffer_at_offset(input_buffer)[0] >= '0') && (buffer_at_offset(input_buffer)[0] <= '9')))) + { + return parse_number(item, input_buffer); + } + /* array */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '[')) + { + return parse_array(item, input_buffer); + } + /* object */ + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '{')) + { + return parse_object(item, input_buffer); + } + + return false; } /* Render a value to text. */ -static cJSON_bool print_value(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output = NULL; - - if((item == NULL) || - (output_buffer == NULL)) - { - return false; - } - - switch((item->type) & 0xFF) { - case cJSON_NULL: - output = ensure(output_buffer, 5); - if(output == NULL) { - return false; - } - strcpy((char *) output, "null"); - return true; - - case cJSON_False: - output = ensure(output_buffer, 6); - if(output == NULL) { - return false; - } - strcpy((char *) output, "false"); - return true; - - case cJSON_True: - output = ensure(output_buffer, 5); - if(output == NULL) { - return false; - } - strcpy((char *) output, "true"); - return true; - - case cJSON_Number: - return print_number(item, output_buffer); - - case cJSON_Raw: - { - size_t raw_length = 0; - if(item->valuestring == NULL) { - return false; - } - - raw_length = strlen(item->valuestring) + sizeof(""); - output = ensure(output_buffer, raw_length); - if(output == NULL) { - return false; - } - memcpy(output, item->valuestring, raw_length); - return true; - } - - case cJSON_String: - return print_string(item, output_buffer); - - case cJSON_Array: - return print_array(item, output_buffer); - - case cJSON_Object: - return print_object(item, output_buffer); - - default: - return false; - } +static cJSON_bool print_value(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output = NULL; + + if ((item == NULL) || (output_buffer == NULL)) + { + return false; + } + + switch ((item->type) & 0xFF) + { + case cJSON_NULL: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "null"); + return true; + + case cJSON_False: + output = ensure(output_buffer, 6); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "false"); + return true; + + case cJSON_True: + output = ensure(output_buffer, 5); + if (output == NULL) + { + return false; + } + strcpy((char*)output, "true"); + return true; + + case cJSON_Number: + return print_number(item, output_buffer); + + case cJSON_Raw: + { + size_t raw_length = 0; + if (item->valuestring == NULL) + { + return false; + } + + raw_length = strlen(item->valuestring) + sizeof(""); + output = ensure(output_buffer, raw_length); + if (output == NULL) + { + return false; + } + memcpy(output, item->valuestring, raw_length); + return true; + } + + case cJSON_String: + return print_string(item, output_buffer); + + case cJSON_Array: + return print_array(item, output_buffer); + + case cJSON_Object: + return print_object(item, output_buffer); + + default: + return false; + } } /* Build an array from input text. */ -static cJSON_bool parse_array(cJSON *const item, - parse_buffer *const input_buffer) { - cJSON *head = NULL; /* head of the linked list */ - cJSON *current_item = NULL; - - if(input_buffer->depth >= CJSON_NESTING_LIMIT) { - return false; /* to deeply nested */ - } - input_buffer->depth++; - - if(buffer_at_offset(input_buffer)[0] != '[') { - /* not an array */ - goto fail; - } - - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == ']')) - { - /* empty array */ - goto success; - } - - /* check if we skipped to the end of the buffer */ - if(cannot_access_at_index(input_buffer, 0)) { - input_buffer->offset--; - goto fail; - } - - /* step back to character in front of the first element */ - input_buffer->offset--; - /* loop through the comma separated array elements */ - do { - /* allocate next item */ - cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); - if(new_item == NULL) { - goto fail; /* allocation failure */ - } - - /* attach next item to list */ - if(head == NULL) { - /* start the linked list */ - current_item = head = new_item; - } else { - /* add to the end and advance */ - current_item->next = new_item; - new_item->prev = current_item; - current_item = new_item; - } - - /* parse next value */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(!parse_value(current_item, input_buffer)) { - goto fail; /* failed to parse value */ - } - buffer_skip_whitespace(input_buffer); - } while(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == ',')); - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != ']') ) - { - goto fail; /* expected end of array */ - } +static cJSON_bool parse_array(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* head of the linked list */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (buffer_at_offset(input_buffer)[0] != '[') + { + /* not an array */ + goto fail; + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ']')) + { + /* empty array */ + goto success; + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse next value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || buffer_at_offset(input_buffer)[0] != ']') + { + goto fail; /* expected end of array */ + } success: - input_buffer->depth--; + input_buffer->depth--; - item->type = cJSON_Array; - item->child = head; + item->type = cJSON_Array; + item->child = head; - input_buffer->offset++; + input_buffer->offset++; - return true; + return true; fail: - if(head != NULL) { - cJSON_Delete(head); - } + if (head != NULL) + { + cJSON_Delete(head); + } - return false; + return false; } /* Render an array to text */ -static cJSON_bool print_array(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output_pointer = NULL; - size_t length = 0; - cJSON *current_element = item->child; - - if(output_buffer == NULL) { - return false; - } - - /* Compose the output array. */ - /* opening square bracket */ - output_pointer = ensure(output_buffer, 1); - if(output_pointer == NULL) { - return false; - } - - *output_pointer = '['; - output_buffer->offset++; - output_buffer->depth++; - - while(current_element != NULL) { - if(!print_value(current_element, output_buffer)) { - return false; - } - update_offset(output_buffer); - if(current_element->next) { - length = (size_t) (output_buffer->format ? 2 : 1); - output_pointer = ensure(output_buffer, length + 1); - if(output_pointer == NULL) { - return false; - } - *output_pointer++ = ','; - if(output_buffer->format) { - *output_pointer++ = ' '; - } - *output_pointer = '\0'; - output_buffer->offset += length; - } - current_element = current_element->next; - } - - output_pointer = ensure(output_buffer, 2); - if(output_pointer == NULL) { - return false; - } - *output_pointer++ = ']'; - *output_pointer = '\0'; - output_buffer->depth--; - - return true; +static cJSON_bool print_array(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_element = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output array. */ + /* opening square bracket */ + output_pointer = ensure(output_buffer, 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer = '['; + output_buffer->offset++; + output_buffer->depth++; + + while (current_element != NULL) + { + if (!print_value(current_element, output_buffer)) + { + return false; + } + update_offset(output_buffer); + if (current_element->next) + { + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ','; + if(output_buffer->format) + { + *output_pointer++ = ' '; + } + *output_pointer = '\0'; + output_buffer->offset += length; + } + current_element = current_element->next; + } + + output_pointer = ensure(output_buffer, 2); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ']'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; } /* Build an object from the text. */ -static cJSON_bool parse_object(cJSON *const item, - parse_buffer *const input_buffer) { - cJSON *head = NULL; /* linked list head */ - cJSON *current_item = NULL; - - if(input_buffer->depth >= CJSON_NESTING_LIMIT) { - return false; /* to deeply nested */ - } - input_buffer->depth++; - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != '{')) - { - goto fail; /* not an object */ - } - - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == '}')) - { - goto success; /* empty object */ - } - - /* check if we skipped to the end of the buffer */ - if(cannot_access_at_index(input_buffer, 0)) { - input_buffer->offset--; - goto fail; - } - - /* step back to character in front of the first element */ - input_buffer->offset--; - /* loop through the comma separated array elements */ - do { - /* allocate next item */ - cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); - if(new_item == NULL) { - goto fail; /* allocation failure */ - } - - /* attach next item to list */ - if(head == NULL) { - /* start the linked list */ - current_item = head = new_item; - } else { - /* add to the end and advance */ - current_item->next = new_item; - new_item->prev = current_item; - current_item = new_item; - } - - /* parse the name of the child */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(!parse_string(current_item, input_buffer)) { - goto fail; /* faile to parse name */ - } - buffer_skip_whitespace(input_buffer); - - /* swap valuestring and string, because we parsed the name */ - current_item->string = current_item->valuestring; - current_item->valuestring = NULL; - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != ':')) - { - goto fail; /* invalid object */ - } - - /* parse the value */ - input_buffer->offset++; - buffer_skip_whitespace(input_buffer); - if(!parse_value(current_item, input_buffer)) { - goto fail; /* failed to parse value */ - } - buffer_skip_whitespace(input_buffer); - } while(can_access_at_index(input_buffer, 0) && - (buffer_at_offset(input_buffer)[0] == ',')); - - if(cannot_access_at_index(input_buffer, 0) || - (buffer_at_offset(input_buffer)[0] != '}')) - { - goto fail; /* expected end of object */ - } +static cJSON_bool parse_object(cJSON * const item, parse_buffer * const input_buffer) +{ + cJSON *head = NULL; /* linked list head */ + cJSON *current_item = NULL; + + if (input_buffer->depth >= CJSON_NESTING_LIMIT) + { + return false; /* to deeply nested */ + } + input_buffer->depth++; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '{')) + { + goto fail; /* not an object */ + } + + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == '}')) + { + goto success; /* empty object */ + } + + /* check if we skipped to the end of the buffer */ + if (cannot_access_at_index(input_buffer, 0)) + { + input_buffer->offset--; + goto fail; + } + + /* step back to character in front of the first element */ + input_buffer->offset--; + /* loop through the comma separated array elements */ + do + { + /* allocate next item */ + cJSON *new_item = cJSON_New_Item(&(input_buffer->hooks)); + if (new_item == NULL) + { + goto fail; /* allocation failure */ + } + + /* attach next item to list */ + if (head == NULL) + { + /* start the linked list */ + current_item = head = new_item; + } + else + { + /* add to the end and advance */ + current_item->next = new_item; + new_item->prev = current_item; + current_item = new_item; + } + + /* parse the name of the child */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_string(current_item, input_buffer)) + { + goto fail; /* faile to parse name */ + } + buffer_skip_whitespace(input_buffer); + + /* swap valuestring and string, because we parsed the name */ + current_item->string = current_item->valuestring; + current_item->valuestring = NULL; + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != ':')) + { + goto fail; /* invalid object */ + } + + /* parse the value */ + input_buffer->offset++; + buffer_skip_whitespace(input_buffer); + if (!parse_value(current_item, input_buffer)) + { + goto fail; /* failed to parse value */ + } + buffer_skip_whitespace(input_buffer); + } + while (can_access_at_index(input_buffer, 0) && (buffer_at_offset(input_buffer)[0] == ',')); + + if (cannot_access_at_index(input_buffer, 0) || (buffer_at_offset(input_buffer)[0] != '}')) + { + goto fail; /* expected end of object */ + } success: - input_buffer->depth--; + input_buffer->depth--; - item->type = cJSON_Object; - item->child = head; + item->type = cJSON_Object; + item->child = head; - input_buffer->offset++; - return true; + input_buffer->offset++; + return true; fail: - if(head != NULL) { - cJSON_Delete(head); - } + if (head != NULL) + { + cJSON_Delete(head); + } - return false; + return false; } /* Render an object to text. */ -static cJSON_bool print_object(const cJSON *const item, - printbuffer *const output_buffer) { - unsigned char *output_pointer = NULL; - size_t length = 0; - cJSON *current_item = item->child; - - if(output_buffer == NULL) { - return false; - } - - /* Compose the output: */ - length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ - output_pointer = ensure(output_buffer, length + 1); - if(output_pointer == NULL) { - return false; - } - - *output_pointer++ = '{'; - output_buffer->depth++; - if(output_buffer->format) { - *output_pointer++ = '\n'; - } - output_buffer->offset += length; - - while(current_item) { - if(output_buffer->format) { - size_t i; - output_pointer = ensure(output_buffer, - output_buffer->depth); - if(output_pointer == NULL) { - return false; - } - for(i = 0; i < output_buffer->depth; i++) { - *output_pointer++ = '\t'; - } - output_buffer->offset += output_buffer->depth; - } - - /* print key */ - if(!print_string_ptr((unsigned char *) current_item->string, - output_buffer)) { - return false; - } - update_offset(output_buffer); - - length = (size_t) (output_buffer->format ? 2 : 1); - output_pointer = ensure(output_buffer, length); - if(output_pointer == NULL) { - return false; - } - *output_pointer++ = ':'; - if(output_buffer->format) { - *output_pointer++ = '\t'; - } - output_buffer->offset += length; - - /* print value */ - if(!print_value(current_item, output_buffer)) { - return false; - } - update_offset(output_buffer); - - /* print comma if not last */ - length = - (size_t) ((output_buffer->format ? 1 : 0) + - (current_item->next ? 1 : 0)); - output_pointer = ensure(output_buffer, length + 1); - if(output_pointer == NULL) { - return false; - } - if(current_item->next) { - *output_pointer++ = ','; - } - - if(output_buffer->format) { - *output_pointer++ = '\n'; - } - *output_pointer = '\0'; - output_buffer->offset += length; - - current_item = current_item->next; - } - - output_pointer = - ensure(output_buffer, - output_buffer->format ? (output_buffer->depth + 1) : 2); - if(output_pointer == NULL) { - return false; - } - if(output_buffer->format) { - size_t i; - for(i = 0; i < (output_buffer->depth - 1); i++) { - *output_pointer++ = '\t'; - } - } - *output_pointer++ = '}'; - *output_pointer = '\0'; - output_buffer->depth--; - - return true; +static cJSON_bool print_object(const cJSON * const item, printbuffer * const output_buffer) +{ + unsigned char *output_pointer = NULL; + size_t length = 0; + cJSON *current_item = item->child; + + if (output_buffer == NULL) + { + return false; + } + + /* Compose the output: */ + length = (size_t) (output_buffer->format ? 2 : 1); /* fmt: {\n */ + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + + *output_pointer++ = '{'; + output_buffer->depth++; + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + output_buffer->offset += length; + + while (current_item) + { + if (output_buffer->format) + { + size_t i; + output_pointer = ensure(output_buffer, output_buffer->depth); + if (output_pointer == NULL) + { + return false; + } + for (i = 0; i < output_buffer->depth; i++) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += output_buffer->depth; + } + + /* print key */ + if (!print_string_ptr((unsigned char*)current_item->string, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + length = (size_t) (output_buffer->format ? 2 : 1); + output_pointer = ensure(output_buffer, length); + if (output_pointer == NULL) + { + return false; + } + *output_pointer++ = ':'; + if (output_buffer->format) + { + *output_pointer++ = '\t'; + } + output_buffer->offset += length; + + /* print value */ + if (!print_value(current_item, output_buffer)) + { + return false; + } + update_offset(output_buffer); + + /* print comma if not last */ + length = (size_t) ((output_buffer->format ? 1 : 0) + (current_item->next ? 1 : 0)); + output_pointer = ensure(output_buffer, length + 1); + if (output_pointer == NULL) + { + return false; + } + if (current_item->next) + { + *output_pointer++ = ','; + } + + if (output_buffer->format) + { + *output_pointer++ = '\n'; + } + *output_pointer = '\0'; + output_buffer->offset += length; + + current_item = current_item->next; + } + + output_pointer = ensure(output_buffer, output_buffer->format ? (output_buffer->depth + 1) : 2); + if (output_pointer == NULL) + { + return false; + } + if (output_buffer->format) + { + size_t i; + for (i = 0; i < (output_buffer->depth - 1); i++) + { + *output_pointer++ = '\t'; + } + } + *output_pointer++ = '}'; + *output_pointer = '\0'; + output_buffer->depth--; + + return true; } /* Get Array size/item / object item. */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON * array) +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array) { - cJSON *child = NULL; - size_t size = 0; + cJSON *child = NULL; + size_t size = 0; - if(array == NULL) { - return 0; - } + if (array == NULL) + { + return 0; + } - child = array->child; + child = array->child; - while(child != NULL) { - size++; - child = child->next; - } + while(child != NULL) + { + size++; + child = child->next; + } - /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ + /* FIXME: Can overflow here. Cannot be fixed without breaking the API */ - return (int) size; + return (int)size; } -static cJSON *get_array_item(const cJSON *array, size_t index) { - cJSON *current_child = NULL; +static cJSON* get_array_item(const cJSON *array, size_t index) +{ + cJSON *current_child = NULL; - if(array == NULL) { - return NULL; - } + if (array == NULL) + { + return NULL; + } - current_child = array->child; - while((current_child != NULL) && - (index > 0)) - { - index--; - current_child = current_child->next; - } + current_child = array->child; + while ((current_child != NULL) && (index > 0)) + { + index--; + current_child = current_child->next; + } - return current_child; + return current_child; } -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON * array, int index) +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index) { - if(index < 0) { - return NULL; - } + if (index < 0) + { + return NULL; + } - return get_array_item(array, (size_t) index); + return get_array_item(array, (size_t)index); } -static cJSON *get_object_item(const cJSON *const object, const char *const name, - const cJSON_bool case_sensitive) { - cJSON *current_element = NULL; +static cJSON *get_object_item(const cJSON * const object, const char * const name, const cJSON_bool case_sensitive) +{ + cJSON *current_element = NULL; - if((object == NULL) || - (name == NULL)) - { - return NULL; - } + if ((object == NULL) || (name == NULL)) + { + return NULL; + } - current_element = object->child; - if(case_sensitive) { - while((current_element != NULL) && - (strcmp(name, current_element->string) != 0)) - { - current_element = current_element->next; - } - } else { - while((current_element != NULL) && - (case_insensitive_strcmp((const unsigned char *) name, - (const unsigned char *) ( - current_element->string)) - != 0)) - { - current_element = current_element->next; - } - } + current_element = object->child; + if (case_sensitive) + { + while ((current_element != NULL) && (strcmp(name, current_element->string) != 0)) + { + current_element = current_element->next; + } + } + else + { + while ((current_element != NULL) && (case_insensitive_strcmp((const unsigned char*)name, (const unsigned char*)(current_element->string)) != 0)) + { + current_element = current_element->next; + } + } - return current_element; + return current_element; } -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, - const char *const string) +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string) { - return get_object_item(object, string, false); + return get_object_item(object, string, false); } -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive( - const cJSON * const object, const char *const string) +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string) { - return get_object_item(object, string, true); + return get_object_item(object, string, true); } -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON * object, - const char *string) +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string) { - return cJSON_GetObjectItem(object, string) ? 1 : 0; + return cJSON_GetObjectItem(object, string) ? 1 : 0; } /* Utility for array list handling. */ -static void suffix_object(cJSON *prev, cJSON *item) { - prev->next = item; - item->prev = prev; +static void suffix_object(cJSON *prev, cJSON *item) +{ + prev->next = item; + item->prev = prev; } /* Utility for handling references. */ -static cJSON *create_reference(const cJSON *item, - const internal_hooks *const hooks) { - cJSON *reference = NULL; - if(item == NULL) { - return NULL; - } - - reference = cJSON_New_Item(hooks); - if(reference == NULL) { - return NULL; - } - - memcpy(reference, item, sizeof(cJSON)); - reference->string = NULL; - reference->type |= cJSON_IsReference; - reference->next = reference->prev = NULL; - return reference; -} - -static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) { - cJSON *child = NULL; - - if((item == NULL) || - (array == NULL)) - { - return false; - } - - child = array->child; - - if(child == NULL) { - /* list is empty, start new one */ - array->child = item; - } else { - /* append to the end */ - while(child->next) { - child = child->next; - } - suffix_object(child, item); - } - - return true; +static cJSON *create_reference(const cJSON *item, const internal_hooks * const hooks) +{ + cJSON *reference = NULL; + if (item == NULL) + { + return NULL; + } + + reference = cJSON_New_Item(hooks); + if (reference == NULL) + { + return NULL; + } + + memcpy(reference, item, sizeof(cJSON)); + reference->string = NULL; + reference->type |= cJSON_IsReference; + reference->next = reference->prev = NULL; + return reference; +} + +static cJSON_bool add_item_to_array(cJSON *array, cJSON *item) +{ + cJSON *child = NULL; + + if ((item == NULL) || (array == NULL)) + { + return false; + } + + child = array->child; + + if (child == NULL) + { + /* list is empty, start new one */ + array->child = item; + } + else + { + /* append to the end */ + while (child->next) + { + child = child->next; + } + suffix_object(child, item); + } + + return true; } /* Add item to array/object. */ -CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON * array, cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item) { - add_item_to_array(array, item); + add_item_to_array(array, item); } -#if defined(__clang__) || \ - (defined(__GNUC__) && \ - ((__GNUC__ > 4) || \ - ((__GNUC__ == 4) && \ - (__GNUC_MINOR__ > 5)))) +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic push #endif #ifdef __GNUC__ #pragma GCC diagnostic ignored "-Wcast-qual" #endif /* helper function to cast away const */ -static void *cast_away_const(const void *string) { - return (void *) string; -} -#if defined(__clang__) || \ - (defined(__GNUC__) && \ - ((__GNUC__ > 4) || \ - ((__GNUC__ == 4) && \ - (__GNUC_MINOR__ > 5)))) +static void* cast_away_const(const void* string) +{ + return (void*)string; +} +#if defined(__clang__) || (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))) #pragma GCC diagnostic pop #endif -static cJSON_bool add_item_to_object(cJSON *const object, - const char *const string, - cJSON *const item, - const internal_hooks *const hooks, - const cJSON_bool constant_key) +static cJSON_bool add_item_to_object(cJSON * const object, const char * const string, cJSON * const item, const internal_hooks * const hooks, const cJSON_bool constant_key) { - char *new_key = NULL; - int new_type = cJSON_Invalid; + char *new_key = NULL; + int new_type = cJSON_Invalid; - if((object == NULL) || - (string == NULL) || - (item == NULL)) - { - return false; - } + if ((object == NULL) || (string == NULL) || (item == NULL)) + { + return false; + } - if(constant_key) { - new_key = (char *) cast_away_const(string); - new_type = item->type | cJSON_StringIsConst; - } else { - new_key = (char *) cJSON_strdup((const unsigned char *) string, - hooks); - if(new_key == NULL) { - return false; - } + if (constant_key) + { + new_key = (char*)cast_away_const(string); + new_type = item->type | cJSON_StringIsConst; + } + else + { + new_key = (char*)cJSON_strdup((const unsigned char*)string, hooks); + if (new_key == NULL) + { + return false; + } - new_type = item->type & ~cJSON_StringIsConst; - } + new_type = item->type & ~cJSON_StringIsConst; + } - if(!(item->type & cJSON_StringIsConst) && - (item->string != NULL)) - { - hooks->deallocate(item->string); - } + if (!(item->type & cJSON_StringIsConst) && (item->string != NULL)) + { + hooks->deallocate(item->string); + } - item->string = new_key; - item->type = new_type; + item->string = new_key; + item->type = new_type; - return add_item_to_array(object, item); + return add_item_to_array(object, item); } -CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON * object, const char *string, - cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item) { - add_item_to_object(object, string, item, &global_hooks, false); + add_item_to_object(object, string, item, &global_hooks, false); } /* Add an item to an object with constant string as key */ -CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON * object, const char *string, - cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item) { - add_item_to_object(object, string, item, &global_hooks, true); + add_item_to_object(object, string, item, &global_hooks, true); } -CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON * array, cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item) { - if(array == NULL) { - return; - } + if (array == NULL) + { + return; + } - add_item_to_array(array, create_reference(item, &global_hooks)); + add_item_to_array(array, create_reference(item, &global_hooks)); } -CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON * object, - const char *string, - cJSON * item) +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item) { - if((object == NULL) || - (string == NULL)) - { - return; - } + if ((object == NULL) || (string == NULL)) + { + return; + } - add_item_to_object(object, string, create_reference(item, - &global_hooks), &global_hooks, - false); + add_item_to_object(object, string, create_reference(item, &global_hooks), &global_hooks, false); } -CJSON_PUBLIC(cJSON *) cJSON_AddNullToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name) { - cJSON *null = cJSON_CreateNull(); - if(add_item_to_object(object, name, null, &global_hooks, false)) { - return null; - } + cJSON *null = cJSON_CreateNull(); + if (add_item_to_object(object, name, null, &global_hooks, false)) + { + return null; + } - cJSON_Delete(null); - return NULL; + cJSON_Delete(null); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddTrueToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name) { - cJSON *true_item = cJSON_CreateTrue(); - if(add_item_to_object(object, name, true_item, &global_hooks, false)) { - return true_item; - } + cJSON *true_item = cJSON_CreateTrue(); + if (add_item_to_object(object, name, true_item, &global_hooks, false)) + { + return true_item; + } - cJSON_Delete(true_item); - return NULL; + cJSON_Delete(true_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddFalseToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name) { - cJSON *false_item = cJSON_CreateFalse(); - if(add_item_to_object(object, name, false_item, &global_hooks, false)) { - return false_item; - } + cJSON *false_item = cJSON_CreateFalse(); + if (add_item_to_object(object, name, false_item, &global_hooks, false)) + { + return false_item; + } - cJSON_Delete(false_item); - return NULL; + cJSON_Delete(false_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddBoolToObject(cJSON * const object, - const char *const name, - const cJSON_bool boolean) +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean) { - cJSON *bool_item = cJSON_CreateBool(boolean); - if(add_item_to_object(object, name, bool_item, &global_hooks, false)) { - return bool_item; - } + cJSON *bool_item = cJSON_CreateBool(boolean); + if (add_item_to_object(object, name, bool_item, &global_hooks, false)) + { + return bool_item; + } - cJSON_Delete(bool_item); - return NULL; + cJSON_Delete(bool_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddNumberToObject(cJSON * const object, - const char *const name, - const double number) +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number) { - cJSON *number_item = cJSON_CreateNumber(number); - if(add_item_to_object(object, name, number_item, &global_hooks, - false)) { - return number_item; - } + cJSON *number_item = cJSON_CreateNumber(number); + if (add_item_to_object(object, name, number_item, &global_hooks, false)) + { + return number_item; + } - cJSON_Delete(number_item); - return NULL; + cJSON_Delete(number_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddStringToObject(cJSON * const object, - const char *const name, - const char *const string) +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string) { - cJSON *string_item = cJSON_CreateString(string); - if(add_item_to_object(object, name, string_item, &global_hooks, - false)) { - return string_item; - } + cJSON *string_item = cJSON_CreateString(string); + if (add_item_to_object(object, name, string_item, &global_hooks, false)) + { + return string_item; + } - cJSON_Delete(string_item); - return NULL; + cJSON_Delete(string_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddRawToObject(cJSON * const object, - const char *const name, - const char *const raw) +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw) { - cJSON *raw_item = cJSON_CreateRaw(raw); - if(add_item_to_object(object, name, raw_item, &global_hooks, false)) { - return raw_item; - } + cJSON *raw_item = cJSON_CreateRaw(raw); + if (add_item_to_object(object, name, raw_item, &global_hooks, false)) + { + return raw_item; + } - cJSON_Delete(raw_item); - return NULL; + cJSON_Delete(raw_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddObjectToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name) { - cJSON *object_item = cJSON_CreateObject(); - if(add_item_to_object(object, name, object_item, &global_hooks, - false)) { - return object_item; - } + cJSON *object_item = cJSON_CreateObject(); + if (add_item_to_object(object, name, object_item, &global_hooks, false)) + { + return object_item; + } - cJSON_Delete(object_item); - return NULL; + cJSON_Delete(object_item); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_AddArrayToObject(cJSON * const object, - const char *const name) +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name) { - cJSON *array = cJSON_CreateArray(); - if(add_item_to_object(object, name, array, &global_hooks, false)) { - return array; - } + cJSON *array = cJSON_CreateArray(); + if (add_item_to_object(object, name, array, &global_hooks, false)) + { + return array; + } - cJSON_Delete(array); - return NULL; + cJSON_Delete(array); + return NULL; } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON * parent, - cJSON * const item) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item) { - if((parent == NULL) || - (item == NULL)) - { - return NULL; - } + if ((parent == NULL) || (item == NULL)) + { + return NULL; + } - if(item->prev != NULL) { - /* not the first element */ - item->prev->next = item->next; - } - if(item->next != NULL) { - /* not the last element */ - item->next->prev = item->prev; - } + if (item->prev != NULL) + { + /* not the first element */ + item->prev->next = item->next; + } + if (item->next != NULL) + { + /* not the last element */ + item->next->prev = item->prev; + } - if(item == parent->child) { - /* first element */ - parent->child = item->next; - } - /* make sure the detached item doesn't point anywhere anymore */ - item->prev = NULL; - item->next = NULL; + if (item == parent->child) + { + /* first element */ + parent->child = item->next; + } + /* make sure the detached item doesn't point anywhere anymore */ + item->prev = NULL; + item->next = NULL; - return item; + return item; } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON * array, int which) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which) { - if(which < 0) { - return NULL; - } + if (which < 0) + { + return NULL; + } - return cJSON_DetachItemViaPointer(array, - get_array_item(array, - (size_t) which)); + return cJSON_DetachItemViaPointer(array, get_array_item(array, (size_t)which)); } -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON * array, int which) +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which) { - cJSON_Delete(cJSON_DetachItemFromArray(array, which)); + cJSON_Delete(cJSON_DetachItemFromArray(array, which)); } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON * object, - const char *string) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string) { - cJSON *to_detach = cJSON_GetObjectItem(object, string); + cJSON *to_detach = cJSON_GetObjectItem(object, string); - return cJSON_DetachItemViaPointer(object, to_detach); + return cJSON_DetachItemViaPointer(object, to_detach); } -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON * object, - const char *string) +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string) { - cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); + cJSON *to_detach = cJSON_GetObjectItemCaseSensitive(object, string); - return cJSON_DetachItemViaPointer(object, to_detach); + return cJSON_DetachItemViaPointer(object, to_detach); } -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON * object, - const char *string) +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string) { - cJSON_Delete(cJSON_DetachItemFromObject(object, string)); + cJSON_Delete(cJSON_DetachItemFromObject(object, string)); } -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON * object, - const char *string) +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string) { - cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); + cJSON_Delete(cJSON_DetachItemFromObjectCaseSensitive(object, string)); } /* Replace array/object items with new ones. */ -CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON * array, int which, - cJSON * newitem) -{ - cJSON *after_inserted = NULL; +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem) +{ + cJSON *after_inserted = NULL; - if(which < 0) { - return; - } + if (which < 0) + { + return; + } - after_inserted = get_array_item(array, (size_t) which); - if(after_inserted == NULL) { - add_item_to_array(array, newitem); - return; - } + after_inserted = get_array_item(array, (size_t)which); + if (after_inserted == NULL) + { + add_item_to_array(array, newitem); + return; + } - newitem->next = after_inserted; - newitem->prev = after_inserted->prev; - after_inserted->prev = newitem; - if(after_inserted == array->child) { - array->child = newitem; - } else { - newitem->prev->next = newitem; - } + newitem->next = after_inserted; + newitem->prev = after_inserted->prev; + after_inserted->prev = newitem; + if (after_inserted == array->child) + { + array->child = newitem; + } + else + { + newitem->prev->next = newitem; + } } -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, - cJSON * const item, - cJSON * replacement) +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement) { - if((parent == NULL) || - (replacement == NULL) || - (item == NULL)) - { - return false; - } + if ((parent == NULL) || (replacement == NULL) || (item == NULL)) + { + return false; + } - if(replacement == item) { - return true; - } + if (replacement == item) + { + return true; + } - replacement->next = item->next; - replacement->prev = item->prev; + replacement->next = item->next; + replacement->prev = item->prev; - if(replacement->next != NULL) { - replacement->next->prev = replacement; - } - if(replacement->prev != NULL) { - replacement->prev->next = replacement; - } - if(parent->child == item) { - parent->child = replacement; - } + if (replacement->next != NULL) + { + replacement->next->prev = replacement; + } + if (replacement->prev != NULL) + { + replacement->prev->next = replacement; + } + if (parent->child == item) + { + parent->child = replacement; + } - item->next = NULL; - item->prev = NULL; - cJSON_Delete(item); + item->next = NULL; + item->prev = NULL; + cJSON_Delete(item); - return true; + return true; } -CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON * array, int which, - cJSON * newitem) +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem) { - if(which < 0) { - return; - } + if (which < 0) + { + return; + } - cJSON_ReplaceItemViaPointer(array, get_array_item(array, - (size_t) which), - newitem); + cJSON_ReplaceItemViaPointer(array, get_array_item(array, (size_t)which), newitem); } -static cJSON_bool replace_item_in_object(cJSON *object, const char *string, - cJSON *replacement, - cJSON_bool case_sensitive) { - if((replacement == NULL) || - (string == NULL)) - { - return false; - } +static cJSON_bool replace_item_in_object(cJSON *object, const char *string, cJSON *replacement, cJSON_bool case_sensitive) +{ + if ((replacement == NULL) || (string == NULL)) + { + return false; + } - /* replace the name in the replacement */ - if(!(replacement->type & cJSON_StringIsConst) && - (replacement->string != NULL)) - { - cJSON_free(replacement->string); - } - replacement->string = (char *) cJSON_strdup( - (const unsigned char *) string, &global_hooks); - replacement->type &= ~cJSON_StringIsConst; + /* replace the name in the replacement */ + if (!(replacement->type & cJSON_StringIsConst) && (replacement->string != NULL)) + { + cJSON_free(replacement->string); + } + replacement->string = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + replacement->type &= ~cJSON_StringIsConst; - cJSON_ReplaceItemViaPointer(object, - get_object_item(object, string, - case_sensitive), - replacement); + cJSON_ReplaceItemViaPointer(object, get_object_item(object, string, case_sensitive), replacement); - return true; + return true; } -CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON * object, const char *string, - cJSON * newitem) +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object, const char *string, cJSON *newitem) { - replace_item_in_object(object, string, newitem, false); + replace_item_in_object(object, string, newitem, false); } -CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON * object, - const char *string, - cJSON * newitem) +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object, const char *string, cJSON *newitem) { - replace_item_in_object(object, string, newitem, true); + replace_item_in_object(object, string, newitem, true); } /* Create basic types: */ CJSON_PUBLIC(cJSON *) cJSON_CreateNull(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_NULL; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_NULL; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateTrue(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_True; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_True; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateFalse(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_False; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_False; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateBool(cJSON_bool b) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = b ? cJSON_True : cJSON_False; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = b ? cJSON_True : cJSON_False; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateNumber(double num) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Number; - item->valuedouble = num; - - /* use saturation in case of overflow */ - if(num >= INT_MAX) { - item->valueint = INT_MAX; - } else if(num <= INT_MIN) { - item->valueint = INT_MIN; - } else { - item->valueint = (int) num; - } - } - - return item; + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Number; + item->valuedouble = num; + + /* use saturation in case of overflow */ + if (num >= INT_MAX) + { + item->valueint = INT_MAX; + } + else if (num <= INT_MIN) + { + item->valueint = INT_MIN; + } + else + { + item->valueint = (int)num; + } + } + + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateString(const char *string) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_String; - item->valuestring = (char *) cJSON_strdup( - (const unsigned char *) string, &global_hooks); - if(!item->valuestring) { - cJSON_Delete(item); - return NULL; - } - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_String; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)string, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item != NULL) { - item->type = cJSON_String | cJSON_IsReference; - item->valuestring = (char *) cast_away_const(string); - } + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) + { + item->type = cJSON_String | cJSON_IsReference; + item->valuestring = (char*)cast_away_const(string); + } - return item; + return item; } -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON * child) +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item != NULL) { - item->type = cJSON_Object | cJSON_IsReference; - item->child = (cJSON *) cast_away_const(child); - } + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Object | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } - return item; + return item; } -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON * child) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item != NULL) { - item->type = cJSON_Array | cJSON_IsReference; - item->child = (cJSON *) cast_away_const(child); - } +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child) { + cJSON *item = cJSON_New_Item(&global_hooks); + if (item != NULL) { + item->type = cJSON_Array | cJSON_IsReference; + item->child = (cJSON*)cast_away_const(child); + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateRaw(const char *raw) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Raw; - item->valuestring = (char *) cJSON_strdup( - (const unsigned char *) raw, &global_hooks); - if(!item->valuestring) { - cJSON_Delete(item); - return NULL; - } - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type = cJSON_Raw; + item->valuestring = (char*)cJSON_strdup((const unsigned char*)raw, &global_hooks); + if(!item->valuestring) + { + cJSON_Delete(item); + return NULL; + } + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateArray(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Array; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if(item) + { + item->type=cJSON_Array; + } - return item; + return item; } CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void) { - cJSON *item = cJSON_New_Item(&global_hooks); - if(item) { - item->type = cJSON_Object; - } + cJSON *item = cJSON_New_Item(&global_hooks); + if (item) + { + item->type = cJSON_Object; + } - return item; + return item; } /* Create Arrays: */ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateNumber(numbers[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if (!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; } CJSON_PUBLIC(cJSON *) cJSON_CreateFloatArray(const float *numbers, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateNumber((double) numbers[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber((double)numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; } CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (numbers == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateNumber(numbers[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (numbers == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for(i = 0;a && (i < (size_t)count); i++) + { + n = cJSON_CreateNumber(numbers[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p, n); + } + p = n; + } + + return a; } CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count) { - size_t i = 0; - cJSON *n = NULL; - cJSON *p = NULL; - cJSON *a = NULL; - - if((count < 0) || - (strings == NULL)) - { - return NULL; - } - - a = cJSON_CreateArray(); - - for(i = 0; a && - (i < (size_t) count); i++) - { - n = cJSON_CreateString(strings[i]); - if(!n) { - cJSON_Delete(a); - return NULL; - } - if(!i) { - a->child = n; - } else { - suffix_object(p, n); - } - p = n; - } - - return a; + size_t i = 0; + cJSON *n = NULL; + cJSON *p = NULL; + cJSON *a = NULL; + + if ((count < 0) || (strings == NULL)) + { + return NULL; + } + + a = cJSON_CreateArray(); + + for (i = 0; a && (i < (size_t)count); i++) + { + n = cJSON_CreateString(strings[i]); + if(!n) + { + cJSON_Delete(a); + return NULL; + } + if(!i) + { + a->child = n; + } + else + { + suffix_object(p,n); + } + p = n; + } + + return a; } /* Duplication */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON * item, cJSON_bool recurse) -{ - cJSON *newitem = NULL; - cJSON *child = NULL; - cJSON *next = NULL; - cJSON *newchild = NULL; - - /* Bail on bad ptr */ - if(!item) { - goto fail; - } - /* Create new item */ - newitem = cJSON_New_Item(&global_hooks); - if(!newitem) { - goto fail; - } - /* Copy over all vars */ - newitem->type = item->type & (~cJSON_IsReference); - newitem->valueint = item->valueint; - newitem->valuedouble = item->valuedouble; - if(item->valuestring) { - newitem->valuestring = (char *) cJSON_strdup( - (unsigned char *) item->valuestring, &global_hooks); - if(!newitem->valuestring) { - goto fail; - } - } - if(item->string) { - newitem->string = - (item->type & - cJSON_StringIsConst) ? item->string : (char *) - cJSON_strdup(( - unsigned - char *) item->string, - &global_hooks); - if(!newitem->string) { - goto fail; - } - } - /* If non-recursive, then we're done! */ - if(!recurse) { - return newitem; - } - /* Walk the ->next chain for the child. */ - child = item->child; - while(child != NULL) { - newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ - if(!newchild) { - goto fail; - } - if(next != NULL) { - /* If newitem->child already set, then crosswire ->prev and ->next and move on */ - next->next = newchild; - newchild->prev = next; - next = newchild; - } else { - /* Set newitem->child and move to it */ - newitem->child = newchild; - next = newchild; - } - child = child->next; - } - - return newitem; +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse) +{ + cJSON *newitem = NULL; + cJSON *child = NULL; + cJSON *next = NULL; + cJSON *newchild = NULL; + + /* Bail on bad ptr */ + if (!item) + { + goto fail; + } + /* Create new item */ + newitem = cJSON_New_Item(&global_hooks); + if (!newitem) + { + goto fail; + } + /* Copy over all vars */ + newitem->type = item->type & (~cJSON_IsReference); + newitem->valueint = item->valueint; + newitem->valuedouble = item->valuedouble; + if (item->valuestring) + { + newitem->valuestring = (char*)cJSON_strdup((unsigned char*)item->valuestring, &global_hooks); + if (!newitem->valuestring) + { + goto fail; + } + } + if (item->string) + { + newitem->string = (item->type&cJSON_StringIsConst) ? item->string : (char*)cJSON_strdup((unsigned char*)item->string, &global_hooks); + if (!newitem->string) + { + goto fail; + } + } + /* If non-recursive, then we're done! */ + if (!recurse) + { + return newitem; + } + /* Walk the ->next chain for the child. */ + child = item->child; + while (child != NULL) + { + newchild = cJSON_Duplicate(child, true); /* Duplicate (with recurse) each item in the ->next chain */ + if (!newchild) + { + goto fail; + } + if (next != NULL) + { + /* If newitem->child already set, then crosswire ->prev and ->next and move on */ + next->next = newchild; + newchild->prev = next; + next = newchild; + } + else + { + /* Set newitem->child and move to it */ + newitem->child = newchild; + next = newchild; + } + child = child->next; + } + + return newitem; fail: - if(newitem != NULL) { - cJSON_Delete(newitem); - } + if (newitem != NULL) + { + cJSON_Delete(newitem); + } - return NULL; + return NULL; } CJSON_PUBLIC(void) cJSON_Minify(char *json) { - unsigned char *into = (unsigned char *) json; - - if(json == NULL) { - return; - } - - while(*json) { - if(*json == ' ') { - json++; - } else if(*json == '\t') { - /* Whitespace characters. */ - json++; - } else if(*json == '\r') { - json++; - } else if(*json == '\n') { - json++; - } else if((*json == '/') && - (json[1] == '/')) - { - /* double-slash comments, to end of line. */ - while(*json && - (*json != '\n')) - { - json++; - } - } else if((*json == '/') && - (json[1] == '*')) - { - /* multiline comments. */ - while(*json && - !((*json == '*') && - (json[1] == '/'))) - { - json++; - } - json += 2; - } else if(*json == '\"') { - /* string literals, which are \" sensitive. */ - *into++ = (unsigned char) *json++; - while(*json && - (*json != '\"')) - { - if(*json == '\\') { - *into++ = (unsigned char) *json++; - } - *into++ = (unsigned char) *json++; - } - *into++ = (unsigned char) *json++; - } else { - /* All other characters. */ - *into++ = (unsigned char) *json++; - } - } - - /* and null-terminate. */ - *into = '\0'; + unsigned char *into = (unsigned char*)json; + + if (json == NULL) + { + return; + } + + while (*json) + { + if (*json == ' ') + { + json++; + } + else if (*json == '\t') + { + /* Whitespace characters. */ + json++; + } + else if (*json == '\r') + { + json++; + } + else if (*json=='\n') + { + json++; + } + else if ((*json == '/') && (json[1] == '/')) + { + /* double-slash comments, to end of line. */ + while (*json && (*json != '\n')) + { + json++; + } + } + else if ((*json == '/') && (json[1] == '*')) + { + /* multiline comments. */ + while (*json && !((*json == '*') && (json[1] == '/'))) + { + json++; + } + json += 2; + } + else if (*json == '\"') + { + /* string literals, which are \" sensitive. */ + *into++ = (unsigned char)*json++; + while (*json && (*json != '\"')) + { + if (*json == '\\') + { + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + *into++ = (unsigned char)*json++; + } + else + { + /* All other characters. */ + *into++ = (unsigned char)*json++; + } + } + + /* and null-terminate. */ + *into = '\0'; } CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Invalid; + return (item->type & 0xFF) == cJSON_Invalid; } CJSON_PUBLIC(cJSON_bool) cJSON_IsFalse(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_False; + return (item->type & 0xFF) == cJSON_False; } CJSON_PUBLIC(cJSON_bool) cJSON_IsTrue(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xff) == cJSON_True; + return (item->type & 0xff) == cJSON_True; } CJSON_PUBLIC(cJSON_bool) cJSON_IsBool(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & (cJSON_True | cJSON_False)) != 0; + return (item->type & (cJSON_True | cJSON_False)) != 0; } CJSON_PUBLIC(cJSON_bool) cJSON_IsNull(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_NULL; + return (item->type & 0xFF) == cJSON_NULL; } CJSON_PUBLIC(cJSON_bool) cJSON_IsNumber(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Number; + return (item->type & 0xFF) == cJSON_Number; } CJSON_PUBLIC(cJSON_bool) cJSON_IsString(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_String; + return (item->type & 0xFF) == cJSON_String; } CJSON_PUBLIC(cJSON_bool) cJSON_IsArray(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Array; + return (item->type & 0xFF) == cJSON_Array; } CJSON_PUBLIC(cJSON_bool) cJSON_IsObject(const cJSON * const item) { - if(item == NULL) { - return false; - } + if (item == NULL) + { + return false; + } - return (item->type & 0xFF) == cJSON_Object; + return (item->type & 0xFF) == cJSON_Object; } CJSON_PUBLIC(cJSON_bool) cJSON_IsRaw(const cJSON * const item) { - if(item == NULL) { - return false; - } - - return (item->type & 0xFF) == cJSON_Raw; -} - -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, - const cJSON * const b, - const cJSON_bool case_sensitive) -{ - if((a == NULL) || - (b == NULL) || - ((a->type & 0xFF) != (b->type & 0xFF)) || - cJSON_IsInvalid(a)) - { - return false; - } - - /* check if type is valid */ - switch(a->type & 0xFF) { - case cJSON_False: - case cJSON_True: - case cJSON_NULL: - case cJSON_Number: - case cJSON_String: - case cJSON_Raw: - case cJSON_Array: - case cJSON_Object: - break; - - default: - return false; - } - - /* identical objects are equal */ - if(a == b) { - return true; - } - - switch(a->type & 0xFF) { - /* in these cases and equal type is enough */ - case cJSON_False: - case cJSON_True: - case cJSON_NULL: - return true; - - case cJSON_Number: - if(a->valuedouble == b->valuedouble) { - return true; - } - return false; - - case cJSON_String: - case cJSON_Raw: - if((a->valuestring == NULL) || - (b->valuestring == NULL)) - { - return false; - } - if(strcmp(a->valuestring, b->valuestring) == 0) { - return true; - } - - return false; - - case cJSON_Array: - { - cJSON *a_element = a->child; - cJSON *b_element = b->child; - - for( ; (a_element != NULL) && - (b_element != NULL); ) - { - if(!cJSON_Compare(a_element, b_element, - case_sensitive)) { - return false; - } - - a_element = a_element->next; - b_element = b_element->next; - } - - /* one of the arrays is longer than the other */ - if(a_element != b_element) { - return false; - } - - return true; - } - - case cJSON_Object: - { - cJSON *a_element = NULL; - cJSON *b_element = NULL; - cJSON_ArrayForEach(a_element, a) - { - /* TODO This has O(n^2) runtime, which is horrible! */ - b_element = get_object_item(b, a_element->string, - case_sensitive); - if(b_element == NULL) { - return false; - } - - if(!cJSON_Compare(a_element, b_element, - case_sensitive)) { - return false; - } - } - - /* doing this twice, once on a and b to prevent true comparison if a subset of b - * TODO: Do this the proper way, this is just a fix for now */ - cJSON_ArrayForEach(b_element, b) - { - a_element = get_object_item(a, b_element->string, - case_sensitive); - if(a_element == NULL) { - return false; - } - - if(!cJSON_Compare(b_element, a_element, - case_sensitive)) { - return false; - } - } - - return true; - } - - default: - return false; - } + if (item == NULL) + { + return false; + } + + return (item->type & 0xFF) == cJSON_Raw; +} + +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive) +{ + if ((a == NULL) || (b == NULL) || ((a->type & 0xFF) != (b->type & 0xFF)) || cJSON_IsInvalid(a)) + { + return false; + } + + /* check if type is valid */ + switch (a->type & 0xFF) + { + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + case cJSON_Number: + case cJSON_String: + case cJSON_Raw: + case cJSON_Array: + case cJSON_Object: + break; + + default: + return false; + } + + /* identical objects are equal */ + if (a == b) + { + return true; + } + + switch (a->type & 0xFF) + { + /* in these cases and equal type is enough */ + case cJSON_False: + case cJSON_True: + case cJSON_NULL: + return true; + + case cJSON_Number: + if (a->valuedouble == b->valuedouble) + { + return true; + } + return false; + + case cJSON_String: + case cJSON_Raw: + if ((a->valuestring == NULL) || (b->valuestring == NULL)) + { + return false; + } + if (strcmp(a->valuestring, b->valuestring) == 0) + { + return true; + } + + return false; + + case cJSON_Array: + { + cJSON *a_element = a->child; + cJSON *b_element = b->child; + + for (; (a_element != NULL) && (b_element != NULL);) + { + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + + a_element = a_element->next; + b_element = b_element->next; + } + + /* one of the arrays is longer than the other */ + if (a_element != b_element) { + return false; + } + + return true; + } + + case cJSON_Object: + { + cJSON *a_element = NULL; + cJSON *b_element = NULL; + cJSON_ArrayForEach(a_element, a) + { + /* TODO This has O(n^2) runtime, which is horrible! */ + b_element = get_object_item(b, a_element->string, case_sensitive); + if (b_element == NULL) + { + return false; + } + + if (!cJSON_Compare(a_element, b_element, case_sensitive)) + { + return false; + } + } + + /* doing this twice, once on a and b to prevent true comparison if a subset of b + * TODO: Do this the proper way, this is just a fix for now */ + cJSON_ArrayForEach(b_element, b) + { + a_element = get_object_item(a, b_element->string, case_sensitive); + if (a_element == NULL) + { + return false; + } + + if (!cJSON_Compare(b_element, a_element, case_sensitive)) + { + return false; + } + } + + return true; + } + + default: + return false; + } } CJSON_PUBLIC(void *) cJSON_malloc(size_t size) { - return global_hooks.allocate(size); + return global_hooks.allocate(size); } CJSON_PUBLIC(void) cJSON_free(void *object) { - global_hooks.deallocate(object); + global_hooks.deallocate(object); } diff --git a/samples/client/petstore/c/external/cJSON.h b/samples/client/petstore/c/external/cJSON.h index f35925db6ff7..6e0bde93204b 100644 --- a/samples/client/petstore/c/external/cJSON.h +++ b/samples/client/petstore/c/external/cJSON.h @@ -1,24 +1,24 @@ /* - Copyright (c) 2009-2017 Dave Gamble and cJSON contributors - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - */ + Copyright (c) 2009-2017 Dave Gamble and cJSON contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. +*/ #ifndef cJSON__h #define cJSON__h @@ -37,94 +37,87 @@ extern "C" /* cJSON Types: */ #define cJSON_Invalid (0) -#define cJSON_False (1 << 0) -#define cJSON_True (1 << 1) -#define cJSON_NULL (1 << 2) +#define cJSON_False (1 << 0) +#define cJSON_True (1 << 1) +#define cJSON_NULL (1 << 2) #define cJSON_Number (1 << 3) #define cJSON_String (1 << 4) -#define cJSON_Array (1 << 5) +#define cJSON_Array (1 << 5) #define cJSON_Object (1 << 6) -#define cJSON_Raw (1 << 7) /* raw json */ +#define cJSON_Raw (1 << 7) /* raw json */ #define cJSON_IsReference 256 #define cJSON_StringIsConst 512 /* The cJSON structure: */ -typedef struct cJSON { - /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ - struct cJSON *next; - struct cJSON *prev; - /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ - struct cJSON *child; - - /* The type of the item, as above. */ - int type; - - /* The item's string, if type==cJSON_String and type == cJSON_Raw */ - char *valuestring; - /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ - int valueint; - /* The item's number, if type==cJSON_Number */ - double valuedouble; - - /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ - char *string; +typedef struct cJSON +{ + /* next/prev allow you to walk array/object chains. Alternatively, use GetArraySize/GetArrayItem/GetObjectItem */ + struct cJSON *next; + struct cJSON *prev; + /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ + struct cJSON *child; + + /* The type of the item, as above. */ + int type; + + /* The item's string, if type==cJSON_String and type == cJSON_Raw */ + char *valuestring; + /* writing to valueint is DEPRECATED, use cJSON_SetNumberValue instead */ + int valueint; + /* The item's number, if type==cJSON_Number */ + double valuedouble; + + /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ + char *string; } cJSON; -typedef struct cJSON_Hooks { - void *(*malloc_fn)(size_t sz); - void (*free_fn)(void *ptr); +typedef struct cJSON_Hooks +{ + void *(*malloc_fn)(size_t sz); + void (*free_fn)(void *ptr); } cJSON_Hooks; typedef int cJSON_bool; -#if !defined(__WINDOWS__) && \ - (defined(WIN32) || \ - defined(WIN64) || \ - defined(_MSC_VER) || \ - defined(_WIN32)) +#if !defined(__WINDOWS__) && (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32)) #define __WINDOWS__ #endif #ifdef __WINDOWS__ /* When compiling for windows, we specify a specific calling convention to avoid issues where we are being called from a project with a different default calling convention. For windows you have 2 define options: - CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols - CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) - CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol +CJSON_HIDE_SYMBOLS - Define this in the case where you don't want to ever dllexport symbols +CJSON_EXPORT_SYMBOLS - Define this on library build when you want to dllexport symbols (default) +CJSON_IMPORT_SYMBOLS - Define this if you want to dllimport symbol - For *nix builds that support visibility attribute, you can define similar behavior by +For *nix builds that support visibility attribute, you can define similar behavior by - setting default visibility to hidden by adding - -fvisibility=hidden (for gcc) - or - -xldscope=hidden (for sun cc) - to CFLAGS +setting default visibility to hidden by adding +-fvisibility=hidden (for gcc) +or +-xldscope=hidden (for sun cc) +to CFLAGS - then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does +then using the CJSON_API_VISIBILITY flag to "export" the same symbols the way CJSON_EXPORT_SYMBOLS does - */ +*/ /* export symbols by default, this is necessary for copy pasting the C and header file */ -#if !defined(CJSON_HIDE_SYMBOLS) && \ - !defined(CJSON_IMPORT_SYMBOLS) && \ - !defined(CJSON_EXPORT_SYMBOLS) +#if !defined(CJSON_HIDE_SYMBOLS) && !defined(CJSON_IMPORT_SYMBOLS) && !defined(CJSON_EXPORT_SYMBOLS) #define CJSON_EXPORT_SYMBOLS #endif #if defined(CJSON_HIDE_SYMBOLS) -#define CJSON_PUBLIC(type) type __stdcall +#define CJSON_PUBLIC(type) type __stdcall #elif defined(CJSON_EXPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall +#define CJSON_PUBLIC(type) __declspec(dllexport) type __stdcall #elif defined(CJSON_IMPORT_SYMBOLS) -#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall +#define CJSON_PUBLIC(type) __declspec(dllimport) type __stdcall #endif #else /* !WIN32 */ -#if (defined(__GNUC__) || \ - defined(__SUNPRO_CC) || \ - defined(__SUNPRO_C)) && \ - defined(CJSON_API_VISIBILITY) -#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type +#if (defined(__GNUC__) || defined(__SUNPRO_CC) || defined (__SUNPRO_C)) && defined(CJSON_API_VISIBILITY) +#define CJSON_PUBLIC(type) __attribute__((visibility("default"))) type #else #define CJSON_PUBLIC(type) type #endif @@ -137,51 +130,43 @@ typedef int cJSON_bool; #endif /* returns the version of cJSON as a string */ -CJSON_PUBLIC(const char *) cJSON_Version(void); +CJSON_PUBLIC(const char*) cJSON_Version(void); /* Supply malloc, realloc and free functions to cJSON */ -CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks * hooks); +CJSON_PUBLIC(void) cJSON_InitHooks(cJSON_Hooks* hooks); /* Memory Management: the caller is always responsible to free the results from all variants of cJSON_Parse (with cJSON_Delete) and cJSON_Print (with stdlib free, cJSON_Hooks.free_fn, or cJSON_free as appropriate). The exception is cJSON_PrintPreallocated, where the caller has full responsibility of the buffer. */ /* Supply a block of JSON, and this returns a cJSON object you can interrogate. */ CJSON_PUBLIC(cJSON *) cJSON_Parse(const char *value); /* ParseWithOpts allows you to require (and check) that the JSON is null terminated, and to retrieve the pointer to the final byte parsed. */ /* If you supply a ptr in return_parse_end and parsing fails, then return_parse_end will contain a pointer to the error so will match cJSON_GetErrorPtr(). */ -CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, - const char **return_parse_end, - cJSON_bool require_null_terminated); +CJSON_PUBLIC(cJSON *) cJSON_ParseWithOpts(const char *value, const char **return_parse_end, cJSON_bool require_null_terminated); /* Render a cJSON entity to text for transfer/storage. */ -CJSON_PUBLIC(char *) cJSON_Print(const cJSON * item); +CJSON_PUBLIC(char *) cJSON_Print(const cJSON *item); /* Render a cJSON entity to text for transfer/storage without any formatting. */ -CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON * item); +CJSON_PUBLIC(char *) cJSON_PrintUnformatted(const cJSON *item); /* Render a cJSON entity to text using a buffered strategy. prebuffer is a guess at the final size. guessing well reduces reallocation. fmt=0 gives unformatted, =1 gives formatted */ -CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON * item, int prebuffer, - cJSON_bool fmt); +CJSON_PUBLIC(char *) cJSON_PrintBuffered(const cJSON *item, int prebuffer, cJSON_bool fmt); /* Render a cJSON entity to text using a buffer already allocated in memory with given length. Returns 1 on success and 0 on failure. */ /* NOTE: cJSON is not always 100% accurate in estimating how much memory it will use, so to be safe allocate 5 bytes more than you actually need */ -CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON * item, char *buffer, - const int length, - const cJSON_bool format); +CJSON_PUBLIC(cJSON_bool) cJSON_PrintPreallocated(cJSON *item, char *buffer, const int length, const cJSON_bool format); /* Delete a cJSON entity and all subentities. */ -CJSON_PUBLIC(void) cJSON_Delete(cJSON * c); +CJSON_PUBLIC(void) cJSON_Delete(cJSON *c); /* Returns the number of items in an array (or object). */ -CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON * array); +CJSON_PUBLIC(int) cJSON_GetArraySize(const cJSON *array); /* Retrieve item number "index" from array "array". Returns NULL if unsuccessful. */ -CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON * array, int index); +CJSON_PUBLIC(cJSON *) cJSON_GetArrayItem(const cJSON *array, int index); /* Get item "string" from object. Case insensitive. */ -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, - const char *const string); -CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive( - const cJSON * const object, const char *const string); -CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON * object, - const char *string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItem(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON *) cJSON_GetObjectItemCaseSensitive(const cJSON * const object, const char * const string); +CJSON_PUBLIC(cJSON_bool) cJSON_HasObjectItem(const cJSON *object, const char *string); /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when cJSON_Parse() returns 0. 0 when cJSON_Parse() succeeds. */ CJSON_PUBLIC(const char *) cJSON_GetErrorPtr(void); /* Check if the item is a string and return its valuestring */ -CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON * item); +CJSON_PUBLIC(char *) cJSON_GetStringValue(cJSON *item); /* These functions check the type of an item */ CJSON_PUBLIC(cJSON_bool) cJSON_IsInvalid(const cJSON * const item); @@ -212,8 +197,8 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateObject(void); CJSON_PUBLIC(cJSON *) cJSON_CreateStringReference(const char *string); /* Create an object/arrray that only references it's elements so * they will not be freed by cJSON_Delete */ -CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON * child); -CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON * child); +CJSON_PUBLIC(cJSON *) cJSON_CreateObjectReference(const cJSON *child); +CJSON_PUBLIC(cJSON *) cJSON_CreateArrayReference(const cJSON *child); /* These utilities create an Array of count items. */ CJSON_PUBLIC(cJSON *) cJSON_CreateIntArray(const int *numbers, int count); @@ -222,109 +207,64 @@ CJSON_PUBLIC(cJSON *) cJSON_CreateDoubleArray(const double *numbers, int count); CJSON_PUBLIC(cJSON *) cJSON_CreateStringArray(const char **strings, int count); /* Append item to the specified array/object. */ -CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON * array, cJSON * item); -CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON * object, const char *string, - cJSON * item); +CJSON_PUBLIC(void) cJSON_AddItemToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemToObject(cJSON *object, const char *string, cJSON *item); /* Use this when string is definitely const (i.e. a literal, or as good as), and will definitely survive the cJSON object. * WARNING: When this function was used, make sure to always check that (item->type & cJSON_StringIsConst) is zero before * writing to `item->string` */ -CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON * object, const char *string, - cJSON * item); +CJSON_PUBLIC(void) cJSON_AddItemToObjectCS(cJSON *object, const char *string, cJSON *item); /* Append reference to item to the specified array/object. Use this when you want to add an existing cJSON to a new cJSON, but don't want to corrupt your existing cJSON. */ -CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON * array, cJSON * item); -CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON * object, - const char *string, - cJSON * item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToArray(cJSON *array, cJSON *item); +CJSON_PUBLIC(void) cJSON_AddItemReferenceToObject(cJSON *object, const char *string, cJSON *item); /* Remove/Detatch items from Arrays/Objects. */ -CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON * parent, - cJSON * const item); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON * array, int which); -CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON * array, int which); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON * object, - const char *string); -CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON * object, - const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON * object, - const char *string); -CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON * object, - const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemViaPointer(cJSON *parent, cJSON * const item); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(void) cJSON_DeleteItemFromArray(cJSON *array, int which); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(cJSON *) cJSON_DetachItemFromObjectCaseSensitive(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObject(cJSON *object, const char *string); +CJSON_PUBLIC(void) cJSON_DeleteItemFromObjectCaseSensitive(cJSON *object, const char *string); /* Update array items. */ -CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON * array, int which, - cJSON * newitem); /* Shifts pre-existing items to the right. */ -CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, - cJSON * const item, - cJSON * replacement); -CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON * array, int which, - cJSON * newitem); -CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON * object, const char *string, - cJSON * newitem); -CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON * object, - const char *string, - cJSON * newitem); +CJSON_PUBLIC(void) cJSON_InsertItemInArray(cJSON *array, int which, cJSON *newitem); /* Shifts pre-existing items to the right. */ +CJSON_PUBLIC(cJSON_bool) cJSON_ReplaceItemViaPointer(cJSON * const parent, cJSON * const item, cJSON * replacement); +CJSON_PUBLIC(void) cJSON_ReplaceItemInArray(cJSON *array, int which, cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObject(cJSON *object,const char *string,cJSON *newitem); +CJSON_PUBLIC(void) cJSON_ReplaceItemInObjectCaseSensitive(cJSON *object,const char *string,cJSON *newitem); /* Duplicate a cJSON item */ -CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON * item, cJSON_bool recurse); +CJSON_PUBLIC(cJSON *) cJSON_Duplicate(const cJSON *item, cJSON_bool recurse); /* Duplicate will create a new, identical cJSON item to the one you pass, in new memory that will - need to be released. With recurse!=0, it will duplicate any children connected to the item. - The item->next and ->prev pointers are always zero on return from Duplicate. */ +need to be released. With recurse!=0, it will duplicate any children connected to the item. +The item->next and ->prev pointers are always zero on return from Duplicate. */ /* Recursively compare two cJSON items for equality. If either a or b is NULL or invalid, they will be considered unequal. * case_sensitive determines if object keys are treated case sensitive (1) or case insensitive (0) */ -CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, - const cJSON * const b, - const cJSON_bool case_sensitive); +CJSON_PUBLIC(cJSON_bool) cJSON_Compare(const cJSON * const a, const cJSON * const b, const cJSON_bool case_sensitive); CJSON_PUBLIC(void) cJSON_Minify(char *json); /* Helper functions for creating and adding items to an object at the same time. * They return the added item or NULL on failure. */ -CJSON_PUBLIC(cJSON *) cJSON_AddNullToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddTrueToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddFalseToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddBoolToObject(cJSON * const object, - const char *const name, - const cJSON_bool boolean); -CJSON_PUBLIC(cJSON *) cJSON_AddNumberToObject(cJSON * const object, - const char *const name, - const double number); -CJSON_PUBLIC(cJSON *) cJSON_AddStringToObject(cJSON * const object, - const char *const name, - const char *const string); -CJSON_PUBLIC(cJSON *) cJSON_AddRawToObject(cJSON * const object, - const char *const name, - const char *const raw); -CJSON_PUBLIC(cJSON *) cJSON_AddObjectToObject(cJSON * const object, - const char *const name); -CJSON_PUBLIC(cJSON *) cJSON_AddArrayToObject(cJSON * const object, - const char *const name); +CJSON_PUBLIC(cJSON*) cJSON_AddNullToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddTrueToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddFalseToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddBoolToObject(cJSON * const object, const char * const name, const cJSON_bool boolean); +CJSON_PUBLIC(cJSON*) cJSON_AddNumberToObject(cJSON * const object, const char * const name, const double number); +CJSON_PUBLIC(cJSON*) cJSON_AddStringToObject(cJSON * const object, const char * const name, const char * const string); +CJSON_PUBLIC(cJSON*) cJSON_AddRawToObject(cJSON * const object, const char * const name, const char * const raw); +CJSON_PUBLIC(cJSON*) cJSON_AddObjectToObject(cJSON * const object, const char * const name); +CJSON_PUBLIC(cJSON*) cJSON_AddArrayToObject(cJSON * const object, const char * const name); /* When assigning an integer value, it needs to be propagated to valuedouble too. */ -#define cJSON_SetIntValue(object, \ - number) ((object) ? (object)->valueint = \ - (object)->valuedouble = \ - (number) : (number)) +#define cJSON_SetIntValue(object, number) ((object) ? (object)->valueint = (object)->valuedouble = (number) : (number)) /* helper for the cJSON_SetNumberValue macro */ -CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON * object, double number); -#define cJSON_SetNumberValue(object, \ - number) ((object != \ - NULL) ? cJSON_SetNumberHelper(object, \ - ( \ - double) \ - number) : ( \ - number)) +CJSON_PUBLIC(double) cJSON_SetNumberHelper(cJSON *object, double number); +#define cJSON_SetNumberValue(object, number) ((object != NULL) ? cJSON_SetNumberHelper(object, (double)number) : (number)) /* Macro for iterating over an array or object */ -#define cJSON_ArrayForEach(element, array) for(element = \ - (array != \ - NULL) ? (array)->child : \ - NULL; \ - element != NULL; \ - element = element->next) +#define cJSON_ArrayForEach(element, array) for(element = (array != NULL) ? (array)->child : NULL; element != NULL; element = element->next) /* malloc/free objects using the malloc/free functions that have been set with cJSON_InitHooks */ CJSON_PUBLIC(void *) cJSON_malloc(size_t size); diff --git a/samples/client/petstore/c/include/apiClient.h b/samples/client/petstore/c/include/apiClient.h index a000be9df125..aea3ec93738c 100644 --- a/samples/client/petstore/c/include/apiClient.h +++ b/samples/client/petstore/c/include/apiClient.h @@ -10,27 +10,24 @@ #include "../include/keyValuePair.h" typedef struct apiClient_t { - char *basePath; - void *dataReceived; - long response_code; - list_t *apiKeys; - char *accessToken; + char *basePath; + void *dataReceived; + long response_code; + list_t *apiKeys; + char *accessToken; } apiClient_t; -typedef struct binary_t { - uint8_t *data; - unsigned int len; +typedef struct binary_t +{ + uint8_t* data; + unsigned int len; } binary_t; -apiClient_t *apiClient_create(); +apiClient_t* apiClient_create(); void apiClient_free(apiClient_t *apiClient); -void apiClient_invoke(apiClient_t *apiClient, char *operationParameter, - list_t *queryParameters, list_t *headerParameters, - list_t *formParameters, list_t *headerType, - list_t *contentType, char *bodyParameters, - char *requestType); +void apiClient_invoke(apiClient_t *apiClient,char* operationParameter, list_t *queryParameters, list_t *headerParameters, list_t *formParameters,list_t *headerType,list_t *contentType, char *bodyParameters, char *requestType); char *strReplace(char *orig, char *rep, char *with); diff --git a/samples/client/petstore/c/include/keyValuePair.h b/samples/client/petstore/c/include/keyValuePair.h index 710b46f30e31..90f92e71f66b 100644 --- a/samples/client/petstore/c/include/keyValuePair.h +++ b/samples/client/petstore/c/include/keyValuePair.h @@ -1,11 +1,11 @@ #ifndef _keyValuePair_H_ #define _keyValuePair_H_ -#include +#include typedef struct keyValuePair_t { - char *key; - void *value; + char* key; + void* value; } keyValuePair_t; keyValuePair_t *keyValuePair_create(char *key, void *value); diff --git a/samples/client/petstore/c/include/list.h b/samples/client/petstore/c/include/list.h index ae35304139cd..7d98d7f306b1 100644 --- a/samples/client/petstore/c/include/list.h +++ b/samples/client/petstore/c/include/list.h @@ -9,40 +9,31 @@ typedef struct list_t list_t; typedef struct listEntry_t listEntry_t; struct listEntry_t { - listEntry_t *nextListEntry; - listEntry_t *prevListEntry; - void *data; + listEntry_t* nextListEntry; + listEntry_t* prevListEntry; + void* data; }; typedef struct list_t { - listEntry_t *firstEntry; - listEntry_t *lastEntry; + listEntry_t *firstEntry; + listEntry_t *lastEntry; - long count; + long count; } list_t; -#define list_ForEach(element, list) for(element = \ - (list != \ - NULL) ? (list)->firstEntry : \ - NULL; \ - element != NULL; \ - element = element->nextListEntry) - -list_t *list_create(); -void list_free(list_t *listToFree); - -void list_addElement(list_t *list, void *dataToAddInList); -listEntry_t *list_getElementAt(list_t *list, long indexOfElement); -listEntry_t *list_getWithIndex(list_t *list, int index); -void list_removeElement(list_t *list, listEntry_t *elementToRemove); - -void list_iterateThroughListForward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *), void *additionalDataNeededForCallbackFunction); -void list_iterateThroughListBackward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *), void *additionalDataNeededForCallbackFunction); - -void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData); +#define list_ForEach(element, list) for(element = (list != NULL) ? (list)->firstEntry : NULL; element != NULL; element = element->nextListEntry) + +list_t* list_create(); +void list_free(list_t* listToFree); + +void list_addElement(list_t* list, void* dataToAddInList); +listEntry_t* list_getElementAt(list_t *list, long indexOfElement); +listEntry_t* list_getWithIndex(list_t* list, int index); +void list_removeElement(list_t* list, listEntry_t* elementToRemove); + +void list_iterateThroughListForward(list_t* list, void (*operationToPerform)(listEntry_t*, void*), void *additionalDataNeededForCallbackFunction); +void list_iterateThroughListBackward(list_t* list, void (*operationToPerform)(listEntry_t*, void*), void *additionalDataNeededForCallbackFunction); + +void listEntry_printAsInt(listEntry_t* listEntry, void *additionalData); void listEntry_free(listEntry_t *listEntry, void *additionalData); #endif // INCLUDE_LIST_H diff --git a/samples/client/petstore/c/model/api_response.c b/samples/client/petstore/c/model/api_response.c index 3201624063ca..569e58ef0c5e 100644 --- a/samples/client/petstore/c/model/api_response.c +++ b/samples/client/petstore/c/model/api_response.c @@ -5,11 +5,15 @@ -api_response_t *api_response_create(int code, char *type, char *message) { +api_response_t *api_response_create( + int code, + char *type, + char *message + ) { api_response_t *api_response_local_var = malloc(sizeof(api_response_t)); - if(!api_response_local_var) { - return NULL; - } + if (!api_response_local_var) { + return NULL; + } api_response_local_var->code = code; api_response_local_var->type = type; api_response_local_var->message = message; @@ -19,9 +23,9 @@ api_response_t *api_response_create(int code, char *type, char *message) { void api_response_free(api_response_t *api_response) { - listEntry_t *listEntry; - free(api_response->type); - free(api_response->message); + listEntry_t *listEntry; + free(api_response->type); + free(api_response->message); free(api_response); } @@ -29,80 +33,76 @@ cJSON *api_response_convertToJSON(api_response_t *api_response) { cJSON *item = cJSON_CreateObject(); // api_response->code - if(api_response->code) { - if(cJSON_AddNumberToObject(item, "code", - api_response->code) == NULL) - { - goto fail; // Numeric - } - } + if(api_response->code) { + if(cJSON_AddNumberToObject(item, "code", api_response->code) == NULL) { + goto fail; //Numeric + } + } // api_response->type - if(api_response->type) { - if(cJSON_AddStringToObject(item, "type", - api_response->type) == NULL) - { - goto fail; // String - } - } + if(api_response->type) { + if(cJSON_AddStringToObject(item, "type", api_response->type) == NULL) { + goto fail; //String + } + } // api_response->message - if(api_response->message) { - if(cJSON_AddStringToObject(item, "message", - api_response->message) == NULL) - { - goto fail; // String - } - } + if(api_response->message) { + if(cJSON_AddStringToObject(item, "message", api_response->message) == NULL) { + goto fail; //String + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON) { - api_response_t *api_response_local_var = NULL; - - // api_response->code - cJSON *code = - cJSON_GetObjectItemCaseSensitive(api_responseJSON, "code"); - if(code) { - if(!cJSON_IsNumber(code)) { - goto end; // Numeric - } - } - - // api_response->type - cJSON *type = - cJSON_GetObjectItemCaseSensitive(api_responseJSON, "type"); - if(type) { - if(!cJSON_IsString(type)) { - goto end; // String - } - } - - // api_response->message - cJSON *message = cJSON_GetObjectItemCaseSensitive(api_responseJSON, - "message"); - if(message) { - if(!cJSON_IsString(message)) { - goto end; // String - } - } - - - api_response_local_var = api_response_create( - code ? code->valuedouble : 0, - type ? strdup(type->valuestring) : NULL, - message ? strdup(message->valuestring) : NULL - ); - - return api_response_local_var; +api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON){ + + api_response_t *api_response_local_var = NULL; + + // api_response->code + cJSON *code = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "code"); + if (code) { + if(!cJSON_IsNumber(code)) + { + goto end; //Numeric + } + } + + // api_response->type + cJSON *type = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "type"); + if (type) { + if(!cJSON_IsString(type)) + { + goto end; //String + } + } + + // api_response->message + cJSON *message = cJSON_GetObjectItemCaseSensitive(api_responseJSON, "message"); + if (message) { + if(!cJSON_IsString(message)) + { + goto end; //String + } + } + + + api_response_local_var = api_response_create ( + code ? code->valuedouble : 0, + type ? strdup(type->valuestring) : NULL, + message ? strdup(message->valuestring) : NULL + ); + + return api_response_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/api_response.h b/samples/client/petstore/c/model/api_response.h index 73e92795eec8..0b0866e3d5a6 100644 --- a/samples/client/petstore/c/model/api_response.h +++ b/samples/client/petstore/c/model/api_response.h @@ -15,12 +15,17 @@ typedef struct api_response_t { - int code; // numeric - char *type; // string - char *message; // string + int code; //numeric + char *type; // string + char *message; // string + } api_response_t; -api_response_t *api_response_create(int code, char *type, char *message); +api_response_t *api_response_create( + int code, + char *type, + char *message +); void api_response_free(api_response_t *api_response); @@ -29,3 +34,4 @@ api_response_t *api_response_parseFromJSON(cJSON *api_responseJSON); cJSON *api_response_convertToJSON(api_response_t *api_response); #endif /* _api_response_H_ */ + diff --git a/samples/client/petstore/c/model/category.c b/samples/client/petstore/c/model/category.c index fe44d0afc96c..d2a721241731 100644 --- a/samples/client/petstore/c/model/category.c +++ b/samples/client/petstore/c/model/category.c @@ -5,11 +5,14 @@ -category_t *category_create(long id, char *name) { +category_t *category_create( + long id, + char *name + ) { category_t *category_local_var = malloc(sizeof(category_t)); - if(!category_local_var) { - return NULL; - } + if (!category_local_var) { + return NULL; + } category_local_var->id = id; category_local_var->name = name; @@ -18,8 +21,8 @@ category_t *category_create(long id, char *name) { void category_free(category_t *category) { - listEntry_t *listEntry; - free(category->name); + listEntry_t *listEntry; + free(category->name); free(category); } @@ -27,56 +30,58 @@ cJSON *category_convertToJSON(category_t *category) { cJSON *item = cJSON_CreateObject(); // category->id - if(category->id) { - if(cJSON_AddNumberToObject(item, "id", category->id) == NULL) { - goto fail; // Numeric - } - } + if(category->id) { + if(cJSON_AddNumberToObject(item, "id", category->id) == NULL) { + goto fail; //Numeric + } + } // category->name - if(category->name) { - if(cJSON_AddStringToObject(item, "name", - category->name) == NULL) - { - goto fail; // String - } - } + if(category->name) { + if(cJSON_AddStringToObject(item, "name", category->name) == NULL) { + goto fail; //String + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -category_t *category_parseFromJSON(cJSON *categoryJSON) { - category_t *category_local_var = NULL; +category_t *category_parseFromJSON(cJSON *categoryJSON){ - // category->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(categoryJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } + category_t *category_local_var = NULL; - // category->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(categoryJSON, "name"); - if(name) { - if(!cJSON_IsString(name)) { - goto end; // String - } - } + // category->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(categoryJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + // category->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(categoryJSON, "name"); + if (name) { + if(!cJSON_IsString(name)) + { + goto end; //String + } + } - category_local_var = category_create( - id ? id->valuedouble : 0, - name ? strdup(name->valuestring) : NULL - ); - return category_local_var; + category_local_var = category_create ( + id ? id->valuedouble : 0, + name ? strdup(name->valuestring) : NULL + ); + + return category_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/category.h b/samples/client/petstore/c/model/category.h index 27c9387e2f59..e63a04e096c5 100644 --- a/samples/client/petstore/c/model/category.h +++ b/samples/client/petstore/c/model/category.h @@ -15,11 +15,15 @@ typedef struct category_t { - long id; // numeric - char *name; // string + long id; //numeric + char *name; // string + } category_t; -category_t *category_create(long id, char *name); +category_t *category_create( + long id, + char *name +); void category_free(category_t *category); @@ -28,3 +32,4 @@ category_t *category_parseFromJSON(cJSON *categoryJSON); cJSON *category_convertToJSON(category_t *category); #endif /* _category_H_ */ + diff --git a/samples/client/petstore/c/model/object.c b/samples/client/petstore/c/model/object.c index 410c31b6c6b2..d106693842f6 100644 --- a/samples/client/petstore/c/model/object.c +++ b/samples/client/petstore/c/model/object.c @@ -4,28 +4,28 @@ #include "object.h" object_t *object_create() { - object_t *object = malloc(sizeof(object_t)); + object_t *object = malloc(sizeof(object_t)); - return object; + return object; } void object_free(object_t *object) { - free(object); + free (object); } cJSON *object_convertToJSON(object_t *object) { - cJSON *item = cJSON_CreateObject(); + cJSON *item = cJSON_CreateObject(); - return item; + return item; fail: - cJSON_Delete(item); - return NULL; + cJSON_Delete(item); + return NULL; } -object_t *object_parseFromJSON(char *jsonString) { - object_t *object = NULL; +object_t *object_parseFromJSON(char *jsonString){ + object_t *object = NULL; - return object; + return object; end: - return NULL; + return NULL; } diff --git a/samples/client/petstore/c/model/object.h b/samples/client/petstore/c/model/object.h index 1dad2093fed2..6b1a77fc508a 100644 --- a/samples/client/petstore/c/model/object.h +++ b/samples/client/petstore/c/model/object.h @@ -12,7 +12,7 @@ typedef struct object_t { - void *temporary; + void *temporary; } object_t; object_t *object_create(); diff --git a/samples/client/petstore/c/model/order.c b/samples/client/petstore/c/model/order.c index de4c3db1959f..5afa7ce20a9b 100644 --- a/samples/client/petstore/c/model/order.c +++ b/samples/client/petstore/c/model/order.c @@ -4,30 +4,36 @@ #include "order.h" -char *statusorder_ToString(status_e status) { - char *statusArray[] = { "placed", "approved", "delivered" }; - return statusArray[status]; -} - -status_e statusorder_FromString(char *status) { - int stringToReturn = 0; - char *statusArray[] = { "placed", "approved", "delivered" }; - size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); - while(stringToReturn < sizeofArray) { - if(strcmp(status, statusArray[stringToReturn]) == 0) { - return stringToReturn; - } - stringToReturn++; - } - return 0; -} - -order_t *order_create(long id, long petId, int quantity, char *shipDate, - status_e status, int complete) { + char* statusorder_ToString(status_e status){ + char *statusArray[] = { "placed","approved","delivered" }; + return statusArray[status]; + } + + status_e statusorder_FromString(char* status){ + int stringToReturn = 0; + char *statusArray[] = { "placed","approved","delivered" }; + size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(status, statusArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; + } + +order_t *order_create( + long id, + long petId, + int quantity, + char *shipDate, + status_e status, + int complete + ) { order_t *order_local_var = malloc(sizeof(order_t)); - if(!order_local_var) { - return NULL; - } + if (!order_local_var) { + return NULL; + } order_local_var->id = id; order_local_var->petId = petId; order_local_var->quantity = quantity; @@ -40,8 +46,8 @@ order_t *order_create(long id, long petId, int quantity, char *shipDate, void order_free(order_t *order) { - listEntry_t *listEntry; - free(order->shipDate); + listEntry_t *listEntry; + free(order->shipDate); free(order); } @@ -49,137 +55,133 @@ cJSON *order_convertToJSON(order_t *order) { cJSON *item = cJSON_CreateObject(); // order->id - if(order->id) { - if(cJSON_AddNumberToObject(item, "id", order->id) == NULL) { - goto fail; // Numeric - } - } + if(order->id) { + if(cJSON_AddNumberToObject(item, "id", order->id) == NULL) { + goto fail; //Numeric + } + } // order->petId - if(order->petId) { - if(cJSON_AddNumberToObject(item, "petId", - order->petId) == NULL) - { - goto fail; // Numeric - } - } + if(order->petId) { + if(cJSON_AddNumberToObject(item, "petId", order->petId) == NULL) { + goto fail; //Numeric + } + } // order->quantity - if(order->quantity) { - if(cJSON_AddNumberToObject(item, "quantity", - order->quantity) == NULL) - { - goto fail; // Numeric - } - } + if(order->quantity) { + if(cJSON_AddNumberToObject(item, "quantity", order->quantity) == NULL) { + goto fail; //Numeric + } + } // order->shipDate - if(order->shipDate) { - if(cJSON_AddStringToObject(item, "shipDate", - order->shipDate) == NULL) - { - goto fail; // Date-Time - } - } + if(order->shipDate) { + if(cJSON_AddStringToObject(item, "shipDate", order->shipDate) == NULL) { + goto fail; //Date-Time + } + } // order->status - - if(cJSON_AddStringToObject(item, "status", - statusorder_ToString(order->status)) == NULL) - { - goto fail; // Enum - } - + + if(cJSON_AddStringToObject(item, "status", statusorder_ToString(order->status)) == NULL) + { + goto fail; //Enum + } + // order->complete - if(order->complete) { - if(cJSON_AddBoolToObject(item, "complete", - order->complete) == NULL) - { - goto fail; // Bool - } - } + if(order->complete) { + if(cJSON_AddBoolToObject(item, "complete", order->complete) == NULL) { + goto fail; //Bool + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -order_t *order_parseFromJSON(cJSON *orderJSON) { - order_t *order_local_var = NULL; - - // order->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(orderJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } - - // order->petId - cJSON *petId = cJSON_GetObjectItemCaseSensitive(orderJSON, "petId"); - if(petId) { - if(!cJSON_IsNumber(petId)) { - goto end; // Numeric - } - } - - // order->quantity - cJSON *quantity = - cJSON_GetObjectItemCaseSensitive(orderJSON, "quantity"); - if(quantity) { - if(!cJSON_IsNumber(quantity)) { - goto end; // Numeric - } - } - - // order->shipDate - cJSON *shipDate = - cJSON_GetObjectItemCaseSensitive(orderJSON, "shipDate"); - if(shipDate) { - if(!cJSON_IsString(shipDate)) { - goto end; // DateTime - } - } - - // order->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(orderJSON, "status"); - status_e statusVariable; - if(status) { - if(!cJSON_IsString(status)) { - goto end; // Enum - } - statusVariable = statusorder_FromString(status->valuestring); - } - - // order->complete - cJSON *complete = - cJSON_GetObjectItemCaseSensitive(orderJSON, "complete"); - if(complete) { - if(!cJSON_IsBool(complete)) { - goto end; // Bool - } - } - - - order_local_var = order_create( - id ? id->valuedouble : 0, - petId ? petId->valuedouble : 0, - quantity ? quantity->valuedouble : 0, - shipDate ? strdup(shipDate->valuestring) : NULL, - status ? statusVariable : -1, - complete ? complete->valueint : 0 - ); - - return order_local_var; +order_t *order_parseFromJSON(cJSON *orderJSON){ + + order_t *order_local_var = NULL; + + // order->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(orderJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + + // order->petId + cJSON *petId = cJSON_GetObjectItemCaseSensitive(orderJSON, "petId"); + if (petId) { + if(!cJSON_IsNumber(petId)) + { + goto end; //Numeric + } + } + + // order->quantity + cJSON *quantity = cJSON_GetObjectItemCaseSensitive(orderJSON, "quantity"); + if (quantity) { + if(!cJSON_IsNumber(quantity)) + { + goto end; //Numeric + } + } + + // order->shipDate + cJSON *shipDate = cJSON_GetObjectItemCaseSensitive(orderJSON, "shipDate"); + if (shipDate) { + if(!cJSON_IsString(shipDate)) + { + goto end; //DateTime + } + } + + // order->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(orderJSON, "status"); + status_e statusVariable; + if (status) { + if(!cJSON_IsString(status)) + { + goto end; //Enum + } + statusVariable = statusorder_FromString(status->valuestring); + } + + // order->complete + cJSON *complete = cJSON_GetObjectItemCaseSensitive(orderJSON, "complete"); + if (complete) { + if(!cJSON_IsBool(complete)) + { + goto end; //Bool + } + } + + + order_local_var = order_create ( + id ? id->valuedouble : 0, + petId ? petId->valuedouble : 0, + quantity ? quantity->valuedouble : 0, + shipDate ? strdup(shipDate->valuestring) : NULL, + status ? statusVariable : -1, + complete ? complete->valueint : 0 + ); + + return order_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/order.h b/samples/client/petstore/c/model/order.h index ef99a5da98c2..e7f814e1fa13 100644 --- a/samples/client/petstore/c/model/order.h +++ b/samples/client/petstore/c/model/order.h @@ -12,24 +12,31 @@ #include "../include/list.h" #include "../include/keyValuePair.h" -typedef enum { placed, approved, delivered } status_e; + typedef enum { placed, approved, delivered } status_e; -char *status_ToString(status_e status); + char* status_ToString(status_e status); -status_e status_FromString(char *status); + status_e status_FromString(char* status); typedef struct order_t { - long id; // numeric - long petId; // numeric - int quantity; // numeric - char *shipDate; // date time - status_e status; // enum - int complete; // boolean + long id; //numeric + long petId; //numeric + int quantity; //numeric + char *shipDate; //date time + status_e status; //enum + int complete; //boolean + } order_t; -order_t *order_create(long id, long petId, int quantity, char *shipDate, - status_e status, int complete); +order_t *order_create( + long id, + long petId, + int quantity, + char *shipDate, + status_e status, + int complete +); void order_free(order_t *order); @@ -38,3 +45,4 @@ order_t *order_parseFromJSON(cJSON *orderJSON); cJSON *order_convertToJSON(order_t *order); #endif /* _order_H_ */ + diff --git a/samples/client/petstore/c/model/pet.c b/samples/client/petstore/c/model/pet.c index 73b6c4e28f45..1b28a6a2abde 100644 --- a/samples/client/petstore/c/model/pet.c +++ b/samples/client/petstore/c/model/pet.c @@ -4,30 +4,36 @@ #include "pet.h" -char *statuspet_ToString(status_e status) { - char *statusArray[] = { "available", "pending", "sold" }; - return statusArray[status]; -} - -status_e statuspet_FromString(char *status) { - int stringToReturn = 0; - char *statusArray[] = { "available", "pending", "sold" }; - size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); - while(stringToReturn < sizeofArray) { - if(strcmp(status, statusArray[stringToReturn]) == 0) { - return stringToReturn; - } - stringToReturn++; - } - return 0; -} - -pet_t *pet_create(long id, category_t *category, char *name, list_t *photoUrls, - list_t *tags, status_e status) { + char* statuspet_ToString(status_e status){ + char *statusArray[] = { "available","pending","sold" }; + return statusArray[status]; + } + + status_e statuspet_FromString(char* status){ + int stringToReturn = 0; + char *statusArray[] = { "available","pending","sold" }; + size_t sizeofArray = sizeof(statusArray) / sizeof(statusArray[0]); + while(stringToReturn < sizeofArray) { + if(strcmp(status, statusArray[stringToReturn]) == 0) { + return stringToReturn; + } + stringToReturn++; + } + return 0; + } + +pet_t *pet_create( + long id, + category_t *category, + char *name, + list_t *photoUrls, + list_t *tags, + status_e status + ) { pet_t *pet_local_var = malloc(sizeof(pet_t)); - if(!pet_local_var) { - return NULL; - } + if (!pet_local_var) { + return NULL; + } pet_local_var->id = id; pet_local_var->category = category; pet_local_var->name = name; @@ -40,9 +46,9 @@ pet_t *pet_create(long id, category_t *category, char *name, list_t *photoUrls, void pet_free(pet_t *pet) { - listEntry_t *listEntry; - category_free(pet->category); - free(pet->name); + listEntry_t *listEntry; + category_free(pet->category); + free(pet->name); list_ForEach(listEntry, pet->photoUrls) { free(listEntry->data); } @@ -58,193 +64,191 @@ cJSON *pet_convertToJSON(pet_t *pet) { cJSON *item = cJSON_CreateObject(); // pet->id - if(pet->id) { - if(cJSON_AddNumberToObject(item, "id", pet->id) == NULL) { - goto fail; // Numeric - } - } + if(pet->id) { + if(cJSON_AddNumberToObject(item, "id", pet->id) == NULL) { + goto fail; //Numeric + } + } // pet->category - if(pet->category) { - cJSON *category_local_JSON = category_convertToJSON( - pet->category); - if(category_local_JSON == NULL) { - goto fail; // model - } - cJSON_AddItemToObject(item, "category", category_local_JSON); - if(item->child == NULL) { - goto fail; - } - } + if(pet->category) { + cJSON *category_local_JSON = category_convertToJSON(pet->category); + if(category_local_JSON == NULL) { + goto fail; //model + } + cJSON_AddItemToObject(item, "category", category_local_JSON); + if(item->child == NULL) { + goto fail; + } + } // pet->name - if(!pet->name) { - goto fail; - } - - if(cJSON_AddStringToObject(item, "name", pet->name) == NULL) { - goto fail; // String - } + if (!pet->name) { + goto fail; + } + + if(cJSON_AddStringToObject(item, "name", pet->name) == NULL) { + goto fail; //String + } // pet->photoUrls - if(!pet->photoUrls) { - goto fail; - } - + if (!pet->photoUrls) { + goto fail; + } + cJSON *photo_urls = cJSON_AddArrayToObject(item, "photoUrls"); if(photo_urls == NULL) { - goto fail; // primitive container + goto fail; //primitive container } listEntry_t *photo_urlsListEntry; - list_ForEach(photo_urlsListEntry, pet->photoUrls) { - if(cJSON_AddStringToObject(photo_urls, "", - (char *) photo_urlsListEntry->data) - == NULL) - { - goto fail; - } - } + list_ForEach(photo_urlsListEntry, pet->photoUrls) { + if(cJSON_AddStringToObject(photo_urls, "", (char*)photo_urlsListEntry->data) == NULL) + { + goto fail; + } + } // pet->tags - if(pet->tags) { - cJSON *tags = cJSON_AddArrayToObject(item, "tags"); - if(tags == NULL) { - goto fail; // nonprimitive container - } - - listEntry_t *tagsListEntry; - if(pet->tags) { - list_ForEach(tagsListEntry, pet->tags) { - cJSON *itemLocal = tag_convertToJSON( - tagsListEntry->data); - if(itemLocal == NULL) { - goto fail; - } - cJSON_AddItemToArray(tags, itemLocal); - } - } - } + if(pet->tags) { + cJSON *tags = cJSON_AddArrayToObject(item, "tags"); + if(tags == NULL) { + goto fail; //nonprimitive container + } + + listEntry_t *tagsListEntry; + if (pet->tags) { + list_ForEach(tagsListEntry, pet->tags) { + cJSON *itemLocal = tag_convertToJSON(tagsListEntry->data); + if(itemLocal == NULL) { + goto fail; + } + cJSON_AddItemToArray(tags, itemLocal); + } + } + } // pet->status - - if(cJSON_AddStringToObject(item, "status", - statuspet_ToString(pet->status)) == NULL) - { - goto fail; // Enum - } - + + if(cJSON_AddStringToObject(item, "status", statuspet_ToString(pet->status)) == NULL) + { + goto fail; //Enum + } + return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -pet_t *pet_parseFromJSON(cJSON *petJSON) { - pet_t *pet_local_var = NULL; - - // pet->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } - - // pet->category - cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); - category_t *category_local_nonprim = NULL; - if(category) { - category_local_nonprim = category_parseFromJSON(category); // nonprimitive - } - - // pet->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(petJSON, "name"); - if(!name) { - goto end; - } - - - if(!cJSON_IsString(name)) { - goto end; // String - } - - // pet->photoUrls - cJSON *photoUrls = - cJSON_GetObjectItemCaseSensitive(petJSON, "photoUrls"); - if(!photoUrls) { - goto end; - } - - list_t *photo_urlsList; - - cJSON *photo_urls_local; - if(!cJSON_IsArray(photoUrls)) { - goto end; // primitive container - } - photo_urlsList = list_create(); - - cJSON_ArrayForEach(photo_urls_local, photoUrls) - { - if(!cJSON_IsString(photo_urls_local)) { - goto end; - } - list_addElement(photo_urlsList, - strdup(photo_urls_local->valuestring)); - } - - // pet->tags - cJSON *tags = cJSON_GetObjectItemCaseSensitive(petJSON, "tags"); - list_t *tagsList; - if(tags) { - cJSON *tags_local_nonprimitive; - if(!cJSON_IsArray(tags)) { - goto end; // nonprimitive container - } - - tagsList = list_create(); - - cJSON_ArrayForEach(tags_local_nonprimitive, tags) - { - if(!cJSON_IsObject(tags_local_nonprimitive)) { - goto end; - } - tag_t *tagsItem = tag_parseFromJSON( - tags_local_nonprimitive); - - list_addElement(tagsList, tagsItem); - } - } - - // pet->status - cJSON *status = cJSON_GetObjectItemCaseSensitive(petJSON, "status"); - status_e statusVariable; - if(status) { - if(!cJSON_IsString(status)) { - goto end; // Enum - } - statusVariable = statuspet_FromString(status->valuestring); - } - - - pet_local_var = pet_create( - id ? id->valuedouble : 0, - category ? category_local_nonprim : NULL, - strdup(name->valuestring), - photo_urlsList, - tags ? tagsList : NULL, - status ? statusVariable : -1 - ); - - return pet_local_var; +pet_t *pet_parseFromJSON(cJSON *petJSON){ + + pet_t *pet_local_var = NULL; + + // pet->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(petJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + + // pet->category + cJSON *category = cJSON_GetObjectItemCaseSensitive(petJSON, "category"); + category_t *category_local_nonprim = NULL; + if (category) { + category_local_nonprim = category_parseFromJSON(category); //nonprimitive + } + + // pet->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(petJSON, "name"); + if (!name) { + goto end; + } + + + if(!cJSON_IsString(name)) + { + goto end; //String + } + + // pet->photoUrls + cJSON *photoUrls = cJSON_GetObjectItemCaseSensitive(petJSON, "photoUrls"); + if (!photoUrls) { + goto end; + } + + list_t *photo_urlsList; + + cJSON *photo_urls_local; + if(!cJSON_IsArray(photoUrls)) { + goto end;//primitive container + } + photo_urlsList = list_create(); + + cJSON_ArrayForEach(photo_urls_local, photoUrls) + { + if(!cJSON_IsString(photo_urls_local)) + { + goto end; + } + list_addElement(photo_urlsList , strdup(photo_urls_local->valuestring)); + } + + // pet->tags + cJSON *tags = cJSON_GetObjectItemCaseSensitive(petJSON, "tags"); + list_t *tagsList; + if (tags) { + cJSON *tags_local_nonprimitive; + if(!cJSON_IsArray(tags)){ + goto end; //nonprimitive container + } + + tagsList = list_create(); + + cJSON_ArrayForEach(tags_local_nonprimitive,tags ) + { + if(!cJSON_IsObject(tags_local_nonprimitive)){ + goto end; + } + tag_t *tagsItem = tag_parseFromJSON(tags_local_nonprimitive); + + list_addElement(tagsList, tagsItem); + } + } + + // pet->status + cJSON *status = cJSON_GetObjectItemCaseSensitive(petJSON, "status"); + status_e statusVariable; + if (status) { + if(!cJSON_IsString(status)) + { + goto end; //Enum + } + statusVariable = statuspet_FromString(status->valuestring); + } + + + pet_local_var = pet_create ( + id ? id->valuedouble : 0, + category ? category_local_nonprim : NULL, + strdup(name->valuestring), + photo_urlsList, + tags ? tagsList : NULL, + status ? statusVariable : -1 + ); + + return pet_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/pet.h b/samples/client/petstore/c/model/pet.h index da5b3df5e7a6..a29280648d88 100644 --- a/samples/client/petstore/c/model/pet.h +++ b/samples/client/petstore/c/model/pet.h @@ -14,24 +14,31 @@ #include "category.h" #include "tag.h" -typedef enum { available, pending, sold } status_e; + typedef enum { available, pending, sold } status_e; -char *status_ToString(status_e status); + char* status_ToString(status_e status); -status_e status_FromString(char *status); + status_e status_FromString(char* status); typedef struct pet_t { - long id; // numeric - category_t *category; // model - char *name; // string - list_t *photoUrls; // primitive container - list_t *tags; // nonprimitive container - status_e status; // enum + long id; //numeric + category_t *category; //model + char *name; // string + list_t *photoUrls; //primitive container + list_t *tags; //nonprimitive container + status_e status; //enum + } pet_t; -pet_t *pet_create(long id, category_t *category, char *name, list_t *photoUrls, - list_t *tags, status_e status); +pet_t *pet_create( + long id, + category_t *category, + char *name, + list_t *photoUrls, + list_t *tags, + status_e status +); void pet_free(pet_t *pet); @@ -40,3 +47,4 @@ pet_t *pet_parseFromJSON(cJSON *petJSON); cJSON *pet_convertToJSON(pet_t *pet); #endif /* _pet_H_ */ + diff --git a/samples/client/petstore/c/model/tag.c b/samples/client/petstore/c/model/tag.c index ca6c9e9184e3..89f3c89b93e1 100644 --- a/samples/client/petstore/c/model/tag.c +++ b/samples/client/petstore/c/model/tag.c @@ -5,11 +5,14 @@ -tag_t *tag_create(long id, char *name) { +tag_t *tag_create( + long id, + char *name + ) { tag_t *tag_local_var = malloc(sizeof(tag_t)); - if(!tag_local_var) { - return NULL; - } + if (!tag_local_var) { + return NULL; + } tag_local_var->id = id; tag_local_var->name = name; @@ -18,8 +21,8 @@ tag_t *tag_create(long id, char *name) { void tag_free(tag_t *tag) { - listEntry_t *listEntry; - free(tag->name); + listEntry_t *listEntry; + free(tag->name); free(tag); } @@ -27,54 +30,58 @@ cJSON *tag_convertToJSON(tag_t *tag) { cJSON *item = cJSON_CreateObject(); // tag->id - if(tag->id) { - if(cJSON_AddNumberToObject(item, "id", tag->id) == NULL) { - goto fail; // Numeric - } - } + if(tag->id) { + if(cJSON_AddNumberToObject(item, "id", tag->id) == NULL) { + goto fail; //Numeric + } + } // tag->name - if(tag->name) { - if(cJSON_AddStringToObject(item, "name", tag->name) == NULL) { - goto fail; // String - } - } + if(tag->name) { + if(cJSON_AddStringToObject(item, "name", tag->name) == NULL) { + goto fail; //String + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -tag_t *tag_parseFromJSON(cJSON *tagJSON) { - tag_t *tag_local_var = NULL; +tag_t *tag_parseFromJSON(cJSON *tagJSON){ - // tag->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(tagJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } + tag_t *tag_local_var = NULL; - // tag->name - cJSON *name = cJSON_GetObjectItemCaseSensitive(tagJSON, "name"); - if(name) { - if(!cJSON_IsString(name)) { - goto end; // String - } - } + // tag->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(tagJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + // tag->name + cJSON *name = cJSON_GetObjectItemCaseSensitive(tagJSON, "name"); + if (name) { + if(!cJSON_IsString(name)) + { + goto end; //String + } + } - tag_local_var = tag_create( - id ? id->valuedouble : 0, - name ? strdup(name->valuestring) : NULL - ); - return tag_local_var; + tag_local_var = tag_create ( + id ? id->valuedouble : 0, + name ? strdup(name->valuestring) : NULL + ); + + return tag_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/tag.h b/samples/client/petstore/c/model/tag.h index 235f7b2ea452..26f70686658e 100644 --- a/samples/client/petstore/c/model/tag.h +++ b/samples/client/petstore/c/model/tag.h @@ -15,11 +15,15 @@ typedef struct tag_t { - long id; // numeric - char *name; // string + long id; //numeric + char *name; // string + } tag_t; -tag_t *tag_create(long id, char *name); +tag_t *tag_create( + long id, + char *name +); void tag_free(tag_t *tag); @@ -28,3 +32,4 @@ tag_t *tag_parseFromJSON(cJSON *tagJSON); cJSON *tag_convertToJSON(tag_t *tag); #endif /* _tag_H_ */ + diff --git a/samples/client/petstore/c/model/user.c b/samples/client/petstore/c/model/user.c index a12f59bb3d4f..412336cdd520 100644 --- a/samples/client/petstore/c/model/user.c +++ b/samples/client/petstore/c/model/user.c @@ -5,12 +5,20 @@ -user_t *user_create(long id, char *username, char *firstName, char *lastName, - char *email, char *password, char *phone, int userStatus) { +user_t *user_create( + long id, + char *username, + char *firstName, + char *lastName, + char *email, + char *password, + char *phone, + int userStatus + ) { user_t *user_local_var = malloc(sizeof(user_t)); - if(!user_local_var) { - return NULL; - } + if (!user_local_var) { + return NULL; + } user_local_var->id = id; user_local_var->username = username; user_local_var->firstName = firstName; @@ -25,13 +33,13 @@ user_t *user_create(long id, char *username, char *firstName, char *lastName, void user_free(user_t *user) { - listEntry_t *listEntry; - free(user->username); - free(user->firstName); - free(user->lastName); - free(user->email); - free(user->password); - free(user->phone); + listEntry_t *listEntry; + free(user->username); + free(user->firstName); + free(user->lastName); + free(user->email); + free(user->password); + free(user->phone); free(user); } @@ -39,175 +47,166 @@ cJSON *user_convertToJSON(user_t *user) { cJSON *item = cJSON_CreateObject(); // user->id - if(user->id) { - if(cJSON_AddNumberToObject(item, "id", user->id) == NULL) { - goto fail; // Numeric - } - } + if(user->id) { + if(cJSON_AddNumberToObject(item, "id", user->id) == NULL) { + goto fail; //Numeric + } + } // user->username - if(user->username) { - if(cJSON_AddStringToObject(item, "username", - user->username) == NULL) - { - goto fail; // String - } - } + if(user->username) { + if(cJSON_AddStringToObject(item, "username", user->username) == NULL) { + goto fail; //String + } + } // user->firstName - if(user->firstName) { - if(cJSON_AddStringToObject(item, "firstName", - user->firstName) == NULL) - { - goto fail; // String - } - } + if(user->firstName) { + if(cJSON_AddStringToObject(item, "firstName", user->firstName) == NULL) { + goto fail; //String + } + } // user->lastName - if(user->lastName) { - if(cJSON_AddStringToObject(item, "lastName", - user->lastName) == NULL) - { - goto fail; // String - } - } + if(user->lastName) { + if(cJSON_AddStringToObject(item, "lastName", user->lastName) == NULL) { + goto fail; //String + } + } // user->email - if(user->email) { - if(cJSON_AddStringToObject(item, "email", - user->email) == NULL) - { - goto fail; // String - } - } + if(user->email) { + if(cJSON_AddStringToObject(item, "email", user->email) == NULL) { + goto fail; //String + } + } // user->password - if(user->password) { - if(cJSON_AddStringToObject(item, "password", - user->password) == NULL) - { - goto fail; // String - } - } + if(user->password) { + if(cJSON_AddStringToObject(item, "password", user->password) == NULL) { + goto fail; //String + } + } // user->phone - if(user->phone) { - if(cJSON_AddStringToObject(item, "phone", - user->phone) == NULL) - { - goto fail; // String - } - } + if(user->phone) { + if(cJSON_AddStringToObject(item, "phone", user->phone) == NULL) { + goto fail; //String + } + } // user->userStatus - if(user->userStatus) { - if(cJSON_AddNumberToObject(item, "userStatus", - user->userStatus) == NULL) - { - goto fail; // Numeric - } - } + if(user->userStatus) { + if(cJSON_AddNumberToObject(item, "userStatus", user->userStatus) == NULL) { + goto fail; //Numeric + } + } return item; fail: - if(item) { - cJSON_Delete(item); - } + if (item) { + cJSON_Delete(item); + } return NULL; } -user_t *user_parseFromJSON(cJSON *userJSON) { - user_t *user_local_var = NULL; - - // user->id - cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); - if(id) { - if(!cJSON_IsNumber(id)) { - goto end; // Numeric - } - } - - // user->username - cJSON *username = - cJSON_GetObjectItemCaseSensitive(userJSON, "username"); - if(username) { - if(!cJSON_IsString(username)) { - goto end; // String - } - } - - // user->firstName - cJSON *firstName = cJSON_GetObjectItemCaseSensitive(userJSON, - "firstName"); - if(firstName) { - if(!cJSON_IsString(firstName)) { - goto end; // String - } - } - - // user->lastName - cJSON *lastName = - cJSON_GetObjectItemCaseSensitive(userJSON, "lastName"); - if(lastName) { - if(!cJSON_IsString(lastName)) { - goto end; // String - } - } - - // user->email - cJSON *email = cJSON_GetObjectItemCaseSensitive(userJSON, "email"); - if(email) { - if(!cJSON_IsString(email)) { - goto end; // String - } - } - - // user->password - cJSON *password = - cJSON_GetObjectItemCaseSensitive(userJSON, "password"); - if(password) { - if(!cJSON_IsString(password)) { - goto end; // String - } - } - - // user->phone - cJSON *phone = cJSON_GetObjectItemCaseSensitive(userJSON, "phone"); - if(phone) { - if(!cJSON_IsString(phone)) { - goto end; // String - } - } - - // user->userStatus - cJSON *userStatus = cJSON_GetObjectItemCaseSensitive(userJSON, - "userStatus"); - if(userStatus) { - if(!cJSON_IsNumber(userStatus)) { - goto end; // Numeric - } - } - - - user_local_var = user_create( - id ? id->valuedouble : 0, - username ? strdup(username->valuestring) : NULL, - firstName ? strdup(firstName->valuestring) : NULL, - lastName ? strdup(lastName->valuestring) : NULL, - email ? strdup(email->valuestring) : NULL, - password ? strdup(password->valuestring) : NULL, - phone ? strdup(phone->valuestring) : NULL, - userStatus ? userStatus->valuedouble : 0 - ); - - return user_local_var; +user_t *user_parseFromJSON(cJSON *userJSON){ + + user_t *user_local_var = NULL; + + // user->id + cJSON *id = cJSON_GetObjectItemCaseSensitive(userJSON, "id"); + if (id) { + if(!cJSON_IsNumber(id)) + { + goto end; //Numeric + } + } + + // user->username + cJSON *username = cJSON_GetObjectItemCaseSensitive(userJSON, "username"); + if (username) { + if(!cJSON_IsString(username)) + { + goto end; //String + } + } + + // user->firstName + cJSON *firstName = cJSON_GetObjectItemCaseSensitive(userJSON, "firstName"); + if (firstName) { + if(!cJSON_IsString(firstName)) + { + goto end; //String + } + } + + // user->lastName + cJSON *lastName = cJSON_GetObjectItemCaseSensitive(userJSON, "lastName"); + if (lastName) { + if(!cJSON_IsString(lastName)) + { + goto end; //String + } + } + + // user->email + cJSON *email = cJSON_GetObjectItemCaseSensitive(userJSON, "email"); + if (email) { + if(!cJSON_IsString(email)) + { + goto end; //String + } + } + + // user->password + cJSON *password = cJSON_GetObjectItemCaseSensitive(userJSON, "password"); + if (password) { + if(!cJSON_IsString(password)) + { + goto end; //String + } + } + + // user->phone + cJSON *phone = cJSON_GetObjectItemCaseSensitive(userJSON, "phone"); + if (phone) { + if(!cJSON_IsString(phone)) + { + goto end; //String + } + } + + // user->userStatus + cJSON *userStatus = cJSON_GetObjectItemCaseSensitive(userJSON, "userStatus"); + if (userStatus) { + if(!cJSON_IsNumber(userStatus)) + { + goto end; //Numeric + } + } + + + user_local_var = user_create ( + id ? id->valuedouble : 0, + username ? strdup(username->valuestring) : NULL, + firstName ? strdup(firstName->valuestring) : NULL, + lastName ? strdup(lastName->valuestring) : NULL, + email ? strdup(email->valuestring) : NULL, + password ? strdup(password->valuestring) : NULL, + phone ? strdup(phone->valuestring) : NULL, + userStatus ? userStatus->valuedouble : 0 + ); + + return user_local_var; end: - return NULL; + return NULL; + } diff --git a/samples/client/petstore/c/model/user.h b/samples/client/petstore/c/model/user.h index dfb704efb26c..954bc64a1282 100644 --- a/samples/client/petstore/c/model/user.h +++ b/samples/client/petstore/c/model/user.h @@ -15,18 +15,27 @@ typedef struct user_t { - long id; // numeric - char *username; // string - char *firstName; // string - char *lastName; // string - char *email; // string - char *password; // string - char *phone; // string - int userStatus; // numeric + long id; //numeric + char *username; // string + char *firstName; // string + char *lastName; // string + char *email; // string + char *password; // string + char *phone; // string + int userStatus; //numeric + } user_t; -user_t *user_create(long id, char *username, char *firstName, char *lastName, - char *email, char *password, char *phone, int userStatus); +user_t *user_create( + long id, + char *username, + char *firstName, + char *lastName, + char *email, + char *password, + char *phone, + int userStatus +); void user_free(user_t *user); @@ -35,3 +44,4 @@ user_t *user_parseFromJSON(cJSON *userJSON); cJSON *user_convertToJSON(user_t *user); #endif /* _user_H_ */ + diff --git a/samples/client/petstore/c/src/apiClient.c b/samples/client/petstore/c/src/apiClient.c index eb569bd27a39..492b05632032 100644 --- a/samples/client/petstore/c/src/apiClient.c +++ b/samples/client/petstore/c/src/apiClient.c @@ -10,451 +10,448 @@ size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp); apiClient_t *apiClient_create() { - curl_global_init(CURL_GLOBAL_ALL); - apiClient_t *apiClient = malloc(sizeof(apiClient_t)); - apiClient->basePath = "http://petstore.swagger.io/v2"; - apiClient->dataReceived = NULL; - apiClient->response_code = 0; - apiClient->apiKeys = NULL; - apiClient->accessToken = NULL; - - return apiClient; + curl_global_init(CURL_GLOBAL_ALL); + apiClient_t *apiClient = malloc(sizeof(apiClient_t)); + apiClient->basePath = "http://petstore.swagger.io/v2"; + apiClient->dataReceived = NULL; + apiClient->response_code = 0; + apiClient->apiKeys = NULL; + apiClient->accessToken = NULL; + + return apiClient; } void apiClient_free(apiClient_t *apiClient) { - if(apiClient->accessToken) { - list_free(apiClient->apiKeys); - } - if(apiClient->accessToken) { - free(apiClient->accessToken); - } - free(apiClient); - curl_global_cleanup(); + if(apiClient->accessToken) { + list_free(apiClient->apiKeys); + } + if(apiClient->accessToken) { + free(apiClient->accessToken); + } + free(apiClient); + curl_global_cleanup(); } void replaceSpaceWithPlus(char *stringToProcess) { - for(int i = 0; i < strlen(stringToProcess); i++) { - if(stringToProcess[i] == ' ') { - stringToProcess[i] = '+'; - } - } + for(int i = 0; i < strlen(stringToProcess); i++) { + if(stringToProcess[i] == ' ') { + stringToProcess[i] = '+'; + } + } } -char *assembleTargetUrl(char *basePath, char *operationParameter, - list_t *queryParameters) { - int neededBufferSizeForQueryParameters = 0; - listEntry_t *listEntry; - - if(queryParameters != NULL) { - list_ForEach(listEntry, queryParameters) { - keyValuePair_t *pair = listEntry->data; - neededBufferSizeForQueryParameters += - strlen(pair->key) + strlen(pair->value); - } - - neededBufferSizeForQueryParameters += - (queryParameters->count * 2); // each keyValuePair is separated by a = and a & except the last, but this makes up for the ? at the beginning - } - - int operationParameterLength = 0; - int basePathLength = strlen(basePath); - bool slashNeedsToBeAppendedToBasePath = false; - - if(operationParameter != NULL) { - operationParameterLength = (1 + strlen(operationParameter)); - } - if(basePath[strlen(basePath) - 1] != '/') { - slashNeedsToBeAppendedToBasePath = true; - basePathLength++; - } - - char *targetUrl = - malloc( - neededBufferSizeForQueryParameters + basePathLength + operationParameterLength + - 1); - - strcpy(targetUrl, basePath); - - if(operationParameter != NULL) { - strcat(targetUrl, operationParameter); - } - - if(queryParameters != NULL) { - strcat(targetUrl, "?"); - list_ForEach(listEntry, queryParameters) { - keyValuePair_t *pair = listEntry->data; - replaceSpaceWithPlus(pair->key); - strcat(targetUrl, pair->key); - strcat(targetUrl, "="); - replaceSpaceWithPlus(pair->value); - strcat(targetUrl, pair->value); - if(listEntry->nextListEntry != NULL) { - strcat(targetUrl, "&"); - } - } - } - - return targetUrl; +char *assembleTargetUrl(char *basePath, + char *operationParameter, + list_t *queryParameters) { + int neededBufferSizeForQueryParameters = 0; + listEntry_t *listEntry; + + if(queryParameters != NULL) { + list_ForEach(listEntry, queryParameters) { + keyValuePair_t *pair = listEntry->data; + neededBufferSizeForQueryParameters += + strlen(pair->key) + strlen(pair->value); + } + + neededBufferSizeForQueryParameters += + (queryParameters->count * 2); // each keyValuePair is separated by a = and a & except the last, but this makes up for the ? at the beginning + } + + int operationParameterLength = 0; + int basePathLength = strlen(basePath); + bool slashNeedsToBeAppendedToBasePath = false; + + if(operationParameter != NULL) { + operationParameterLength = (1 + strlen(operationParameter)); + } + if(basePath[strlen(basePath) - 1] != '/') { + slashNeedsToBeAppendedToBasePath = true; + basePathLength++; + } + + char *targetUrl = + malloc( + neededBufferSizeForQueryParameters + basePathLength + operationParameterLength + + 1); + + strcpy(targetUrl, basePath); + + if(operationParameter != NULL) { + strcat(targetUrl, operationParameter); + } + + if(queryParameters != NULL) { + strcat(targetUrl, "?"); + list_ForEach(listEntry, queryParameters) { + keyValuePair_t *pair = listEntry->data; + replaceSpaceWithPlus(pair->key); + strcat(targetUrl, pair->key); + strcat(targetUrl, "="); + replaceSpaceWithPlus(pair->value); + strcat(targetUrl, pair->value); + if(listEntry->nextListEntry != NULL) { + strcat(targetUrl, "&"); + } + } + } + + return targetUrl; } char *assembleHeaderField(char *key, char *value) { - char *header = malloc(strlen(key) + strlen(value) + 3); + char *header = malloc(strlen(key) + strlen(value) + 3); - strcpy(header, key), - strcat(header, ": "); - strcat(header, value); + strcpy(header, key), + strcat(header, ": "); + strcat(header, value); - return header; + return header; } void postData(CURL *handle, char *bodyParameters) { - curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters); - curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE, - strlen(bodyParameters)); + curl_easy_setopt(handle, CURLOPT_POSTFIELDS, bodyParameters); + curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE_LARGE, + strlen(bodyParameters)); } int lengthOfKeyPair(keyValuePair_t *keyPair) { - long length = 0; - if((keyPair->key != NULL) && - (keyPair->value != NULL) ) - { - length = strlen(keyPair->key) + strlen(keyPair->value); - return length; - } - return 0; + long length = 0; + if((keyPair->key != NULL) && + (keyPair->value != NULL) ) + { + length = strlen(keyPair->key) + strlen(keyPair->value); + return length; + } + return 0; } -void apiClient_invoke(apiClient_t *apiClient, char *operationParameter, - list_t *queryParameters, list_t *headerParameters, - list_t *formParameters, list_t *headerType, - list_t *contentType, char *bodyParameters, - char *requestType) { - CURL *handle = curl_easy_init(); - CURLcode res; - - if(handle) { - listEntry_t *listEntry; - curl_mime *mime = NULL; - struct curl_slist *headers = NULL; - char *buffContent = NULL; - char *buffHeader = NULL; - binary_t *fileVar = NULL; - char *formString = NULL; - - if(headerType != NULL) { - list_ForEach(listEntry, headerType) { - if(strstr((char *) listEntry->data, - "xml") == NULL) - { - buffHeader = malloc(strlen( - "Accept: ") + - strlen((char *) - listEntry-> - data) + 1); - sprintf(buffHeader, "%s%s", "Accept: ", - (char *) listEntry->data); - headers = curl_slist_append(headers, - buffHeader); - free(buffHeader); - } - } - } - if(contentType != NULL) { - list_ForEach(listEntry, contentType) { - if(strstr((char *) listEntry->data, - "xml") == NULL) - { - buffContent = - malloc(strlen( - "Content-Type: ") + strlen( - (char *) - listEntry->data) + - 1); - sprintf(buffContent, "%s%s", - "Content-Type: ", - (char *) listEntry->data); - headers = curl_slist_append(headers, - buffContent); - } - } - } else { - headers = curl_slist_append(headers, - "Content-Type: application/json"); - } - - if(requestType != NULL) { - curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, - requestType); - } - - if(formParameters != NULL) { - if(strstr(buffContent, - "application/x-www-form-urlencoded") != NULL) - { - long parameterLength = 0; - long keyPairLength = 0; - list_ForEach(listEntry, formParameters) { - keyValuePair_t *keyPair = - listEntry->data; - - keyPairLength = - lengthOfKeyPair(keyPair) + 1; - - if(listEntry->nextListEntry != NULL) { - parameterLength++; - } - parameterLength = parameterLength + - keyPairLength; - } - - formString = malloc(parameterLength + 1); - memset(formString, 0, parameterLength + 1); - - list_ForEach(listEntry, formParameters) { - keyValuePair_t *keyPair = - listEntry->data; - if((keyPair->key != NULL) && - (keyPair->value != NULL) ) - { - strcat(formString, - keyPair->key); - strcat(formString, "="); - strcat(formString, - keyPair->value); - if(listEntry->nextListEntry != - NULL) - { - strcat(formString, "&"); - } - } - } - curl_easy_setopt(handle, CURLOPT_POSTFIELDS, - formString); - } - if(strstr(buffContent, "multipart/form-data") != NULL) { - mime = curl_mime_init(handle); - list_ForEach(listEntry, formParameters) { - keyValuePair_t *keyValuePair = - listEntry->data; - - if((keyValuePair->key != NULL) && - (keyValuePair->value != NULL) ) - { - curl_mimepart *part = - curl_mime_addpart(mime); - - curl_mime_name(part, - keyValuePair->key); - - - if(strcmp(keyValuePair->key, - "file") == 0) - { - memcpy(&fileVar, - keyValuePair->value, - sizeof(fileVar)); - curl_mime_data(part, - fileVar->data, - fileVar->len); - curl_mime_filename(part, - "image.png"); - } else { - curl_mime_data(part, - keyValuePair->value, - CURL_ZERO_TERMINATED); - } - } - } - curl_easy_setopt(handle, CURLOPT_MIMEPOST, - mime); - } - } - - list_ForEach(listEntry, headerParameters) { - keyValuePair_t *keyValuePair = listEntry->data; - if((keyValuePair->key != NULL) && - (keyValuePair->value != NULL) ) - { - char *headerValueToWrite = assembleHeaderField( - keyValuePair->key, keyValuePair->value); - curl_slist_append(headers, headerValueToWrite); - free(headerValueToWrite); - } - } - // this would only be generated for apiKey authentication - if(apiClient->apiKeys != NULL) { - list_ForEach(listEntry, apiClient->apiKeys) { - keyValuePair_t *apiKey = listEntry->data; - if((apiKey->key != NULL) && - (apiKey->value != NULL) ) - { - char *headerValueToWrite = - assembleHeaderField( - apiKey->key, - apiKey->value); - curl_slist_append(headers, - headerValueToWrite); - free(headerValueToWrite); - } - } - } - - char *targetUrl = - assembleTargetUrl(apiClient->basePath, - operationParameter, - queryParameters); - - curl_easy_setopt(handle, CURLOPT_URL, targetUrl); - curl_easy_setopt(handle, - CURLOPT_WRITEFUNCTION, - writeDataCallback); - curl_easy_setopt(handle, - CURLOPT_WRITEDATA, - &apiClient->dataReceived); - curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); - curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable - - // this would only be generated for OAuth2 authentication - if(apiClient->accessToken != NULL) { - // curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_BEARER); - curl_easy_setopt(handle, - CURLOPT_XOAUTH2_BEARER, - apiClient->accessToken); - } - - if(bodyParameters != NULL) { - postData(handle, bodyParameters); - } - - res = curl_easy_perform(handle); - - curl_slist_free_all(headers); - - free(targetUrl); - - if(contentType != NULL) { - free(buffContent); - } - - if(res == CURLE_OK) { - curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, - &apiClient->response_code); - } else { - char *url, *ip, *scheme; - long port; - curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url); - curl_easy_getinfo(handle, CURLINFO_PRIMARY_IP, &ip); - curl_easy_getinfo(handle, CURLINFO_PRIMARY_PORT, &port); - curl_easy_getinfo(handle, CURLINFO_SCHEME, &scheme); - fprintf(stderr, - "curl_easy_perform() failed\n\nURL: %s\nIP: %s\nPORT: %li\nSCHEME: %s\nStrERROR: %s\n", url, ip, port, scheme, - curl_easy_strerror(res)); - } - - curl_easy_cleanup(handle); - if(formParameters != NULL) { - free(formString); - curl_mime_free(mime); - } - } +void apiClient_invoke(apiClient_t *apiClient, + char *operationParameter, + list_t *queryParameters, + list_t *headerParameters, + list_t *formParameters, + list_t *headerType, + list_t *contentType, + char *bodyParameters, + char *requestType) { + CURL *handle = curl_easy_init(); + CURLcode res; + + if(handle) { + listEntry_t *listEntry; + curl_mime *mime = NULL; + struct curl_slist *headers = NULL; + char *buffContent = NULL; + char *buffHeader = NULL; + binary_t *fileVar = NULL; + char *formString = NULL; + + if(headerType != NULL) { + list_ForEach(listEntry, headerType) { + if(strstr((char *) listEntry->data, + "xml") == NULL) + { + buffHeader = malloc(strlen( + "Accept: ") + + strlen((char *) + listEntry-> + data) + 1); + sprintf(buffHeader, "%s%s", "Accept: ", + (char *) listEntry->data); + headers = curl_slist_append(headers, + buffHeader); + free(buffHeader); + } + } + } + if(contentType != NULL) { + list_ForEach(listEntry, contentType) { + if(strstr((char *) listEntry->data, + "xml") == NULL) + { + buffContent = + malloc(strlen( + "Content-Type: ") + strlen( + (char *) + listEntry->data) + + 1); + sprintf(buffContent, "%s%s", + "Content-Type: ", + (char *) listEntry->data); + headers = curl_slist_append(headers, + buffContent); + } + } + } else { + headers = curl_slist_append(headers, + "Content-Type: application/json"); + } + + if(requestType != NULL) { + curl_easy_setopt(handle, CURLOPT_CUSTOMREQUEST, + requestType); + } + + if(formParameters != NULL) { + if(strstr(buffContent, + "application/x-www-form-urlencoded") != NULL) + { + long parameterLength = 0; + long keyPairLength = 0; + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyPair = + listEntry->data; + + keyPairLength = + lengthOfKeyPair(keyPair) + 1; + + if(listEntry->nextListEntry != NULL) { + parameterLength++; + } + parameterLength = parameterLength + + keyPairLength; + } + + formString = malloc(parameterLength + 1); + memset(formString, 0, parameterLength + 1); + + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyPair = + listEntry->data; + if((keyPair->key != NULL) && + (keyPair->value != NULL) ) + { + strcat(formString, + keyPair->key); + strcat(formString, "="); + strcat(formString, + keyPair->value); + if(listEntry->nextListEntry != + NULL) + { + strcat(formString, "&"); + } + } + } + curl_easy_setopt(handle, CURLOPT_POSTFIELDS, + formString); + } + if(strstr(buffContent, "multipart/form-data") != NULL) { + mime = curl_mime_init(handle); + list_ForEach(listEntry, formParameters) { + keyValuePair_t *keyValuePair = + listEntry->data; + + if((keyValuePair->key != NULL) && + (keyValuePair->value != NULL) ) + { + curl_mimepart *part = + curl_mime_addpart(mime); + + curl_mime_name(part, + keyValuePair->key); + + + if(strcmp(keyValuePair->key, + "file") == 0) + { + memcpy(&fileVar, + keyValuePair->value, + sizeof(fileVar)); + curl_mime_data(part, + fileVar->data, + fileVar->len); + curl_mime_filename(part, + "image.png"); + } else { + curl_mime_data(part, + keyValuePair->value, + CURL_ZERO_TERMINATED); + } + } + } + curl_easy_setopt(handle, CURLOPT_MIMEPOST, + mime); + } + } + + list_ForEach(listEntry, headerParameters) { + keyValuePair_t *keyValuePair = listEntry->data; + if((keyValuePair->key != NULL) && + (keyValuePair->value != NULL) ) + { + char *headerValueToWrite = assembleHeaderField( + keyValuePair->key, keyValuePair->value); + curl_slist_append(headers, headerValueToWrite); + free(headerValueToWrite); + } + } + // this would only be generated for apiKey authentication + if (apiClient->apiKeys != NULL) + { + list_ForEach(listEntry, apiClient->apiKeys) { + keyValuePair_t *apiKey = listEntry->data; + if((apiKey->key != NULL) && + (apiKey->value != NULL) ) + { + char *headerValueToWrite = assembleHeaderField( + apiKey->key, apiKey->value); + curl_slist_append(headers, headerValueToWrite); + free(headerValueToWrite); + } + } + } + + char *targetUrl = + assembleTargetUrl(apiClient->basePath, + operationParameter, + queryParameters); + + curl_easy_setopt(handle, CURLOPT_URL, targetUrl); + curl_easy_setopt(handle, + CURLOPT_WRITEFUNCTION, + writeDataCallback); + curl_easy_setopt(handle, + CURLOPT_WRITEDATA, + &apiClient->dataReceived); + curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); + curl_easy_setopt(handle, CURLOPT_VERBOSE, 0); // to get curl debug msg 0: to disable, 1L:to enable + + // this would only be generated for OAuth2 authentication + if(apiClient->accessToken != NULL) { + // curl_easy_setopt(handle, CURLOPT_HTTPAUTH, CURLAUTH_BEARER); + curl_easy_setopt(handle, + CURLOPT_XOAUTH2_BEARER, + apiClient->accessToken); + } + + if(bodyParameters != NULL) { + postData(handle, bodyParameters); + } + + res = curl_easy_perform(handle); + + curl_slist_free_all(headers); + + free(targetUrl); + + if(contentType != NULL) { + free(buffContent); + } + + if(res == CURLE_OK) { + curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &apiClient->response_code); + } else { + char *url,*ip,*scheme; + long port; + curl_easy_getinfo(handle, CURLINFO_EFFECTIVE_URL, &url); + curl_easy_getinfo(handle, CURLINFO_PRIMARY_IP, &ip); + curl_easy_getinfo(handle, CURLINFO_PRIMARY_PORT, &port); + curl_easy_getinfo(handle, CURLINFO_SCHEME, &scheme); + fprintf(stderr, "curl_easy_perform() failed\n\nURL: %s\nIP: %s\nPORT: %li\nSCHEME: %s\nStrERROR: %s\n",url,ip,port,scheme, + curl_easy_strerror(res)); + } + + curl_easy_cleanup(handle); + if(formParameters != NULL) { + free(formString); + curl_mime_free(mime); + } + } } size_t writeDataCallback(void *buffer, size_t size, size_t nmemb, void *userp) { - *(char **) userp = strdup(buffer); + *(char **) userp = strdup(buffer); - return size * nmemb; + return size * nmemb; } char *strReplace(char *orig, char *rep, char *with) { - char *result; // the return string - char *ins; // the next insert point - char *tmp; // varies - int lenRep; // length of rep (the string to remove) - int lenWith; // length of with (the string to replace rep with) - int lenFront; // distance between rep and end of last rep - int count; // number of replacements - - // sanity checks and initialization - if(!orig || - !rep) - { - return NULL; - } - lenRep = strlen(rep); - if(lenRep == 0) { - return NULL; // empty rep causes infinite loop during count - } - if(!with) { - with = ""; - } - lenWith = strlen(with); - - // count the number of replacements needed - ins = orig; - for(count = 0; tmp = strstr(ins, rep); ++count) { - ins = tmp + lenRep; - } - - tmp = result = malloc(strlen(orig) + (lenWith - lenRep) * count + 1); - - if(!result) { - return NULL; - } - char *originalPointer = orig; // copying original pointer to free the memory - // first time through the loop, all the variable are set correctly - // from here on, - // tmp points to the end of the result string - // ins points to the next occurrence of rep in orig - // orig points to the remainder of orig after "end of rep" - while(count--) { - ins = strstr(orig, rep); - lenFront = ins - orig; - tmp = strncpy(tmp, orig, lenFront) + lenFront; - tmp = strcpy(tmp, with) + lenWith; - orig += lenFront + lenRep; // move to next "end of rep" - } - strcpy(tmp, orig); - free(originalPointer); - return result; + char *result; // the return string + char *ins; // the next insert point + char *tmp; // varies + int lenRep; // length of rep (the string to remove) + int lenWith; // length of with (the string to replace rep with) + int lenFront; // distance between rep and end of last rep + int count; // number of replacements + + // sanity checks and initialization + if(!orig || !rep) + { + return NULL; + } + lenRep = strlen(rep); + if(lenRep == 0) { + return NULL; // empty rep causes infinite loop during count + } + if(!with) { + with = ""; + } + lenWith = strlen(with); + + // count the number of replacements needed + ins = orig; + for(count = 0; tmp = strstr(ins, rep); ++count) { + ins = tmp + lenRep; + } + + tmp = result = malloc(strlen(orig) + (lenWith - lenRep) * count + 1); + + if(!result) { + return NULL; + } + char *originalPointer = orig; // copying original pointer to free the memory + // first time through the loop, all the variable are set correctly + // from here on, + // tmp points to the end of the result string + // ins points to the next occurrence of rep in orig + // orig points to the remainder of orig after "end of rep" + while(count--) { + ins = strstr(orig, rep); + lenFront = ins - orig; + tmp = strncpy(tmp, orig, lenFront) + lenFront; + tmp = strcpy(tmp, with) + lenWith; + orig += lenFront + lenRep; // move to next "end of rep" + } + strcpy(tmp, orig); + free(originalPointer); + return result; } -char *sbi_base64encode(const void *b64_encode_this, - int encode_this_many_bytes) { +char *sbi_base64encode (const void *b64_encode_this, int encode_this_many_bytes){ #ifdef OPENSSL - BIO *b64_bio, *mem_bio; // Declares two OpenSSL BIOs: a base64 filter and a memory BIO. - BUF_MEM *mem_bio_mem_ptr; // Pointer to a "memory BIO" structure holding our base64 data. - b64_bio = BIO_new(BIO_f_base64()); // Initialize our base64 filter BIO. - mem_bio = BIO_new(BIO_s_mem()); // Initialize our memory sink BIO. - BIO_push(b64_bio, mem_bio); // Link the BIOs by creating a filter-sink BIO chain. - BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); // No newlines every 64 characters or less. - BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); // Records base64 encoded data. - BIO_flush(b64_bio); // Flush data. Necessary for b64 encoding, because of pad characters. - BIO_get_mem_ptr(mem_bio, &mem_bio_mem_ptr); // Store address of mem_bio's memory structure. - BIO_set_close(mem_bio, BIO_NOCLOSE); // Permit access to mem_ptr after BIOs are destroyed. - BIO_free_all(b64_bio); // Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). - BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); // Makes space for end null. - (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; // Adds null-terminator to tail. - return (*mem_bio_mem_ptr).data; // Returns base-64 encoded data. (See: "buf_mem_st" struct). + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + BUF_MEM *mem_bio_mem_ptr; //Pointer to a "memory BIO" structure holding our base64 data. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory sink BIO. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-sink BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //No newlines every 64 characters or less. + BIO_write(b64_bio, b64_encode_this, encode_this_many_bytes); //Records base64 encoded data. + BIO_flush(b64_bio); //Flush data. Necessary for b64 encoding, because of pad characters. + BIO_get_mem_ptr(mem_bio, &mem_bio_mem_ptr); //Store address of mem_bio's memory structure. + BIO_set_close(mem_bio, BIO_NOCLOSE); //Permit access to mem_ptr after BIOs are destroyed. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + BUF_MEM_grow(mem_bio_mem_ptr, (*mem_bio_mem_ptr).length + 1); //Makes space for end null. + (*mem_bio_mem_ptr).data[(*mem_bio_mem_ptr).length] = '\0'; //Adds null-terminator to tail. + return (*mem_bio_mem_ptr).data; //Returns base-64 encoded data. (See: "buf_mem_st" struct). #endif } -char *sbi_base64decode(const void *b64_decode_this, - int decode_this_many_bytes) { +char *sbi_base64decode (const void *b64_decode_this, int decode_this_many_bytes){ #ifdef OPENSSL - BIO *b64_bio, *mem_bio; // Declares two OpenSSL BIOs: a base64 filter and a memory BIO. - char *base64_decoded = calloc( (decode_this_many_bytes * 3) / 4 + 1, - sizeof(char) ); // +1 = null. - b64_bio = BIO_new(BIO_f_base64()); // Initialize our base64 filter BIO. - mem_bio = BIO_new(BIO_s_mem()); // Initialize our memory source BIO. - BIO_write(mem_bio, b64_decode_this, decode_this_many_bytes); // Base64 data saved in source. - BIO_push(b64_bio, mem_bio); // Link the BIOs by creating a filter-source BIO chain. - BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); // Don't require trailing newlines. - int decoded_byte_index = 0; // Index where the next base64_decoded byte should be written. - while(0 < BIO_read(b64_bio, base64_decoded + decoded_byte_index, 1) ) { // Read byte-by-byte. - decoded_byte_index++; // Increment the index until read of BIO decoded data is complete. - } // Once we're done reading decoded data, BIO_read returns -1 even though there's no error. - BIO_free_all(b64_bio); // Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). - return base64_decoded; // Returns base-64 decoded data with trailing null terminator. + BIO *b64_bio, *mem_bio; //Declares two OpenSSL BIOs: a base64 filter and a memory BIO. + char *base64_decoded = calloc( (decode_this_many_bytes*3)/4+1, sizeof(char) ); //+1 = null. + b64_bio = BIO_new(BIO_f_base64()); //Initialize our base64 filter BIO. + mem_bio = BIO_new(BIO_s_mem()); //Initialize our memory source BIO. + BIO_write(mem_bio, b64_decode_this, decode_this_many_bytes); //Base64 data saved in source. + BIO_push(b64_bio, mem_bio); //Link the BIOs by creating a filter-source BIO chain. + BIO_set_flags(b64_bio, BIO_FLAGS_BASE64_NO_NL); //Don't require trailing newlines. + int decoded_byte_index = 0; //Index where the next base64_decoded byte should be written. + while ( 0 < BIO_read(b64_bio, base64_decoded+decoded_byte_index, 1) ){ //Read byte-by-byte. + decoded_byte_index++; //Increment the index until read of BIO decoded data is complete. + } //Once we're done reading decoded data, BIO_read returns -1 even though there's no error. + BIO_free_all(b64_bio); //Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + return base64_decoded; //Returns base-64 decoded data with trailing null terminator. #endif } diff --git a/samples/client/petstore/c/src/apiKey.c b/samples/client/petstore/c/src/apiKey.c index a7e000eb3b15..2bf8fc3e9d06 100644 --- a/samples/client/petstore/c/src/apiKey.c +++ b/samples/client/petstore/c/src/apiKey.c @@ -3,12 +3,12 @@ #include "../include/keyValuePair.h" keyValuePair_t *keyValuePair_create(char *key, void *value) { - keyValuePair_t *keyValuePair = malloc(sizeof(keyValuePair_t)); - keyValuePair->key = key; - keyValuePair->value = value; - return keyValuePair; + keyValuePair_t *keyValuePair = malloc(sizeof(keyValuePair_t)); + keyValuePair->key = key; + keyValuePair->value = value; + return keyValuePair; } void keyValuePair_free(keyValuePair_t *keyValuePair) { - free(keyValuePair); + free(keyValuePair); } diff --git a/samples/client/petstore/c/src/list.c b/samples/client/petstore/c/src/list.c index dc3f78dab764..73eee13c24d4 100644 --- a/samples/client/petstore/c/src/list.c +++ b/samples/client/petstore/c/src/list.c @@ -4,161 +4,163 @@ #include "../include/list.h" static listEntry_t *listEntry_create(void *data) { - listEntry_t *createdListEntry = malloc(sizeof(listEntry_t)); - if(createdListEntry == NULL) { - // TODO Malloc Failure - return NULL; - } - createdListEntry->data = data; - - return createdListEntry; + listEntry_t *createdListEntry = malloc(sizeof(listEntry_t)); + if(createdListEntry == NULL) { + // TODO Malloc Failure + return NULL; + } + createdListEntry->data = data; + + return createdListEntry; } void listEntry_free(listEntry_t *listEntry, void *additionalData) { - free(listEntry); + free(listEntry); } void listEntry_printAsInt(listEntry_t *listEntry, void *additionalData) { - printf("%i\n", *((int *) (listEntry->data))); + printf("%i\n", *((int *) (listEntry->data))); } list_t *list_create() { - list_t *createdList = malloc(sizeof(list_t)); - if(createdList == NULL) { - // TODO Malloc Failure - return NULL; - } - createdList->firstEntry = NULL; - createdList->lastEntry = NULL; - createdList->count = 0; - - return createdList; + list_t *createdList = malloc(sizeof(list_t)); + if(createdList == NULL) { + // TODO Malloc Failure + return NULL; + } + createdList->firstEntry = NULL; + createdList->lastEntry = NULL; + createdList->count = 0; + + return createdList; } -void list_iterateThroughListForward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *callbackFunctionUsedData), +void list_iterateThroughListForward(list_t *list, + void (*operationToPerform)( + listEntry_t *, + void *callbackFunctionUsedData), void *additionalDataNeededForCallbackFunction) { - listEntry_t *currentListEntry = list->firstEntry; - listEntry_t *nextListEntry; + listEntry_t *currentListEntry = list->firstEntry; + listEntry_t *nextListEntry; - if(currentListEntry == NULL) { - return; - } + if(currentListEntry == NULL) { + return; + } - nextListEntry = currentListEntry->nextListEntry; + nextListEntry = currentListEntry->nextListEntry; - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; - while(currentListEntry != NULL) { - nextListEntry = currentListEntry->nextListEntry; - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; - } + while(currentListEntry != NULL) { + nextListEntry = currentListEntry->nextListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + } } -void list_iterateThroughListBackward(list_t *list, void (*operationToPerform)( - listEntry_t *, - void *callbackFunctionUsedData), +void list_iterateThroughListBackward(list_t *list, + void (*operationToPerform)( + listEntry_t *, + void *callbackFunctionUsedData), void *additionalDataNeededForCallbackFunction) { - listEntry_t *currentListEntry = list->lastEntry; - listEntry_t *nextListEntry = currentListEntry->prevListEntry; - - if(currentListEntry == NULL) { - return; - } - - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; - - while(currentListEntry != NULL) { - nextListEntry = currentListEntry->prevListEntry; - operationToPerform(currentListEntry, - additionalDataNeededForCallbackFunction); - currentListEntry = nextListEntry; - } + listEntry_t *currentListEntry = list->lastEntry; + listEntry_t *nextListEntry = currentListEntry->prevListEntry; + + if(currentListEntry == NULL) { + return; + } + + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + + while(currentListEntry != NULL) { + nextListEntry = currentListEntry->prevListEntry; + operationToPerform(currentListEntry, + additionalDataNeededForCallbackFunction); + currentListEntry = nextListEntry; + } } void list_free(list_t *list) { - list_iterateThroughListForward(list, listEntry_free, NULL); - free(list); + list_iterateThroughListForward(list, listEntry_free, NULL); + free(list); } void list_addElement(list_t *list, void *dataToAddInList) { - listEntry_t *newListEntry = listEntry_create(dataToAddInList); - if(newListEntry == NULL) { - // TODO Malloc Failure - return; - } - if(list->firstEntry == NULL) { - list->firstEntry = newListEntry; - list->lastEntry = newListEntry; + listEntry_t *newListEntry = listEntry_create(dataToAddInList); + if(newListEntry == NULL) { + // TODO Malloc Failure + return; + } + if(list->firstEntry == NULL) { + list->firstEntry = newListEntry; + list->lastEntry = newListEntry; - newListEntry->prevListEntry = NULL; - newListEntry->nextListEntry = NULL; + newListEntry->prevListEntry = NULL; + newListEntry->nextListEntry = NULL; - list->count++; + list->count++; - return; - } + return; + } - list->lastEntry->nextListEntry = newListEntry; - newListEntry->prevListEntry = list->lastEntry; - newListEntry->nextListEntry = NULL; - list->lastEntry = newListEntry; + list->lastEntry->nextListEntry = newListEntry; + newListEntry->prevListEntry = list->lastEntry; + newListEntry->nextListEntry = NULL; + list->lastEntry = newListEntry; - list->count++; + list->count++; } void list_removeElement(list_t *list, listEntry_t *elementToRemove) { - listEntry_t *elementBeforeElementToRemove = - elementToRemove->prevListEntry; - listEntry_t *elementAfterElementToRemove = - elementToRemove->nextListEntry; - - if(elementBeforeElementToRemove != NULL) { - elementBeforeElementToRemove->nextListEntry = - elementAfterElementToRemove; - } else { - list->firstEntry = elementAfterElementToRemove; - } - - if(elementAfterElementToRemove != NULL) { - elementAfterElementToRemove->prevListEntry = - elementBeforeElementToRemove; - } else { - list->lastEntry = elementBeforeElementToRemove; - } - - listEntry_free(elementToRemove, NULL); - - list->count--; + listEntry_t *elementBeforeElementToRemove = + elementToRemove->prevListEntry; + listEntry_t *elementAfterElementToRemove = + elementToRemove->nextListEntry; + + if(elementBeforeElementToRemove != NULL) { + elementBeforeElementToRemove->nextListEntry = + elementAfterElementToRemove; + } else { + list->firstEntry = elementAfterElementToRemove; + } + + if(elementAfterElementToRemove != NULL) { + elementAfterElementToRemove->prevListEntry = + elementBeforeElementToRemove; + } else { + list->lastEntry = elementBeforeElementToRemove; + } + + listEntry_free(elementToRemove, NULL); + + list->count--; } listEntry_t *list_getElementAt(list_t *list, long indexOfElement) { - listEntry_t *currentListEntry; + listEntry_t *currentListEntry; - if((list->count / 2) > indexOfElement) { - currentListEntry = list->firstEntry; + if((list->count / 2) > indexOfElement) { + currentListEntry = list->firstEntry; - for(int i = 0; i < indexOfElement; i++) { - currentListEntry = currentListEntry->nextListEntry; - } + for(int i = 0; i < indexOfElement; i++) { + currentListEntry = currentListEntry->nextListEntry; + } - return currentListEntry; - } else { - currentListEntry = list->lastEntry; + return currentListEntry; + } else { + currentListEntry = list->lastEntry; - for(int i = 1; i < (list->count - indexOfElement); i++) { - currentListEntry = currentListEntry->prevListEntry; - } + for(int i = 1; i < (list->count - indexOfElement); i++) { + currentListEntry = currentListEntry->prevListEntry; + } - return currentListEntry; - } + return currentListEntry; + } } diff --git a/samples/client/petstore/clojure/.gitignore b/samples/client/petstore/clojure/.gitignore index 47fed6c20d9b..e3388bed39e4 100644 --- a/samples/client/petstore/clojure/.gitignore +++ b/samples/client/petstore/clojure/.gitignore @@ -1,4 +1,3 @@ -pom.xml pom.xml.asc *jar /lib/ diff --git a/samples/client/petstore/clojure/.openapi-generator/VERSION b/samples/client/petstore/clojure/.openapi-generator/VERSION index afa636560641..e4955748d3e7 100644 --- a/samples/client/petstore/clojure/.openapi-generator/VERSION +++ b/samples/client/petstore/clojure/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/clojure/git_push.sh b/samples/client/petstore/clojure/git_push.sh index 8442b80bb445..ced3be2b0c7b 100644 --- a/samples/client/petstore/clojure/git_push.sh +++ b/samples/client/petstore/clojure/git_push.sh @@ -1,11 +1,17 @@ #!/bin/sh # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # -# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" git_user_id=$1 git_repo_id=$2 release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi if [ "$git_user_id" = "" ]; then git_user_id="GIT_USER_ID" @@ -28,7 +34,7 @@ git init # Adds the files in the local repository and stages them for commit. git add . -# Commits the tracked changes and prepares them to be pushed to a remote repository. +# Commits the tracked changes and prepares them to be pushed to a remote repository. git commit -m "$release_note" # Sets the new remote @@ -37,9 +43,9 @@ if [ "$git_remote" = "" ]; then # git remote not defined if [ "$GIT_TOKEN" = "" ]; then echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git fi fi @@ -47,6 +53,6 @@ fi git pull origin master # Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj index 4dc96302b70a..22154d797a8d 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/pet.clj @@ -15,13 +15,13 @@ (defn-spec add-pet-with-http-info any? "Add a new pet to the store" ([] (add-pet-with-http-info nil)) - ([{:keys [pet]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/pet" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param pet + :body-param body :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) @@ -137,13 +137,13 @@ (defn-spec update-pet-with-http-info any? "Update an existing pet" ([] (update-pet-with-http-info nil)) - ([{:keys [pet]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/pet" :put {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param pet + :body-param body :content-types ["application/json" "application/xml"] :accepts [] :auth-names ["petstore_auth"]}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj index a91c086c3fd4..aa35487c2f55 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/store.clj @@ -86,13 +86,13 @@ (defn-spec place-order-with-http-info any? "Place an order for a pet" ([] (place-order-with-http-info nil)) - ([{:keys [order]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/store/order" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param order + :body-param body :content-types [] :accepts ["application/json" "application/xml"] :auth-names []}))) diff --git a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj index ee758efedcd6..301195b823ad 100644 --- a/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj +++ b/samples/client/petstore/clojure/src/open_api_petstore/api/user.clj @@ -16,13 +16,13 @@ "Create user This can only be done by the logged in user." ([] (create-user-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -41,13 +41,13 @@ (defn-spec create-users-with-array-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-array-input-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user/createWithArray" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -65,13 +65,13 @@ (defn-spec create-users-with-list-input-with-http-info any? "Creates list of users with given input array" ([] (create-users-with-list-input-with-http-info nil)) - ([{:keys [user]} (s/map-of keyword? any?)] + ([{:keys [body]} (s/map-of keyword? any?)] (call-api "/user/createWithList" :post {:path-params {} :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) @@ -180,14 +180,14 @@ "Updated user This can only be done by the logged in user." ([username string?, ] (update-user-with-http-info username nil)) - ([username string?, {:keys [user]} (s/map-of keyword? any?)] + ([username string?, {:keys [body]} (s/map-of keyword? any?)] (check-required-params username) (call-api "/user/{username}" :put {:path-params {"username" username } :header-params {} :query-params {} :form-params {} - :body-param user + :body-param body :content-types [] :accepts [] :auth-names []}))) diff --git a/samples/client/petstore/cpp-qt5/.gitignore b/samples/client/petstore/cpp-qt5/.gitignore deleted file mode 100644 index 378eac25d311..000000000000 --- a/samples/client/petstore/cpp-qt5/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator-ignore b/samples/client/petstore/cpp-qt5/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/cpp-qt5/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION b/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION deleted file mode 100644 index e4955748d3e7..000000000000 --- a/samples/client/petstore/cpp-qt5/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.2.2-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-qt5/CMakeLists.txt b/samples/client/petstore/cpp-qt5/CMakeLists.txt deleted file mode 100644 index 517669ae8062..000000000000 --- a/samples/client/petstore/cpp-qt5/CMakeLists.txt +++ /dev/null @@ -1,29 +0,0 @@ -cmake_minimum_required(VERSION 3.2) - -project(cpp-qt5-petstore) -set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") - -find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) -find_package(Qt5Test REQUIRED) - -file(GLOB SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/PetStore/*.cpp -) - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/client -) - -add_subdirectory(client) -add_executable(${PROJECT_NAME} ${SRCS}) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network Qt5::Test ssl crypto client) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF) - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp deleted file mode 100644 index da684cfc7f59..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.cpp +++ /dev/null @@ -1,189 +0,0 @@ -#include "PetApiTests.h" - -#include -#include - -PFXPet PetApiTests::createRandomPet() { - PFXPet pet; - qint64 id = QDateTime::currentMSecsSinceEpoch(); - pet.setName("monster"); - pet.setId(id); - pet.setStatus("freaky"); - return pet; -} - -void PetApiTests::findPetsByStatusTest() { - PFXPetApi api; - QEventLoop loop; - bool petFound = false; - - connect(&api, &PFXPetApi::findPetsByStatusSignal, [&](QList pets) { - petFound = true; - foreach(PFXPet pet, pets) { - QVERIFY(pet.getStatus().startsWith("available") || pet.getStatus().startsWith("sold")); - } - loop.quit(); - }); - - api.findPetsByStatus({"available", "sold"}); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petFound, "didn't finish within timeout"); -} - -void PetApiTests::createAndGetPetTest() { - PFXPetApi api; - QEventLoop loop; - bool petCreated = false; - - connect(&api, &PFXPetApi::addPetSignal, [&]() { - // pet created - petCreated = true; - loop.quit(); - }); - - PFXPet pet = createRandomPet(); - qint64 id = pet.getId(); - - api.addPet(pet); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petCreated, "didn't finish within timeout"); - - bool petFetched = false; - - connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { - QVERIFY(pet.getId() > 0); - QVERIFY(pet.getStatus().compare("freaky") == 0); - loop.quit(); - petFetched = true; - }); - - api.getPetById(id); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petFetched, "didn't finish within timeout"); -} - -void PetApiTests::updatePetTest() { - PFXPetApi api; - - PFXPet pet = createRandomPet(); - PFXPet petToCheck; - qint64 id = pet.getId(); - QEventLoop loop; - bool petAdded = false; - - connect(&api, &PFXPetApi::addPetSignal, [&](){ - petAdded = true; - loop.quit(); - }); - - // create pet - api.addPet(pet); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petAdded, "didn't finish within timeout"); - - // fetch it - - bool petFetched = false; - connect(&api, &PFXPetApi::getPetByIdSignal, this, [&](PFXPet pet) { - petFetched = true; - petToCheck = pet; - loop.quit(); - }); - - // create pet - api.getPetById(id); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petFetched, "didn't finish within timeout"); - - // update it - bool petUpdated = false; - connect(&api, &PFXPetApi::updatePetSignal, [&]() { - petUpdated = true; - loop.quit(); - }); - - // update pet - petToCheck.setStatus(QString("scary")); - api.updatePet(petToCheck); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petUpdated, "didn't finish within timeout"); - - // check it - bool petFetched2 = false; - connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { - petFetched2 = true; - QVERIFY(pet.getId() == petToCheck.getId()); - QVERIFY(pet.getStatus().compare(petToCheck.getStatus()) == 0); - loop.quit(); - }); - api.getPetById(id); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petFetched2, "didn't finish within timeout"); -} - -void PetApiTests::updatePetWithFormTest() { - PFXPetApi api; - - PFXPet pet = createRandomPet(); - PFXPet petToCheck; - qint64 id = pet.getId(); - QEventLoop loop; - - // create pet - bool petAdded = false; - connect(&api, &PFXPetApi::addPetSignal, [&](){ - petAdded = true; - loop.quit(); - }); - - api.addPet(pet); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petAdded, "didn't finish within timeout"); - - // fetch it - bool petFetched = false; - connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { - petFetched = true; - petToCheck = pet; - loop.quit(); - }); - - api.getPetById(id); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petFetched, "didn't finish within timeout"); - - // update it - bool petUpdated = false; - connect(&api, &PFXPetApi::updatePetWithFormSignal, [&](){ - petUpdated = true; - loop.quit(); - }); - - QString name("gorilla"); - api.updatePetWithForm(id, name, nullptr); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petUpdated, "didn't finish within timeout"); - - // fetch it - bool petUpdated2 = false; - connect(&api, &PFXPetApi::getPetByIdSignal, [&](PFXPet pet) { - petUpdated2 = true; - QVERIFY(pet.getName().compare(QString("gorilla")) == 0); - loop.quit(); - }); - - api.getPetById(id); - QTimer::singleShot(5000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(petUpdated2, "didn't finish within timeout"); -} diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h b/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h deleted file mode 100644 index ec126905cf53..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/PetApiTests.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "../client/PFXPetApi.h" - -using namespace test_namespace; - -class PetApiTests: public QObject { - Q_OBJECT - - PFXPet createRandomPet(); - -private slots: - void findPetsByStatusTest(); - void createAndGetPetTest(); - void updatePetTest(); - void updatePetWithFormTest(); -}; diff --git a/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro b/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro deleted file mode 100644 index 88d64d639582..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/PetStore.pro +++ /dev/null @@ -1,31 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2015-05-14T20:56:31 -# -#------------------------------------------------- - -QT += core gui testlib network - -QT -= gui - -TARGET = PetStore -CONFIG += console -CONFIG -= app_bundle - -CONFIG += c++11 - -TEMPLATE = app - -include(../client/PFXclient.pri) - -SOURCES += main.cpp \ - PetApiTests.cpp \ - StoreApiTests.cpp \ - UserApiTests.cpp - -HEADERS += PetApiTests.h \ - StoreApiTests.h \ - UserApiTests.h - -# Disable optimisation for better valgrind report -QMAKE_CXXFLAGS_DEBUG += -O0 diff --git a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp deleted file mode 100644 index 282d40cac10e..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.cpp +++ /dev/null @@ -1,73 +0,0 @@ -#include "StoreApiTests.h" - -#include -#include -#include - -void StoreApiTests::placeOrderTest() { - PFXStoreApi api; - QEventLoop loop; - bool orderPlaced = false; - - connect(&api, &PFXStoreApi::placeOrderSignal, [&](PFXOrder order) { - orderPlaced = true; - QVERIFY(order.getPetId() == 10000); - QVERIFY((order.getId() == 500)); - qDebug() << order.getShipDate(); - loop.quit(); - }); - connect(&api, &PFXStoreApi::placeOrderSignalE, [&](){ - QFAIL("shouldn't trigger error"); - loop.quit(); - }); - - PFXOrder order; - order.setId(500); - order.setQuantity(10); - order.setPetId(10000); - order.setComplete(false); - order.setStatus("shipping"); - order.setShipDate(QDateTime::currentDateTime()); - api.placeOrder(order); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(orderPlaced, "didn't finish within timeout"); -} - -void StoreApiTests::getOrderByIdTest() { - PFXStoreApi api; - QEventLoop loop; - bool orderFetched = false; - - connect(&api, &PFXStoreApi::getOrderByIdSignal, [&](PFXOrder order) { - orderFetched = true; - QVERIFY(order.getPetId() == 10000); - QVERIFY((order.getId() == 500)); - qDebug() << order.getShipDate(); - loop.quit(); - }); - - api.getOrderById(500); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(orderFetched, "didn't finish within timeout"); -} - -void StoreApiTests::getInventoryTest() { - PFXStoreApi api; - QEventLoop loop; - bool inventoryFetched = false; - - connect(&api, &PFXStoreApi::getInventorySignal, [&](QMap status) { - inventoryFetched = true; - for(const auto& key : status.keys()) { - qDebug() << (key) << " Quantities " << status.value(key); - } - loop.quit(); - }); - - api.getInventory(); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(inventoryFetched, "didn't finish within timeout"); -} diff --git a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h b/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h deleted file mode 100644 index 440bf181c54a..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/StoreApiTests.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include "../client/PFXStoreApi.h" - -using namespace test_namespace; - -class StoreApiTests: public QObject { - Q_OBJECT - -private slots: - void placeOrderTest(); - void getOrderByIdTest(); - void getInventoryTest(); -}; diff --git a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp deleted file mode 100644 index c047724372a9..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.cpp +++ /dev/null @@ -1,163 +0,0 @@ -#include "UserApiTests.h" - -#include -#include -#include - -PFXUser UserApiTests::createRandomUser() { - PFXUser user; - user.setId(QDateTime::currentMSecsSinceEpoch()); - user.setEmail("Jane.Doe@openapitools.io"); - user.setFirstName("Jane"); - user.setLastName("Doe"); - user.setPhone("123456789"); - user.setUsername("janedoe"); - user.setPassword("secretPassword"); - user.setUserStatus(static_cast(rand())); - return user; -} - -void UserApiTests::createUserTest(){ - PFXUserApi api; - QEventLoop loop; - bool userCreated = false; - - connect(&api, &PFXUserApi::createUserSignal, [&](){ - userCreated = true; - loop.quit(); - }); - - api.createUser(createRandomUser()); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(userCreated, "didn't finish within timeout"); -} - -void UserApiTests::createUsersWithArrayInputTest(){ - PFXUserApi api; - QEventLoop loop; - bool usersCreated = false; - - connect(&api, &PFXUserApi::createUsersWithArrayInputSignal, [&](){ - usersCreated = true; - loop.quit(); - }); - - QList users; - users.append(createRandomUser()); - users.append(createRandomUser()); - users.append(createRandomUser()); - api.createUsersWithArrayInput(users); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(usersCreated, "didn't finish within timeout"); -} - -void UserApiTests::createUsersWithListInputTest(){ - PFXUserApi api; - QEventLoop loop; - bool usersCreated = false; - - connect(&api, &PFXUserApi::createUsersWithListInputSignal, [&](){ - usersCreated = true; - loop.quit(); - }); - - QList users; - auto johndoe = createRandomUser(); - johndoe.setUsername("johndoe"); - auto rambo = createRandomUser(); - rambo.setUsername("rambo"); - users.append(johndoe); - users.append(rambo); - users.append(createRandomUser()); - api.createUsersWithListInput(users); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(usersCreated, "didn't finish within timeout"); -} - -void UserApiTests::deleteUserTest(){ - PFXUserApi api; - QEventLoop loop; - bool userDeleted = false; - - connect(&api, &PFXUserApi::deleteUserSignal, [&](){ - userDeleted = true; - loop.quit(); - }); - - api.deleteUser("rambo"); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(userDeleted, "didn't finish within timeout"); -} - -void UserApiTests::getUserByNameTest(){ - PFXUserApi api; - QEventLoop loop; - bool userFetched = false; - - connect(&api, &PFXUserApi::getUserByNameSignal, [&](PFXUser summary) { - userFetched = true; - qDebug() << summary.getUsername(); - QVERIFY(summary.getUsername() == "johndoe"); - loop.quit(); - }); - - api.getUserByName("johndoe"); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(userFetched, "didn't finish within timeout"); -} - -void UserApiTests::loginUserTest(){ - PFXUserApi api; - QEventLoop loop; - bool userLogged = false; - - connect(&api, &PFXUserApi::loginUserSignal, [&](QString summary) { - userLogged = true; - qDebug() << summary; - loop.quit(); - }); - - api.loginUser("johndoe", "123456789"); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(userLogged, "didn't finish within timeout"); -} - -void UserApiTests::logoutUserTest(){ - PFXUserApi api; - QEventLoop loop; - bool userLoggedOut = false; - - connect(&api, &PFXUserApi::logoutUserSignal, [&](){ - userLoggedOut = true; - loop.quit(); - }); - - api.logoutUser(); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(userLoggedOut, "didn't finish within timeout"); -} - -void UserApiTests::updateUserTest(){ - PFXUserApi api; - QEventLoop loop; - bool userUpdated = false; - - connect(&api, &PFXUserApi::updateUserSignal, [&]() { - userUpdated = true; - loop.quit(); - }); - - auto johndoe = createRandomUser(); - johndoe.setUsername("johndoe"); - api.updateUser("johndoe", johndoe); - QTimer::singleShot(14000, &loop, &QEventLoop::quit); - loop.exec(); - QVERIFY2(userUpdated, "didn't finish within timeout"); -} diff --git a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h b/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h deleted file mode 100644 index 3cfd25bd8fe2..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/UserApiTests.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "../client/PFXUserApi.h" - -using namespace test_namespace; - -class UserApiTests: public QObject { - Q_OBJECT - - PFXUser createRandomUser(); - -private slots: - void createUserTest(); - void createUsersWithArrayInputTest(); - void createUsersWithListInputTest(); - void deleteUserTest(); - void getUserByNameTest(); - void loginUserTest(); - void logoutUserTest(); - void updateUserTest(); -}; diff --git a/samples/client/petstore/cpp-qt5/PetStore/main.cpp b/samples/client/petstore/cpp-qt5/PetStore/main.cpp deleted file mode 100644 index af23f1652a87..000000000000 --- a/samples/client/petstore/cpp-qt5/PetStore/main.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include -#include - -#include "PetApiTests.h" -#include "StoreApiTests.h" -#include "UserApiTests.h" - -int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); - PetApiTests petApiTests; - StoreApiTests storeApiTests; - UserApiTests userApiTests; - int failedTests = 0; - - failedTests += QTest::qExec(&petApiTests); - failedTests += QTest::qExec(&storeApiTests); - failedTests += QTest::qExec(&userApiTests); - - return failedTests; -} diff --git a/samples/client/petstore/cpp-qt5/build-and-test.bash b/samples/client/petstore/cpp-qt5/build-and-test.bash deleted file mode 100755 index bcf96489533f..000000000000 --- a/samples/client/petstore/cpp-qt5/build-and-test.bash +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -e -# export RUN_VALGRIND_TESTS=TRUE - -mkdir -p build -cd build - -cmake .. - -make - -if [[ -z "${RUN_VALGRIND_TESTS}" ]]; then - echo "Running Qt5 Petstore Tests" - ./cpp-qt5-petstore -else - echo "Running Qt5 Petstore Tests with Valgrind" - valgrind --leak-check=full ./cpp-qt5-petstore |& tee result.log || exit 1 - testCount=$(cat result.log | grep 'Finished testing of' | wc -l) - if [ $testCount == 3 ] - then - echo "Ok" - else - echo "The tests were not run!!!" - exit 1 - fi - - echo "Make sure the tests passed:" - successCount=$(cat result.log | grep '0 failed' | wc -l) - if [ $successCount == 3 ] - then - echo "Ok" - else - echo "The tests failed!!!" - exit 1 - fi - - echo "Check if no memory leaks occured:" - leakCount=$(cat result.log | grep 'lost: 0 bytes in 0 blocks' | wc -l) - if [ $leakCount == 3 ] - then - echo "Ok" - else - echo "There was memory leaks!!!" - exit 1 - fi -fi - diff --git a/samples/client/petstore/cpp-qt5/client/CMakeLists.txt b/samples/client/petstore/cpp-qt5/client/CMakeLists.txt deleted file mode 100644 index c53100cca69b..000000000000 --- a/samples/client/petstore/cpp-qt5/client/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.2) - -project(client) -set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-unused-variable") - -find_package(Qt5Core REQUIRED) -find_package(Qt5Network REQUIRED) - -file(GLOB SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp -) - -add_library(${PROJECT_NAME} ${SRCS}) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Core Qt5::Network ssl crypto) - -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_EXTENSIONS OFF) - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp deleted file mode 100644 index 81438054c73a..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PFXApiResponse.h" - -#include -#include -#include -#include - -#include "PFXHelpers.h" - -namespace test_namespace { - -PFXApiResponse::PFXApiResponse(QString json) { - this->initializeModel(); - this->fromJson(json); -} - -PFXApiResponse::PFXApiResponse() { - this->initializeModel(); -} - -PFXApiResponse::~PFXApiResponse() { - -} - -void -PFXApiResponse::initializeModel() { - - m_code_isSet = false; - m_code_isValid = false; - - m_type_isSet = false; - m_type_isValid = false; - - m_message_isSet = false; - m_message_isValid = false; - -} - -void -PFXApiResponse::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); -} - -void -PFXApiResponse::fromJsonObject(QJsonObject json) { - - m_code_isValid = ::test_namespace::fromJsonValue(code, json[QString("code")]); - m_code_isSet = !json[QString("code")].isNull() && m_code_isValid; - - m_type_isValid = ::test_namespace::fromJsonValue(type, json[QString("type")]); - m_type_isSet = !json[QString("type")].isNull() && m_type_isValid; - - m_message_isValid = ::test_namespace::fromJsonValue(message, json[QString("message")]); - m_message_isSet = !json[QString("message")].isNull() && m_message_isValid; - -} - -QString -PFXApiResponse::asJson () const { - QJsonObject obj = this->asJsonObject(); - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); -} - -QJsonObject -PFXApiResponse::asJsonObject() const { - QJsonObject obj; - if(m_code_isSet){ - obj.insert(QString("code"), ::test_namespace::toJsonValue(code)); - } - if(m_type_isSet){ - obj.insert(QString("type"), ::test_namespace::toJsonValue(type)); - } - if(m_message_isSet){ - obj.insert(QString("message"), ::test_namespace::toJsonValue(message)); - } - return obj; -} - - -qint32 -PFXApiResponse::getCode() const { - return code; -} -void -PFXApiResponse::setCode(const qint32 &code) { - this->code = code; - this->m_code_isSet = true; -} - - -QString -PFXApiResponse::getType() const { - return type; -} -void -PFXApiResponse::setType(const QString &type) { - this->type = type; - this->m_type_isSet = true; -} - - -QString -PFXApiResponse::getMessage() const { - return message; -} -void -PFXApiResponse::setMessage(const QString &message) { - this->message = message; - this->m_message_isSet = true; -} - -bool -PFXApiResponse::isSet() const { - bool isObjectUpdated = false; - do{ - if(m_code_isSet){ isObjectUpdated = true; break;} - - if(m_type_isSet){ isObjectUpdated = true; break;} - - if(m_message_isSet){ isObjectUpdated = true; break;} - }while(false); - return isObjectUpdated; -} - -bool -PFXApiResponse::isValid() const { - // only required properties are required for the object to be considered valid - return true; -} - -} - diff --git a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h b/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h deleted file mode 100644 index 77f5765b2a8e..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXApiResponse.h +++ /dev/null @@ -1,82 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PFXApiResponse.h - * - * Describes the result of uploading an image resource - */ - -#ifndef PFXApiResponse_H -#define PFXApiResponse_H - -#include - - -#include - -#include "PFXObject.h" -#include "PFXEnum.h" - - -namespace test_namespace { - -class PFXApiResponse: public PFXObject { -public: - PFXApiResponse(); - PFXApiResponse(QString json); - ~PFXApiResponse() override; - - QString asJson () const override; - QJsonObject asJsonObject() const override; - void fromJsonObject(QJsonObject json) override; - void fromJson(QString jsonString) override; - - - qint32 getCode() const; - void setCode(const qint32 &code); - - - QString getType() const; - void setType(const QString &type); - - - QString getMessage() const; - void setMessage(const QString &message); - - - - virtual bool isSet() const override; - virtual bool isValid() const override; - -private: - void initializeModel(); - - qint32 code; - bool m_code_isSet; - bool m_code_isValid; - - QString type; - bool m_type_isSet; - bool m_type_isValid; - - QString message; - bool m_message_isSet; - bool m_message_isValid; - - }; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXApiResponse) - -#endif // PFXApiResponse_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp b/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp deleted file mode 100644 index 5b1404cd7dc9..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXCategory.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PFXCategory.h" - -#include -#include -#include -#include - -#include "PFXHelpers.h" - -namespace test_namespace { - -PFXCategory::PFXCategory(QString json) { - this->initializeModel(); - this->fromJson(json); -} - -PFXCategory::PFXCategory() { - this->initializeModel(); -} - -PFXCategory::~PFXCategory() { - -} - -void -PFXCategory::initializeModel() { - - m_id_isSet = false; - m_id_isValid = false; - - m_name_isSet = false; - m_name_isValid = false; - -} - -void -PFXCategory::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); -} - -void -PFXCategory::fromJsonObject(QJsonObject json) { - - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); - m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - - m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); - m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; - -} - -QString -PFXCategory::asJson () const { - QJsonObject obj = this->asJsonObject(); - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); -} - -QJsonObject -PFXCategory::asJsonObject() const { - QJsonObject obj; - if(m_id_isSet){ - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); - } - if(m_name_isSet){ - obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); - } - return obj; -} - - -qint64 -PFXCategory::getId() const { - return id; -} -void -PFXCategory::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; -} - - -QString -PFXCategory::getName() const { - return name; -} -void -PFXCategory::setName(const QString &name) { - this->name = name; - this->m_name_isSet = true; -} - -bool -PFXCategory::isSet() const { - bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_name_isSet){ isObjectUpdated = true; break;} - }while(false); - return isObjectUpdated; -} - -bool -PFXCategory::isValid() const { - // only required properties are required for the object to be considered valid - return true; -} - -} - diff --git a/samples/client/petstore/cpp-qt5/client/PFXCategory.h b/samples/client/petstore/cpp-qt5/client/PFXCategory.h deleted file mode 100644 index 6bfe71d7a747..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXCategory.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PFXCategory.h - * - * A category for a pet - */ - -#ifndef PFXCategory_H -#define PFXCategory_H - -#include - - -#include - -#include "PFXObject.h" -#include "PFXEnum.h" - - -namespace test_namespace { - -class PFXCategory: public PFXObject { -public: - PFXCategory(); - PFXCategory(QString json); - ~PFXCategory() override; - - QString asJson () const override; - QJsonObject asJsonObject() const override; - void fromJsonObject(QJsonObject json) override; - void fromJson(QString jsonString) override; - - - qint64 getId() const; - void setId(const qint64 &id); - - - QString getName() const; - void setName(const QString &name); - - - - virtual bool isSet() const override; - virtual bool isValid() const override; - -private: - void initializeModel(); - - qint64 id; - bool m_id_isSet; - bool m_id_isValid; - - QString name; - bool m_name_isSet; - bool m_name_isValid; - - }; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXCategory) - -#endif // PFXCategory_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXEnum.h b/samples/client/petstore/cpp-qt5/client/PFXEnum.h deleted file mode 100644 index 9f3c93282551..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXEnum.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_ENUM_H -#define PFX_ENUM_H - -#include -#include -#include - -namespace test_namespace { - -class PFXEnum { - public: - PFXEnum() { - - } - - PFXEnum(QString jsonString) { - fromJson(jsonString); - } - - virtual ~PFXEnum(){ - - } - - virtual QJsonValue asJsonValue() const { - return QJsonValue(jstr); - } - - virtual QString asJson() const { - return jstr; - } - - virtual void fromJson(QString jsonString) { - jstr = jsonString; - } - - virtual void fromJsonValue(QJsonValue jval) { - jstr = jval.toString(); - } - - virtual bool isSet() const { - return false; - } - - virtual bool isValid() const { - return true; - } -private : - QString jstr; -}; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXEnum) - -#endif // PFX_ENUM_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp b/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp deleted file mode 100644 index 15ed5d0c1bfd..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXHelpers.cpp +++ /dev/null @@ -1,377 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include -#include "PFXHelpers.h" - - -namespace test_namespace { - - -QString -toStringValue(const QString &value) { - return value; -} - -QString -toStringValue(const QDateTime &value){ - // ISO 8601 - return value.toString("yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); -} - -QString -toStringValue(const QByteArray &value){ - return QString(value); -} - -QString -toStringValue(const QDate &value){ - // ISO 8601 - return value.toString(Qt::DateFormat::ISODate); -} - -QString -toStringValue(const qint32 &value) { - return QString::number(value); -} - -QString -toStringValue(const qint64 &value) { - return QString::number(value); -} - -QString -toStringValue(const bool &value) { - return QString(value ? "true" : "false"); -} - -QString -toStringValue(const float &value){ - return QString::number(static_cast(value)); -} - -QString -toStringValue(const double &value){ - return QString::number(value); -} - -QString -toStringValue(const PFXObject &value){ - return value.asJson(); -} - - -QString -toStringValue(const PFXEnum &value){ - return value.asJson(); -} - -QString -toStringValue(const PFXHttpFileElement &value){ - return value.asJson(); -} - - -QJsonValue -toJsonValue(const QString &value){ - return QJsonValue(value); -} - -QJsonValue -toJsonValue(const QDateTime &value){ - return QJsonValue(value.toString(Qt::ISODate)); -} - -QJsonValue -toJsonValue(const QByteArray &value){ - return QJsonValue(QString(value.toBase64())); -} - -QJsonValue -toJsonValue(const QDate &value){ - return QJsonValue(value.toString(Qt::ISODate)); -} - -QJsonValue -toJsonValue(const qint32 &value){ - return QJsonValue(value); -} - -QJsonValue -toJsonValue(const qint64 &value){ - return QJsonValue(value); -} - -QJsonValue -toJsonValue(const bool &value){ - return QJsonValue(value); -} - -QJsonValue -toJsonValue(const float &value){ - return QJsonValue(static_cast(value)); -} - -QJsonValue -toJsonValue(const double &value){ - return QJsonValue(value); -} - -QJsonValue -toJsonValue(const PFXObject &value){ - return value.asJsonObject(); -} - -QJsonValue -toJsonValue(const PFXEnum &value){ - return value.asJsonValue(); -} - -QJsonValue -toJsonValue(const PFXHttpFileElement &value){ - return value.asJsonValue(); -} - - -bool -fromStringValue(const QString &inStr, QString &value){ - value.clear(); - value.append(inStr); - return !inStr.isEmpty(); -} - -bool -fromStringValue(const QString &inStr, QDateTime &value){ - if(inStr.isEmpty()){ - return false; - } - else{ - auto dateTime = QDateTime::fromString(inStr, "yyyy-MM-ddTHH:mm:ss[Z|[+|-]HH:mm]"); - if(dateTime.isValid()){ - value.setDate(dateTime.date()); - value.setTime(dateTime.time()); - } - else{ - qDebug() << "DateTime is invalid"; - } - return dateTime.isValid(); - } -} - -bool -fromStringValue(const QString &inStr, QByteArray &value){ - if(inStr.isEmpty()){ - return false; - } - else{ - value.clear(); - value.append(inStr.toUtf8()); - return value.count() > 0; - } -} - -bool -fromStringValue(const QString &inStr, QDate &value){ - if(inStr.isEmpty()){ - return false; - } - else{ - auto date = QDate::fromString(inStr, Qt::DateFormat::ISODate); - if(date.isValid()){ - value.setDate(date.year(), date.month(), date.day()); - } - else{ - qDebug() << "Date is invalid"; - } - return date.isValid(); - } -} - -bool -fromStringValue(const QString &inStr, qint32 &value){ - bool ok = false; - value = QVariant(inStr).toInt(&ok); - return ok; -} - -bool -fromStringValue(const QString &inStr, qint64 &value){ - bool ok = false; - value = QVariant(inStr).toLongLong(&ok); - return ok; -} - -bool -fromStringValue(const QString &inStr, bool &value){ - value = QVariant(inStr).toBool(); - return ((inStr == "true") || (inStr == "false")); -} - -bool -fromStringValue(const QString &inStr, float &value){ - bool ok = false; - value = QVariant(inStr).toFloat(&ok); - return ok; -} - -bool -fromStringValue(const QString &inStr, double &value){ - bool ok = false; - value = QVariant(inStr).toDouble(&ok); - return ok; -} - -bool -fromStringValue(const QString &inStr, PFXEnum &value){ - value.fromJson(inStr); - return true; -} - -bool -fromStringValue(const QString &inStr, PFXHttpFileElement &value){ - return value.fromStringValue(inStr); -} - -bool -fromJsonValue(QString &value, const QJsonValue &jval){ - bool ok = true; - if(!jval.isUndefined() && !jval.isNull()){ - if(jval.isString()){ - value = jval.toString(); - } else if(jval.isBool()) { - value = jval.toBool() ? "true" : "false"; - } else if(jval.isDouble()){ - value = QString::number(jval.toDouble()); - } else { - ok = false; - } - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(QDateTime &value, const QJsonValue &jval){ - bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ - value = QDateTime::fromString(jval.toString(), Qt::ISODate); - ok = value.isValid(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(QByteArray &value, const QJsonValue &jval){ - bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()) { - value = QByteArray::fromBase64(QByteArray::fromStdString(jval.toString().toStdString())); - ok = value.size() > 0 ; - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(QDate &value, const QJsonValue &jval){ - bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && jval.isString()){ - value = QDate::fromString(jval.toString(), Qt::ISODate); - ok = value.isValid(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(qint32 &value, const QJsonValue &jval){ - bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ - value = jval.toInt(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(qint64 &value, const QJsonValue &jval){ - bool ok = true; - if(!jval.isUndefined() && !jval.isNull() && !jval.isObject() && !jval.isArray()){ - value = jval.toVariant().toLongLong(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(bool &value, const QJsonValue &jval){ - bool ok = true; - if(jval.isBool()){ - value = jval.toBool(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(float &value, const QJsonValue &jval){ - bool ok = true; - if(jval.isDouble()){ - value = static_cast(jval.toDouble()); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(double &value, const QJsonValue &jval){ - bool ok = true; - if(jval.isDouble()){ - value = jval.toDouble(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(PFXObject &value, const QJsonValue &jval){ - bool ok = true; - if(jval.isObject()){ - value.fromJsonObject(jval.toObject()); - ok = value.isValid(); - } else { - ok = false; - } - return ok; -} - -bool -fromJsonValue(PFXEnum &value, const QJsonValue &jval){ - value.fromJsonValue(jval); - return true; -} - -bool -fromJsonValue(PFXHttpFileElement &value, const QJsonValue &jval){ - return value.fromJsonValue(jval); -} - -} diff --git a/samples/client/petstore/cpp-qt5/client/PFXHelpers.h b/samples/client/petstore/cpp-qt5/client/PFXHelpers.h deleted file mode 100644 index 13b15dabdb2a..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXHelpers.h +++ /dev/null @@ -1,192 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_HELPERS_H -#define PFX_HELPERS_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "PFXObject.h" -#include "PFXEnum.h" -#include "PFXHttpFileElement.h" - -namespace test_namespace { - - template QString - toStringValue(const QList &val); - - template - bool fromStringValue(const QList &inStr, QList &val); - - template - bool fromStringValue(const QMap &inStr, QMap &val); - - template - QJsonValue toJsonValue(const QList &val); - - template - QJsonValue toJsonValue(const QMap &val); - - template - bool fromJsonValue(QList &val, const QJsonValue &jval); - - template - bool fromJsonValue(QMap &val, const QJsonValue &jval); - - QString toStringValue(const QString &value); - QString toStringValue(const QDateTime &value); - QString toStringValue(const QByteArray &value); - QString toStringValue(const QDate &value); - QString toStringValue(const qint32 &value); - QString toStringValue(const qint64 &value); - QString toStringValue(const bool &value); - QString toStringValue(const float &value); - QString toStringValue(const double &value); - QString toStringValue(const PFXObject &value); - QString toStringValue(const PFXEnum &value); - QString toStringValue(const PFXHttpFileElement &value); - - template - QString toStringValue(const QList &val) { - QString strArray; - for(const auto& item : val) { - strArray.append(toStringValue(item) + ","); - } - if(val.count() > 0) { - strArray.chop(1); - } - return strArray; - } - - QJsonValue toJsonValue(const QString &value); - QJsonValue toJsonValue(const QDateTime &value); - QJsonValue toJsonValue(const QByteArray &value); - QJsonValue toJsonValue(const QDate &value); - QJsonValue toJsonValue(const qint32 &value); - QJsonValue toJsonValue(const qint64 &value); - QJsonValue toJsonValue(const bool &value); - QJsonValue toJsonValue(const float &value); - QJsonValue toJsonValue(const double &value); - QJsonValue toJsonValue(const PFXObject &value); - QJsonValue toJsonValue(const PFXEnum &value); - QJsonValue toJsonValue(const PFXHttpFileElement &value); - - template - QJsonValue toJsonValue(const QList &val) { - QJsonArray jArray; - for(const auto& item : val) { - jArray.append(toJsonValue(item)); - } - return jArray; - } - - template - QJsonValue toJsonValue(const QMap &val) { - QJsonObject jObject; - for(const auto& itemkey : val.keys()) { - jObject.insert(itemkey, toJsonValue(val.value(itemkey))); - } - return jObject; - } - - bool fromStringValue(const QString &inStr, QString &value); - bool fromStringValue(const QString &inStr, QDateTime &value); - bool fromStringValue(const QString &inStr, QByteArray &value); - bool fromStringValue(const QString &inStr, QDate &value); - bool fromStringValue(const QString &inStr, qint32 &value); - bool fromStringValue(const QString &inStr, qint64 &value); - bool fromStringValue(const QString &inStr, bool &value); - bool fromStringValue(const QString &inStr, float &value); - bool fromStringValue(const QString &inStr, double &value); - bool fromStringValue(const QString &inStr, PFXObject &value); - bool fromStringValue(const QString &inStr, PFXEnum &value); - bool fromStringValue(const QString &inStr, PFXHttpFileElement &value); - - template - bool fromStringValue(const QList &inStr, QList &val) { - bool ok = (inStr.count() > 0); - for(const auto& item: inStr){ - T itemVal; - ok &= fromStringValue(item, itemVal); - val.push_back(itemVal); - } - return ok; - } - - template - bool fromStringValue(const QMap &inStr, QMap &val) { - bool ok = (inStr.count() > 0); - for(const auto& itemkey : inStr.keys()){ - T itemVal; - ok &= fromStringValue(inStr.value(itemkey), itemVal); - val.insert(itemkey, itemVal); - } - return ok; - } - - bool fromJsonValue(QString &value, const QJsonValue &jval); - bool fromJsonValue(QDateTime &value, const QJsonValue &jval); - bool fromJsonValue(QByteArray &value, const QJsonValue &jval); - bool fromJsonValue(QDate &value, const QJsonValue &jval); - bool fromJsonValue(qint32 &value, const QJsonValue &jval); - bool fromJsonValue(qint64 &value, const QJsonValue &jval); - bool fromJsonValue(bool &value, const QJsonValue &jval); - bool fromJsonValue(float &value, const QJsonValue &jval); - bool fromJsonValue(double &value, const QJsonValue &jval); - bool fromJsonValue(PFXObject &value, const QJsonValue &jval); - bool fromJsonValue(PFXEnum &value, const QJsonValue &jval); - bool fromJsonValue(PFXHttpFileElement &value, const QJsonValue &jval); - - template - bool fromJsonValue(QList &val, const QJsonValue &jval) { - bool ok = true; - if(jval.isArray()){ - for(const auto jitem : jval.toArray()){ - T item; - ok &= fromJsonValue(item, jitem); - val.push_back(item); - } - } else { - ok = false; - } - return ok; - } - - template - bool fromJsonValue(QMap &val, const QJsonValue &jval) { - bool ok = true; - if(jval.isObject()){ - auto varmap = jval.toObject().toVariantMap(); - if(varmap.count() > 0){ - for(const auto& itemkey : varmap.keys() ){ - T itemVal; - ok &= fromJsonValue(itemVal, QJsonValue::fromVariant(varmap.value(itemkey))); - val.insert(itemkey, itemVal); - } - } - } else { - ok = false; - } - return ok; - } - -} - -#endif // PFX_HELPERS_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.cpp deleted file mode 100644 index c2616877958f..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include -#include -#include -#include - -#include "PFXHttpFileElement.h" - -namespace test_namespace { - -void -PFXHttpFileElement::setMimeType(const QString &mime){ - mime_type = mime; -} - -void -PFXHttpFileElement::setFileName(const QString &name){ - local_filename = name; -} - -void -PFXHttpFileElement::setVariableName(const QString &name){ - variable_name = name; -} - -void -PFXHttpFileElement::setRequestFileName(const QString &name){ - request_filename = name; -} - -bool -PFXHttpFileElement::isSet() const { - return !local_filename.isEmpty() || !request_filename.isEmpty(); -} - -QString -PFXHttpFileElement::asJson() const{ - QFile file(local_filename); - QByteArray bArray; - bool result = false; - if(file.exists()) { - result = file.open(QIODevice::ReadOnly); - bArray = file.readAll(); - file.close(); - } - if(!result) { - qDebug() << "Error opening file " << local_filename; - } - return QString(bArray); -} - -QJsonValue -PFXHttpFileElement::asJsonValue() const{ - QFile file(local_filename); - QByteArray bArray; - bool result = false; - if(file.exists()) { - result = file.open(QIODevice::ReadOnly); - bArray = file.readAll(); - file.close(); - } - if(!result) { - qDebug() << "Error opening file " << local_filename; - } - return QJsonDocument::fromBinaryData(bArray.data()).object(); -} - -bool -PFXHttpFileElement::fromStringValue(const QString &instr){ - QFile file(local_filename); - bool result = false; - if(file.exists()) { - file.remove(); - } - result = file.open(QIODevice::WriteOnly); - file.write(instr.toUtf8()); - file.close(); - if(!result) { - qDebug() << "Error creating file " << local_filename; - } - return result; -} - -bool -PFXHttpFileElement::fromJsonValue(const QJsonValue &jval) { - QFile file(local_filename); - bool result = false; - if(file.exists()) { - file.remove(); - } - result = file.open(QIODevice::WriteOnly); - file.write(QJsonDocument(jval.toObject()).toBinaryData()); - file.close(); - if(!result) { - qDebug() << "Error creating file " << local_filename; - } - return result; -} - -QByteArray -PFXHttpFileElement::asByteArray() const { - QFile file(local_filename); - QByteArray bArray; - bool result = false; - if(file.exists()) { - result = file.open(QIODevice::ReadOnly); - bArray = file.readAll(); - file.close(); - } - if(!result) { - qDebug() << "Error opening file " << local_filename; - } - return bArray; -} - -bool -PFXHttpFileElement::fromByteArray(const QByteArray& bytes){ - QFile file(local_filename); - bool result = false; - if(file.exists()){ - file.remove(); - } - result = file.open(QIODevice::WriteOnly); - file.write(bytes); - file.close(); - if(!result) { - qDebug() << "Error creating file " << local_filename; - } - return result; -} - -bool -PFXHttpFileElement::saveToFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime, const QByteArray& bytes){ - setMimeType(mime); - setFileName(localFName); - setVariableName(varName); - setRequestFileName(reqFname); - return fromByteArray(bytes); -} - -QByteArray -PFXHttpFileElement::loadFromFile(const QString &varName, const QString &localFName, const QString &reqFname, const QString &mime){ - setMimeType(mime); - setFileName(localFName); - setVariableName(varName); - setRequestFileName(reqFname); - return asByteArray(); -} - -} diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.h b/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.h deleted file mode 100644 index af819aff761f..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpFileElement.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_HTTP_FILE_ELEMENT_H -#define PFX_HTTP_FILE_ELEMENT_H - -#include -#include -#include - - -namespace test_namespace { - -class PFXHttpFileElement { - -public: - QString variable_name; - QString local_filename; - QString request_filename; - QString mime_type; - void setMimeType(const QString &mime); - void setFileName(const QString &name); - void setVariableName(const QString &name); - void setRequestFileName(const QString &name); - bool isSet() const; - bool fromStringValue(const QString &instr); - bool fromJsonValue(const QJsonValue &jval); - bool fromByteArray(const QByteArray& bytes); - bool saveToFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime, const QByteArray& bytes); - QString asJson() const; - QJsonValue asJsonValue() const; - QByteArray asByteArray() const; - QByteArray loadFromFile(const QString &variable_name, const QString &local_filename, const QString &request_filename, const QString &mime); -}; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXHttpFileElement) - -#endif // PFX_HTTP_FILE_ELEMENT_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp deleted file mode 100644 index 951b9b911f02..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.cpp +++ /dev/null @@ -1,423 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "PFXHttpRequest.h" - - -namespace test_namespace { - -PFXHttpRequestInput::PFXHttpRequestInput() { - initialize(); -} - -PFXHttpRequestInput::PFXHttpRequestInput(QString v_url_str, QString v_http_method) { - initialize(); - url_str = v_url_str; - http_method = v_http_method; -} - -void PFXHttpRequestInput::initialize() { - var_layout = NOT_SET; - url_str = ""; - http_method = "GET"; -} - -void PFXHttpRequestInput::add_var(QString key, QString value) { - vars[key] = value; -} - -void PFXHttpRequestInput::add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type) { - PFXHttpFileElement file; - file.variable_name = variable_name; - file.local_filename = local_filename; - file.request_filename = request_filename; - file.mime_type = mime_type; - files.append(file); -} - - -PFXHttpRequestWorker::PFXHttpRequestWorker(QObject *parent) - : QObject(parent), manager(nullptr), _timeOut(0) -{ - qsrand(QDateTime::currentDateTime().toTime_t()); - manager = new QNetworkAccessManager(this); - workingDirectory = QDir::currentPath(); - connect(manager, &QNetworkAccessManager::finished, this, &PFXHttpRequestWorker::on_manager_finished); -} - -PFXHttpRequestWorker::~PFXHttpRequestWorker() { - for (const auto & item: multiPartFields) { - if(item != nullptr) { - delete item; - } - } -} - -QMap PFXHttpRequestWorker::getResponseHeaders() const { - return headers; -} - -PFXHttpFileElement PFXHttpRequestWorker::getHttpFileElement(const QString &fieldname){ - if(!files.isEmpty()){ - if(fieldname.isEmpty()){ - return files.first(); - }else if (files.contains(fieldname)){ - return files[fieldname]; - } - } - return PFXHttpFileElement(); -} - -QByteArray *PFXHttpRequestWorker::getMultiPartField(const QString &fieldname){ - if(!multiPartFields.isEmpty()){ - if(fieldname.isEmpty()){ - return multiPartFields.first(); - }else if (multiPartFields.contains(fieldname)){ - return multiPartFields[fieldname]; - } - } - return nullptr; -} - -void PFXHttpRequestWorker::setTimeOut(int timeOut){ - _timeOut = timeOut; -} - -void PFXHttpRequestWorker::setWorkingDirectory(const QString &path){ - if(!path.isEmpty()){ - workingDirectory = path; - } -} - - -QString PFXHttpRequestWorker::http_attribute_encode(QString attribute_name, QString input) { - // result structure follows RFC 5987 - bool need_utf_encoding = false; - QString result = ""; - QByteArray input_c = input.toLocal8Bit(); - char c; - for (int i = 0; i < input_c.length(); i++) { - c = input_c.at(i); - if (c == '\\' || c == '/' || c == '\0' || c < ' ' || c > '~') { - // ignore and request utf-8 version - need_utf_encoding = true; - } - else if (c == '"') { - result += "\\\""; - } - else { - result += c; - } - } - - if (result.length() == 0) { - need_utf_encoding = true; - } - - if (!need_utf_encoding) { - // return simple version - return QString("%1=\"%2\"").arg(attribute_name, result); - } - - QString result_utf8 = ""; - for (int i = 0; i < input_c.length(); i++) { - c = input_c.at(i); - if ( - (c >= '0' && c <= '9') - || (c >= 'A' && c <= 'Z') - || (c >= 'a' && c <= 'z') - ) { - result_utf8 += c; - } - else { - result_utf8 += "%" + QString::number(static_cast(input_c.at(i)), 16).toUpper(); - } - } - - // return enhanced version with UTF-8 support - return QString("%1=\"%2\"; %1*=utf-8''%3").arg(attribute_name, result, result_utf8); -} - -void PFXHttpRequestWorker::execute(PFXHttpRequestInput *input) { - - // reset variables - QNetworkReply* reply = nullptr; - QByteArray request_content = ""; - response = ""; - error_type = QNetworkReply::NoError; - error_str = ""; - bool isFormData = false; - - - // decide on the variable layout - - if (input->files.length() > 0) { - input->var_layout = MULTIPART; - } - if (input->var_layout == NOT_SET) { - input->var_layout = input->http_method == "GET" || input->http_method == "HEAD" ? ADDRESS : URL_ENCODED; - } - - - // prepare request content - - QString boundary = ""; - - if (input->var_layout == ADDRESS || input->var_layout == URL_ENCODED) { - // variable layout is ADDRESS or URL_ENCODED - - if (input->vars.count() > 0) { - bool first = true; - isFormData = true; - foreach (QString key, input->vars.keys()) { - if (!first) { - request_content.append("&"); - } - first = false; - - request_content.append(QUrl::toPercentEncoding(key)); - request_content.append("="); - request_content.append(QUrl::toPercentEncoding(input->vars.value(key))); - } - - if (input->var_layout == ADDRESS) { - input->url_str += "?" + request_content; - request_content = ""; - } - } - } - else { - // variable layout is MULTIPART - - boundary = "__-----------------------" - + QString::number(QDateTime::currentDateTime().toTime_t()) - + QString::number(qrand()); - QString boundary_delimiter = "--"; - QString new_line = "\r\n"; - - // add variables - foreach (QString key, input->vars.keys()) { - // add boundary - request_content.append(boundary_delimiter); - request_content.append(boundary); - request_content.append(new_line); - - // add header - request_content.append("Content-Disposition: form-data; "); - request_content.append(http_attribute_encode("name", key)); - request_content.append(new_line); - request_content.append("Content-Type: text/plain"); - request_content.append(new_line); - - // add header to body splitter - request_content.append(new_line); - - // add variable content - request_content.append(input->vars.value(key)); - request_content.append(new_line); - } - - // add files - for (QList::iterator file_info = input->files.begin(); file_info != input->files.end(); file_info++) { - QFileInfo fi(file_info->local_filename); - - // ensure necessary variables are available - if ( - file_info->local_filename == nullptr || file_info->local_filename.isEmpty() - || file_info->variable_name == nullptr || file_info->variable_name.isEmpty() - || !fi.exists() || !fi.isFile() || !fi.isReadable() - ) { - // silent abort for the current file - continue; - } - - QFile file(file_info->local_filename); - if (!file.open(QIODevice::ReadOnly)) { - // silent abort for the current file - continue; - } - - // ensure filename for the request - if (file_info->request_filename == nullptr || file_info->request_filename.isEmpty()) { - file_info->request_filename = fi.fileName(); - if (file_info->request_filename.isEmpty()) { - file_info->request_filename = "file"; - } - } - - // add boundary - request_content.append(boundary_delimiter); - request_content.append(boundary); - request_content.append(new_line); - - // add header - request_content.append(QString("Content-Disposition: form-data; %1; %2").arg( - http_attribute_encode("name", file_info->variable_name), - http_attribute_encode("filename", file_info->request_filename) - )); - request_content.append(new_line); - - if (file_info->mime_type != nullptr && !file_info->mime_type.isEmpty()) { - request_content.append("Content-Type: "); - request_content.append(file_info->mime_type); - request_content.append(new_line); - } - - request_content.append("Content-Transfer-Encoding: binary"); - request_content.append(new_line); - - // add header to body splitter - request_content.append(new_line); - - // add file content - request_content.append(file.readAll()); - request_content.append(new_line); - - file.close(); - } - - // add end of body - request_content.append(boundary_delimiter); - request_content.append(boundary); - request_content.append(boundary_delimiter); - } - - if(input->request_body.size() > 0) { - qDebug() << "got a request body"; - request_content.clear(); - request_content.append(input->request_body); - } - // prepare connection - - QNetworkRequest request = QNetworkRequest(QUrl(input->url_str)); - if (PFXHttpRequestWorker::sslDefaultConfiguration != nullptr) { - request.setSslConfiguration(*PFXHttpRequestWorker::sslDefaultConfiguration); - } - request.setRawHeader("User-Agent", "OpenAPI-Generator/1.0.0/cpp-qt5"); - foreach(QString key, input->headers.keys()) { - request.setRawHeader(key.toStdString().c_str(), input->headers.value(key).toStdString().c_str()); - } - - if (request_content.size() > 0 && !isFormData && (input->var_layout != MULTIPART)) { - if(!input->headers.contains("Content-Type")){ - request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json"); - } - else { - request.setHeader(QNetworkRequest::ContentTypeHeader, input->headers.value("Content-Type")); - } - } - else if (input->var_layout == URL_ENCODED) { - request.setHeader(QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); - } - else if (input->var_layout == MULTIPART) { - request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data; boundary=" + boundary); - } - - if (input->http_method == "GET") { - reply = manager->get(request); - } - else if (input->http_method == "POST") { - reply = manager->post(request, request_content); - } - else if (input->http_method == "PUT") { - reply = manager->put(request, request_content); - } - else if (input->http_method == "HEAD") { - reply = manager->head(request); - } - else if (input->http_method == "DELETE") { - reply = manager->deleteResource(request); - } - else { -#if (QT_VERSION >= 0x050800) - manager->sendCustomRequest(request, input->http_method.toLatin1(), request_content); -#else - QBuffer *buffer = new QBuffer; - buffer->setData(request_content); - buffer->open(QIODevice::ReadOnly); - - reply = manager->sendCustomRequest(request, input->http_method.toLatin1(), buffer); - buffer->setParent(reply); -#endif - } - if(_timeOut > 0){ - QTimer::singleShot(_timeOut, [=](){ on_manager_timeout(reply); }); - } -} - -void PFXHttpRequestWorker::on_manager_finished(QNetworkReply *reply) { - error_type = reply->error(); - response = reply->readAll(); - error_str = reply->errorString(); - if(reply->rawHeaderPairs().count() > 0){ - for(const auto& item: reply->rawHeaderPairs()){ - headers.insert(item.first, item.second); - } - } - reply->deleteLater(); - process_form_response(); - emit on_execution_finished(this); -} - -void PFXHttpRequestWorker::on_manager_timeout(QNetworkReply *reply) { - error_type = QNetworkReply::TimeoutError; - response = ""; - error_str = "Timed out waiting for response"; - disconnect(manager, nullptr, nullptr, nullptr); - reply->abort(); - reply->deleteLater(); - emit on_execution_finished(this); -} - -void PFXHttpRequestWorker::process_form_response() { - if(getResponseHeaders().contains(QString("Content-Disposition")) ) { - auto contentDisposition = getResponseHeaders().value(QString("Content-Disposition").toUtf8()).split(QString(";"), QString::SkipEmptyParts); - auto contentType = getResponseHeaders().contains(QString("Content-Type")) ? getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts).first() : QString(); - if((contentDisposition.count() > 0) && (contentDisposition.first() == QString("attachment"))){ - QString filename = QUuid::createUuid().toString(); - for(const auto &file : contentDisposition){ - if(file.contains(QString("filename"))){ - filename = file.split(QString("="), QString::SkipEmptyParts).at(1); - break; - } - } - PFXHttpFileElement felement; - felement.saveToFile(QString(), workingDirectory + QDir::separator() + filename, filename, contentType, response.data()); - files.insert(filename, felement); - } - - } else if(getResponseHeaders().contains(QString("Content-Type")) ) { - auto contentType = getResponseHeaders().value(QString("Content-Type").toUtf8()).split(QString(";"), QString::SkipEmptyParts); - if((contentType.count() > 0) && (contentType.first() == QString("multipart/form-data"))){ - - } - else { - - } - } -} - -QSslConfiguration* PFXHttpRequestWorker::sslDefaultConfiguration; - - -} diff --git a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h b/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h deleted file mode 100644 index 3ca8e2f8c727..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXHttpRequest.h +++ /dev/null @@ -1,91 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/** - * Based on http://www.creativepulse.gr/en/blog/2014/restful-api-requests-using-qt-cpp-for-linux-mac-osx-ms-windows - * By Alex Stylianos - * - **/ - -#ifndef PFX_HTTPREQUESTWORKER_H -#define PFX_HTTPREQUESTWORKER_H - -#include -#include -#include -#include -#include - -#include "PFXHttpFileElement.h" - -namespace test_namespace { - -enum PFXHttpRequestVarLayout {NOT_SET, ADDRESS, URL_ENCODED, MULTIPART}; - - -class PFXHttpRequestInput { - -public: - QString url_str; - QString http_method; - PFXHttpRequestVarLayout var_layout; - QMap vars; - QMap headers; - QList files; - QByteArray request_body; - - PFXHttpRequestInput(); - PFXHttpRequestInput(QString v_url_str, QString v_http_method); - void initialize(); - void add_var(QString key, QString value); - void add_file(QString variable_name, QString local_filename, QString request_filename, QString mime_type); - -}; - - -class PFXHttpRequestWorker : public QObject { - Q_OBJECT - -public: - QByteArray response; - QNetworkReply::NetworkError error_type; - QString error_str; - explicit PFXHttpRequestWorker(QObject *parent = nullptr); - virtual ~PFXHttpRequestWorker(); - - QMap getResponseHeaders() const; - QString http_attribute_encode(QString attribute_name, QString input); - void execute(PFXHttpRequestInput *input); - static QSslConfiguration* sslDefaultConfiguration; - void setTimeOut(int tout); - void setWorkingDirectory(const QString &path); - PFXHttpFileElement getHttpFileElement(const QString &fieldname = QString()); - QByteArray* getMultiPartField(const QString &fieldname = QString()); -signals: - void on_execution_finished(PFXHttpRequestWorker *worker); - -private: - QNetworkAccessManager *manager; - QMap headers; - QMap files; - QMap multiPartFields; - QString workingDirectory; - int _timeOut; - void on_manager_timeout(QNetworkReply *reply); - void process_form_response(); -private slots: - void on_manager_finished(QNetworkReply *reply); -}; - -} - -#endif // PFX_HTTPREQUESTWORKER_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXObject.h b/samples/client/petstore/cpp-qt5/client/PFXObject.h deleted file mode 100644 index fb6004bbbc35..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXObject.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_OBJECT_H -#define PFX_OBJECT_H - -#include -#include -#include - -namespace test_namespace { - -class PFXObject { - public: - PFXObject() { - - } - - PFXObject(QString jsonString) { - fromJson(jsonString); - } - - virtual ~PFXObject(){ - - } - - virtual QJsonObject asJsonObject() const { - return jObj; - } - - virtual QString asJson() const { - QJsonDocument doc(jObj); - return doc.toJson(QJsonDocument::Compact); - } - - virtual void fromJson(QString jsonString) { - QJsonDocument doc = QJsonDocument::fromJson(jsonString.toUtf8()); - jObj = doc.object(); - } - - virtual void fromJsonObject(QJsonObject json) { - jObj = json; - } - - virtual bool isSet() const { - return false; - } - - virtual bool isValid() const { - return true; - } -private : - QJsonObject jObj; -}; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXObject) - -#endif // PFX_OBJECT_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp b/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp deleted file mode 100644 index 5887591617c6..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXOrder.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PFXOrder.h" - -#include -#include -#include -#include - -#include "PFXHelpers.h" - -namespace test_namespace { - -PFXOrder::PFXOrder(QString json) { - this->initializeModel(); - this->fromJson(json); -} - -PFXOrder::PFXOrder() { - this->initializeModel(); -} - -PFXOrder::~PFXOrder() { - -} - -void -PFXOrder::initializeModel() { - - m_id_isSet = false; - m_id_isValid = false; - - m_pet_id_isSet = false; - m_pet_id_isValid = false; - - m_quantity_isSet = false; - m_quantity_isValid = false; - - m_ship_date_isSet = false; - m_ship_date_isValid = false; - - m_status_isSet = false; - m_status_isValid = false; - - m_complete_isSet = false; - m_complete_isValid = false; - -} - -void -PFXOrder::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); -} - -void -PFXOrder::fromJsonObject(QJsonObject json) { - - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); - m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - - m_pet_id_isValid = ::test_namespace::fromJsonValue(pet_id, json[QString("petId")]); - m_pet_id_isSet = !json[QString("petId")].isNull() && m_pet_id_isValid; - - m_quantity_isValid = ::test_namespace::fromJsonValue(quantity, json[QString("quantity")]); - m_quantity_isSet = !json[QString("quantity")].isNull() && m_quantity_isValid; - - m_ship_date_isValid = ::test_namespace::fromJsonValue(ship_date, json[QString("shipDate")]); - m_ship_date_isSet = !json[QString("shipDate")].isNull() && m_ship_date_isValid; - - m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]); - m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; - - m_complete_isValid = ::test_namespace::fromJsonValue(complete, json[QString("complete")]); - m_complete_isSet = !json[QString("complete")].isNull() && m_complete_isValid; - -} - -QString -PFXOrder::asJson () const { - QJsonObject obj = this->asJsonObject(); - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); -} - -QJsonObject -PFXOrder::asJsonObject() const { - QJsonObject obj; - if(m_id_isSet){ - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); - } - if(m_pet_id_isSet){ - obj.insert(QString("petId"), ::test_namespace::toJsonValue(pet_id)); - } - if(m_quantity_isSet){ - obj.insert(QString("quantity"), ::test_namespace::toJsonValue(quantity)); - } - if(m_ship_date_isSet){ - obj.insert(QString("shipDate"), ::test_namespace::toJsonValue(ship_date)); - } - if(m_status_isSet){ - obj.insert(QString("status"), ::test_namespace::toJsonValue(status)); - } - if(m_complete_isSet){ - obj.insert(QString("complete"), ::test_namespace::toJsonValue(complete)); - } - return obj; -} - - -qint64 -PFXOrder::getId() const { - return id; -} -void -PFXOrder::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; -} - - -qint64 -PFXOrder::getPetId() const { - return pet_id; -} -void -PFXOrder::setPetId(const qint64 &pet_id) { - this->pet_id = pet_id; - this->m_pet_id_isSet = true; -} - - -qint32 -PFXOrder::getQuantity() const { - return quantity; -} -void -PFXOrder::setQuantity(const qint32 &quantity) { - this->quantity = quantity; - this->m_quantity_isSet = true; -} - - -QDateTime -PFXOrder::getShipDate() const { - return ship_date; -} -void -PFXOrder::setShipDate(const QDateTime &ship_date) { - this->ship_date = ship_date; - this->m_ship_date_isSet = true; -} - - -QString -PFXOrder::getStatus() const { - return status; -} -void -PFXOrder::setStatus(const QString &status) { - this->status = status; - this->m_status_isSet = true; -} - - -bool -PFXOrder::isComplete() const { - return complete; -} -void -PFXOrder::setComplete(const bool &complete) { - this->complete = complete; - this->m_complete_isSet = true; -} - -bool -PFXOrder::isSet() const { - bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_pet_id_isSet){ isObjectUpdated = true; break;} - - if(m_quantity_isSet){ isObjectUpdated = true; break;} - - if(m_ship_date_isSet){ isObjectUpdated = true; break;} - - if(m_status_isSet){ isObjectUpdated = true; break;} - - if(m_complete_isSet){ isObjectUpdated = true; break;} - }while(false); - return isObjectUpdated; -} - -bool -PFXOrder::isValid() const { - // only required properties are required for the object to be considered valid - return true; -} - -} - diff --git a/samples/client/petstore/cpp-qt5/client/PFXOrder.h b/samples/client/petstore/cpp-qt5/client/PFXOrder.h deleted file mode 100644 index 34fc7eb1f559..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXOrder.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PFXOrder.h - * - * An order for a pets from the pet store - */ - -#ifndef PFXOrder_H -#define PFXOrder_H - -#include - - -#include -#include - -#include "PFXObject.h" -#include "PFXEnum.h" - - -namespace test_namespace { - -class PFXOrder: public PFXObject { -public: - PFXOrder(); - PFXOrder(QString json); - ~PFXOrder() override; - - QString asJson () const override; - QJsonObject asJsonObject() const override; - void fromJsonObject(QJsonObject json) override; - void fromJson(QString jsonString) override; - - - qint64 getId() const; - void setId(const qint64 &id); - - - qint64 getPetId() const; - void setPetId(const qint64 &pet_id); - - - qint32 getQuantity() const; - void setQuantity(const qint32 &quantity); - - - QDateTime getShipDate() const; - void setShipDate(const QDateTime &ship_date); - - - QString getStatus() const; - void setStatus(const QString &status); - - - bool isComplete() const; - void setComplete(const bool &complete); - - - - virtual bool isSet() const override; - virtual bool isValid() const override; - -private: - void initializeModel(); - - qint64 id; - bool m_id_isSet; - bool m_id_isValid; - - qint64 pet_id; - bool m_pet_id_isSet; - bool m_pet_id_isValid; - - qint32 quantity; - bool m_quantity_isSet; - bool m_quantity_isValid; - - QDateTime ship_date; - bool m_ship_date_isSet; - bool m_ship_date_isValid; - - QString status; - bool m_status_isSet; - bool m_status_isValid; - - bool complete; - bool m_complete_isSet; - bool m_complete_isValid; - - }; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXOrder) - -#endif // PFXOrder_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXPet.cpp b/samples/client/petstore/cpp-qt5/client/PFXPet.cpp deleted file mode 100644 index 955fc9166aca..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXPet.cpp +++ /dev/null @@ -1,218 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PFXPet.h" - -#include -#include -#include -#include - -#include "PFXHelpers.h" - -namespace test_namespace { - -PFXPet::PFXPet(QString json) { - this->initializeModel(); - this->fromJson(json); -} - -PFXPet::PFXPet() { - this->initializeModel(); -} - -PFXPet::~PFXPet() { - -} - -void -PFXPet::initializeModel() { - - m_id_isSet = false; - m_id_isValid = false; - - m_category_isSet = false; - m_category_isValid = false; - - m_name_isSet = false; - m_name_isValid = false; - - m_photo_urls_isSet = false; - m_photo_urls_isValid = false; - - m_tags_isSet = false; - m_tags_isValid = false; - - m_status_isSet = false; - m_status_isValid = false; - -} - -void -PFXPet::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); -} - -void -PFXPet::fromJsonObject(QJsonObject json) { - - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); - m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - - m_category_isValid = ::test_namespace::fromJsonValue(category, json[QString("category")]); - m_category_isSet = !json[QString("category")].isNull() && m_category_isValid; - - m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); - m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; - - m_photo_urls_isValid = ::test_namespace::fromJsonValue(photo_urls, json[QString("photoUrls")]); - m_photo_urls_isSet = !json[QString("photoUrls")].isNull() && m_photo_urls_isValid; - - m_tags_isValid = ::test_namespace::fromJsonValue(tags, json[QString("tags")]); - m_tags_isSet = !json[QString("tags")].isNull() && m_tags_isValid; - - m_status_isValid = ::test_namespace::fromJsonValue(status, json[QString("status")]); - m_status_isSet = !json[QString("status")].isNull() && m_status_isValid; - -} - -QString -PFXPet::asJson () const { - QJsonObject obj = this->asJsonObject(); - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); -} - -QJsonObject -PFXPet::asJsonObject() const { - QJsonObject obj; - if(m_id_isSet){ - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); - } - if(category.isSet()){ - obj.insert(QString("category"), ::test_namespace::toJsonValue(category)); - } - if(m_name_isSet){ - obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); - } - - if(photo_urls.size() > 0){ - obj.insert(QString("photoUrls"), ::test_namespace::toJsonValue(photo_urls)); - } - - if(tags.size() > 0){ - obj.insert(QString("tags"), ::test_namespace::toJsonValue(tags)); - } - if(m_status_isSet){ - obj.insert(QString("status"), ::test_namespace::toJsonValue(status)); - } - return obj; -} - - -qint64 -PFXPet::getId() const { - return id; -} -void -PFXPet::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; -} - - -PFXCategory -PFXPet::getCategory() const { - return category; -} -void -PFXPet::setCategory(const PFXCategory &category) { - this->category = category; - this->m_category_isSet = true; -} - - -QString -PFXPet::getName() const { - return name; -} -void -PFXPet::setName(const QString &name) { - this->name = name; - this->m_name_isSet = true; -} - - -QList -PFXPet::getPhotoUrls() const { - return photo_urls; -} -void -PFXPet::setPhotoUrls(const QList &photo_urls) { - this->photo_urls = photo_urls; - this->m_photo_urls_isSet = true; -} - - -QList -PFXPet::getTags() const { - return tags; -} -void -PFXPet::setTags(const QList &tags) { - this->tags = tags; - this->m_tags_isSet = true; -} - - -QString -PFXPet::getStatus() const { - return status; -} -void -PFXPet::setStatus(const QString &status) { - this->status = status; - this->m_status_isSet = true; -} - -bool -PFXPet::isSet() const { - bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(category.isSet()){ isObjectUpdated = true; break;} - - if(m_name_isSet){ isObjectUpdated = true; break;} - - if(photo_urls.size() > 0){ isObjectUpdated = true; break;} - - if(tags.size() > 0){ isObjectUpdated = true; break;} - - if(m_status_isSet){ isObjectUpdated = true; break;} - }while(false); - return isObjectUpdated; -} - -bool -PFXPet::isValid() const { - // only required properties are required for the object to be considered valid - return m_name_isValid && m_photo_urls_isValid && true; -} - -} - diff --git a/samples/client/petstore/cpp-qt5/client/PFXPet.h b/samples/client/petstore/cpp-qt5/client/PFXPet.h deleted file mode 100644 index ad5d035e995b..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXPet.h +++ /dev/null @@ -1,109 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PFXPet.h - * - * A pet for sale in the pet store - */ - -#ifndef PFXPet_H -#define PFXPet_H - -#include - - -#include "PFXCategory.h" -#include "PFXTag.h" -#include -#include - -#include "PFXObject.h" -#include "PFXEnum.h" - - -namespace test_namespace { - -class PFXPet: public PFXObject { -public: - PFXPet(); - PFXPet(QString json); - ~PFXPet() override; - - QString asJson () const override; - QJsonObject asJsonObject() const override; - void fromJsonObject(QJsonObject json) override; - void fromJson(QString jsonString) override; - - - qint64 getId() const; - void setId(const qint64 &id); - - - PFXCategory getCategory() const; - void setCategory(const PFXCategory &category); - - - QString getName() const; - void setName(const QString &name); - - - QList getPhotoUrls() const; - void setPhotoUrls(const QList &photo_urls); - - - QList getTags() const; - void setTags(const QList &tags); - - - QString getStatus() const; - void setStatus(const QString &status); - - - - virtual bool isSet() const override; - virtual bool isValid() const override; - -private: - void initializeModel(); - - qint64 id; - bool m_id_isSet; - bool m_id_isValid; - - PFXCategory category; - bool m_category_isSet; - bool m_category_isValid; - - QString name; - bool m_name_isSet; - bool m_name_isValid; - - QList photo_urls; - bool m_photo_urls_isSet; - bool m_photo_urls_isValid; - - QList tags; - bool m_tags_isSet; - bool m_tags_isValid; - - QString status; - bool m_status_isSet; - bool m_status_isValid; - - }; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXPet) - -#endif // PFXPet_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp deleted file mode 100644 index 0c03c3cd31c1..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.cpp +++ /dev/null @@ -1,596 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "PFXPetApi.h" -#include "PFXHelpers.h" - -#include -#include - -namespace test_namespace { - -PFXPetApi::PFXPetApi(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : - _scheme(scheme), - _host(host), - _port(port), - _basePath(basePath), - _timeOut(timeOut) { -} - -PFXPetApi::~PFXPetApi() { -} - -void PFXPetApi::setScheme(const QString& scheme){ - _scheme = scheme; -} - -void PFXPetApi::setHost(const QString& host){ - _host = host; -} - -void PFXPetApi::setPort(int port){ - _port = port; -} - -void PFXPetApi::setBasePath(const QString& basePath){ - _basePath = basePath; -} - -void PFXPetApi::setTimeOut(const int timeOut){ - _timeOut = timeOut; -} - -void PFXPetApi::setWorkingDirectory(const QString& path){ - _workingDirectory = path; -} - -void PFXPetApi::addHeaders(const QString& key, const QString& value){ - defaultHeaders.insert(key, value); -} - -void -PFXPetApi::addPet(const PFXPet& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - - QString output = body.asJson(); - input.request_body.append(output); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::addPetCallback); - - worker->execute(&input); -} - -void -PFXPetApi::addPetCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit addPetSignal(); - emit addPetSignalFull(worker); - } else { - emit addPetSignalE(error_type, error_str); - emit addPetSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::deletePet(const qint64& pet_id, const QString& api_key) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet/{petId}"); - QString pet_idPathParam("{"); - pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "DELETE"); - - - if (api_key != nullptr) { - input.headers.insert("api_key", api_key); - } - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::deletePetCallback); - - worker->execute(&input); -} - -void -PFXPetApi::deletePetCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit deletePetSignal(); - emit deletePetSignalFull(worker); - } else { - emit deletePetSignalE(error_type, error_str); - emit deletePetSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::findPetsByStatus(const QList& status) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet/findByStatus"); - - if (status.size() > 0) { - if (QString("csv").indexOf("multi") == 0) { - foreach(QString t, status) { - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("status=").append(::test_namespace::toStringValue(t)); - } - } - else if (QString("csv").indexOf("ssv") == 0) { - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("status="); - qint32 count = 0; - foreach(QString t, status) { - if (count > 0) { - fullPath.append(" "); - } - fullPath.append(::test_namespace::toStringValue(t)); - } - } - else if (QString("csv").indexOf("tsv") == 0) { - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("status="); - qint32 count = 0; - foreach(QString t, status) { - if (count > 0) { - fullPath.append("\t"); - } - fullPath.append(::test_namespace::toStringValue(t)); - } - } - } - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::findPetsByStatusCallback); - - worker->execute(&input); -} - -void -PFXPetApi::findPetsByStatusCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - QList output; - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonArray jsonArray = doc.array(); - foreach(QJsonValue obj, jsonArray) { - PFXPet val; - ::test_namespace::fromJsonValue(val, obj); - output.append(val); - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit findPetsByStatusSignal(output); - emit findPetsByStatusSignalFull(worker, output); - } else { - emit findPetsByStatusSignalE(output, error_type, error_str); - emit findPetsByStatusSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::findPetsByTags(const QList& tags) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet/findByTags"); - - if (tags.size() > 0) { - if (QString("csv").indexOf("multi") == 0) { - foreach(QString t, tags) { - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("tags=").append(::test_namespace::toStringValue(t)); - } - } - else if (QString("csv").indexOf("ssv") == 0) { - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("tags="); - qint32 count = 0; - foreach(QString t, tags) { - if (count > 0) { - fullPath.append(" "); - } - fullPath.append(::test_namespace::toStringValue(t)); - } - } - else if (QString("csv").indexOf("tsv") == 0) { - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append("tags="); - qint32 count = 0; - foreach(QString t, tags) { - if (count > 0) { - fullPath.append("\t"); - } - fullPath.append(::test_namespace::toStringValue(t)); - } - } - } - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::findPetsByTagsCallback); - - worker->execute(&input); -} - -void -PFXPetApi::findPetsByTagsCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - QList output; - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonArray jsonArray = doc.array(); - foreach(QJsonValue obj, jsonArray) { - PFXPet val; - ::test_namespace::fromJsonValue(val, obj); - output.append(val); - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit findPetsByTagsSignal(output); - emit findPetsByTagsSignalFull(worker, output); - } else { - emit findPetsByTagsSignalE(output, error_type, error_str); - emit findPetsByTagsSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::getPetById(const qint64& pet_id) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet/{petId}"); - QString pet_idPathParam("{"); - pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::getPetByIdCallback); - - worker->execute(&input); -} - -void -PFXPetApi::getPetByIdCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - PFXPet output(QString(worker->response)); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit getPetByIdSignal(output); - emit getPetByIdSignalFull(worker, output); - } else { - emit getPetByIdSignalE(output, error_type, error_str); - emit getPetByIdSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::updatePet(const PFXPet& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "PUT"); - - - QString output = body.asJson(); - input.request_body.append(output); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::updatePetCallback); - - worker->execute(&input); -} - -void -PFXPetApi::updatePetCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit updatePetSignal(); - emit updatePetSignalFull(worker); - } else { - emit updatePetSignalE(error_type, error_str); - emit updatePetSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet/{petId}"); - QString pet_idPathParam("{"); - pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - input.add_var("name", ::test_namespace::toStringValue(name)); - input.add_var("status", ::test_namespace::toStringValue(status)); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::updatePetWithFormCallback); - - worker->execute(&input); -} - -void -PFXPetApi::updatePetWithFormCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit updatePetWithFormSignal(); - emit updatePetWithFormSignalFull(worker); - } else { - emit updatePetWithFormSignalE(error_type, error_str); - emit updatePetWithFormSignalEFull(worker, error_type, error_str); - } -} - -void -PFXPetApi::uploadFile(const qint64& pet_id, const QString& additional_metadata, const PFXHttpFileElement& file) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/pet/{petId}/uploadImage"); - QString pet_idPathParam("{"); - pet_idPathParam.append("petId").append("}"); - fullPath.replace(pet_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(pet_id))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - input.add_var("additionalMetadata", ::test_namespace::toStringValue(additional_metadata)); - input.add_file("file", file.local_filename, file.request_filename, file.mime_type); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXPetApi::uploadFileCallback); - - worker->execute(&input); -} - -void -PFXPetApi::uploadFileCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - PFXApiResponse output(QString(worker->response)); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit uploadFileSignal(output); - emit uploadFileSignalFull(worker, output); - } else { - emit uploadFileSignalE(output, error_type, error_str); - emit uploadFileSignalEFull(worker, error_type, error_str); - } -} - - -} diff --git a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h b/samples/client/petstore/cpp-qt5/client/PFXPetApi.h deleted file mode 100644 index 67fc74d25a0a..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXPetApi.h +++ /dev/null @@ -1,105 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_PFXPetApi_H -#define PFX_PFXPetApi_H - -#include "PFXHttpRequest.h" - -#include "PFXApiResponse.h" -#include "PFXHttpFileElement.h" -#include "PFXPet.h" -#include - -#include - -namespace test_namespace { - -class PFXPetApi: public QObject { - Q_OBJECT - -public: - PFXPetApi(const QString &scheme = "http", const QString &host = "petstore.swagger.io", int port = 0, const QString& basePath = "/v2", const int timeOut = 0); - ~PFXPetApi(); - - void setScheme(const QString &scheme); - void setHost(const QString &host); - void setPort(int port); - void setBasePath(const QString& basePath); - void setTimeOut(const int timeOut); - void setWorkingDirectory(const QString& path); - void addHeaders(const QString& key, const QString& value); - - void addPet(const PFXPet& body); - void deletePet(const qint64& pet_id, const QString& api_key); - void findPetsByStatus(const QList& status); - void findPetsByTags(const QList& tags); - void getPetById(const qint64& pet_id); - void updatePet(const PFXPet& body); - void updatePetWithForm(const qint64& pet_id, const QString& name, const QString& status); - void uploadFile(const qint64& pet_id, const QString& additional_metadata, const PFXHttpFileElement& file); - -private: - QString _scheme, _host, _basePath; - int _port, _timeOut; - QString _workingDirectory; - QMap defaultHeaders; - void addPetCallback (PFXHttpRequestWorker * worker); - void deletePetCallback (PFXHttpRequestWorker * worker); - void findPetsByStatusCallback (PFXHttpRequestWorker * worker); - void findPetsByTagsCallback (PFXHttpRequestWorker * worker); - void getPetByIdCallback (PFXHttpRequestWorker * worker); - void updatePetCallback (PFXHttpRequestWorker * worker); - void updatePetWithFormCallback (PFXHttpRequestWorker * worker); - void uploadFileCallback (PFXHttpRequestWorker * worker); - -signals: - void addPetSignal(); - void deletePetSignal(); - void findPetsByStatusSignal(QList summary); - void findPetsByTagsSignal(QList summary); - void getPetByIdSignal(PFXPet summary); - void updatePetSignal(); - void updatePetWithFormSignal(); - void uploadFileSignal(PFXApiResponse summary); - - void addPetSignalFull(PFXHttpRequestWorker* worker); - void deletePetSignalFull(PFXHttpRequestWorker* worker); - void findPetsByStatusSignalFull(PFXHttpRequestWorker* worker, QList summary); - void findPetsByTagsSignalFull(PFXHttpRequestWorker* worker, QList summary); - void getPetByIdSignalFull(PFXHttpRequestWorker* worker, PFXPet summary); - void updatePetSignalFull(PFXHttpRequestWorker* worker); - void updatePetWithFormSignalFull(PFXHttpRequestWorker* worker); - void uploadFileSignalFull(PFXHttpRequestWorker* worker, PFXApiResponse summary); - - void addPetSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void deletePetSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByStatusSignalE(QList summary, QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByTagsSignalE(QList summary, QNetworkReply::NetworkError error_type, QString error_str); - void getPetByIdSignalE(PFXPet summary, QNetworkReply::NetworkError error_type, QString error_str); - void updatePetSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void updatePetWithFormSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void uploadFileSignalE(PFXApiResponse summary, QNetworkReply::NetworkError error_type, QString error_str); - - void addPetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void deletePetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByStatusSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void findPetsByTagsSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getPetByIdSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void updatePetSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void updatePetWithFormSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void uploadFileSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - -}; - -} -#endif diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp deleted file mode 100644 index df62ceb15b1b..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.cpp +++ /dev/null @@ -1,286 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "PFXStoreApi.h" -#include "PFXHelpers.h" - -#include -#include - -namespace test_namespace { - -PFXStoreApi::PFXStoreApi(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : - _scheme(scheme), - _host(host), - _port(port), - _basePath(basePath), - _timeOut(timeOut) { -} - -PFXStoreApi::~PFXStoreApi() { -} - -void PFXStoreApi::setScheme(const QString& scheme){ - _scheme = scheme; -} - -void PFXStoreApi::setHost(const QString& host){ - _host = host; -} - -void PFXStoreApi::setPort(int port){ - _port = port; -} - -void PFXStoreApi::setBasePath(const QString& basePath){ - _basePath = basePath; -} - -void PFXStoreApi::setTimeOut(const int timeOut){ - _timeOut = timeOut; -} - -void PFXStoreApi::setWorkingDirectory(const QString& path){ - _workingDirectory = path; -} - -void PFXStoreApi::addHeaders(const QString& key, const QString& value){ - defaultHeaders.insert(key, value); -} - -void -PFXStoreApi::deleteOrder(const QString& order_id) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/store/order/{orderId}"); - QString order_idPathParam("{"); - order_idPathParam.append("orderId").append("}"); - fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "DELETE"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXStoreApi::deleteOrderCallback); - - worker->execute(&input); -} - -void -PFXStoreApi::deleteOrderCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit deleteOrderSignal(); - emit deleteOrderSignalFull(worker); - } else { - emit deleteOrderSignalE(error_type, error_str); - emit deleteOrderSignalEFull(worker, error_type, error_str); - } -} - -void -PFXStoreApi::getInventory() { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/store/inventory"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXStoreApi::getInventoryCallback); - - worker->execute(&input); -} - -void -PFXStoreApi::getInventoryCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - QMap output; - QString json(worker->response); - QByteArray array (json.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject obj = doc.object(); - foreach(QString key, obj.keys()) { - qint32 val; - ::test_namespace::fromJsonValue(val, obj[key]); - output.insert(key, val); - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit getInventorySignal(output); - emit getInventorySignalFull(worker, output); - } else { - emit getInventorySignalE(output, error_type, error_str); - emit getInventorySignalEFull(worker, error_type, error_str); - } -} - -void -PFXStoreApi::getOrderById(const qint64& order_id) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/store/order/{orderId}"); - QString order_idPathParam("{"); - order_idPathParam.append("orderId").append("}"); - fullPath.replace(order_idPathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(order_id))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXStoreApi::getOrderByIdCallback); - - worker->execute(&input); -} - -void -PFXStoreApi::getOrderByIdCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - PFXOrder output(QString(worker->response)); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit getOrderByIdSignal(output); - emit getOrderByIdSignalFull(worker, output); - } else { - emit getOrderByIdSignalE(output, error_type, error_str); - emit getOrderByIdSignalEFull(worker, error_type, error_str); - } -} - -void -PFXStoreApi::placeOrder(const PFXOrder& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/store/order"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - - QString output = body.asJson(); - input.request_body.append(output); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXStoreApi::placeOrderCallback); - - worker->execute(&input); -} - -void -PFXStoreApi::placeOrderCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - PFXOrder output(QString(worker->response)); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit placeOrderSignal(output); - emit placeOrderSignalFull(worker, output); - } else { - emit placeOrderSignalE(output, error_type, error_str); - emit placeOrderSignalEFull(worker, error_type, error_str); - } -} - - -} diff --git a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h b/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h deleted file mode 100644 index d292d819467d..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXStoreApi.h +++ /dev/null @@ -1,80 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_PFXStoreApi_H -#define PFX_PFXStoreApi_H - -#include "PFXHttpRequest.h" - -#include "PFXOrder.h" -#include -#include - -#include - -namespace test_namespace { - -class PFXStoreApi: public QObject { - Q_OBJECT - -public: - PFXStoreApi(const QString &scheme = "http", const QString &host = "petstore.swagger.io", int port = 0, const QString& basePath = "/v2", const int timeOut = 0); - ~PFXStoreApi(); - - void setScheme(const QString &scheme); - void setHost(const QString &host); - void setPort(int port); - void setBasePath(const QString& basePath); - void setTimeOut(const int timeOut); - void setWorkingDirectory(const QString& path); - void addHeaders(const QString& key, const QString& value); - - void deleteOrder(const QString& order_id); - void getInventory(); - void getOrderById(const qint64& order_id); - void placeOrder(const PFXOrder& body); - -private: - QString _scheme, _host, _basePath; - int _port, _timeOut; - QString _workingDirectory; - QMap defaultHeaders; - void deleteOrderCallback (PFXHttpRequestWorker * worker); - void getInventoryCallback (PFXHttpRequestWorker * worker); - void getOrderByIdCallback (PFXHttpRequestWorker * worker); - void placeOrderCallback (PFXHttpRequestWorker * worker); - -signals: - void deleteOrderSignal(); - void getInventorySignal(QMap summary); - void getOrderByIdSignal(PFXOrder summary); - void placeOrderSignal(PFXOrder summary); - - void deleteOrderSignalFull(PFXHttpRequestWorker* worker); - void getInventorySignalFull(PFXHttpRequestWorker* worker, QMap summary); - void getOrderByIdSignalFull(PFXHttpRequestWorker* worker, PFXOrder summary); - void placeOrderSignalFull(PFXHttpRequestWorker* worker, PFXOrder summary); - - void deleteOrderSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void getInventorySignalE(QMap summary, QNetworkReply::NetworkError error_type, QString error_str); - void getOrderByIdSignalE(PFXOrder summary, QNetworkReply::NetworkError error_type, QString error_str); - void placeOrderSignalE(PFXOrder summary, QNetworkReply::NetworkError error_type, QString error_str); - - void deleteOrderSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getInventorySignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getOrderByIdSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void placeOrderSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - -}; - -} -#endif diff --git a/samples/client/petstore/cpp-qt5/client/PFXTag.cpp b/samples/client/petstore/cpp-qt5/client/PFXTag.cpp deleted file mode 100644 index b4fa9007879c..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXTag.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PFXTag.h" - -#include -#include -#include -#include - -#include "PFXHelpers.h" - -namespace test_namespace { - -PFXTag::PFXTag(QString json) { - this->initializeModel(); - this->fromJson(json); -} - -PFXTag::PFXTag() { - this->initializeModel(); -} - -PFXTag::~PFXTag() { - -} - -void -PFXTag::initializeModel() { - - m_id_isSet = false; - m_id_isValid = false; - - m_name_isSet = false; - m_name_isValid = false; - -} - -void -PFXTag::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); -} - -void -PFXTag::fromJsonObject(QJsonObject json) { - - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); - m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - - m_name_isValid = ::test_namespace::fromJsonValue(name, json[QString("name")]); - m_name_isSet = !json[QString("name")].isNull() && m_name_isValid; - -} - -QString -PFXTag::asJson () const { - QJsonObject obj = this->asJsonObject(); - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); -} - -QJsonObject -PFXTag::asJsonObject() const { - QJsonObject obj; - if(m_id_isSet){ - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); - } - if(m_name_isSet){ - obj.insert(QString("name"), ::test_namespace::toJsonValue(name)); - } - return obj; -} - - -qint64 -PFXTag::getId() const { - return id; -} -void -PFXTag::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; -} - - -QString -PFXTag::getName() const { - return name; -} -void -PFXTag::setName(const QString &name) { - this->name = name; - this->m_name_isSet = true; -} - -bool -PFXTag::isSet() const { - bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_name_isSet){ isObjectUpdated = true; break;} - }while(false); - return isObjectUpdated; -} - -bool -PFXTag::isValid() const { - // only required properties are required for the object to be considered valid - return true; -} - -} - diff --git a/samples/client/petstore/cpp-qt5/client/PFXTag.h b/samples/client/petstore/cpp-qt5/client/PFXTag.h deleted file mode 100644 index 0ac8fe370852..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXTag.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PFXTag.h - * - * A tag for a pet - */ - -#ifndef PFXTag_H -#define PFXTag_H - -#include - - -#include - -#include "PFXObject.h" -#include "PFXEnum.h" - - -namespace test_namespace { - -class PFXTag: public PFXObject { -public: - PFXTag(); - PFXTag(QString json); - ~PFXTag() override; - - QString asJson () const override; - QJsonObject asJsonObject() const override; - void fromJsonObject(QJsonObject json) override; - void fromJson(QString jsonString) override; - - - qint64 getId() const; - void setId(const qint64 &id); - - - QString getName() const; - void setName(const QString &name); - - - - virtual bool isSet() const override; - virtual bool isValid() const override; - -private: - void initializeModel(); - - qint64 id; - bool m_id_isSet; - bool m_id_isValid; - - QString name; - bool m_name_isSet; - bool m_name_isValid; - - }; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXTag) - -#endif // PFXTag_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXUser.cpp b/samples/client/petstore/cpp-qt5/client/PFXUser.cpp deleted file mode 100644 index d77213bfd86f..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXUser.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PFXUser.h" - -#include -#include -#include -#include - -#include "PFXHelpers.h" - -namespace test_namespace { - -PFXUser::PFXUser(QString json) { - this->initializeModel(); - this->fromJson(json); -} - -PFXUser::PFXUser() { - this->initializeModel(); -} - -PFXUser::~PFXUser() { - -} - -void -PFXUser::initializeModel() { - - m_id_isSet = false; - m_id_isValid = false; - - m_username_isSet = false; - m_username_isValid = false; - - m_first_name_isSet = false; - m_first_name_isValid = false; - - m_last_name_isSet = false; - m_last_name_isValid = false; - - m_email_isSet = false; - m_email_isValid = false; - - m_password_isSet = false; - m_password_isValid = false; - - m_phone_isSet = false; - m_phone_isValid = false; - - m_user_status_isSet = false; - m_user_status_isValid = false; - -} - -void -PFXUser::fromJson(QString jsonString) { - QByteArray array (jsonString.toStdString().c_str()); - QJsonDocument doc = QJsonDocument::fromJson(array); - QJsonObject jsonObject = doc.object(); - this->fromJsonObject(jsonObject); -} - -void -PFXUser::fromJsonObject(QJsonObject json) { - - m_id_isValid = ::test_namespace::fromJsonValue(id, json[QString("id")]); - m_id_isSet = !json[QString("id")].isNull() && m_id_isValid; - - m_username_isValid = ::test_namespace::fromJsonValue(username, json[QString("username")]); - m_username_isSet = !json[QString("username")].isNull() && m_username_isValid; - - m_first_name_isValid = ::test_namespace::fromJsonValue(first_name, json[QString("firstName")]); - m_first_name_isSet = !json[QString("firstName")].isNull() && m_first_name_isValid; - - m_last_name_isValid = ::test_namespace::fromJsonValue(last_name, json[QString("lastName")]); - m_last_name_isSet = !json[QString("lastName")].isNull() && m_last_name_isValid; - - m_email_isValid = ::test_namespace::fromJsonValue(email, json[QString("email")]); - m_email_isSet = !json[QString("email")].isNull() && m_email_isValid; - - m_password_isValid = ::test_namespace::fromJsonValue(password, json[QString("password")]); - m_password_isSet = !json[QString("password")].isNull() && m_password_isValid; - - m_phone_isValid = ::test_namespace::fromJsonValue(phone, json[QString("phone")]); - m_phone_isSet = !json[QString("phone")].isNull() && m_phone_isValid; - - m_user_status_isValid = ::test_namespace::fromJsonValue(user_status, json[QString("userStatus")]); - m_user_status_isSet = !json[QString("userStatus")].isNull() && m_user_status_isValid; - -} - -QString -PFXUser::asJson () const { - QJsonObject obj = this->asJsonObject(); - QJsonDocument doc(obj); - QByteArray bytes = doc.toJson(); - return QString(bytes); -} - -QJsonObject -PFXUser::asJsonObject() const { - QJsonObject obj; - if(m_id_isSet){ - obj.insert(QString("id"), ::test_namespace::toJsonValue(id)); - } - if(m_username_isSet){ - obj.insert(QString("username"), ::test_namespace::toJsonValue(username)); - } - if(m_first_name_isSet){ - obj.insert(QString("firstName"), ::test_namespace::toJsonValue(first_name)); - } - if(m_last_name_isSet){ - obj.insert(QString("lastName"), ::test_namespace::toJsonValue(last_name)); - } - if(m_email_isSet){ - obj.insert(QString("email"), ::test_namespace::toJsonValue(email)); - } - if(m_password_isSet){ - obj.insert(QString("password"), ::test_namespace::toJsonValue(password)); - } - if(m_phone_isSet){ - obj.insert(QString("phone"), ::test_namespace::toJsonValue(phone)); - } - if(m_user_status_isSet){ - obj.insert(QString("userStatus"), ::test_namespace::toJsonValue(user_status)); - } - return obj; -} - - -qint64 -PFXUser::getId() const { - return id; -} -void -PFXUser::setId(const qint64 &id) { - this->id = id; - this->m_id_isSet = true; -} - - -QString -PFXUser::getUsername() const { - return username; -} -void -PFXUser::setUsername(const QString &username) { - this->username = username; - this->m_username_isSet = true; -} - - -QString -PFXUser::getFirstName() const { - return first_name; -} -void -PFXUser::setFirstName(const QString &first_name) { - this->first_name = first_name; - this->m_first_name_isSet = true; -} - - -QString -PFXUser::getLastName() const { - return last_name; -} -void -PFXUser::setLastName(const QString &last_name) { - this->last_name = last_name; - this->m_last_name_isSet = true; -} - - -QString -PFXUser::getEmail() const { - return email; -} -void -PFXUser::setEmail(const QString &email) { - this->email = email; - this->m_email_isSet = true; -} - - -QString -PFXUser::getPassword() const { - return password; -} -void -PFXUser::setPassword(const QString &password) { - this->password = password; - this->m_password_isSet = true; -} - - -QString -PFXUser::getPhone() const { - return phone; -} -void -PFXUser::setPhone(const QString &phone) { - this->phone = phone; - this->m_phone_isSet = true; -} - - -qint32 -PFXUser::getUserStatus() const { - return user_status; -} -void -PFXUser::setUserStatus(const qint32 &user_status) { - this->user_status = user_status; - this->m_user_status_isSet = true; -} - -bool -PFXUser::isSet() const { - bool isObjectUpdated = false; - do{ - if(m_id_isSet){ isObjectUpdated = true; break;} - - if(m_username_isSet){ isObjectUpdated = true; break;} - - if(m_first_name_isSet){ isObjectUpdated = true; break;} - - if(m_last_name_isSet){ isObjectUpdated = true; break;} - - if(m_email_isSet){ isObjectUpdated = true; break;} - - if(m_password_isSet){ isObjectUpdated = true; break;} - - if(m_phone_isSet){ isObjectUpdated = true; break;} - - if(m_user_status_isSet){ isObjectUpdated = true; break;} - }while(false); - return isObjectUpdated; -} - -bool -PFXUser::isValid() const { - // only required properties are required for the object to be considered valid - return true; -} - -} - diff --git a/samples/client/petstore/cpp-qt5/client/PFXUser.h b/samples/client/petstore/cpp-qt5/client/PFXUser.h deleted file mode 100644 index bfda4d5e4e0d..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXUser.h +++ /dev/null @@ -1,122 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PFXUser.h - * - * A User who is purchasing from the pet store - */ - -#ifndef PFXUser_H -#define PFXUser_H - -#include - - -#include - -#include "PFXObject.h" -#include "PFXEnum.h" - - -namespace test_namespace { - -class PFXUser: public PFXObject { -public: - PFXUser(); - PFXUser(QString json); - ~PFXUser() override; - - QString asJson () const override; - QJsonObject asJsonObject() const override; - void fromJsonObject(QJsonObject json) override; - void fromJson(QString jsonString) override; - - - qint64 getId() const; - void setId(const qint64 &id); - - - QString getUsername() const; - void setUsername(const QString &username); - - - QString getFirstName() const; - void setFirstName(const QString &first_name); - - - QString getLastName() const; - void setLastName(const QString &last_name); - - - QString getEmail() const; - void setEmail(const QString &email); - - - QString getPassword() const; - void setPassword(const QString &password); - - - QString getPhone() const; - void setPhone(const QString &phone); - - - qint32 getUserStatus() const; - void setUserStatus(const qint32 &user_status); - - - - virtual bool isSet() const override; - virtual bool isValid() const override; - -private: - void initializeModel(); - - qint64 id; - bool m_id_isSet; - bool m_id_isValid; - - QString username; - bool m_username_isSet; - bool m_username_isValid; - - QString first_name; - bool m_first_name_isSet; - bool m_first_name_isValid; - - QString last_name; - bool m_last_name_isSet; - bool m_last_name_isValid; - - QString email; - bool m_email_isSet; - bool m_email_isValid; - - QString password; - bool m_password_isSet; - bool m_password_isValid; - - QString phone; - bool m_phone_isSet; - bool m_phone_isValid; - - qint32 user_status; - bool m_user_status_isSet; - bool m_user_status_isValid; - - }; - -} - -Q_DECLARE_METATYPE(test_namespace::PFXUser) - -#endif // PFXUser_H diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp b/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp deleted file mode 100644 index 07c5edb9b907..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.cpp +++ /dev/null @@ -1,511 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "PFXUserApi.h" -#include "PFXHelpers.h" - -#include -#include - -namespace test_namespace { - -PFXUserApi::PFXUserApi(const QString &scheme, const QString &host, int port, const QString& basePath, const int timeOut) : - _scheme(scheme), - _host(host), - _port(port), - _basePath(basePath), - _timeOut(timeOut) { -} - -PFXUserApi::~PFXUserApi() { -} - -void PFXUserApi::setScheme(const QString& scheme){ - _scheme = scheme; -} - -void PFXUserApi::setHost(const QString& host){ - _host = host; -} - -void PFXUserApi::setPort(int port){ - _port = port; -} - -void PFXUserApi::setBasePath(const QString& basePath){ - _basePath = basePath; -} - -void PFXUserApi::setTimeOut(const int timeOut){ - _timeOut = timeOut; -} - -void PFXUserApi::setWorkingDirectory(const QString& path){ - _workingDirectory = path; -} - -void PFXUserApi::addHeaders(const QString& key, const QString& value){ - defaultHeaders.insert(key, value); -} - -void -PFXUserApi::createUser(const PFXUser& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - - QString output = body.asJson(); - input.request_body.append(output); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::createUserCallback); - - worker->execute(&input); -} - -void -PFXUserApi::createUserCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit createUserSignal(); - emit createUserSignalFull(worker); - } else { - emit createUserSignalE(error_type, error_str); - emit createUserSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::createUsersWithArrayInput(const QList& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/createWithArray"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - - QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); - QByteArray bytes = doc.toJson(); - input.request_body.append(bytes); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::createUsersWithArrayInputCallback); - - worker->execute(&input); -} - -void -PFXUserApi::createUsersWithArrayInputCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit createUsersWithArrayInputSignal(); - emit createUsersWithArrayInputSignalFull(worker); - } else { - emit createUsersWithArrayInputSignalE(error_type, error_str); - emit createUsersWithArrayInputSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::createUsersWithListInput(const QList& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/createWithList"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "POST"); - - - QJsonDocument doc(::test_namespace::toJsonValue(body).toArray()); - QByteArray bytes = doc.toJson(); - input.request_body.append(bytes); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::createUsersWithListInputCallback); - - worker->execute(&input); -} - -void -PFXUserApi::createUsersWithListInputCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit createUsersWithListInputSignal(); - emit createUsersWithListInputSignalFull(worker); - } else { - emit createUsersWithListInputSignalE(error_type, error_str); - emit createUsersWithListInputSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::deleteUser(const QString& username) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/{username}"); - QString usernamePathParam("{"); - usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "DELETE"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::deleteUserCallback); - - worker->execute(&input); -} - -void -PFXUserApi::deleteUserCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit deleteUserSignal(); - emit deleteUserSignalFull(worker); - } else { - emit deleteUserSignalE(error_type, error_str); - emit deleteUserSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::getUserByName(const QString& username) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/{username}"); - QString usernamePathParam("{"); - usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::getUserByNameCallback); - - worker->execute(&input); -} - -void -PFXUserApi::getUserByNameCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - PFXUser output(QString(worker->response)); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit getUserByNameSignal(output); - emit getUserByNameSignalFull(worker, output); - } else { - emit getUserByNameSignalE(output, error_type, error_str); - emit getUserByNameSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::loginUser(const QString& username, const QString& password) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/login"); - - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("username")) - .append("=") - .append(QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - - if (fullPath.indexOf("?") > 0) - fullPath.append("&"); - else - fullPath.append("?"); - fullPath.append(QUrl::toPercentEncoding("password")) - .append("=") - .append(QUrl::toPercentEncoding(::test_namespace::toStringValue(password))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::loginUserCallback); - - worker->execute(&input); -} - -void -PFXUserApi::loginUserCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - QString output; - ::test_namespace::fromStringValue(QString(worker->response), output); - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit loginUserSignal(output); - emit loginUserSignalFull(worker, output); - } else { - emit loginUserSignalE(output, error_type, error_str); - emit loginUserSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::logoutUser() { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/logout"); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "GET"); - - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::logoutUserCallback); - - worker->execute(&input); -} - -void -PFXUserApi::logoutUserCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit logoutUserSignal(); - emit logoutUserSignalFull(worker); - } else { - emit logoutUserSignalE(error_type, error_str); - emit logoutUserSignalEFull(worker, error_type, error_str); - } -} - -void -PFXUserApi::updateUser(const QString& username, const PFXUser& body) { - QString fullPath = QString("%0://%1%2%3%4") - .arg(_scheme) - .arg(_host) - .arg(_port ? ":" + QString::number(_port) : "") - .arg(_basePath) - .arg("/user/{username}"); - QString usernamePathParam("{"); - usernamePathParam.append("username").append("}"); - fullPath.replace(usernamePathParam, QUrl::toPercentEncoding(::test_namespace::toStringValue(username))); - - PFXHttpRequestWorker *worker = new PFXHttpRequestWorker(this); - worker->setTimeOut(_timeOut); - worker->setWorkingDirectory(_workingDirectory); - PFXHttpRequestInput input(fullPath, "PUT"); - - - QString output = body.asJson(); - input.request_body.append(output); - - - foreach(QString key, this->defaultHeaders.keys()) { - input.headers.insert(key, this->defaultHeaders.value(key)); - } - - connect(worker, - &PFXHttpRequestWorker::on_execution_finished, - this, - &PFXUserApi::updateUserCallback); - - worker->execute(&input); -} - -void -PFXUserApi::updateUserCallback(PFXHttpRequestWorker * worker) { - QString msg; - QString error_str = worker->error_str; - QNetworkReply::NetworkError error_type = worker->error_type; - - if (worker->error_type == QNetworkReply::NoError) { - msg = QString("Success! %1 bytes").arg(worker->response.length()); - } - else { - msg = "Error: " + worker->error_str; - } - worker->deleteLater(); - - if (worker->error_type == QNetworkReply::NoError) { - emit updateUserSignal(); - emit updateUserSignalFull(worker); - } else { - emit updateUserSignalE(error_type, error_str); - emit updateUserSignalEFull(worker, error_type, error_str); - } -} - - -} diff --git a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h b/samples/client/petstore/cpp-qt5/client/PFXUserApi.h deleted file mode 100644 index afb098152c73..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXUserApi.h +++ /dev/null @@ -1,104 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#ifndef PFX_PFXUserApi_H -#define PFX_PFXUserApi_H - -#include "PFXHttpRequest.h" - -#include "PFXUser.h" -#include -#include - -#include - -namespace test_namespace { - -class PFXUserApi: public QObject { - Q_OBJECT - -public: - PFXUserApi(const QString &scheme = "http", const QString &host = "petstore.swagger.io", int port = 0, const QString& basePath = "/v2", const int timeOut = 0); - ~PFXUserApi(); - - void setScheme(const QString &scheme); - void setHost(const QString &host); - void setPort(int port); - void setBasePath(const QString& basePath); - void setTimeOut(const int timeOut); - void setWorkingDirectory(const QString& path); - void addHeaders(const QString& key, const QString& value); - - void createUser(const PFXUser& body); - void createUsersWithArrayInput(const QList& body); - void createUsersWithListInput(const QList& body); - void deleteUser(const QString& username); - void getUserByName(const QString& username); - void loginUser(const QString& username, const QString& password); - void logoutUser(); - void updateUser(const QString& username, const PFXUser& body); - -private: - QString _scheme, _host, _basePath; - int _port, _timeOut; - QString _workingDirectory; - QMap defaultHeaders; - void createUserCallback (PFXHttpRequestWorker * worker); - void createUsersWithArrayInputCallback (PFXHttpRequestWorker * worker); - void createUsersWithListInputCallback (PFXHttpRequestWorker * worker); - void deleteUserCallback (PFXHttpRequestWorker * worker); - void getUserByNameCallback (PFXHttpRequestWorker * worker); - void loginUserCallback (PFXHttpRequestWorker * worker); - void logoutUserCallback (PFXHttpRequestWorker * worker); - void updateUserCallback (PFXHttpRequestWorker * worker); - -signals: - void createUserSignal(); - void createUsersWithArrayInputSignal(); - void createUsersWithListInputSignal(); - void deleteUserSignal(); - void getUserByNameSignal(PFXUser summary); - void loginUserSignal(QString summary); - void logoutUserSignal(); - void updateUserSignal(); - - void createUserSignalFull(PFXHttpRequestWorker* worker); - void createUsersWithArrayInputSignalFull(PFXHttpRequestWorker* worker); - void createUsersWithListInputSignalFull(PFXHttpRequestWorker* worker); - void deleteUserSignalFull(PFXHttpRequestWorker* worker); - void getUserByNameSignalFull(PFXHttpRequestWorker* worker, PFXUser summary); - void loginUserSignalFull(PFXHttpRequestWorker* worker, QString summary); - void logoutUserSignalFull(PFXHttpRequestWorker* worker); - void updateUserSignalFull(PFXHttpRequestWorker* worker); - - void createUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithArrayInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithListInputSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void deleteUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void getUserByNameSignalE(PFXUser summary, QNetworkReply::NetworkError error_type, QString error_str); - void loginUserSignalE(QString summary, QNetworkReply::NetworkError error_type, QString error_str); - void logoutUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - void updateUserSignalE(QNetworkReply::NetworkError error_type, QString error_str); - - void createUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithArrayInputSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void createUsersWithListInputSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void deleteUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void getUserByNameSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void loginUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void logoutUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - void updateUserSignalEFull(PFXHttpRequestWorker* worker, QNetworkReply::NetworkError error_type, QString error_str); - -}; - -} -#endif diff --git a/samples/client/petstore/cpp-qt5/client/PFXclient.pri b/samples/client/petstore/cpp-qt5/client/PFXclient.pri deleted file mode 100644 index e86f90006a13..000000000000 --- a/samples/client/petstore/cpp-qt5/client/PFXclient.pri +++ /dev/null @@ -1,38 +0,0 @@ -QT += network - -HEADERS += \ -# Models - $${PWD}/PFXApiResponse.h \ - $${PWD}/PFXCategory.h \ - $${PWD}/PFXOrder.h \ - $${PWD}/PFXPet.h \ - $${PWD}/PFXTag.h \ - $${PWD}/PFXUser.h \ -# APIs - $${PWD}/PFXPetApi.h \ - $${PWD}/PFXStoreApi.h \ - $${PWD}/PFXUserApi.h \ -# Others - $${PWD}/PFXHelpers.h \ - $${PWD}/PFXHttpRequest.h \ - $${PWD}/PFXObject.h \ - $${PWD}/PFXEnum.h \ - $${PWD}/PFXHttpFileElement.h - -SOURCES += \ -# Models - $${PWD}/PFXApiResponse.cpp \ - $${PWD}/PFXCategory.cpp \ - $${PWD}/PFXOrder.cpp \ - $${PWD}/PFXPet.cpp \ - $${PWD}/PFXTag.cpp \ - $${PWD}/PFXUser.cpp \ -# APIs - $${PWD}/PFXPetApi.cpp \ - $${PWD}/PFXStoreApi.cpp \ - $${PWD}/PFXUserApi.cpp \ -# Others - $${PWD}/PFXHelpers.cpp \ - $${PWD}/PFXHttpRequest.cpp \ - $${PWD}/PFXHttpFileElement.cpp - diff --git a/samples/client/petstore/cpp-qt5/pom.xml b/samples/client/petstore/cpp-qt5/pom.xml deleted file mode 100644 index 70cf260fde76..000000000000 --- a/samples/client/petstore/cpp-qt5/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - org.openapitools - CppQt5PetstoreClientTests - pom - 1.0-SNAPSHOT - Qt5 OpenAPI Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - pet-test - integration-test - - exec - - - ./build-and-test.bash - - - - - - - diff --git a/samples/client/petstore/cpp-restsdk/.gitignore b/samples/client/petstore/cpp-restsdk/.gitignore deleted file mode 100644 index 4581ef2eeefc..000000000000 --- a/samples/client/petstore/cpp-restsdk/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app diff --git a/samples/client/petstore/cpp-restsdk/.openapi-generator-ignore b/samples/client/petstore/cpp-restsdk/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/cpp-restsdk/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION deleted file mode 100644 index afa636560641..000000000000 --- a/samples/client/petstore/cpp-restsdk/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/CMakeLists.txt b/samples/client/petstore/cpp-restsdk/CMakeLists.txt deleted file mode 100644 index 6aec7474b595..000000000000 --- a/samples/client/petstore/cpp-restsdk/CMakeLists.txt +++ /dev/null @@ -1,37 +0,0 @@ -cmake_minimum_required (VERSION 3.2) - -project(cpprest-petstore) -set(CMAKE_VERBOSE_MAKEFILE ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -Wno-unused-variable") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -std=c++14 -Wall -Wno-unused-variable") - -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg -g3") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg -g3") -set(CMAKE_BUILD_TYPE Debug) -set(CMAKE_PREFIX_PATH /usr/lib/x86_64-linux-gnu/cmake) -find_package(cpprestsdk REQUIRED) -find_package(Boost REQUIRED) -add_subdirectory(client) - -file(GLOB SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp -) -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR}/client - ${CMAKE_CURRENT_SOURCE_DIR}/client/model - ${CMAKE_CURRENT_SOURCE_DIR}/client/api -) - -link_directories( - ${Boost_LIBRARY_DIRS} -) -add_executable(${PROJECT_NAME} ${SRCS}) -add_dependencies(${PROJECT_NAME} CppRestOpenAPIClient ) -target_link_libraries(${PROJECT_NAME} CppRestOpenAPIClient cpprest pthread boost_system crypto) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) -set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) - -install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/samples/client/petstore/cpp-restsdk/PetApiTests.cpp b/samples/client/petstore/cpp-restsdk/PetApiTests.cpp deleted file mode 100644 index c8a1bdad1a09..000000000000 --- a/samples/client/petstore/cpp-restsdk/PetApiTests.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "PetApiTests.h" -#include -#include -#include -#include - -OAIPetApiTests::OAIPetApiTests(std::string host, std::string basePath){ - apiconfiguration = std::make_shared(); - apiconfiguration->setBaseUrl(host + basePath); - apiconfiguration->setUserAgent(U("OpenAPI Client")); - apiclient = std::make_shared(apiconfiguration); - api = std::make_shared(apiclient); -} - -OAIPetApiTests::~OAIPetApiTests() { - -} - -void OAIPetApiTests::runTests(){ - testAddPet(); - testFindPetsByStatus(); - testGetPetById(); -} - -void OAIPetApiTests::testAddPet(){ - auto req = std::make_shared(); - req->setId(12345); - req->setName("cpprest-pet"); - req->setStatus(U("123")); - - std::function responseCallback = []() - { - std::cout << "added pet successfully" << std::endl; - }; - - auto reqTask = api->addPet(req).then(responseCallback); - try{ - reqTask.wait(); - } - catch(const ApiException& ex){ - std::cout << ex.what() << std::endl << std::flush; - std::string err(ex.what()); - } - catch(const std::exception &ex){ - std::cout << ex.what() << std::endl << std::flush; - std::string err(ex.what()); - } -} - -void OAIPetApiTests::testFindPetsByStatus(){ - auto req = std::vector(); - req.push_back(U("123")); - auto reqTask = api->findPetsByStatus(req) - .then([=](std::vector> pets) - { - std::cout << "found pet successfully" << std::endl; - }); - try{ - reqTask.wait(); - } - catch(const ApiException& ex){ - std::cout << ex.what() << std::endl << std::flush; - std::string err(ex.what()); - } - catch(const std::exception &ex){ - std::cout << ex.what() << std::endl << std::flush; - std::string err(ex.what()); - } -} - -void OAIPetApiTests::testGetPetById(){ - int req = 12345; - auto responseCallback = std::bind(&OAIPetApiTests::getPetByIdCallback, this, std::placeholders::_1); - - auto reqTask = api->getPetById(req).then(responseCallback); - - try{ - reqTask.wait(); - } - catch(const ApiException& ex){ - std::cout << ex.what() << std::endl << std::flush; - std::string err(ex.what()); - } - catch(const std::exception &ex){ - std::cout << ex.what() << std::endl << std::flush; - std::string err(ex.what()); - } -} - -void OAIPetApiTests::getPetByIdCallback(std::shared_ptr pet){ - std::cout << "found pet by id successfully" << std::endl; -} diff --git a/samples/client/petstore/cpp-restsdk/PetApiTests.h b/samples/client/petstore/cpp-restsdk/PetApiTests.h deleted file mode 100644 index 7727a6437fd1..000000000000 --- a/samples/client/petstore/cpp-restsdk/PetApiTests.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef OAI_PETAPI_TESTS_H -#define OAI_PETAPI_TESTS_H - -#include -#include "client/ApiClient.h" -#include "client/ApiConfiguration.h" -#include "client/api/PetApi.h" -#include "client/model/Pet.h" - - -using namespace std; -using namespace org::openapitools::client::api; - -class OAIPetApiTests -{ -public: - explicit OAIPetApiTests(std::string host = U("http://petstore.swagger.io"), std::string basePath = U("/v2")); - - virtual ~OAIPetApiTests(); -public: - void runTests(); -private: - void testAddPet(); - void testFindPetsByStatus(); - void testGetPetById(); - - void getPetByIdCallback(std::shared_ptr pet); - - std::shared_ptr apiconfiguration; - std::shared_ptr apiclient; - std::shared_ptr api; -}; - -#endif // OAI_PETAPI_TESTS_H diff --git a/samples/client/petstore/cpp-restsdk/client/.gitignore b/samples/client/petstore/cpp-restsdk/client/.gitignore deleted file mode 100644 index 4581ef2eeefc..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Compiled Object files -*.slo -*.lo -*.o -*.obj - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Fortran module files -*.mod -*.smod - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore b/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION b/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION deleted file mode 100644 index 83a328a9227e..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.1.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp b/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp deleted file mode 100644 index 7aa7c87fc288..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "ApiClient.h" -#include "MultipartFormData.h" -#include "ModelBase.h" - -#include -#include -#include - -template -utility::string_t toString(const T value) -{ - utility::ostringstream_t out; - out << std::setprecision(std::numeric_limits::digits10) << std::fixed << value; - return out.str(); -} - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - -ApiClient::ApiClient(std::shared_ptr configuration ) - : m_Configuration(configuration) -{ -} -ApiClient::~ApiClient() -{ -} - -const ApiClient::ResponseHandlerType& ApiClient::getResponseHandler() const { - return m_ResponseHandler; -} - -void ApiClient::setResponseHandler(const ResponseHandlerType& responseHandler) { - m_ResponseHandler = responseHandler; -} - -std::shared_ptr ApiClient::getConfiguration() const -{ - return m_Configuration; -} -void ApiClient::setConfiguration(std::shared_ptr configuration) -{ - m_Configuration = configuration; -} - - -utility::string_t ApiClient::parameterToString(utility::string_t value) -{ - return value; -} -utility::string_t ApiClient::parameterToString(int64_t value) -{ - std::stringstream valueAsStringStream; - valueAsStringStream << value; - return utility::conversions::to_string_t(valueAsStringStream.str()); -} -utility::string_t ApiClient::parameterToString(int32_t value) -{ - std::stringstream valueAsStringStream; - valueAsStringStream << value; - return utility::conversions::to_string_t(valueAsStringStream.str()); -} - -utility::string_t ApiClient::parameterToString(float value) -{ - return utility::conversions::to_string_t(toString(value)); -} - -utility::string_t ApiClient::parameterToString(double value) -{ - return utility::conversions::to_string_t(toString(value)); -} - -utility::string_t ApiClient::parameterToString(const utility::datetime &value) -{ - return utility::conversions::to_string_t(value.to_string(utility::datetime::ISO_8601)); -} - -pplx::task ApiClient::callApi( - const utility::string_t& path, - const utility::string_t& method, - const std::map& queryParams, - const std::shared_ptr postBody, - const std::map& headerParams, - const std::map& formParams, - const std::map>& fileParams, - const utility::string_t& contentType -) const -{ - if (postBody != nullptr && formParams.size() != 0) - { - throw ApiException(400, utility::conversions::to_string_t("Cannot have body and form params")); - } - - if (postBody != nullptr && fileParams.size() != 0) - { - throw ApiException(400, utility::conversions::to_string_t("Cannot have body and file params")); - } - - if (fileParams.size() > 0 && contentType != utility::conversions::to_string_t("multipart/form-data")) - { - throw ApiException(400, utility::conversions::to_string_t("Operations with file parameters must be called with multipart/form-data")); - } - - web::http::client::http_client client(m_Configuration->getBaseUrl(), m_Configuration->getHttpConfig()); - - web::http::http_request request; - for ( auto& kvp : headerParams ) - { - request.headers().add(kvp.first, kvp.second); - } - - if (fileParams.size() > 0) - { - MultipartFormData uploadData; - for (auto& kvp : formParams) - { - uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second)); - } - for (auto& kvp : fileParams) - { - uploadData.add(ModelBase::toHttpContent(kvp.first, kvp.second)); - } - std::stringstream data; - uploadData.writeTo(data); - auto bodyString = data.str(); - auto length = bodyString.size(); - request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, utility::conversions::to_string_t("multipart/form-data; boundary=") + uploadData.getBoundary()); - } - else - { - if (postBody != nullptr) - { - std::stringstream data; - postBody->writeTo(data); - auto bodyString = data.str(); - auto length = bodyString.size(); - request.set_body(concurrency::streams::bytestream::open_istream(std::move(bodyString)), length, contentType); - } - else - { - if (contentType == utility::conversions::to_string_t("application/json")) - { - web::json::value body_data = web::json::value::object(); - for (auto& kvp : formParams) - { - body_data[kvp.first] = ModelBase::toJson(kvp.second); - } - if (!formParams.empty()) - { - request.set_body(body_data); - } - } - else - { - web::http::uri_builder formData; - for (auto& kvp : formParams) - { - formData.append_query(kvp.first, kvp.second); - } - if (!formParams.empty()) - { - request.set_body(formData.query(), utility::conversions::to_string_t("application/x-www-form-urlencoded")); - } - } - } - } - - web::http::uri_builder builder(path); - for (auto& kvp : queryParams) - { - builder.append_query(kvp.first, kvp.second); - } - request.set_request_uri(builder.to_uri()); - request.set_method(method); - if ( !request.headers().has( web::http::header_names::user_agent ) ) - { - request.headers().add( web::http::header_names::user_agent, m_Configuration->getUserAgent() ); - } - - return client.request(request); -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/ApiClient.h b/samples/client/petstore/cpp-restsdk/client/ApiClient.h deleted file mode 100644 index bfabf55ec9b8..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ApiClient.h +++ /dev/null @@ -1,113 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * ApiClient.h - * - * This is an API client responsible for stating the HTTP calls - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_API_ApiClient_H_ -#define ORG_OPENAPITOOLS_CLIENT_API_ApiClient_H_ - - -#include "ApiConfiguration.h" -#include "ApiException.h" -#include "IHttpBody.h" -#include "HttpContent.h" - -#include -#include -#include - -#if defined (_WIN32) || defined (_WIN64) -#undef U -#endif - -#include -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - -class ApiClient -{ -public: - ApiClient( std::shared_ptr configuration = nullptr ); - virtual ~ApiClient(); - - typedef std::function ResponseHandlerType; - - const ResponseHandlerType& getResponseHandler() const; - void setResponseHandler(const ResponseHandlerType& responseHandler); - - std::shared_ptr getConfiguration() const; - void setConfiguration(std::shared_ptr configuration); - - static utility::string_t parameterToString(utility::string_t value); - static utility::string_t parameterToString(int32_t value); - static utility::string_t parameterToString(int64_t value); - static utility::string_t parameterToString(float value); - static utility::string_t parameterToString(double value); - static utility::string_t parameterToString(const utility::datetime &value); - template - static utility::string_t parameterToString(const std::vector& value); - template - static utility::string_t parameterToString(const std::shared_ptr& value); - - pplx::task callApi( - const utility::string_t& path, - const utility::string_t& method, - const std::map& queryParams, - const std::shared_ptr postBody, - const std::map& headerParams, - const std::map& formParams, - const std::map>& fileParams, - const utility::string_t& contentType - ) const; - -protected: - - ResponseHandlerType m_ResponseHandler; - std::shared_ptr m_Configuration; -}; - -template -utility::string_t ApiClient::parameterToString(const std::vector& value) -{ - utility::stringstream_t ss; - - for( size_t i = 0; i < value.size(); i++) - { - if( i > 0) ss << utility::conversions::to_string_t(", "); - ss << ApiClient::parameterToString(value[i]); - } - - return ss.str(); -} - -template -utility::string_t ApiClient::parameterToString(const std::shared_ptr& value) -{ - return parameterToString(*value.get()); -} - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_API_ApiClient_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp deleted file mode 100644 index 0d8f3fde31ca..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "ApiConfiguration.h" - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -ApiConfiguration::ApiConfiguration() -{ -} - -ApiConfiguration::~ApiConfiguration() -{ -} - -web::http::client::http_client_config& ApiConfiguration::getHttpConfig() -{ - return m_HttpConfig; -} - -void ApiConfiguration::setHttpConfig( web::http::client::http_client_config& value ) -{ - m_HttpConfig = value; -} - -utility::string_t ApiConfiguration::getBaseUrl() const -{ - return m_BaseUrl; -} - -void ApiConfiguration::setBaseUrl( const utility::string_t value ) -{ - m_BaseUrl = value; -} - -utility::string_t ApiConfiguration::getUserAgent() const -{ - return m_UserAgent; -} - -void ApiConfiguration::setUserAgent( const utility::string_t value ) -{ - m_UserAgent = value; -} - -std::map& ApiConfiguration::getDefaultHeaders() -{ - return m_DefaultHeaders; -} - -utility::string_t ApiConfiguration::getApiKey( const utility::string_t& prefix) const -{ - auto result = m_ApiKeys.find(prefix); - if( result != m_ApiKeys.end() ) - { - return result->second; - } - return utility::conversions::to_string_t(""); -} - -void ApiConfiguration::setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey ) -{ - m_ApiKeys[prefix] = apiKey; -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h b/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h deleted file mode 100644 index 45b5145ab79f..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ApiConfiguration.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * ApiConfiguration.h - * - * This class represents a single item of a multipart-formdata request. - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_API_ApiConfiguration_H_ -#define ORG_OPENAPITOOLS_CLIENT_API_ApiConfiguration_H_ - - - -#include - -#include -#include -namespace org { -namespace openapitools { -namespace client { -namespace api { - -class ApiConfiguration -{ -public: - ApiConfiguration(); - virtual ~ApiConfiguration(); - - web::http::client::http_client_config& getHttpConfig(); - void setHttpConfig( web::http::client::http_client_config& value ); - - utility::string_t getBaseUrl() const; - void setBaseUrl( const utility::string_t value ); - - utility::string_t getUserAgent() const; - void setUserAgent( const utility::string_t value ); - - std::map& getDefaultHeaders(); - - utility::string_t getApiKey( const utility::string_t& prefix) const; - void setApiKey( const utility::string_t& prefix, const utility::string_t& apiKey ); - -protected: - utility::string_t m_BaseUrl; - std::map m_DefaultHeaders; - std::map m_ApiKeys; - web::http::client::http_client_config m_HttpConfig; - utility::string_t m_UserAgent; -}; - -} -} -} -} -#endif /* ORG_OPENAPITOOLS_CLIENT_API_ApiConfiguration_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp b/samples/client/petstore/cpp-restsdk/client/ApiException.cpp deleted file mode 100644 index aae7fcd050cd..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.cpp +++ /dev/null @@ -1,53 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "ApiException.h" - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -ApiException::ApiException( int errorCode - , const utility::string_t& message - , std::shared_ptr content /*= nullptr*/ ) - : web::http::http_exception( errorCode, message ) - , m_Content(content) -{ -} -ApiException::ApiException( int errorCode - , const utility::string_t& message - , std::map& headers - , std::shared_ptr content /*= nullptr*/ ) - : web::http::http_exception( errorCode, message ) - , m_Content(content) - , m_Headers(headers) -{ -} - -ApiException::~ApiException() -{ -} - -std::shared_ptr ApiException::getContent() const -{ - return m_Content; -} - -std::map& ApiException::getHeaders() -{ - return m_Headers; -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/ApiException.h b/samples/client/petstore/cpp-restsdk/client/ApiException.h deleted file mode 100644 index 8be475993995..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ApiException.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * ApiException.h - * - * This is the exception being thrown in case the api call was not successful - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_API_ApiException_H_ -#define ORG_OPENAPITOOLS_CLIENT_API_ApiException_H_ - - - -#include -#include - -#include -#include - - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -class ApiException - : public web::http::http_exception -{ -public: - ApiException( int errorCode - , const utility::string_t& message - , std::shared_ptr content = nullptr ); - ApiException( int errorCode - , const utility::string_t& message - , std::map& headers - , std::shared_ptr content = nullptr ); - virtual ~ApiException(); - - std::map& getHeaders(); - std::shared_ptr getContent() const; - -protected: - std::shared_ptr m_Content; - std::map m_Headers; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_API_ApiBase_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt b/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt deleted file mode 100644 index 86565fec65e0..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/CMakeLists.txt +++ /dev/null @@ -1,54 +0,0 @@ -# -# OpenAPI Petstore -# This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. -# -# The version of the OpenAPI document: 1.0.0 -# -# https://openapi-generator.tech -# -# NOTE: Auto generated by OpenAPI Generator (https://openapi-generator.tech). - -cmake_minimum_required (VERSION 2.8) - -#PROJECT's NAME -project(CppRestOpenAPIClient) - - -# THE LOCATION OF OUTPUT BINARIES -set(CMAKE_LIBRARY_DIR ${PROJECT_SOURCE_DIR}/lib) -set(LIBRARY_OUTPUT_PATH ${CMAKE_LIBRARY_DIR}) - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE Release) -endif() - -# BUILD TYPE -message("A ${CMAKE_BUILD_TYPE} build configuration is detected") - -# Update require components as necessary -#find_package(Boost 1.45.0 REQUIRED COMPONENTS ${Boost_THREAD_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_REGEX_LIBRARY} ${Boost_DATE_TIME_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}) - -# build and set path to cpp rest sdk -set(CPPREST_ROOT ${PROJECT_SOURCE_DIR}/3rdParty/cpprest) -set(CPPREST_INCLUDE_DIR ${CPPREST_ROOT}/include) -set(CPPREST_LIBRARY_DIR ${CPPREST_ROOT}/lib) - -include_directories(${PROJECT_SOURCE_DIR} api model ${CPPREST_INCLUDE_DIR}) - - -# If using vcpkg, set include directories. Also comment out CPPREST section above since vcpkg will handle it. -# To install required vcpkg packages execute: -# > vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows -# set(VCPKG_ROOT "C:\\vcpkg\\installed\\x64-windows") -# set(VCPKG_INCLUDE_DIR ${VCPKG_ROOT}/include) -# set(VCPKG_LIBRARY_DIR ${VCPKG_ROOT}/lib) -# include_directories(${PROJECT_SOURCE_DIR} api model ${VCPKG_INCLUDE_DIR}) - -#SUPPORTING FILES -set(SUPPORTING_FILES "ApiClient" "ApiConfiguration" "ApiException" "HttpContent" "IHttpBody" "JsonBody" "ModelBase" "MultipartFormData" "Object") -#SOURCE FILES -file(GLOB SOURCE_FILES "api/*" "model/*") - -add_library(${PROJECT_NAME} ${SUPPORTING_FILES} ${SOURCE_FILES}) diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp b/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp deleted file mode 100644 index 7664053f202e..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "HttpContent.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -HttpContent::HttpContent() -{ -} - -HttpContent::~HttpContent() -{ -} - -utility::string_t HttpContent::getContentDisposition() -{ - return m_ContentDisposition; -} - -void HttpContent::setContentDisposition( const utility::string_t & value ) -{ - m_ContentDisposition = value; -} - -utility::string_t HttpContent::getName() -{ - return m_Name; -} - -void HttpContent::setName( const utility::string_t & value ) -{ - m_Name = value; -} - -utility::string_t HttpContent::getFileName() -{ - return m_FileName; -} - -void HttpContent::setFileName( const utility::string_t & value ) -{ - m_FileName = value; -} - -utility::string_t HttpContent::getContentType() -{ - return m_ContentType; -} - -void HttpContent::setContentType( const utility::string_t & value ) -{ - m_ContentType = value; -} - -std::shared_ptr HttpContent::getData() -{ - return m_Data; -} - -void HttpContent::setData( std::shared_ptr value ) -{ - m_Data = value; -} - -void HttpContent::writeTo( std::ostream& stream ) -{ - m_Data->seekg( 0, m_Data->beg ); - stream << m_Data->rdbuf(); -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/HttpContent.h b/samples/client/petstore/cpp-restsdk/client/HttpContent.h deleted file mode 100644 index 2024da6764e1..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/HttpContent.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * HttpContent.h - * - * This class represents a single item of a multipart-formdata request. - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_HttpContent_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_HttpContent_H_ - - - -#include - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -class HttpContent -{ -public: - HttpContent(); - virtual ~HttpContent(); - - virtual utility::string_t getContentDisposition(); - virtual void setContentDisposition( const utility::string_t& value ); - - virtual utility::string_t getName(); - virtual void setName( const utility::string_t& value ); - - virtual utility::string_t getFileName(); - virtual void setFileName( const utility::string_t& value ); - - virtual utility::string_t getContentType(); - virtual void setContentType( const utility::string_t& value ); - - virtual std::shared_ptr getData(); - virtual void setData( std::shared_ptr value ); - - virtual void writeTo( std::ostream& stream ); - -protected: - // NOTE: no utility::string_t here because those strings can only contain ascii - utility::string_t m_ContentDisposition; - utility::string_t m_Name; - utility::string_t m_FileName; - utility::string_t m_ContentType; - std::shared_ptr m_Data; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_HttpContent_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h b/samples/client/petstore/cpp-restsdk/client/IHttpBody.h deleted file mode 100644 index 4bcd03e10062..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/IHttpBody.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * IHttpBody.h - * - * This is the interface for contents that can be sent to a remote HTTP server. - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_IHttpBody_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_IHttpBody_H_ - - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -class IHttpBody -{ -public: - virtual ~IHttpBody() { } - - virtual void writeTo( std::ostream& stream ) = 0; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_IHttpBody_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp b/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp deleted file mode 100644 index 19e60971c574..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "JsonBody.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -JsonBody::JsonBody( const web::json::value& json) - : m_Json(json) -{ -} - -JsonBody::~JsonBody() -{ -} - -void JsonBody::writeTo( std::ostream& target ) -{ - m_Json.serialize(target); -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/JsonBody.h b/samples/client/petstore/cpp-restsdk/client/JsonBody.h deleted file mode 100644 index f8011a08da66..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/JsonBody.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * JsonBody.h - * - * This is a JSON http body which can be submitted via http - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_JsonBody_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_JsonBody_H_ - - -#include "IHttpBody.h" - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -class JsonBody - : public IHttpBody -{ -public: - JsonBody( const web::json::value& value ); - virtual ~JsonBody(); - - void writeTo( std::ostream& target ) override; - -protected: - web::json::value m_Json; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_JsonBody_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp b/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp deleted file mode 100644 index 940b9884d23a..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.cpp +++ /dev/null @@ -1,381 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "ModelBase.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -ModelBase::ModelBase() -{ -} -ModelBase::~ModelBase() -{ -} - -web::json::value ModelBase::toJson( const utility::string_t& value ) -{ - return web::json::value::string(value); -} -web::json::value ModelBase::toJson( const utility::datetime& value ) -{ - return web::json::value::string(value.to_string(utility::datetime::ISO_8601)); -} -web::json::value ModelBase::toJson( int32_t value ) -{ - return web::json::value::number(value); -} -web::json::value ModelBase::toJson( int64_t value ) -{ - return web::json::value::number(value); -} -web::json::value ModelBase::toJson( double value ) -{ - return web::json::value::number(value); -} -web::json::value ModelBase::toJson(bool value) { - return web::json::value::boolean(value); -} - -web::json::value ModelBase::toJson( std::shared_ptr content ) -{ - web::json::value value; - value[utility::conversions::to_string_t("ContentDisposition")] = ModelBase::toJson(content->getContentDisposition()); - value[utility::conversions::to_string_t("ContentType")] = ModelBase::toJson(content->getContentType()); - value[utility::conversions::to_string_t("FileName")] = ModelBase::toJson(content->getFileName()); - value[utility::conversions::to_string_t("InputStream")] = web::json::value::string( ModelBase::toBase64(content->getData()) ); - return value; -} - -std::shared_ptr ModelBase::fileFromJson(const web::json::value& val) -{ - std::shared_ptr content(new HttpContent); - - if(val.has_field(utility::conversions::to_string_t("ContentDisposition"))) - { - content->setContentDisposition( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("ContentDisposition"))) ); - } - if(val.has_field(utility::conversions::to_string_t("ContentType"))) - { - content->setContentType( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("ContentType"))) ); - } - if(val.has_field(utility::conversions::to_string_t("FileName"))) - { - content->setFileName( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("FileName"))) ); - } - if(val.has_field(utility::conversions::to_string_t("InputStream"))) - { - content->setData( ModelBase::fromBase64( ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("InputStream")))) ); - } - - return content; -} - -web::json::value ModelBase::toJson( std::shared_ptr content ) -{ - return content.get() ? content->toJson() : web::json::value::null(); -} - -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType) -{ - std::shared_ptr content(new HttpContent); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(value) ) ) ); - return content; -} -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType ) -{ - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(value.to_string(utility::datetime::ISO_8601) ) ) ) ); - return content; -} -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, std::shared_ptr value ) -{ - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( value->getContentDisposition() ); - content->setContentType( value->getContentType() ); - content->setData( value->getData() ); - content->setFileName( value->getFileName() ); - return content; -} -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const web::json::value& value, const utility::string_t& contentType ) -{ - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(value.serialize()) ) ) ); - return content; -} -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType ) -{ - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - std::stringstream* valueAsStringStream = new std::stringstream(); - (*valueAsStringStream) << value; - content->setData( std::shared_ptr( valueAsStringStream ) ); - return content; -} -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType ) -{ - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - std::stringstream* valueAsStringStream = new std::stringstream(); - (*valueAsStringStream) << value; - content->setData( std::shared_ptr( valueAsStringStream) ) ; - return content; -} -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType ) -{ - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - std::stringstream* valueAsStringStream = new std::stringstream(); - (*valueAsStringStream) << value; - content->setData( std::shared_ptr( valueAsStringStream ) ); - return content; -} - -// base64 encoding/decoding based on : https://en.wikibooks.org/wiki/Algorithm_Implementation/Miscellaneous/Base64#C.2B.2B -const static char Base64Chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; -const static char Base64PadChar = '='; -utility::string_t ModelBase::toBase64( utility::string_t value ) -{ - std::shared_ptr source( new std::stringstream( utility::conversions::to_utf8string(value) ) ); - return ModelBase::toBase64(source); -} -utility::string_t ModelBase::toBase64( std::shared_ptr value ) -{ - value->seekg( 0, value->end ); - size_t length = value->tellg(); - value->seekg( 0, value->beg ); - utility::string_t base64; - base64.reserve( ((length / 3) + (length % 3 > 0)) * 4 ); - char read[3] = { 0 }; - uint32_t temp; - for ( size_t idx = 0; idx < length / 3; idx++ ) - { - value->read( read, 3 ); - temp = (read[0]) << 16; - temp += (read[1]) << 8; - temp += (read[2]); - base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] ); - base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] ); - base64.append( 1, Base64Chars[(temp & 0x00000FC0) >> 6] ); - base64.append( 1, Base64Chars[(temp & 0x0000003F)] ); - } - switch ( length % 3 ) - { - case 1: - value->read( read, 1 ); - temp = read[0] << 16; - base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] ); - base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] ); - base64.append( 2, Base64PadChar ); - break; - case 2: - value->read( read, 2 ); - temp = read[0] << 16; - temp += read[1] << 8; - base64.append( 1, Base64Chars[(temp & 0x00FC0000) >> 18] ); - base64.append( 1, Base64Chars[(temp & 0x0003F000) >> 12] ); - base64.append( 1, Base64Chars[(temp & 0x00000FC0) >> 6] ); - base64.append( 1, Base64PadChar ); - break; - } - return base64; -} - - -std::shared_ptr ModelBase::fromBase64( const utility::string_t& encoded ) -{ - std::shared_ptr result(new std::stringstream); - - char outBuf[3] = { 0 }; - uint32_t temp = 0; - - utility::string_t::const_iterator cursor = encoded.begin(); - while ( cursor < encoded.end() ) - { - for ( size_t quantumPosition = 0; quantumPosition < 4; quantumPosition++ ) - { - temp <<= 6; - if ( *cursor >= 0x41 && *cursor <= 0x5A ) - { - temp |= *cursor - 0x41; - } - else if ( *cursor >= 0x61 && *cursor <= 0x7A ) - { - temp |= *cursor - 0x47; - } - else if ( *cursor >= 0x30 && *cursor <= 0x39 ) - { - temp |= *cursor + 0x04; - } - else if ( *cursor == 0x2B ) - { - temp |= 0x3E; //change to 0x2D for URL alphabet - } - else if ( *cursor == 0x2F ) - { - temp |= 0x3F; //change to 0x5F for URL alphabet - } - else if ( *cursor == Base64PadChar ) //pad - { - switch ( encoded.end() - cursor ) - { - case 1: //One pad character - outBuf[0] = (temp >> 16) & 0x000000FF; - outBuf[1] = (temp >> 8) & 0x000000FF; - result->write( outBuf, 2 ); - return result; - case 2: //Two pad characters - outBuf[0] = (temp >> 10) & 0x000000FF; - result->write( outBuf, 1 ); - return result; - default: - throw web::json::json_exception( utility::conversions::to_string_t( "Invalid Padding in Base 64!" ).c_str() ); - } - } - else - { - throw web::json::json_exception( utility::conversions::to_string_t( "Non-Valid Character in Base 64!" ).c_str() ); - } - ++cursor; - } - - outBuf[0] = (temp >> 16) & 0x000000FF; - outBuf[1] = (temp >> 8) & 0x000000FF; - outBuf[2] = (temp) & 0x000000FF; - result->write( outBuf, 3 ); - } - - return result; -} - -int64_t ModelBase::int64_tFromJson(const web::json::value& val) -{ - return val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_number().to_int64(); -} - -int32_t ModelBase::int32_tFromJson(const web::json::value& val) -{ - return val.is_null() ? std::numeric_limits::quiet_NaN() : val.as_integer(); -} - -float ModelBase::floatFromJson(const web::json::value& val) -{ - return val.is_null() ? std::numeric_limits::quiet_NaN() : static_cast(val.as_double()); -} - -utility::string_t ModelBase::stringFromJson(const web::json::value& val) -{ - return val.is_string() ? val.as_string() : utility::conversions::to_string_t(""); -} - -utility::datetime ModelBase::dateFromJson(const web::json::value& val) -{ - return val.is_null() ? utility::datetime::from_string(utility::conversions::to_string_t("NULL"), utility::datetime::ISO_8601) : utility::datetime::from_string(val.as_string(), utility::datetime::ISO_8601); -} -bool ModelBase::boolFromJson(const web::json::value& val) -{ - return val.is_null() ? false : val.as_bool(); -} -double ModelBase::doubleFromJson(const web::json::value& val) -{ - return val.is_null() ? std::numeric_limits::quiet_NaN(): val.as_double(); -} - -int64_t ModelBase::int64_tFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - - utility::stringstream_t ss(str); - int64_t result = 0; - ss >> result; - return result; -} -int32_t ModelBase::int32_tFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - - utility::stringstream_t ss(str); - int32_t result = 0; - ss >> result; - return result; -} -float ModelBase::floatFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - - utility::stringstream_t ss(str); - float result = 0; - ss >> result; - return result; -} -utility::string_t ModelBase::stringFromHttpContent(std::shared_ptr val) -{ - std::shared_ptr data = val->getData(); - data->seekg( 0, data->beg ); - - std::string str((std::istreambuf_iterator(*data.get())), - std::istreambuf_iterator()); - - return utility::conversions::to_string_t(str); -} -utility::datetime ModelBase::dateFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - return utility::datetime::from_string(str, utility::datetime::ISO_8601); -} - -bool ModelBase::boolFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - - utility::stringstream_t ss(str); - bool result = false; - ss >> result; - return result; -} -double ModelBase::doubleFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - - utility::stringstream_t ss(str); - double result = 0.0; - ss >> result; - return result; -} - -web::json::value ModelBase::valueFromHttpContent(std::shared_ptr val) -{ - utility::string_t str = ModelBase::stringFromHttpContent(val); - return web::json::value::parse(str); -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/ModelBase.h b/samples/client/petstore/cpp-restsdk/client/ModelBase.h deleted file mode 100644 index 91eed9bc776e..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/ModelBase.h +++ /dev/null @@ -1,120 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * ModelBase.h - * - * This is the base class for all model classes - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ModelBase_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_ModelBase_H_ - - -#include "HttpContent.h" -#include "MultipartFormData.h" - -#include -#include - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -class ModelBase -{ -public: - ModelBase(); - virtual ~ModelBase(); - - virtual void validate() = 0; - - virtual web::json::value toJson() const = 0; - virtual void fromJson(const web::json::value& json) = 0; - - virtual void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const = 0; - virtual void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) = 0; - - static web::json::value toJson( const utility::string_t& value ); - static web::json::value toJson( const utility::datetime& value ); - static web::json::value toJson( std::shared_ptr value ); - static web::json::value toJson( std::shared_ptr value ); - static web::json::value toJson( int32_t value ); - static web::json::value toJson( int64_t value ); - static web::json::value toJson( double value ); - static web::json::value toJson( bool value ); - template - static web::json::value toJson(const std::vector& value); - - static int64_t int64_tFromJson(const web::json::value& val); - static int32_t int32_tFromJson(const web::json::value& val); - static float floatFromJson(const web::json::value& val); - static utility::string_t stringFromJson(const web::json::value& val); - static utility::datetime dateFromJson(const web::json::value& val); - static double doubleFromJson(const web::json::value& val); - static bool boolFromJson(const web::json::value& val); - static std::shared_ptr fileFromJson(const web::json::value& val); - - static std::shared_ptr toHttpContent( const utility::string_t& name, const utility::string_t& value, const utility::string_t& contentType = utility::conversions::to_string_t("")); - static std::shared_ptr toHttpContent( const utility::string_t& name, const utility::datetime& value, const utility::string_t& contentType = utility::conversions::to_string_t("")); - static std::shared_ptr toHttpContent( const utility::string_t& name, std::shared_ptr value ); - static std::shared_ptr toHttpContent( const utility::string_t& name, const web::json::value& value, const utility::string_t& contentType = utility::conversions::to_string_t("application/json") ); - static std::shared_ptr toHttpContent( const utility::string_t& name, int32_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); - static std::shared_ptr toHttpContent( const utility::string_t& name, int64_t value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); - static std::shared_ptr toHttpContent( const utility::string_t& name, double value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); - template - static std::shared_ptr toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType = utility::conversions::to_string_t("") ); - - static int64_t int64_tFromHttpContent(std::shared_ptr val); - static int32_t int32_tFromHttpContent(std::shared_ptr val); - static float floatFromHttpContent(std::shared_ptr val); - static utility::string_t stringFromHttpContent(std::shared_ptr val); - static utility::datetime dateFromHttpContent(std::shared_ptr val); - static bool boolFromHttpContent(std::shared_ptr val); - static double doubleFromHttpContent(std::shared_ptr val); - static web::json::value valueFromHttpContent(std::shared_ptr val); - - - static utility::string_t toBase64( utility::string_t value ); - static utility::string_t toBase64( std::shared_ptr value ); - static std::shared_ptr fromBase64( const utility::string_t& encoded ); -}; - -template -web::json::value ModelBase::toJson(const std::vector& value) { - std::vector ret; - for (auto& x : value) { - ret.push_back(toJson(x)); - } - - return web::json::value::array(ret); -} - -template -std::shared_ptr ModelBase::toHttpContent( const utility::string_t& name, const std::vector& value, const utility::string_t& contentType ) { - web::json::value json_array = ModelBase::toJson(value); - std::shared_ptr content( new HttpContent ); - content->setName( name ); - content->setContentDisposition( utility::conversions::to_string_t("form-data") ); - content->setContentType( contentType ); - content->setData( std::shared_ptr( new std::stringstream( utility::conversions::to_utf8string(json_array.serialize()) ) ) ); - return content; -} - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ModelBase_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp deleted file mode 100644 index d38042f15cb3..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "MultipartFormData.h" -#include "ModelBase.h" - -#include -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -MultipartFormData::MultipartFormData() -{ - utility::stringstream_t uuidString; - uuidString << boost::uuids::random_generator()(); - m_Boundary = uuidString.str(); -} - -MultipartFormData::MultipartFormData(const utility::string_t& boundary) - : m_Boundary(boundary) -{ - -} - -MultipartFormData::~MultipartFormData() -{ -} - -utility::string_t MultipartFormData::getBoundary() -{ - return m_Boundary; -} - -void MultipartFormData::add( std::shared_ptr content ) -{ - m_Contents.push_back( content ); - m_ContentLookup[content->getName()] = content; -} - -bool MultipartFormData::hasContent(const utility::string_t& name) const -{ - return m_ContentLookup.find(name) != m_ContentLookup.end(); -} - -std::shared_ptr MultipartFormData::getContent(const utility::string_t& name) const -{ - auto result = m_ContentLookup.find(name); - if(result == m_ContentLookup.end()) - { - return std::shared_ptr(nullptr); - } - return result->second; -} - -void MultipartFormData::writeTo( std::ostream& target ) -{ - for ( size_t i = 0; i < m_Contents.size(); i++ ) - { - std::shared_ptr content = m_Contents[i]; - - // boundary - target << "\r\n" << "--" << utility::conversions::to_utf8string( m_Boundary ) << "\r\n"; - - // headers - target << "Content-Disposition: " << utility::conversions::to_utf8string( content->getContentDisposition() ); - if ( content->getName().size() > 0 ) - { - target << "; name=\"" << utility::conversions::to_utf8string( content->getName() ) << "\""; - } - if ( content->getFileName().size() > 0 ) - { - target << "; filename=\"" << utility::conversions::to_utf8string( content->getFileName() ) << "\""; - } - target << "\r\n"; - - if ( content->getContentType().size() > 0 ) - { - target << "Content-Type: " << utility::conversions::to_utf8string( content->getContentType() ) << "\r\n"; - } - - target << "\r\n"; - - // body - std::shared_ptr data = content->getData(); - - data->seekg( 0, data->end ); - std::vector dataBytes( data->tellg() ); - - data->seekg( 0, data->beg ); - data->read( &dataBytes[0], dataBytes.size() ); - - std::copy( dataBytes.begin(), dataBytes.end(), std::ostreambuf_iterator( target ) ); - } - - target << "\r\n--" << utility::conversions::to_utf8string( m_Boundary ) << "--\r\n"; -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h b/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h deleted file mode 100644 index e94e44879533..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/MultipartFormData.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * MultipartFormData.h - * - * This class represents a container for building application/x-multipart-formdata requests. - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_MultipartFormData_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_MultipartFormData_H_ - - -#include "IHttpBody.h" -#include "HttpContent.h" - -#include -#include -#include - -#include - - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -class MultipartFormData - : public IHttpBody -{ -public: - MultipartFormData(); - MultipartFormData(const utility::string_t& boundary); - virtual ~MultipartFormData(); - - virtual void add( std::shared_ptr content ); - virtual utility::string_t getBoundary(); - virtual std::shared_ptr getContent(const utility::string_t& name) const; - virtual bool hasContent(const utility::string_t& name) const; - virtual void writeTo( std::ostream& target ); - -protected: - std::vector> m_Contents; - utility::string_t m_Boundary; - std::map> m_ContentLookup; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_MultipartFormData_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/Object.cpp b/samples/client/petstore/cpp-restsdk/client/Object.cpp deleted file mode 100644 index d148cb427e8e..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/Object.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -#include "Object.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -Object::Object() -{ - m_object = web::json::value::object(); -} - -Object::~Object() -{ -} - -void Object::validate() -{ - // TODO: implement validation -} - -web::json::value Object::toJson() const -{ - return m_object; -} - -void Object::fromJson(const web::json::value& val) -{ - if (val.is_object()) - { - m_object = val; - } -} - -void Object::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("object"), m_object)); -} - -void Object::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - m_object = ModelBase::valueFromHttpContent(multipart->getContent(namePrefix + utility::conversions::to_string_t("object"))); -} - -web::json::value Object::getValue(const utility::string_t& key) const -{ - return m_object.at(key); -} - - -void Object::setValue(const utility::string_t& key, const web::json::value& value) -{ - m_object[key] = value; -} - -} -} -} -} diff --git a/samples/client/petstore/cpp-restsdk/client/Object.h b/samples/client/petstore/cpp-restsdk/client/Object.h deleted file mode 100644 index 191d17e2cc77..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/Object.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Object.h - * - * This is the implementation of a JSON object. - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Object_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_Object_H_ - - -#include "ModelBase.h" - -#include -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - -class Object : public ModelBase -{ -public: - Object(); - virtual ~Object(); - - ///////////////////////////////////////////// - /// ModelBase overrides - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// Object manipulation - web::json::value getValue(const utility::string_t& key) const; - void setValue(const utility::string_t& key, const web::json::value& value); - -private: - web::json::value m_object; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Object_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/README.md b/samples/client/petstore/cpp-restsdk/client/README.md deleted file mode 100644 index d3aca4f9bf2b..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# C++ API client - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -## Overview -This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI spec](https://openapis.org) from a remote server, you can easily generate an API client. - -- API version: 1.0.0 -- Package version: -- Build package: org.openapitools.codegen.languages.CppRestSdkClientCodegen - -- API namespace: org.openapitools.client.api -- Model namespace: org.openapitools.client.model - -## Installation - -### Prerequisites - -Install [cpprestsdk](https://github.com/Microsoft/cpprestsdk). - -- Windows: `vcpkg install cpprestsdk cpprestsdk:x64-windows boost-uuid boost-uuid:x64-windows` -- Mac: `brew install cpprestsdk` -- Linux: `sudo apt-get install libcpprest-dev` - -### Build - -```sh -cmake -DCPPREST_ROOT=/usr -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib" -make -``` - -### Build on Windows with Visual Studio (VS2017) - -- Right click on folder containing source code -- Select 'Open in visual studio' -- Once visual studio opens, CMake should show up in top menu bar. -- Select CMake > Build All. - -*Note: If the CMake menu item doesn't show up in Visual Studio, CMake -for Visual Studio must be installed. In this case, open the 'Visual Studio -Installer' application. Select 'modify' Visual Studio 2017. Make sure -'Desktop Development with C++' is installed, and specifically that 'Visual -C++ tools for CMake' is selected in the 'Installation Details' section. - -Also be sure to review the CMakeLists.txt file. Edits are likely required.* - -## Author - - - diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp deleted file mode 100644 index c5c68011d177..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.cpp +++ /dev/null @@ -1,1028 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "PetApi.h" -#include "IHttpBody.h" -#include "JsonBody.h" -#include "MultipartFormData.h" - -#include - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - -PetApi::PetApi( std::shared_ptr apiClient ) - : m_ApiClient(apiClient) -{ -} - -PetApi::~PetApi() -{ -} - -pplx::task PetApi::addPet(std::shared_ptr body) -{ - - // verify the required parameter 'body' is set - if (body == nullptr) - { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->addPet")); - } - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->addPet does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - localVarJson = ModelBase::toJson(body); - - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - - if(body.get()) - { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->addPet does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling addPet: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling addPet: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task PetApi::deletePet(int64_t petId, boost::optional apiKey) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet/{petId}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("petId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(petId)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->deletePet does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - if (apiKey) - { - localVarHeaderParams[utility::conversions::to_string_t("api_key")] = ApiClient::parameterToString(*apiKey); - } - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->deletePet does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling deletePet: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling deletePet: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task>> PetApi::findPetsByStatus(std::vector status) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet/findByStatus"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->findPetsByStatus does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - { - localVarQueryParams[utility::conversions::to_string_t("status")] = ApiClient::parameterToString(status); - } - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->findPetsByStatus does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling findPetsByStatus: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling findPetsByStatus: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::vector> localVarResult; - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - for( auto& localVarItem : localVarJson.as_array() ) - { - std::shared_ptr localVarItemObj(new Pet()); - localVarItemObj->fromJson(localVarItem); - localVarResult.push_back(localVarItemObj); - - } - - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling findPetsByStatus: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task>> PetApi::findPetsByTags(std::vector tags) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet/findByTags"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->findPetsByTags does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - { - localVarQueryParams[utility::conversions::to_string_t("tags")] = ApiClient::parameterToString(tags); - } - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->findPetsByTags does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling findPetsByTags: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling findPetsByTags: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::vector> localVarResult; - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - for( auto& localVarItem : localVarJson.as_array() ) - { - std::shared_ptr localVarItemObj(new Pet()); - localVarItemObj->fromJson(localVarItem); - localVarResult.push_back(localVarItemObj); - - } - - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling findPetsByTags: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task> PetApi::getPetById(int64_t petId) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet/{petId}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("petId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(petId)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->getPetById does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->getPetById does not consume any supported media type")); - } - - // authentication (api_key) required - { - utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); - if ( localVarApiKey.size() > 0 ) - { - localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; - } - } - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling getPetById: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getPetById: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::shared_ptr localVarResult(new Pet()); - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - localVarResult->fromJson(localVarJson); - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getPetById: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task PetApi::updatePet(std::shared_ptr body) -{ - - // verify the required parameter 'body' is set - if (body == nullptr) - { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling PetApi->updatePet")); - } - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->updatePet does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - localVarJson = ModelBase::toJson(body); - - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - - if(body.get()) - { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->updatePet does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling updatePet: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling updatePet: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task PetApi::updatePetWithForm(int64_t petId, boost::optional name, boost::optional status) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet/{petId}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("petId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(petId)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->updatePetWithForm does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("application/x-www-form-urlencoded") ); - - if (name) - { - localVarFormParams[ utility::conversions::to_string_t("name") ] = ApiClient::parameterToString(*name); - } - if (status) - { - localVarFormParams[ utility::conversions::to_string_t("status") ] = ApiClient::parameterToString(*status); - } - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->updatePetWithForm does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling updatePetWithForm: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling updatePetWithForm: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task> PetApi::uploadFile(int64_t petId, boost::optional additionalMetadata, boost::optional> file) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/pet/{petId}/uploadImage"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("petId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(petId)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("PetApi->uploadFile does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - localVarConsumeHttpContentTypes.insert( utility::conversions::to_string_t("multipart/form-data") ); - - if (additionalMetadata) - { - localVarFormParams[ utility::conversions::to_string_t("additionalMetadata") ] = ApiClient::parameterToString(*additionalMetadata); - } - if (file && *file != nullptr) - { - localVarFileParams[ utility::conversions::to_string_t("file") ] = *file; - } - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("PetApi->uploadFile does not consume any supported media type")); - } - - // authentication (petstore_auth) required - // oauth2 authentication is added automatically as part of the http_client_config - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling uploadFile: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling uploadFile: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::shared_ptr localVarResult(new ApiResponse()); - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - localVarResult->fromJson(localVarJson); - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling uploadFile: unsupported response type")); - } - - return localVarResult; - }); -} - -} -} -} -} - diff --git a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h b/samples/client/petstore/cpp-restsdk/client/api/PetApi.h deleted file mode 100644 index 422ad2afee86..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/api/PetApi.h +++ /dev/null @@ -1,150 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * PetApi.h - * - * - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_API_PetApi_H_ -#define ORG_OPENAPITOOLS_CLIENT_API_PetApi_H_ - - -#include "../ApiClient.h" - -#include "ApiResponse.h" -#include "HttpContent.h" -#include "Pet.h" -#include - - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - - - -class PetApi -{ -public: - - explicit PetApi( std::shared_ptr apiClient ); - - virtual ~PetApi(); - - /// - /// Add a new pet to the store - /// - /// - /// - /// - /// Pet object that needs to be added to the store - pplx::task addPet( - std::shared_ptr body - ); - /// - /// Deletes a pet - /// - /// - /// - /// - /// Pet id to delete - /// (optional, default to utility::conversions::to_string_t("")) - pplx::task deletePet( - int64_t petId, - boost::optional apiKey - ); - /// - /// Finds Pets by status - /// - /// - /// Multiple status values can be provided with comma separated strings - /// - /// Status values that need to be considered for filter - pplx::task>> findPetsByStatus( - std::vector status - ); - /// - /// Finds Pets by tags - /// - /// - /// Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - /// - /// Tags to filter by - pplx::task>> findPetsByTags( - std::vector tags - ); - /// - /// Find pet by ID - /// - /// - /// Returns a single pet - /// - /// ID of pet to return - pplx::task> getPetById( - int64_t petId - ); - /// - /// Update an existing pet - /// - /// - /// - /// - /// Pet object that needs to be added to the store - pplx::task updatePet( - std::shared_ptr body - ); - /// - /// Updates a pet in the store with form data - /// - /// - /// - /// - /// ID of pet that needs to be updated - /// Updated name of the pet (optional, default to utility::conversions::to_string_t("")) - /// Updated status of the pet (optional, default to utility::conversions::to_string_t("")) - pplx::task updatePetWithForm( - int64_t petId, - boost::optional name, - boost::optional status - ); - /// - /// uploads an image - /// - /// - /// - /// - /// ID of pet to update - /// Additional data to pass to server (optional, default to utility::conversions::to_string_t("")) - /// file to upload (optional, default to utility::conversions::to_string_t("")) - pplx::task> uploadFile( - int64_t petId, - boost::optional additionalMetadata, - boost::optional> file - ); - -protected: - std::shared_ptr m_ApiClient; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_API_PetApi_H_ */ - diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp deleted file mode 100644 index a1651f3a1600..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.cpp +++ /dev/null @@ -1,534 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "StoreApi.h" -#include "IHttpBody.h" -#include "JsonBody.h" -#include "MultipartFormData.h" - -#include - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - -StoreApi::StoreApi( std::shared_ptr apiClient ) - : m_ApiClient(apiClient) -{ -} - -StoreApi::~StoreApi() -{ -} - -pplx::task StoreApi::deleteOrder(utility::string_t orderId) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/store/order/{orderId}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("orderId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(orderId)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("StoreApi->deleteOrder does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("StoreApi->deleteOrder does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling deleteOrder: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling deleteOrder: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task> StoreApi::getInventory() -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/store/inventory"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("StoreApi->getInventory does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("StoreApi->getInventory does not consume any supported media type")); - } - - // authentication (api_key) required - { - utility::string_t localVarApiKey = localVarApiConfiguration->getApiKey(utility::conversions::to_string_t("api_key")); - if ( localVarApiKey.size() > 0 ) - { - localVarHeaderParams[utility::conversions::to_string_t("api_key")] = localVarApiKey; - } - } - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling getInventory: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getInventory: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::map localVarResult; - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - for( auto& localVarItem : localVarJson.as_object() ) - { - localVarResult[localVarItem.first] = ModelBase::int32_tFromJson(localVarItem.second); - - } - - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getInventory: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task> StoreApi::getOrderById(int64_t orderId) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/store/order/{orderId}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("orderId") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(orderId)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("StoreApi->getOrderById does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("StoreApi->getOrderById does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling getOrderById: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getOrderById: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::shared_ptr localVarResult(new Order()); - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - localVarResult->fromJson(localVarJson); - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getOrderById: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task> StoreApi::placeOrder(std::shared_ptr body) -{ - - // verify the required parameter 'body' is set - if (body == nullptr) - { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling StoreApi->placeOrder")); - } - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/store/order"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("StoreApi->placeOrder does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - localVarJson = ModelBase::toJson(body); - - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - - if(body.get()) - { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("StoreApi->placeOrder does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling placeOrder: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling placeOrder: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::shared_ptr localVarResult(new Order()); - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - localVarResult->fromJson(localVarJson); - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling placeOrder: unsupported response type")); - } - - return localVarResult; - }); -} - -} -} -} -} - diff --git a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h b/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h deleted file mode 100644 index a13033db76ab..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/api/StoreApi.h +++ /dev/null @@ -1,97 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * StoreApi.h - * - * - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_API_StoreApi_H_ -#define ORG_OPENAPITOOLS_CLIENT_API_StoreApi_H_ - - -#include "../ApiClient.h" - -#include "Order.h" -#include -#include - - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - - - -class StoreApi -{ -public: - - explicit StoreApi( std::shared_ptr apiClient ); - - virtual ~StoreApi(); - - /// - /// Delete purchase order by ID - /// - /// - /// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - /// - /// ID of the order that needs to be deleted - pplx::task deleteOrder( - utility::string_t orderId - ); - /// - /// Returns pet inventories by status - /// - /// - /// Returns a map of status codes to quantities - /// - pplx::task> getInventory( - ); - /// - /// Find purchase order by ID - /// - /// - /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - /// - /// ID of pet that needs to be fetched - pplx::task> getOrderById( - int64_t orderId - ); - /// - /// Place an order for a pet - /// - /// - /// - /// - /// order placed for purchasing the pet - pplx::task> placeOrder( - std::shared_ptr body - ); - -protected: - std::shared_ptr m_ApiClient; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_API_StoreApi_H_ */ - diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp b/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp deleted file mode 100644 index ac5933dde09b..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.cpp +++ /dev/null @@ -1,988 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -#include "UserApi.h" -#include "IHttpBody.h" -#include "JsonBody.h" -#include "MultipartFormData.h" - -#include - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - -UserApi::UserApi( std::shared_ptr apiClient ) - : m_ApiClient(apiClient) -{ -} - -UserApi::~UserApi() -{ -} - -pplx::task UserApi::createUser(std::shared_ptr body) -{ - - // verify the required parameter 'body' is set - if (body == nullptr) - { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->createUser")); - } - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->createUser does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - localVarJson = ModelBase::toJson(body); - - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - - if(body.get()) - { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->createUser does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling createUser: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling createUser: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task UserApi::createUsersWithArrayInput(std::vector> body) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/createWithArray"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->createUsersWithArrayInput does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - { - std::vector localVarJsonArray; - for( auto& localVarItem : body ) - { - localVarJsonArray.push_back( localVarItem.get() ? localVarItem->toJson() : web::json::value::null() ); - - } - localVarJson = web::json::value::array(localVarJsonArray); - } - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - { - std::vector localVarJsonArray; - for( auto& localVarItem : body ) - { - localVarJsonArray.push_back( localVarItem.get() ? localVarItem->toJson() : web::json::value::null() ); - - } - localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(localVarJsonArray), utility::conversions::to_string_t("application/json"))); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->createUsersWithArrayInput does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling createUsersWithArrayInput: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling createUsersWithArrayInput: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task UserApi::createUsersWithListInput(std::vector> body) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/createWithList"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->createUsersWithListInput does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - { - std::vector localVarJsonArray; - for( auto& localVarItem : body ) - { - localVarJsonArray.push_back( localVarItem.get() ? localVarItem->toJson() : web::json::value::null() ); - - } - localVarJson = web::json::value::array(localVarJsonArray); - } - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - { - std::vector localVarJsonArray; - for( auto& localVarItem : body ) - { - localVarJsonArray.push_back( localVarItem.get() ? localVarItem->toJson() : web::json::value::null() ); - - } - localVarMultipart->add(ModelBase::toHttpContent(utility::conversions::to_string_t("body"), web::json::value::array(localVarJsonArray), utility::conversions::to_string_t("application/json"))); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->createUsersWithListInput does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("POST"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling createUsersWithListInput: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling createUsersWithListInput: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task UserApi::deleteUser(utility::string_t username) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/{username}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("username") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(username)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->deleteUser does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->deleteUser does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("DELETE"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling deleteUser: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling deleteUser: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task> UserApi::getUserByName(utility::string_t username) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/{username}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("username") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(username)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->getUserByName does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->getUserByName does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling getUserByName: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getUserByName: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - std::shared_ptr localVarResult(new User()); - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - localVarResult->fromJson(localVarJson); - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling getUserByName: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task UserApi::loginUser(utility::string_t username, utility::string_t password) -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/login"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/xml") ); - localVarResponseHttpContentTypes.insert( utility::conversions::to_string_t("application/json") ); - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - // plain text - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("text/plain")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("text/plain"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->loginUser does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - { - localVarQueryParams[utility::conversions::to_string_t("username")] = ApiClient::parameterToString(username); - } - { - localVarQueryParams[utility::conversions::to_string_t("password")] = ApiClient::parameterToString(password); - } - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->loginUser does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling loginUser: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling loginUser: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - utility::string_t localVarResult(utility::conversions::to_string_t("")); - - if(localVarResponseHttpContentType == utility::conversions::to_string_t("application/json")) - { - web::json::value localVarJson = web::json::value::parse(localVarResponse); - - localVarResult = ModelBase::stringFromJson(localVarJson); - - } - else if(localVarResponseHttpContentType == utility::conversions::to_string_t("text/plain")) - { - localVarResult = localVarResponse; - } - // else if(localVarResponseHttpContentType == utility::conversions::to_string_t("multipart/form-data")) - // { - // TODO multipart response parsing - // } - else - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling loginUser: unsupported response type")); - } - - return localVarResult; - }); -} -pplx::task UserApi::logoutUser() -{ - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/logout"); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->logoutUser does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->logoutUser does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("GET"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling logoutUser: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling logoutUser: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} -pplx::task UserApi::updateUser(utility::string_t username, std::shared_ptr body) -{ - - // verify the required parameter 'body' is set - if (body == nullptr) - { - throw ApiException(400, utility::conversions::to_string_t("Missing required parameter 'body' when calling UserApi->updateUser")); - } - - - std::shared_ptr localVarApiConfiguration( m_ApiClient->getConfiguration() ); - utility::string_t localVarPath = utility::conversions::to_string_t("/user/{username}"); - boost::replace_all(localVarPath, utility::conversions::to_string_t("{") + utility::conversions::to_string_t("username") + utility::conversions::to_string_t("}"), ApiClient::parameterToString(username)); - - std::map localVarQueryParams; - std::map localVarHeaderParams( localVarApiConfiguration->getDefaultHeaders() ); - std::map localVarFormParams; - std::map> localVarFileParams; - - std::unordered_set localVarResponseHttpContentTypes; - - utility::string_t localVarResponseHttpContentType; - - // use JSON if possible - if ( localVarResponseHttpContentTypes.size() == 0 ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // JSON - else if ( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("application/json"); - } - // multipart formdata - else if( localVarResponseHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarResponseHttpContentTypes.end() ) - { - localVarResponseHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - } - else - { - throw ApiException(400, utility::conversions::to_string_t("UserApi->updateUser does not produce any supported media type")); - } - - localVarHeaderParams[utility::conversions::to_string_t("Accept")] = localVarResponseHttpContentType; - - std::unordered_set localVarConsumeHttpContentTypes; - - - std::shared_ptr localVarHttpBody; - utility::string_t localVarRequestHttpContentType; - - // use JSON if possible - if ( localVarConsumeHttpContentTypes.size() == 0 || localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("application/json")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("application/json"); - web::json::value localVarJson; - - localVarJson = ModelBase::toJson(body); - - - localVarHttpBody = std::shared_ptr( new JsonBody( localVarJson ) ); - } - // multipart formdata - else if( localVarConsumeHttpContentTypes.find(utility::conversions::to_string_t("multipart/form-data")) != localVarConsumeHttpContentTypes.end() ) - { - localVarRequestHttpContentType = utility::conversions::to_string_t("multipart/form-data"); - std::shared_ptr localVarMultipart(new MultipartFormData); - - if(body.get()) - { - body->toMultipart(localVarMultipart, utility::conversions::to_string_t("body")); - } - - localVarHttpBody = localVarMultipart; - localVarRequestHttpContentType += utility::conversions::to_string_t("; boundary=") + localVarMultipart->getBoundary(); - } - else - { - throw ApiException(415, utility::conversions::to_string_t("UserApi->updateUser does not consume any supported media type")); - } - - - return m_ApiClient->callApi(localVarPath, utility::conversions::to_string_t("PUT"), localVarQueryParams, localVarHttpBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarRequestHttpContentType) - .then([=](web::http::http_response localVarResponse) - { - if (m_ApiClient->getResponseHandler()) - { - m_ApiClient->getResponseHandler()(localVarResponse.status_code(), localVarResponse.headers()); - } - - // 1xx - informational : OK - // 2xx - successful : OK - // 3xx - redirection : OK - // 4xx - client error : not OK - // 5xx - client error : not OK - if (localVarResponse.status_code() >= 400) - { - throw ApiException(localVarResponse.status_code() - , utility::conversions::to_string_t("error calling updateUser: ") + localVarResponse.reason_phrase() - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - - // check response content type - if(localVarResponse.headers().has(utility::conversions::to_string_t("Content-Type"))) - { - utility::string_t localVarContentType = localVarResponse.headers()[utility::conversions::to_string_t("Content-Type")]; - if( localVarContentType.find(localVarResponseHttpContentType) == std::string::npos ) - { - throw ApiException(500 - , utility::conversions::to_string_t("error calling updateUser: unexpected response type: ") + localVarContentType - , std::make_shared(localVarResponse.extract_utf8string(true).get())); - } - } - - return localVarResponse.extract_string(); - }) - .then([=](utility::string_t localVarResponse) - { - return void(); - }); -} - -} -} -} -} - diff --git a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h b/samples/client/petstore/cpp-restsdk/client/api/UserApi.h deleted file mode 100644 index ede5f2937c7b..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/api/UserApi.h +++ /dev/null @@ -1,141 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * UserApi.h - * - * - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_API_UserApi_H_ -#define ORG_OPENAPITOOLS_CLIENT_API_UserApi_H_ - - -#include "../ApiClient.h" - -#include "User.h" -#include -#include - - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace api { - -using namespace org::openapitools::client::model; - - - -class UserApi -{ -public: - - explicit UserApi( std::shared_ptr apiClient ); - - virtual ~UserApi(); - - /// - /// Create user - /// - /// - /// This can only be done by the logged in user. - /// - /// Created user object - pplx::task createUser( - std::shared_ptr body - ); - /// - /// Creates list of users with given input array - /// - /// - /// - /// - /// List of user object - pplx::task createUsersWithArrayInput( - std::vector> body - ); - /// - /// Creates list of users with given input array - /// - /// - /// - /// - /// List of user object - pplx::task createUsersWithListInput( - std::vector> body - ); - /// - /// Delete user - /// - /// - /// This can only be done by the logged in user. - /// - /// The name that needs to be deleted - pplx::task deleteUser( - utility::string_t username - ); - /// - /// Get user by user name - /// - /// - /// - /// - /// The name that needs to be fetched. Use user1 for testing. - pplx::task> getUserByName( - utility::string_t username - ); - /// - /// Logs user into the system - /// - /// - /// - /// - /// The user name for login - /// The password for login in clear text - pplx::task loginUser( - utility::string_t username, - utility::string_t password - ); - /// - /// Logs out current logged in user session - /// - /// - /// - /// - pplx::task logoutUser( - ); - /// - /// Updated user - /// - /// - /// This can only be done by the logged in user. - /// - /// name that need to be deleted - /// Updated user object - pplx::task updateUser( - utility::string_t username, - std::shared_ptr body - ); - -protected: - std::shared_ptr m_ApiClient; -}; - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_API_UserApi_H_ */ - diff --git a/samples/client/petstore/cpp-restsdk/client/git_push.sh b/samples/client/petstore/cpp-restsdk/client/git_push.sh deleted file mode 100644 index 14171b3f8142..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/git_push.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh -# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ -# -# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-cpprest "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -if [ "$git_user_id" = "" ]; then - git_user_id="GIT_USER_ID" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" -fi - -if [ "$git_repo_id" = "" ]; then - git_repo_id="GIT_REPO_ID" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" -fi - -if [ "$release_note" = "" ]; then - release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" -fi - -# Initialize the local directory as a Git repository -git init - -# Adds the files in the local repository and stages them for commit. -git add . - -# Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" - -# Sets the new remote -git_remote=`git remote` -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git - fi - -fi - -git pull origin master - -# Pushes (Forces) the changes in the local repository up to the remote repository -echo "Git pushing to https://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp deleted file mode 100644 index 2fa289ebd996..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "ApiResponse.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - - - -ApiResponse::ApiResponse() -{ - m_Code = 0; - m_CodeIsSet = false; - m_Type = utility::conversions::to_string_t(""); - m_TypeIsSet = false; - m_Message = utility::conversions::to_string_t(""); - m_MessageIsSet = false; -} - -ApiResponse::~ApiResponse() -{ -} - -void ApiResponse::validate() -{ - // TODO: implement validation -} - -web::json::value ApiResponse::toJson() const -{ - web::json::value val = web::json::value::object(); - - if(m_CodeIsSet) - { - val[utility::conversions::to_string_t("code")] = ModelBase::toJson(m_Code); - } - if(m_TypeIsSet) - { - val[utility::conversions::to_string_t("type")] = ModelBase::toJson(m_Type); - } - if(m_MessageIsSet) - { - val[utility::conversions::to_string_t("message")] = ModelBase::toJson(m_Message); - } - - return val; -} - -void ApiResponse::fromJson(const web::json::value& val) -{ - if(val.has_field(utility::conversions::to_string_t("code"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("code")); - if(!fieldValue.is_null()) - { - setCode(ModelBase::int32_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("type"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("type")); - if(!fieldValue.is_null()) - { - setType(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("message"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("message")); - if(!fieldValue.is_null()) - { - setMessage(ModelBase::stringFromJson(fieldValue)); - } - } -} - -void ApiResponse::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(m_CodeIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("code"), m_Code)); - } - if(m_TypeIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("type"), m_Type)); - } - if(m_MessageIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("message"), m_Message)); - } -} - -void ApiResponse::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(multipart->hasContent(utility::conversions::to_string_t("code"))) - { - setCode(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("code")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("type"))) - { - setType(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("type")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("message"))) - { - setMessage(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("message")))); - } -} - -int32_t ApiResponse::getCode() const -{ - return m_Code; -} - -void ApiResponse::setCode(int32_t value) -{ - m_Code = value; - m_CodeIsSet = true; -} - -bool ApiResponse::codeIsSet() const -{ - return m_CodeIsSet; -} - -void ApiResponse::unsetCode() -{ - m_CodeIsSet = false; -} - -utility::string_t ApiResponse::getType() const -{ - return m_Type; -} - -void ApiResponse::setType(const utility::string_t& value) -{ - m_Type = value; - m_TypeIsSet = true; -} - -bool ApiResponse::typeIsSet() const -{ - return m_TypeIsSet; -} - -void ApiResponse::unsetType() -{ - m_TypeIsSet = false; -} - -utility::string_t ApiResponse::getMessage() const -{ - return m_Message; -} - -void ApiResponse::setMessage(const utility::string_t& value) -{ - m_Message = value; - m_MessageIsSet = true; -} - -bool ApiResponse::messageIsSet() const -{ - return m_MessageIsSet; -} - -void ApiResponse::unsetMessage() -{ - m_MessageIsSet = false; -} - -} -} -} -} - - diff --git a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h b/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h deleted file mode 100644 index 6567d7a82c8d..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/ApiResponse.h +++ /dev/null @@ -1,99 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * ApiResponse.h - * - * Describes the result of uploading an image resource - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_ApiResponse_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_ApiResponse_H_ - - -#include "../ModelBase.h" - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - -/// -/// Describes the result of uploading an image resource -/// -class ApiResponse - : public ModelBase -{ -public: - ApiResponse(); - virtual ~ApiResponse(); - - ///////////////////////////////////////////// - /// ModelBase overrides - - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// ApiResponse members - - /// - /// - /// - int32_t getCode() const; - bool codeIsSet() const; - void unsetCode(); - - void setCode(int32_t value); - - /// - /// - /// - utility::string_t getType() const; - bool typeIsSet() const; - void unsetType(); - - void setType(const utility::string_t& value); - - /// - /// - /// - utility::string_t getMessage() const; - bool messageIsSet() const; - void unsetMessage(); - - void setMessage(const utility::string_t& value); - - -protected: - int32_t m_Code; - bool m_CodeIsSet; - utility::string_t m_Type; - bool m_TypeIsSet; - utility::string_t m_Message; - bool m_MessageIsSet; -}; - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_ApiResponse_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp b/samples/client/petstore/cpp-restsdk/client/model/Category.cpp deleted file mode 100644 index c181f0ba6fa2..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "Category.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - - - -Category::Category() -{ - m_Id = 0L; - m_IdIsSet = false; - m_Name = utility::conversions::to_string_t(""); - m_NameIsSet = false; -} - -Category::~Category() -{ -} - -void Category::validate() -{ - // TODO: implement validation -} - -web::json::value Category::toJson() const -{ - web::json::value val = web::json::value::object(); - - if(m_IdIsSet) - { - val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id); - } - if(m_NameIsSet) - { - val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_Name); - } - - return val; -} - -void Category::fromJson(const web::json::value& val) -{ - if(val.has_field(utility::conversions::to_string_t("id"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id")); - if(!fieldValue.is_null()) - { - setId(ModelBase::int64_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("name"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("name")); - if(!fieldValue.is_null()) - { - setName(ModelBase::stringFromJson(fieldValue)); - } - } -} - -void Category::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(m_IdIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id)); - } - if(m_NameIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_Name)); - } -} - -void Category::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(multipart->hasContent(utility::conversions::to_string_t("id"))) - { - setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("name"))) - { - setName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("name")))); - } -} - -int64_t Category::getId() const -{ - return m_Id; -} - -void Category::setId(int64_t value) -{ - m_Id = value; - m_IdIsSet = true; -} - -bool Category::idIsSet() const -{ - return m_IdIsSet; -} - -void Category::unsetId() -{ - m_IdIsSet = false; -} - -utility::string_t Category::getName() const -{ - return m_Name; -} - -void Category::setName(const utility::string_t& value) -{ - m_Name = value; - m_NameIsSet = true; -} - -bool Category::nameIsSet() const -{ - return m_NameIsSet; -} - -void Category::unsetName() -{ - m_NameIsSet = false; -} - -} -} -} -} - - diff --git a/samples/client/petstore/cpp-restsdk/client/model/Category.h b/samples/client/petstore/cpp-restsdk/client/model/Category.h deleted file mode 100644 index d12c200ca706..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Category.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Category.h - * - * A category for a pet - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Category_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_Category_H_ - - -#include "../ModelBase.h" - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - -/// -/// A category for a pet -/// -class Category - : public ModelBase -{ -public: - Category(); - virtual ~Category(); - - ///////////////////////////////////////////// - /// ModelBase overrides - - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// Category members - - /// - /// - /// - int64_t getId() const; - bool idIsSet() const; - void unsetId(); - - void setId(int64_t value); - - /// - /// - /// - utility::string_t getName() const; - bool nameIsSet() const; - void unsetName(); - - void setName(const utility::string_t& value); - - -protected: - int64_t m_Id; - bool m_IdIsSet; - utility::string_t m_Name; - bool m_NameIsSet; -}; - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Category_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp b/samples/client/petstore/cpp-restsdk/client/model/Order.cpp deleted file mode 100644 index 2d869abdd453..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.cpp +++ /dev/null @@ -1,332 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "Order.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - - - -Order::Order() -{ - m_Id = 0L; - m_IdIsSet = false; - m_PetId = 0L; - m_PetIdIsSet = false; - m_Quantity = 0; - m_QuantityIsSet = false; - m_ShipDate = utility::datetime(); - m_ShipDateIsSet = false; - m_Status = utility::conversions::to_string_t(""); - m_StatusIsSet = false; - m_Complete = false; - m_CompleteIsSet = false; -} - -Order::~Order() -{ -} - -void Order::validate() -{ - // TODO: implement validation -} - -web::json::value Order::toJson() const -{ - web::json::value val = web::json::value::object(); - - if(m_IdIsSet) - { - val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id); - } - if(m_PetIdIsSet) - { - val[utility::conversions::to_string_t("petId")] = ModelBase::toJson(m_PetId); - } - if(m_QuantityIsSet) - { - val[utility::conversions::to_string_t("quantity")] = ModelBase::toJson(m_Quantity); - } - if(m_ShipDateIsSet) - { - val[utility::conversions::to_string_t("shipDate")] = ModelBase::toJson(m_ShipDate); - } - if(m_StatusIsSet) - { - val[utility::conversions::to_string_t("status")] = ModelBase::toJson(m_Status); - } - if(m_CompleteIsSet) - { - val[utility::conversions::to_string_t("complete")] = ModelBase::toJson(m_Complete); - } - - return val; -} - -void Order::fromJson(const web::json::value& val) -{ - if(val.has_field(utility::conversions::to_string_t("id"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id")); - if(!fieldValue.is_null()) - { - setId(ModelBase::int64_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("petId"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("petId")); - if(!fieldValue.is_null()) - { - setPetId(ModelBase::int64_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("quantity"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("quantity")); - if(!fieldValue.is_null()) - { - setQuantity(ModelBase::int32_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("shipDate"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("shipDate")); - if(!fieldValue.is_null()) - { - setShipDate(ModelBase::dateFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("status"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("status")); - if(!fieldValue.is_null()) - { - setStatus(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("complete"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("complete")); - if(!fieldValue.is_null()) - { - setComplete(ModelBase::boolFromJson(fieldValue)); - } - } -} - -void Order::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(m_IdIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id)); - } - if(m_PetIdIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("petId"), m_PetId)); - } - if(m_QuantityIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("quantity"), m_Quantity)); - } - if(m_ShipDateIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("shipDate"), m_ShipDate)); - } - if(m_StatusIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("status"), m_Status)); - } - if(m_CompleteIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("complete"), m_Complete)); - } -} - -void Order::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(multipart->hasContent(utility::conversions::to_string_t("id"))) - { - setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("petId"))) - { - setPetId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("petId")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("quantity"))) - { - setQuantity(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("quantity")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("shipDate"))) - { - setShipDate(ModelBase::dateFromHttpContent(multipart->getContent(utility::conversions::to_string_t("shipDate")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("status"))) - { - setStatus(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("status")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("complete"))) - { - setComplete(ModelBase::boolFromHttpContent(multipart->getContent(utility::conversions::to_string_t("complete")))); - } -} - -int64_t Order::getId() const -{ - return m_Id; -} - -void Order::setId(int64_t value) -{ - m_Id = value; - m_IdIsSet = true; -} - -bool Order::idIsSet() const -{ - return m_IdIsSet; -} - -void Order::unsetId() -{ - m_IdIsSet = false; -} - -int64_t Order::getPetId() const -{ - return m_PetId; -} - -void Order::setPetId(int64_t value) -{ - m_PetId = value; - m_PetIdIsSet = true; -} - -bool Order::petIdIsSet() const -{ - return m_PetIdIsSet; -} - -void Order::unsetPetId() -{ - m_PetIdIsSet = false; -} - -int32_t Order::getQuantity() const -{ - return m_Quantity; -} - -void Order::setQuantity(int32_t value) -{ - m_Quantity = value; - m_QuantityIsSet = true; -} - -bool Order::quantityIsSet() const -{ - return m_QuantityIsSet; -} - -void Order::unsetQuantity() -{ - m_QuantityIsSet = false; -} - -utility::datetime Order::getShipDate() const -{ - return m_ShipDate; -} - -void Order::setShipDate(const utility::datetime& value) -{ - m_ShipDate = value; - m_ShipDateIsSet = true; -} - -bool Order::shipDateIsSet() const -{ - return m_ShipDateIsSet; -} - -void Order::unsetShipDate() -{ - m_ShipDateIsSet = false; -} - -utility::string_t Order::getStatus() const -{ - return m_Status; -} - -void Order::setStatus(const utility::string_t& value) -{ - m_Status = value; - m_StatusIsSet = true; -} - -bool Order::statusIsSet() const -{ - return m_StatusIsSet; -} - -void Order::unsetStatus() -{ - m_StatusIsSet = false; -} - -bool Order::isComplete() const -{ - return m_Complete; -} - -void Order::setComplete(bool value) -{ - m_Complete = value; - m_CompleteIsSet = true; -} - -bool Order::completeIsSet() const -{ - return m_CompleteIsSet; -} - -void Order::unsetComplete() -{ - m_CompleteIsSet = false; -} - -} -} -} -} - - diff --git a/samples/client/petstore/cpp-restsdk/client/model/Order.h b/samples/client/petstore/cpp-restsdk/client/model/Order.h deleted file mode 100644 index b678f43361e4..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Order.h +++ /dev/null @@ -1,132 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Order.h - * - * An order for a pets from the pet store - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ - - -#include "../ModelBase.h" - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - -/// -/// An order for a pets from the pet store -/// -class Order - : public ModelBase -{ -public: - Order(); - virtual ~Order(); - - ///////////////////////////////////////////// - /// ModelBase overrides - - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// Order members - - /// - /// - /// - int64_t getId() const; - bool idIsSet() const; - void unsetId(); - - void setId(int64_t value); - - /// - /// - /// - int64_t getPetId() const; - bool petIdIsSet() const; - void unsetPetId(); - - void setPetId(int64_t value); - - /// - /// - /// - int32_t getQuantity() const; - bool quantityIsSet() const; - void unsetQuantity(); - - void setQuantity(int32_t value); - - /// - /// - /// - utility::datetime getShipDate() const; - bool shipDateIsSet() const; - void unsetShipDate(); - - void setShipDate(const utility::datetime& value); - - /// - /// Order Status - /// - utility::string_t getStatus() const; - bool statusIsSet() const; - void unsetStatus(); - - void setStatus(const utility::string_t& value); - - /// - /// - /// - bool isComplete() const; - bool completeIsSet() const; - void unsetComplete(); - - void setComplete(bool value); - - -protected: - int64_t m_Id; - bool m_IdIsSet; - int64_t m_PetId; - bool m_PetIdIsSet; - int32_t m_Quantity; - bool m_QuantityIsSet; - utility::datetime m_ShipDate; - bool m_ShipDateIsSet; - utility::string_t m_Status; - bool m_StatusIsSet; - bool m_Complete; - bool m_CompleteIsSet; -}; - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Order_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp b/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp deleted file mode 100644 index f82d856aaacf..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "Pet.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - - - -Pet::Pet() -{ - m_Id = 0L; - m_IdIsSet = false; - m_CategoryIsSet = false; - m_Name = utility::conversions::to_string_t(""); - m_TagsIsSet = false; - m_Status = utility::conversions::to_string_t(""); - m_StatusIsSet = false; -} - -Pet::~Pet() -{ -} - -void Pet::validate() -{ - // TODO: implement validation -} - -web::json::value Pet::toJson() const -{ - web::json::value val = web::json::value::object(); - - if(m_IdIsSet) - { - val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id); - } - if(m_CategoryIsSet) - { - val[utility::conversions::to_string_t("category")] = ModelBase::toJson(m_Category); - } - val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_Name); - { - std::vector jsonArray; - for( auto& item : m_PhotoUrls ) - { - jsonArray.push_back(ModelBase::toJson(item)); - } - val[utility::conversions::to_string_t("photoUrls")] = web::json::value::array(jsonArray); - } - { - std::vector jsonArray; - for( auto& item : m_Tags ) - { - jsonArray.push_back(ModelBase::toJson(item)); - } - if(jsonArray.size() > 0) - { - val[utility::conversions::to_string_t("tags")] = web::json::value::array(jsonArray); - } - } - if(m_StatusIsSet) - { - val[utility::conversions::to_string_t("status")] = ModelBase::toJson(m_Status); - } - - return val; -} - -void Pet::fromJson(const web::json::value& val) -{ - if(val.has_field(utility::conversions::to_string_t("id"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id")); - if(!fieldValue.is_null()) - { - setId(ModelBase::int64_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("category"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("category")); - if(!fieldValue.is_null()) - { - std::shared_ptr newItem(new Category()); - newItem->fromJson(fieldValue); - setCategory( newItem ); - } - } - setName(ModelBase::stringFromJson(val.at(utility::conversions::to_string_t("name")))); - { - m_PhotoUrls.clear(); - std::vector jsonArray; - for( auto& item : val.at(utility::conversions::to_string_t("photoUrls")).as_array() ) - { - m_PhotoUrls.push_back(ModelBase::stringFromJson(item)); - } - } - { - m_Tags.clear(); - std::vector jsonArray; - if(val.has_field(utility::conversions::to_string_t("tags"))) - { - for( auto& item : val.at(utility::conversions::to_string_t("tags")).as_array() ) - { - if(item.is_null()) - { - m_Tags.push_back( std::shared_ptr(nullptr) ); - } - else - { - std::shared_ptr newItem(new Tag()); - newItem->fromJson(item); - m_Tags.push_back( newItem ); - } - } - } - } - if(val.has_field(utility::conversions::to_string_t("status"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("status")); - if(!fieldValue.is_null()) - { - setStatus(ModelBase::stringFromJson(fieldValue)); - } - } -} - -void Pet::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(m_IdIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id)); - } - if(m_CategoryIsSet) - { - if (m_Category.get()) - { - m_Category->toMultipart(multipart, utility::conversions::to_string_t("category.")); - } - } - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_Name)); - { - std::vector jsonArray; - for( auto& item : m_PhotoUrls ) - { - jsonArray.push_back(ModelBase::toJson(item)); - } - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("photoUrls"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); - } - { - std::vector jsonArray; - for( auto& item : m_Tags ) - { - jsonArray.push_back(ModelBase::toJson(item)); - } - - if(jsonArray.size() > 0) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("tags"), web::json::value::array(jsonArray), utility::conversions::to_string_t("application/json"))); - } - } - if(m_StatusIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("status"), m_Status)); - } -} - -void Pet::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(multipart->hasContent(utility::conversions::to_string_t("id"))) - { - setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("category"))) - { - if(multipart->hasContent(utility::conversions::to_string_t("category"))) - { - std::shared_ptr newItem(new Category()); - newItem->fromMultiPart(multipart, utility::conversions::to_string_t("category.")); - setCategory( newItem ); - } - } - setName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("name")))); - { - m_PhotoUrls.clear(); - - web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("photoUrls")))); - for( auto& item : jsonArray.as_array() ) - { - m_PhotoUrls.push_back(ModelBase::stringFromJson(item)); - } - } - { - m_Tags.clear(); - if(multipart->hasContent(utility::conversions::to_string_t("tags"))) - { - - web::json::value jsonArray = web::json::value::parse(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("tags")))); - for( auto& item : jsonArray.as_array() ) - { - if(item.is_null()) - { - m_Tags.push_back( std::shared_ptr(nullptr) ); - } - else - { - std::shared_ptr newItem(new Tag()); - newItem->fromJson(item); - m_Tags.push_back( newItem ); - } - } - } - } - if(multipart->hasContent(utility::conversions::to_string_t("status"))) - { - setStatus(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("status")))); - } -} - -int64_t Pet::getId() const -{ - return m_Id; -} - -void Pet::setId(int64_t value) -{ - m_Id = value; - m_IdIsSet = true; -} - -bool Pet::idIsSet() const -{ - return m_IdIsSet; -} - -void Pet::unsetId() -{ - m_IdIsSet = false; -} - -std::shared_ptr Pet::getCategory() const -{ - return m_Category; -} - -void Pet::setCategory(const std::shared_ptr& value) -{ - m_Category = value; - m_CategoryIsSet = true; -} - -bool Pet::categoryIsSet() const -{ - return m_CategoryIsSet; -} - -void Pet::unsetCategory() -{ - m_CategoryIsSet = false; -} - -utility::string_t Pet::getName() const -{ - return m_Name; -} - -void Pet::setName(const utility::string_t& value) -{ - m_Name = value; - -} - -std::vector& Pet::getPhotoUrls() -{ - return m_PhotoUrls; -} - -void Pet::setPhotoUrls(const std::vector& value) -{ - m_PhotoUrls = value; - -} - -std::vector>& Pet::getTags() -{ - return m_Tags; -} - -void Pet::setTags(const std::vector>& value) -{ - m_Tags = value; - m_TagsIsSet = true; -} - -bool Pet::tagsIsSet() const -{ - return m_TagsIsSet; -} - -void Pet::unsetTags() -{ - m_TagsIsSet = false; -} - -utility::string_t Pet::getStatus() const -{ - return m_Status; -} - -void Pet::setStatus(const utility::string_t& value) -{ - m_Status = value; - m_StatusIsSet = true; -} - -bool Pet::statusIsSet() const -{ - return m_StatusIsSet; -} - -void Pet::unsetStatus() -{ - m_StatusIsSet = false; -} - -} -} -} -} - - diff --git a/samples/client/petstore/cpp-restsdk/client/model/Pet.h b/samples/client/petstore/cpp-restsdk/client/model/Pet.h deleted file mode 100644 index 5c8a9ddaedf2..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Pet.h +++ /dev/null @@ -1,129 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Pet.h - * - * A pet for sale in the pet store - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ - - -#include "../ModelBase.h" - -#include "Tag.h" -#include -#include "Category.h" -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - -/// -/// A pet for sale in the pet store -/// -class Pet - : public ModelBase -{ -public: - Pet(); - virtual ~Pet(); - - ///////////////////////////////////////////// - /// ModelBase overrides - - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// Pet members - - /// - /// - /// - int64_t getId() const; - bool idIsSet() const; - void unsetId(); - - void setId(int64_t value); - - /// - /// - /// - std::shared_ptr getCategory() const; - bool categoryIsSet() const; - void unsetCategory(); - - void setCategory(const std::shared_ptr& value); - - /// - /// - /// - utility::string_t getName() const; - - void setName(const utility::string_t& value); - - /// - /// - /// - std::vector& getPhotoUrls(); - - void setPhotoUrls(const std::vector& value); - - /// - /// - /// - std::vector>& getTags(); - bool tagsIsSet() const; - void unsetTags(); - - void setTags(const std::vector>& value); - - /// - /// pet status in the store - /// - utility::string_t getStatus() const; - bool statusIsSet() const; - void unsetStatus(); - - void setStatus(const utility::string_t& value); - - -protected: - int64_t m_Id; - bool m_IdIsSet; - std::shared_ptr m_Category; - bool m_CategoryIsSet; - utility::string_t m_Name; - std::vector m_PhotoUrls; - std::vector> m_Tags; - bool m_TagsIsSet; - utility::string_t m_Status; - bool m_StatusIsSet; -}; - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Pet_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp b/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp deleted file mode 100644 index 9b46c05f0d71..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "Tag.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - - - -Tag::Tag() -{ - m_Id = 0L; - m_IdIsSet = false; - m_Name = utility::conversions::to_string_t(""); - m_NameIsSet = false; -} - -Tag::~Tag() -{ -} - -void Tag::validate() -{ - // TODO: implement validation -} - -web::json::value Tag::toJson() const -{ - web::json::value val = web::json::value::object(); - - if(m_IdIsSet) - { - val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id); - } - if(m_NameIsSet) - { - val[utility::conversions::to_string_t("name")] = ModelBase::toJson(m_Name); - } - - return val; -} - -void Tag::fromJson(const web::json::value& val) -{ - if(val.has_field(utility::conversions::to_string_t("id"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id")); - if(!fieldValue.is_null()) - { - setId(ModelBase::int64_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("name"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("name")); - if(!fieldValue.is_null()) - { - setName(ModelBase::stringFromJson(fieldValue)); - } - } -} - -void Tag::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(m_IdIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id)); - } - if(m_NameIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("name"), m_Name)); - } -} - -void Tag::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(multipart->hasContent(utility::conversions::to_string_t("id"))) - { - setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("name"))) - { - setName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("name")))); - } -} - -int64_t Tag::getId() const -{ - return m_Id; -} - -void Tag::setId(int64_t value) -{ - m_Id = value; - m_IdIsSet = true; -} - -bool Tag::idIsSet() const -{ - return m_IdIsSet; -} - -void Tag::unsetId() -{ - m_IdIsSet = false; -} - -utility::string_t Tag::getName() const -{ - return m_Name; -} - -void Tag::setName(const utility::string_t& value) -{ - m_Name = value; - m_NameIsSet = true; -} - -bool Tag::nameIsSet() const -{ - return m_NameIsSet; -} - -void Tag::unsetName() -{ - m_NameIsSet = false; -} - -} -} -} -} - - diff --git a/samples/client/petstore/cpp-restsdk/client/model/Tag.h b/samples/client/petstore/cpp-restsdk/client/model/Tag.h deleted file mode 100644 index 921d17672be8..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/Tag.h +++ /dev/null @@ -1,88 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * Tag.h - * - * A tag for a pet - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_Tag_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_Tag_H_ - - -#include "../ModelBase.h" - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - -/// -/// A tag for a pet -/// -class Tag - : public ModelBase -{ -public: - Tag(); - virtual ~Tag(); - - ///////////////////////////////////////////// - /// ModelBase overrides - - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// Tag members - - /// - /// - /// - int64_t getId() const; - bool idIsSet() const; - void unsetId(); - - void setId(int64_t value); - - /// - /// - /// - utility::string_t getName() const; - bool nameIsSet() const; - void unsetName(); - - void setName(const utility::string_t& value); - - -protected: - int64_t m_Id; - bool m_IdIsSet; - utility::string_t m_Name; - bool m_NameIsSet; -}; - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_Tag_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.cpp b/samples/client/petstore/cpp-restsdk/client/model/User.cpp deleted file mode 100644 index ace766573f3e..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/User.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - - -#include "User.h" - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - - - -User::User() -{ - m_Id = 0L; - m_IdIsSet = false; - m_Username = utility::conversions::to_string_t(""); - m_UsernameIsSet = false; - m_FirstName = utility::conversions::to_string_t(""); - m_FirstNameIsSet = false; - m_LastName = utility::conversions::to_string_t(""); - m_LastNameIsSet = false; - m_Email = utility::conversions::to_string_t(""); - m_EmailIsSet = false; - m_Password = utility::conversions::to_string_t(""); - m_PasswordIsSet = false; - m_Phone = utility::conversions::to_string_t(""); - m_PhoneIsSet = false; - m_UserStatus = 0; - m_UserStatusIsSet = false; -} - -User::~User() -{ -} - -void User::validate() -{ - // TODO: implement validation -} - -web::json::value User::toJson() const -{ - web::json::value val = web::json::value::object(); - - if(m_IdIsSet) - { - val[utility::conversions::to_string_t("id")] = ModelBase::toJson(m_Id); - } - if(m_UsernameIsSet) - { - val[utility::conversions::to_string_t("username")] = ModelBase::toJson(m_Username); - } - if(m_FirstNameIsSet) - { - val[utility::conversions::to_string_t("firstName")] = ModelBase::toJson(m_FirstName); - } - if(m_LastNameIsSet) - { - val[utility::conversions::to_string_t("lastName")] = ModelBase::toJson(m_LastName); - } - if(m_EmailIsSet) - { - val[utility::conversions::to_string_t("email")] = ModelBase::toJson(m_Email); - } - if(m_PasswordIsSet) - { - val[utility::conversions::to_string_t("password")] = ModelBase::toJson(m_Password); - } - if(m_PhoneIsSet) - { - val[utility::conversions::to_string_t("phone")] = ModelBase::toJson(m_Phone); - } - if(m_UserStatusIsSet) - { - val[utility::conversions::to_string_t("userStatus")] = ModelBase::toJson(m_UserStatus); - } - - return val; -} - -void User::fromJson(const web::json::value& val) -{ - if(val.has_field(utility::conversions::to_string_t("id"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("id")); - if(!fieldValue.is_null()) - { - setId(ModelBase::int64_tFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("username"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("username")); - if(!fieldValue.is_null()) - { - setUsername(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("firstName"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("firstName")); - if(!fieldValue.is_null()) - { - setFirstName(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("lastName"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("lastName")); - if(!fieldValue.is_null()) - { - setLastName(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("email"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("email")); - if(!fieldValue.is_null()) - { - setEmail(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("password"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("password")); - if(!fieldValue.is_null()) - { - setPassword(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("phone"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("phone")); - if(!fieldValue.is_null()) - { - setPhone(ModelBase::stringFromJson(fieldValue)); - } - } - if(val.has_field(utility::conversions::to_string_t("userStatus"))) - { - const web::json::value& fieldValue = val.at(utility::conversions::to_string_t("userStatus")); - if(!fieldValue.is_null()) - { - setUserStatus(ModelBase::int32_tFromJson(fieldValue)); - } - } -} - -void User::toMultipart(std::shared_ptr multipart, const utility::string_t& prefix) const -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(m_IdIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("id"), m_Id)); - } - if(m_UsernameIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("username"), m_Username)); - } - if(m_FirstNameIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("firstName"), m_FirstName)); - } - if(m_LastNameIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("lastName"), m_LastName)); - } - if(m_EmailIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("email"), m_Email)); - } - if(m_PasswordIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("password"), m_Password)); - } - if(m_PhoneIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("phone"), m_Phone)); - } - if(m_UserStatusIsSet) - { - multipart->add(ModelBase::toHttpContent(namePrefix + utility::conversions::to_string_t("userStatus"), m_UserStatus)); - } -} - -void User::fromMultiPart(std::shared_ptr multipart, const utility::string_t& prefix) -{ - utility::string_t namePrefix = prefix; - if(namePrefix.size() > 0 && namePrefix.substr(namePrefix.size() - 1) != utility::conversions::to_string_t(".")) - { - namePrefix += utility::conversions::to_string_t("."); - } - - if(multipart->hasContent(utility::conversions::to_string_t("id"))) - { - setId(ModelBase::int64_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("id")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("username"))) - { - setUsername(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("username")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("firstName"))) - { - setFirstName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("firstName")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("lastName"))) - { - setLastName(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("lastName")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("email"))) - { - setEmail(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("email")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("password"))) - { - setPassword(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("password")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("phone"))) - { - setPhone(ModelBase::stringFromHttpContent(multipart->getContent(utility::conversions::to_string_t("phone")))); - } - if(multipart->hasContent(utility::conversions::to_string_t("userStatus"))) - { - setUserStatus(ModelBase::int32_tFromHttpContent(multipart->getContent(utility::conversions::to_string_t("userStatus")))); - } -} - -int64_t User::getId() const -{ - return m_Id; -} - -void User::setId(int64_t value) -{ - m_Id = value; - m_IdIsSet = true; -} - -bool User::idIsSet() const -{ - return m_IdIsSet; -} - -void User::unsetId() -{ - m_IdIsSet = false; -} - -utility::string_t User::getUsername() const -{ - return m_Username; -} - -void User::setUsername(const utility::string_t& value) -{ - m_Username = value; - m_UsernameIsSet = true; -} - -bool User::usernameIsSet() const -{ - return m_UsernameIsSet; -} - -void User::unsetUsername() -{ - m_UsernameIsSet = false; -} - -utility::string_t User::getFirstName() const -{ - return m_FirstName; -} - -void User::setFirstName(const utility::string_t& value) -{ - m_FirstName = value; - m_FirstNameIsSet = true; -} - -bool User::firstNameIsSet() const -{ - return m_FirstNameIsSet; -} - -void User::unsetFirstName() -{ - m_FirstNameIsSet = false; -} - -utility::string_t User::getLastName() const -{ - return m_LastName; -} - -void User::setLastName(const utility::string_t& value) -{ - m_LastName = value; - m_LastNameIsSet = true; -} - -bool User::lastNameIsSet() const -{ - return m_LastNameIsSet; -} - -void User::unsetLastName() -{ - m_LastNameIsSet = false; -} - -utility::string_t User::getEmail() const -{ - return m_Email; -} - -void User::setEmail(const utility::string_t& value) -{ - m_Email = value; - m_EmailIsSet = true; -} - -bool User::emailIsSet() const -{ - return m_EmailIsSet; -} - -void User::unsetEmail() -{ - m_EmailIsSet = false; -} - -utility::string_t User::getPassword() const -{ - return m_Password; -} - -void User::setPassword(const utility::string_t& value) -{ - m_Password = value; - m_PasswordIsSet = true; -} - -bool User::passwordIsSet() const -{ - return m_PasswordIsSet; -} - -void User::unsetPassword() -{ - m_PasswordIsSet = false; -} - -utility::string_t User::getPhone() const -{ - return m_Phone; -} - -void User::setPhone(const utility::string_t& value) -{ - m_Phone = value; - m_PhoneIsSet = true; -} - -bool User::phoneIsSet() const -{ - return m_PhoneIsSet; -} - -void User::unsetPhone() -{ - m_PhoneIsSet = false; -} - -int32_t User::getUserStatus() const -{ - return m_UserStatus; -} - -void User::setUserStatus(int32_t value) -{ - m_UserStatus = value; - m_UserStatusIsSet = true; -} - -bool User::userStatusIsSet() const -{ - return m_UserStatusIsSet; -} - -void User::unsetUserStatus() -{ - m_UserStatusIsSet = false; -} - -} -} -} -} - - diff --git a/samples/client/petstore/cpp-restsdk/client/model/User.h b/samples/client/petstore/cpp-restsdk/client/model/User.h deleted file mode 100644 index ce0fea2d166f..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/model/User.h +++ /dev/null @@ -1,154 +0,0 @@ -/** - * OpenAPI Petstore - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * The version of the OpenAPI document: 1.0.0 - * - * NOTE: This class is auto generated by OpenAPI-Generator 4.1.3-SNAPSHOT. - * https://openapi-generator.tech - * Do not edit the class manually. - */ - -/* - * User.h - * - * A User who is purchasing from the pet store - */ - -#ifndef ORG_OPENAPITOOLS_CLIENT_MODEL_User_H_ -#define ORG_OPENAPITOOLS_CLIENT_MODEL_User_H_ - - -#include "../ModelBase.h" - -#include - -namespace org { -namespace openapitools { -namespace client { -namespace model { - - -/// -/// A User who is purchasing from the pet store -/// -class User - : public ModelBase -{ -public: - User(); - virtual ~User(); - - ///////////////////////////////////////////// - /// ModelBase overrides - - void validate() override; - - web::json::value toJson() const override; - void fromJson(const web::json::value& json) override; - - void toMultipart(std::shared_ptr multipart, const utility::string_t& namePrefix) const override; - void fromMultiPart(std::shared_ptr multipart, const utility::string_t& namePrefix) override; - - ///////////////////////////////////////////// - /// User members - - /// - /// - /// - int64_t getId() const; - bool idIsSet() const; - void unsetId(); - - void setId(int64_t value); - - /// - /// - /// - utility::string_t getUsername() const; - bool usernameIsSet() const; - void unsetUsername(); - - void setUsername(const utility::string_t& value); - - /// - /// - /// - utility::string_t getFirstName() const; - bool firstNameIsSet() const; - void unsetFirstName(); - - void setFirstName(const utility::string_t& value); - - /// - /// - /// - utility::string_t getLastName() const; - bool lastNameIsSet() const; - void unsetLastName(); - - void setLastName(const utility::string_t& value); - - /// - /// - /// - utility::string_t getEmail() const; - bool emailIsSet() const; - void unsetEmail(); - - void setEmail(const utility::string_t& value); - - /// - /// - /// - utility::string_t getPassword() const; - bool passwordIsSet() const; - void unsetPassword(); - - void setPassword(const utility::string_t& value); - - /// - /// - /// - utility::string_t getPhone() const; - bool phoneIsSet() const; - void unsetPhone(); - - void setPhone(const utility::string_t& value); - - /// - /// User Status - /// - int32_t getUserStatus() const; - bool userStatusIsSet() const; - void unsetUserStatus(); - - void setUserStatus(int32_t value); - - -protected: - int64_t m_Id; - bool m_IdIsSet; - utility::string_t m_Username; - bool m_UsernameIsSet; - utility::string_t m_FirstName; - bool m_FirstNameIsSet; - utility::string_t m_LastName; - bool m_LastNameIsSet; - utility::string_t m_Email; - bool m_EmailIsSet; - utility::string_t m_Password; - bool m_PasswordIsSet; - utility::string_t m_Phone; - bool m_PhoneIsSet; - int32_t m_UserStatus; - bool m_UserStatusIsSet; -}; - - -} -} -} -} - -#endif /* ORG_OPENAPITOOLS_CLIENT_MODEL_User_H_ */ diff --git a/samples/client/petstore/cpp-restsdk/client/pom.xml b/samples/client/petstore/cpp-restsdk/client/pom.xml deleted file mode 100644 index f127ec6ede34..000000000000 --- a/samples/client/petstore/cpp-restsdk/client/pom.xml +++ /dev/null @@ -1,57 +0,0 @@ - - 4.0.0 - org.openapitools - CppRestPetstoreClientTests - pom - 1.0-SNAPSHOT - CppRest Petstore Client - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory} - - - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - cmake - pre-integration-test - - exec - - - cmake - - -DCMAKE_CXX_FLAGS="-I/usr/local/opt/openssl/include" - -DCMAKE_MODULE_LINKER_FLAGS="-L/usr/local/opt/openssl/lib" - - - - - make - integration-test - - exec - - - make - - - - - - - diff --git a/samples/client/petstore/cpp-restsdk/main.cpp b/samples/client/petstore/cpp-restsdk/main.cpp deleted file mode 100644 index 27ca41ceb641..000000000000 --- a/samples/client/petstore/cpp-restsdk/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "PetApiTests.h" - -int main(int argc, char *argv[]) { - auto petTest = std::make_shared(); - petTest->runTests(); -} diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator-ignore b/samples/client/petstore/cpp-tizen/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/client/petstore/cpp-tizen/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION b/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION deleted file mode 100644 index 4395ff592326..000000000000 --- a/samples/client/petstore/cpp-tizen/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/cpp-tizen/PetStoreTest/CMakeLists.txt b/samples/client/petstore/cpp-tizen/PetStoreTest/CMakeLists.txt deleted file mode 100644 index b8a4a02b6b07..000000000000 --- a/samples/client/petstore/cpp-tizen/PetStoreTest/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT("PetStoreTest") -INCLUDE(GNUInstallDirs) - -SET(target ${PROJECT_NAME}) - -# Dependencies -SET(dependents "glib-2.0 json-glib-1.0 libcurl") -INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED ${dependents}) -FOREACH(flag ${pkgs_CFLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") -ENDFOREACH(flag) - -ADD_DEFINITIONS(-O2 -w -fPIC -fvisibility=default -Wno-unused-variable -Wno-shadow -Wno-cast-qual -fpermissive) -SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC") - -FILE(GLOB_RECURSE SRCS "./src/*.cpp" "../src/*.cpp") -add_executable(${PROJECT_NAME} ${SRCS}) - -include_directories(${pkgs_INCLUDE_DIRS}) -link_directories(${pkgs_LIBRARY_DIRS}) -target_link_libraries(${PROJECT_NAME} ${pkgs_LIBRARIES}) - -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) diff --git a/samples/client/petstore/cpp-tizen/PetStoreTest/src/PetStoreTest.cpp b/samples/client/petstore/cpp-tizen/PetStoreTest/src/PetStoreTest.cpp deleted file mode 100644 index 20bb34cefbf4..000000000000 --- a/samples/client/petstore/cpp-tizen/PetStoreTest/src/PetStoreTest.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: PetStoreTest.cpp - * Author: akhil - * - * Created on June 9, 2016, 3:33 PM - */ - -#include "PetStoreTest.h" -#include -#include - -using namespace std; - -void addPetCallback(Error error, void* userdata){ - int code = error.getCode(); - assert(code == 200); - cout<<"In addPetCallback \n"; -} -void getPetCallback(Pet pet,Error error, void* userdata){ - int code = error.getCode(); - assert(code == 200); - string name = pet.getName(); - assert(strcmp(name.c_str(),"myname")==0); - cout<<"In getPetCallback \n"; -} -void updatePetCallback(Error error, void* userdata){ - int code = error.getCode(); - assert(code == 200); - cout<<"In updatePetCallback \n"; -} -void findPetCallback(list retlist, Error error, void* userdata){ - int code = error.getCode(); - assert(code == 200); - int size = retlist.size(); - assert(size>=1); - cout<<"In findPetCallback \n"; -} -void deletePetCallback(Error error, void* userdata){ - int code = error.getCode(); - assert(code == 200); - cout<<"In deletePetCallback \n"; -} - -PetStoreTest::PetStoreTest() { -} - - -PetStoreTest::~PetStoreTest() { -} - -void PetStoreTest::runAllTests(){ - accessToken = "special-key"; - createPetTest(); - getPetTest(); - updatePetWithFormDataTest(); - findPetByStatus(); - deletePetTest(); -} - -void PetStoreTest::createPetTest() { - Category category; - category.setId(100); - category.setName("mycategory"); - Pet body; - body.setId(100); - body.setCategory(category); - body.setName("myname"); - list urllist; - urllist.push_back("myurl"); - body.setPhotoUrls(urllist); - Tag tag; - tag.setId(100); - tag.setName("mytag"); - list taglist; - taglist.push_back(tag); - body.setTags(taglist); - body.setStatus("available"); - //body.setType("mytype"); - - petmanager.addPetSync(accessToken.c_str(),body,addPetCallback,NULL); -} - -void PetStoreTest::getPetTest() { - petmanager.getPetByIdSync(accessToken.c_str(),100,getPetCallback,NULL); -} - -void PetStoreTest::updatePetWithFormDataTest() { - petmanager.updatePetWithFormSync(accessToken.c_str(),100,"myname2","pending",updatePetCallback,NULL); -} -void PetStoreTest::findPetByStatus(){ - list mylist; - mylist.push_back("pending"); - petmanager.findPetsByStatusSync(accessToken.c_str(),mylist,findPetCallback,NULL); -} - -void PetStoreTest::deletePetTest() { - petmanager.deletePetSync(accessToken.c_str(),100,accessToken,deletePetCallback,NULL); -} diff --git a/samples/client/petstore/cpp-tizen/PetStoreTest/src/PetStoreTest.h b/samples/client/petstore/cpp-tizen/PetStoreTest/src/PetStoreTest.h deleted file mode 100644 index 48ea78b68108..000000000000 --- a/samples/client/petstore/cpp-tizen/PetStoreTest/src/PetStoreTest.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: PetStoreTest.h - * Author: akhil - * - * Created on June 9, 2016, 3:33 PM - */ - -#ifndef PETSTORETEST_H -#define PETSTORETEST_H - -#include "../../src/PetManager.h" - -using namespace Tizen::ArtikCloud; - -class PetStoreTest { -public: - PetStoreTest(); - PetStoreTest(const PetStoreTest& orig); - virtual ~PetStoreTest(); - void createPetTest(); - void getPetTest(); - void runAllTests(); - void updatePetWithFormDataTest(); - void findPetByStatus(); - void deletePetTest(); -private: - PetManager petmanager; - std::string accessToken; - -}; - -#endif /* PETSTORETEST_H */ diff --git a/samples/client/petstore/cpp-tizen/PetStoreTest/src/main.cpp b/samples/client/petstore/cpp-tizen/PetStoreTest/src/main.cpp deleted file mode 100644 index a2c1e76541c1..000000000000 --- a/samples/client/petstore/cpp-tizen/PetStoreTest/src/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ - -/* - * File: main.cpp - * Author: akhil - * - * Created on June 8, 2016, 7:30 PM - */ - -#include -#include "PetStoreTest.h" - -using namespace std; - -/* - * - */ -int main(int argc, char** argv) { - PetStoreTest test; - test.runAllTests(); - return 0; -} - diff --git a/samples/client/petstore/cpp-tizen/doc/Doxyfile b/samples/client/petstore/cpp-tizen/doc/Doxyfile deleted file mode 100644 index 9a0ba8f71860..000000000000 --- a/samples/client/petstore/cpp-tizen/doc/Doxyfile +++ /dev/null @@ -1,2313 +0,0 @@ -# Doxyfile 1.8.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "OpenAPI Petstore 1.0.0 Tizen SDK" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = 1.0.0 - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "An SDK for creating client applications for OpenAPI Petstore on Tizen Platform (http://tizen.org/)" - -# With the PROJECT_LOGO tag one can specify a logo or icon that is included in -# the documentation. The maximum height of the logo should not exceed 55 pixels -# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo -# to the output directory. - -PROJECT_LOGO = "./doc/logo.png" - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = "./doc/SDK" - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = NO - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a -# new page for each member. If set to NO, the documentation of a member will be -# part of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. -# -# Note For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by by putting a % sign in front of the word -# or globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = YES - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = NO - -# This flag is only useful for Objective-C code. When set to YES local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO these classes will be included in the various overviews. This option has -# no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the -# todo list. This list is created by putting \todo commands in the -# documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the -# test list. This list is created by putting \test commands in the -# documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES the list -# will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. Do not use file names with spaces, bibtex cannot handle them. See -# also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO doxygen will only warn about wrong or incomplete parameter -# documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. -# Note: If this tag is empty the current directory is searched. - -INPUT = ./src ./include - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank the -# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, -# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, -# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, -# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, -# *.qsf, *.as and *.js. - -FILE_PATTERNS = *.h *.cpp - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER ) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES, then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- -# defined cascading style sheet that is included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. -# Doxygen will copy the style sheet file to the output directory. For an example -# see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the stylesheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to NO can help when comparing the output of multiple runs. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = YES - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler ( hhc.exe). If non-empty -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated ( -# YES) or that it should be included in the master .chm file ( NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated ( -# YES) or a normal table of contents ( NO) in the .chm file. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- -# folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- -# filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using prerendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /