diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..4df8401 Binary files /dev/null and b/.DS_Store differ diff --git a/java-client-generated/.gitignore b/java-client-generated/.gitignore new file mode 100644 index 0000000..a530464 --- /dev/null +++ b/java-client-generated/.gitignore @@ -0,0 +1,21 @@ +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/java-client-generated/.idea/.gitignore b/java-client-generated/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/java-client-generated/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/java-client-generated/.idea/.name b/java-client-generated/.idea/.name new file mode 100644 index 0000000..05eeda8 --- /dev/null +++ b/java-client-generated/.idea/.name @@ -0,0 +1 @@ +swagger-java-client \ No newline at end of file diff --git a/java-client-generated/.idea/compiler.xml b/java-client-generated/.idea/compiler.xml new file mode 100644 index 0000000..b681965 --- /dev/null +++ b/java-client-generated/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/encodings.xml b/java-client-generated/.idea/encodings.xml new file mode 100644 index 0000000..63e9001 --- /dev/null +++ b/java-client-generated/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/jarRepositories.xml b/java-client-generated/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/java-client-generated/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__com_google_code_gson_gson_2_8_1.xml b/java-client-generated/.idea/libraries/Maven__com_google_code_gson_gson_2_8_1.xml new file mode 100644 index 0000000..ef489bc --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__com_google_code_gson_gson_2_8_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__com_squareup_okhttp_logging_interceptor_2_7_5.xml b/java-client-generated/.idea/libraries/Maven__com_squareup_okhttp_logging_interceptor_2_7_5.xml new file mode 100644 index 0000000..c6a5e4f --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__com_squareup_okhttp_logging_interceptor_2_7_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__com_squareup_okhttp_okhttp_2_7_5.xml b/java-client-generated/.idea/libraries/Maven__com_squareup_okhttp_okhttp_2_7_5.xml new file mode 100644 index 0000000..0ae565c --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__com_squareup_okhttp_okhttp_2_7_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__com_squareup_okio_okio_1_6_0.xml b/java-client-generated/.idea/libraries/Maven__com_squareup_okio_okio_1_6_0.xml new file mode 100644 index 0000000..284ba86 --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__com_squareup_okio_okio_1_6_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__io_gsonfire_gson_fire_1_8_3.xml b/java-client-generated/.idea/libraries/Maven__io_gsonfire_gson_fire_1_8_3.xml new file mode 100644 index 0000000..a280b00 --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__io_gsonfire_gson_fire_1_8_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__io_swagger_core_v3_swagger_annotations_2_0_0.xml b/java-client-generated/.idea/libraries/Maven__io_swagger_core_v3_swagger_annotations_2_0_0.xml new file mode 100644 index 0000000..ef09a04 --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__io_swagger_core_v3_swagger_annotations_2_0_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__junit_junit_4_12.xml b/java-client-generated/.idea/libraries/Maven__junit_junit_4_12.xml new file mode 100644 index 0000000..d411041 --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__junit_junit_4_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/java-client-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..f58bbc1 --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/libraries/Maven__org_threeten_threetenbp_1_3_5.xml b/java-client-generated/.idea/libraries/Maven__org_threeten_threetenbp_1_3_5.xml new file mode 100644 index 0000000..02b135c --- /dev/null +++ b/java-client-generated/.idea/libraries/Maven__org_threeten_threetenbp_1_3_5.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/midpoint.xml b/java-client-generated/.idea/midpoint.xml new file mode 100644 index 0000000..9d8d61b --- /dev/null +++ b/java-client-generated/.idea/midpoint.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/misc.xml b/java-client-generated/.idea/misc.xml new file mode 100644 index 0000000..735bb57 --- /dev/null +++ b/java-client-generated/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.idea/modules.xml b/java-client-generated/.idea/modules.xml new file mode 100644 index 0000000..cd80374 --- /dev/null +++ b/java-client-generated/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/java-client-generated/.swagger-codegen-ignore b/java-client-generated/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/java-client-generated/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/java-client-generated/.swagger-codegen/VERSION b/java-client-generated/.swagger-codegen/VERSION new file mode 100644 index 0000000..402b44e --- /dev/null +++ b/java-client-generated/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.21 \ No newline at end of file diff --git a/java-client-generated/.travis.yml b/java-client-generated/.travis.yml new file mode 100644 index 0000000..70cb81a --- /dev/null +++ b/java-client-generated/.travis.yml @@ -0,0 +1,17 @@ +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# +language: java +jdk: + - oraclejdk8 + - oraclejdk7 +before_install: + # ensure gradlew has proper permission + - chmod a+x ./gradlew +script: + # test using maven + - mvn test + # uncomment below to test using gradle + # - gradle test + # uncomment below to test using sbt + # - sbt test diff --git a/java-client-generated/README.md b/java-client-generated/README.md new file mode 100644 index 0000000..40f2a7e --- /dev/null +++ b/java-client-generated/README.md @@ -0,0 +1,248 @@ +# swagger-java-client + +ID Match API +- API version: 1.1.1 + - Build date: 2020-09-18T00:55:04.707Z[GMT] + +ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + + +## Requirements + +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle + +## Installation + +To install the API client library to your local Maven repository, simply execute: + +```shell +mvn clean install +``` + +To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: + +```shell +mvn clean deploy +``` + +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. + +### Maven users + +Add this dependency to your project's POM: + +```xml + + io.swagger + swagger-java-client + 1.0.0 + compile + +``` + +### Gradle users + +Add this dependency to your project's build file: + +```groovy +compile "io.swagger:swagger-java-client:1.0.0" +``` + +### Others + +At first generate the JAR by executing: + +```shell +mvn clean package +``` + +Then manually install the following JARs: + +* `target/swagger-java-client-1.0.0.jar` +* `target/lib/*.jar` + +## Getting Started + +Please follow the [installation](#installation) instruction and execute the following Java code: + +```java +import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.DefaultApi; + +import java.io.File; +import java.util.*; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure OAuth2 access token for authorization: accessCode + OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); + accessCode.setAccessToken("YOUR ACCESS TOKEN"); + + DefaultApi apiInstance = new DefaultApi(); + try { + apiInstance.exampleGet(); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#exampleGet"); + e.printStackTrace(); + } + } +} +import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.DefaultApi; + +import java.io.File; +import java.util.*; + +public class DefaultApiExample { + + public static void main(String[] args) { + + DefaultApi apiInstance = new DefaultApi(); + try { + apiInstance.pingGet(); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#pingGet"); + e.printStackTrace(); + } + } +} +import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.DefaultApi; + +import java.io.File; +import java.util.*; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure OAuth2 access token for authorization: accessCode + OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); + accessCode.setAccessToken("YOUR ACCESS TOKEN"); + + DefaultApi apiInstance = new DefaultApi(); + Integer limit = 56; // Integer | Limits the number of items on a page + Integer offset = 56; // Integer | Specifies the page number of the artists to be displayed + try { + List result = apiInstance.sisGet(limit, offset); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#sisGet"); + e.printStackTrace(); + } + } +} +import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.DefaultApi; + +import java.io.File; +import java.util.*; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure OAuth2 access token for authorization: accessCode + OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); + accessCode.setAccessToken("YOUR ACCESS TOKEN"); + + DefaultApi apiInstance = new DefaultApi(); + Person body = new Person(); // Person | + try { + apiInstance.sisPost(body); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#sisPost"); + e.printStackTrace(); + } + } +} +import io.swagger.client.*; +import io.swagger.client.auth.*; +import io.swagger.client.model.*; +import io.swagger.client.api.DefaultApi; + +import java.io.File; +import java.util.*; + +public class DefaultApiExample { + + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + + // Configure OAuth2 access token for authorization: accessCode + OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); + accessCode.setAccessToken("YOUR ACCESS TOKEN"); + + DefaultApi apiInstance = new DefaultApi(); + String sorId = "sorId_example"; // String | + try { + InlineResponse200 result = apiInstance.sisSorIdGet(sorId); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#sisSorIdGet"); + e.printStackTrace(); + } + } +} +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://virtserver.swaggerhub.com/I2/idMatch/1.0.0* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**exampleGet**](docs/DefaultApi.md#exampleGet) | **GET** /example | Server example operation +*DefaultApi* | [**pingGet**](docs/DefaultApi.md#pingGet) | **GET** /ping | Server heartbeat operation +*DefaultApi* | [**sisGet**](docs/DefaultApi.md#sisGet) | **GET** /sis | +*DefaultApi* | [**sisPost**](docs/DefaultApi.md#sisPost) | **POST** /sis | +*DefaultApi* | [**sisSorIdGet**](docs/DefaultApi.md#sisSorIdGet) | **GET** /sis/{sorId} | + +## Documentation for Models + + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse400](docs/InlineResponse400.md) + - [Person](docs/Person.md) + - [PersonAddress](docs/PersonAddress.md) + - [PersonEmailAddress](docs/PersonEmailAddress.md) + - [PersonIdentifier](docs/PersonIdentifier.md) + - [PersonNames](docs/PersonNames.md) + - [PersonTelephoneNumber](docs/PersonTelephoneNumber.md) + +## Documentation for Authorization + +Authentication schemes defined for the API: +### accessCode + +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: http://example.com/oauth/auth +- **Scopes**: + - : + + +## Recommendation + +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. + +## Author + + diff --git a/java-client-generated/build.gradle b/java-client-generated/build.gradle new file mode 100644 index 0000000..11998c5 --- /dev/null +++ b/java-client-generated/build.gradle @@ -0,0 +1,104 @@ +apply plugin: 'idea' +apply plugin: 'eclipse' + +group = 'io.swagger' +version = '1.0.0' + +buildscript { + repositories { + jcenter() + } + dependencies { + classpath 'com.android.tools.build:gradle:2.3.+' + classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + } +} + +repositories { + jcenter() +} + + +if(hasProperty('target') && target == 'android') { + + apply plugin: 'com.android.library' + apply plugin: 'com.github.dcendents.android-maven' + + android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + defaultConfig { + minSdkVersion 14 + targetSdkVersion 25 + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_7 + targetCompatibility JavaVersion.VERSION_1_7 + } + + // Rename the aar correctly + libraryVariants.all { variant -> + variant.outputs.each { output -> + def outputFile = output.outputFile + if (outputFile != null && outputFile.name.endsWith('.aar')) { + def fileName = "${project.name}-${variant.baseName}-${version}.aar" + output.outputFile = new File(outputFile.parent, fileName) + } + } + } + + dependencies { + provided 'javax.annotation:jsr250-api:1.0' + } + } + + afterEvaluate { + android.libraryVariants.all { variant -> + def task = project.tasks.create "jar${variant.name.capitalize()}", Jar + task.description = "Create jar artifact for ${variant.name}" + task.dependsOn variant.javaCompile + task.from variant.javaCompile.destinationDir + task.destinationDir = project.file("${project.buildDir}/outputs/jar") + task.archiveName = "${project.name}-${variant.baseName}-${version}.jar" + artifacts.add('archives', task); + } + } + + task sourcesJar(type: Jar) { + from android.sourceSets.main.java.srcDirs + classifier = 'sources' + } + + artifacts { + archives sourcesJar + } + +} else { + + apply plugin: 'java' + apply plugin: 'maven' + + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 + + install { + repositories.mavenInstaller { + pom.artifactId = 'swagger-java-client' + } + } + + task execute(type:JavaExec) { + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath + } +} + +dependencies { + compile 'io.swagger.core.v3:swagger-annotations:2.0.0' + compile 'com.squareup.okhttp:okhttp:2.7.5' + compile 'com.squareup.okhttp:logging-interceptor:2.7.5' + compile 'com.google.code.gson:gson:2.8.1' + compile 'io.gsonfire:gson-fire:1.8.3' + compile 'org.threeten:threetenbp:1.3.5' + testCompile 'junit:junit:4.12' +} diff --git a/java-client-generated/build.sbt b/java-client-generated/build.sbt new file mode 100644 index 0000000..0a65ca7 --- /dev/null +++ b/java-client-generated/build.sbt @@ -0,0 +1,21 @@ +lazy val root = (project in file(".")). + settings( + organization := "io.swagger", + name := "swagger-java-client", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "io.swagger.core.v3" % "swagger-annotations" % "2.0.0", + "com.squareup.okhttp" % "okhttp" % "2.7.5", + "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", + "com.google.code.gson" % "gson" % "2.8.1", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.10" % "test" + ) + ) diff --git a/java-client-generated/docs/DefaultApi.md b/java-client-generated/docs/DefaultApi.md new file mode 100644 index 0000000..71a9c72 --- /dev/null +++ b/java-client-generated/docs/DefaultApi.md @@ -0,0 +1,260 @@ +# DefaultApi + +All URIs are relative to *https://virtserver.swaggerhub.com/I2/idMatch/1.0.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**exampleGet**](DefaultApi.md#exampleGet) | **GET** /example | Server example operation +[**pingGet**](DefaultApi.md#pingGet) | **GET** /ping | Server heartbeat operation +[**sisGet**](DefaultApi.md#sisGet) | **GET** /sis | +[**sisPost**](DefaultApi.md#sisPost) | **POST** /sis | +[**sisSorIdGet**](DefaultApi.md#sisSorIdGet) | **GET** /sis/{sorId} | + + +# **exampleGet** +> exampleGet() + +Server example operation + +This is an example operation to show how security is applied to the call. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.DefaultApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: accessCode +OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); +accessCode.setAccessToken("YOUR ACCESS TOKEN"); + +DefaultApi apiInstance = new DefaultApi(); +try { + apiInstance.exampleGet(); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#exampleGet"); + e.printStackTrace(); +} +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +null (empty response body) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + + +# **pingGet** +> pingGet() + +Server heartbeat operation + +This operation shows how to override the global security defined above, as we want to open it up for all users. + +### Example +```java +// Import classes: +//import io.swagger.client.ApiException; +//import io.swagger.client.api.DefaultApi; + + +DefaultApi apiInstance = new DefaultApi(); +try { + apiInstance.pingGet(); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#pingGet"); + 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 + + +# **sisGet** +> List<Person> sisGet(limit, offset) + + + +Returns a list of people + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.DefaultApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: accessCode +OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); +accessCode.setAccessToken("YOUR ACCESS TOKEN"); + +DefaultApi apiInstance = new DefaultApi(); +Integer limit = 56; // Integer | Limits the number of items on a page +Integer offset = 56; // Integer | Specifies the page number of the artists to be displayed +try { + List result = apiInstance.sisGet(limit, offset); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#sisGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **Integer**| Limits the number of items on a page | [optional] + **offset** | **Integer**| Specifies the page number of the artists to be displayed | [optional] + +### Return type + +[**List<Person>**](Person.md) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +# **sisPost** +> sisPost(body) + + + +Get a reference ID for an SoR person + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.DefaultApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: accessCode +OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); +accessCode.setAccessToken("YOUR ACCESS TOKEN"); + +DefaultApi apiInstance = new DefaultApi(); +Person body = new Person(); // Person | +try { + apiInstance.sisPost(body); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#sisPost"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Person**](Person.md)| | + +### Return type + +null (empty response body) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **sisSorIdGet** +> InlineResponse200 sisSorIdGet(sorId) + + + +Obtain information about an person from his or her sorId + +### Example +```java +// Import classes: +//import io.swagger.client.ApiClient; +//import io.swagger.client.ApiException; +//import io.swagger.client.Configuration; +//import io.swagger.client.auth.*; +//import io.swagger.client.api.DefaultApi; + +ApiClient defaultClient = Configuration.getDefaultApiClient(); + +// Configure OAuth2 access token for authorization: accessCode +OAuth accessCode = (OAuth) defaultClient.getAuthentication("accessCode"); +accessCode.setAccessToken("YOUR ACCESS TOKEN"); + +DefaultApi apiInstance = new DefaultApi(); +String sorId = "sorId_example"; // String | +try { + InlineResponse200 result = apiInstance.sisSorIdGet(sorId); + System.out.println(result); +} catch (ApiException e) { + System.err.println("Exception when calling DefaultApi#sisSorIdGet"); + e.printStackTrace(); +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sorId** | **String**| | + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + diff --git a/java-client-generated/docs/InlineResponse200.md b/java-client-generated/docs/InlineResponse200.md new file mode 100644 index 0000000..c3df48a --- /dev/null +++ b/java-client-generated/docs/InlineResponse200.md @@ -0,0 +1,8 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artistName** | **String** | | [optional] +**artistGenre** | **String** | | [optional] +**albumsRecorded** | **Integer** | | [optional] diff --git a/java-client-generated/docs/InlineResponse400.md b/java-client-generated/docs/InlineResponse400.md new file mode 100644 index 0000000..ba1272b --- /dev/null +++ b/java-client-generated/docs/InlineResponse400.md @@ -0,0 +1,6 @@ +# InlineResponse400 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | | [optional] diff --git a/java-client-generated/docs/Person.md b/java-client-generated/docs/Person.md new file mode 100644 index 0000000..de327ee --- /dev/null +++ b/java-client-generated/docs/Person.md @@ -0,0 +1,14 @@ +# Person + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sorId** | **Integer** | | +**dateOfBirth** | **String** | | [optional] +**names** | [**List<PersonNames>**](PersonNames.md) | | [optional] +**address** | [**List<PersonAddress>**](PersonAddress.md) | | [optional] +**emailAddress** | [**List<PersonEmailAddress>**](PersonEmailAddress.md) | | [optional] +**identifier** | [**List<PersonIdentifier>**](PersonIdentifier.md) | | [optional] +**primaryAffiliation** | **String** | | [optional] +**gender** | **String** | | [optional] +**telephoneNumber** | [**List<PersonTelephoneNumber>**](PersonTelephoneNumber.md) | | [optional] diff --git a/java-client-generated/docs/PersonAddress.md b/java-client-generated/docs/PersonAddress.md new file mode 100644 index 0000000..f69e175 --- /dev/null +++ b/java-client-generated/docs/PersonAddress.md @@ -0,0 +1,15 @@ +# PersonAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **String** | | [optional] +**formatted** | **String** | | [optional] +**language** | **String** | | [optional] +**locality** | **String** | | [optional] +**postalCode** | **String** | | [optional] +**region** | **String** | | [optional] +**room** | **String** | | [optional] +**streetAddress** | **String** | | [optional] +**type** | **String** | | [optional] +**verified** | **String** | | [optional] diff --git a/java-client-generated/docs/PersonEmailAddress.md b/java-client-generated/docs/PersonEmailAddress.md new file mode 100644 index 0000000..aaea05f --- /dev/null +++ b/java-client-generated/docs/PersonEmailAddress.md @@ -0,0 +1,8 @@ +# PersonEmailAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **String** | | [optional] +**type** | **String** | | [optional] +**verified** | **String** | | [optional] diff --git a/java-client-generated/docs/PersonIdentifier.md b/java-client-generated/docs/PersonIdentifier.md new file mode 100644 index 0000000..8b8a6bc --- /dev/null +++ b/java-client-generated/docs/PersonIdentifier.md @@ -0,0 +1,7 @@ +# PersonIdentifier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**type** | **String** | | [optional] diff --git a/java-client-generated/docs/PersonNames.md b/java-client-generated/docs/PersonNames.md new file mode 100644 index 0000000..564ea49 --- /dev/null +++ b/java-client-generated/docs/PersonNames.md @@ -0,0 +1,8 @@ +# PersonNames + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | | [optional] +**given** | **String** | | [optional] +**family** | **String** | | [optional] diff --git a/java-client-generated/docs/PersonTelephoneNumber.md b/java-client-generated/docs/PersonTelephoneNumber.md new file mode 100644 index 0000000..85dc104 --- /dev/null +++ b/java-client-generated/docs/PersonTelephoneNumber.md @@ -0,0 +1,7 @@ +# PersonTelephoneNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **String** | | [optional] +**type** | **String** | | [optional] diff --git a/java-client-generated/git_push.sh b/java-client-generated/git_push.sh new file mode 100644 index 0000000..ed37461 --- /dev/null +++ b/java-client-generated/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="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 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/java-client-generated/gradle.properties b/java-client-generated/gradle.properties new file mode 100644 index 0000000..05644f0 --- /dev/null +++ b/java-client-generated/gradle.properties @@ -0,0 +1,2 @@ +# Uncomment to build for Android +#target = android \ No newline at end of file diff --git a/java-client-generated/gradle/wrapper/gradle-wrapper.jar b/java-client-generated/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..2c6137b Binary files /dev/null and b/java-client-generated/gradle/wrapper/gradle-wrapper.jar differ diff --git a/java-client-generated/gradle/wrapper/gradle-wrapper.properties b/java-client-generated/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..b7a3647 --- /dev/null +++ b/java-client-generated/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Tue May 17 23:08:05 CST 2016 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip diff --git a/java-client-generated/gradlew b/java-client-generated/gradlew new file mode 100644 index 0000000..9d82f78 --- /dev/null +++ b/java-client-generated/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# 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 +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# 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 + +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" ] ; 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 + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/java-client-generated/gradlew.bat b/java-client-generated/gradlew.bat new file mode 100644 index 0000000..5f19212 --- /dev/null +++ b/java-client-generated/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/java-client-generated/pom.xml b/java-client-generated/pom.xml new file mode 100644 index 0000000..726f4e4 --- /dev/null +++ b/java-client-generated/pom.xml @@ -0,0 +1,223 @@ + + 4.0.0 + io.swagger + swagger-java-client + jar + swagger-java-client + 1.0.0 + https://github.com/swagger-api/swagger-codegen + Swagger Java + + scm:git:git@github.com:swagger-api/swagger-codegen.git + scm:git:git@github.com:swagger-api/swagger-codegen.git + https://github.com/swagger-api/swagger-codegen + + + 2.2.0 + + + + + Unlicense + http://unlicense.org + repo + + + + + + Swagger + apiteam@swagger.io + Swagger + http://swagger.io + + + + + + + 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 + 1.10 + + + 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-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + + + + + sign-artifacts + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + + + + + + + io.swagger.core.v3 + swagger-annotations + ${swagger-core-version} + + + com.squareup.okhttp + okhttp + ${okhttp-version} + + + com.squareup.okhttp + logging-interceptor + ${okhttp-version} + + + com.google.code.gson + gson + ${gson-version} + + + io.gsonfire + gson-fire + ${gson-fire-version} + + + org.threeten + threetenbp + ${threetenbp-version} + + + + junit + junit + ${junit-version} + test + + + + 1.7 + ${java.version} + ${java.version} + 2.0.0 + 2.7.5 + 2.8.1 + 1.8.3 + 1.3.5 + 1.0.0 + 4.12 + UTF-8 + + diff --git a/java-client-generated/settings.gradle b/java-client-generated/settings.gradle new file mode 100644 index 0000000..55640f7 --- /dev/null +++ b/java-client-generated/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "swagger-java-client" \ No newline at end of file diff --git a/java-client-generated/src/main/AndroidManifest.xml b/java-client-generated/src/main/AndroidManifest.xml new file mode 100644 index 0000000..465dcb5 --- /dev/null +++ b/java-client-generated/src/main/AndroidManifest.xml @@ -0,0 +1,3 @@ + + + diff --git a/java-client-generated/src/main/java/io/swagger/client/ApiCallback.java b/java-client-generated/src/main/java/io/swagger/client/ApiCallback.java new file mode 100644 index 0000000..f86a66d --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/ApiCallback.java @@ -0,0 +1,61 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param The return type + */ +public interface ApiCallback { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API downlond processing. + * + * @param bytesRead bytes Read + * @param contentLength content lenngth of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/java-client-generated/src/main/java/io/swagger/client/ApiClient.java b/java-client-generated/src/main/java/io/swagger/client/ApiClient.java new file mode 100644 index 0000000..8325da6 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/ApiClient.java @@ -0,0 +1,1204 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.*; +import com.squareup.okhttp.internal.http.HttpMethod; +import com.squareup.okhttp.logging.HttpLoggingInterceptor; +import com.squareup.okhttp.logging.HttpLoggingInterceptor.Level; +import okio.BufferedSink; +import okio.Okio; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import io.swagger.client.auth.Authentication; +import io.swagger.client.auth.HttpBasicAuth; +import io.swagger.client.auth.ApiKeyAuth; +import io.swagger.client.auth.OAuth; + +public class ApiClient { + + private String basePath = "https://virtserver.swaggerhub.com/I2/idMatch/1.0.0"; + private boolean debugging = false; + private Map defaultHeaderMap = new HashMap(); + private String tempFolderPath = null; + + private Map authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /* + * Constructor for ApiClient + */ + public ApiClient() { + httpClient = new OkHttpClient(); + + + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("Swagger-Codegen/1.0.0/java"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap(); + authentications.put("accessCode", new OAuth()); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Get base path + * + * @return Baes path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://virtserver.swaggerhub.com/I2/idMatch/1.0.0 + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client + * + * @param httpClient An instance of OkHttpClient + * @return Api Client + */ + public ApiClient setHttpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + public DateFormat getDateFormat() { + return dateFormat; + } + + public ApiClient setDateFormat(DateFormat dateFormat) { + this.json.setDateFormat(dateFormat); + return this; + } + + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + this.json.setSqlDateFormat(dateFormat); + return this; + } + + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + this.json.setOffsetDateTimeFormat(dateFormat); + return this; + } + + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + this.json.setLocalDateFormat(dateFormat); + return this; + } + + public ApiClient setLenientOnJson(boolean lenientOnJson) { + this.json.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient.interceptors().add(loggingInterceptor); + } else { + httpClient.interceptors().remove(loggingInterceptor); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default tempopary folder. + * + * @see createTempFile + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.getConnectTimeout(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient.setConnectTimeout(connectionTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.getReadTimeout(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient.setReadTimeout(readTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.getWriteTimeout(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient.setWriteTimeout(writeTimeout, TimeUnit.MILLISECONDS); + return this; + } + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = json.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } 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); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List parameterToPair(String name, Object value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) return params; + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List parameterToPairs(String collectionFormat, String name, Collection value) { + List params = new ArrayList(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + return params; + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * or matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return json.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create(MediaType.parse(contentType), (byte[]) obj); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create(MediaType.parse(contentType), (File) obj); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = json.serialize(obj); + } else { + content = null; + } + return RequestBody.create(MediaType.parse(contentType), content); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @throws IOException If fail to prepare file for download + * @return Prepared file for the download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // File.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return File.createTempFile(prefix, suffix); + else + return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + } + + /** + * {@link #execute(Call, Type)} + * + * @param Type + * @param call An instance of the Call object + * @throws ApiException If fail to execute the call + * @return ApiResponse<T> + */ + public ApiResponse execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws ApiException If fail to execute the call + */ + public ApiResponse execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public void executeAsync(Call call, ApiCallback callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @see #execute(Call, Type) + * @param Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + */ + @SuppressWarnings("unchecked") + public void executeAsync(Call call, final Type returnType, final ApiCallback callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Request request, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param Type + * @param response Response + * @param returnType Return type + * @throws ApiException If the response has a unsuccessful status code or + * fail to deserialize the response body + * @return Type + */ + public T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP call + * @throws ApiException If fail to serialize the request body object + */ + public Call buildCall(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Request request = buildRequest(path, method, queryParams, collectionQueryParams, body, headerParams, formParams, authNames, progressRequestListener); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param progressRequestListener Progress request listener + * @return The HTTP request + * @throws ApiException If fail to serialize the request body object + */ + public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + updateParamsForAuth(authNames, queryParams, headerParams); + + final String url = buildUrl(path, queryParams, collectionQueryParams); + final Request.Builder reqBuilder = new Request.Builder().url(url); + processHeaderParams(headerParams, reqBuilder); + + String contentType = (String) headerParams.get("Content-Type"); + // ensuring a default content type + if (contentType == null) { + contentType = "application/json"; + } + + RequestBody reqBody; + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentType)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentType)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create(MediaType.parse(contentType), ""); + } + } else { + reqBody = serialize(body, contentType); + } + + Request request = null; + + if(progressRequestListener != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, progressRequestListener); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + public String buildUrl(String path, List queryParams, List collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + url.append(basePath).append(path); + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the ofrm of Map + * @param reqBuilder Reqeust.Builder + */ + public void processHeaderParams(Map headerParams, Request.Builder reqBuilder) { + for (Entry param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + */ + public void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); + auth.applyToParams(queryParams, headerParams); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map formParams) { + FormEncodingBuilder formBuilder = new FormEncodingBuilder(); + for (Entry param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map formParams) { + MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM); + for (Entry param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file)); + } else { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + param.getKey() + "\""); + mpBuilder.addPart(partHeaders, RequestBody.create(null, parameterToString(param.getValue()))); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers = null; + HostnameVerifier hostnameVerifier = null; + if (!verifyingSsl) { + TrustManager trustAll = new X509TrustManager() { + @Override + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {} + @Override + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {} + @Override + public X509Certificate[] getAcceptedIssuers() { return null; } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + trustManagers = new TrustManager[]{ trustAll }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { return true; } + }; + } else if (sslCaCert != null) { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + Integer.toString(index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + trustManagerFactory.init(caKeyStore); + trustManagers = trustManagerFactory.getTrustManagers(); + } + + if (keyManagers != null || trustManagers != null) { + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient.setSslSocketFactory(sslContext.getSocketFactory()); + } else { + httpClient.setSslSocketFactory(null); + } + httpClient.setHostnameVerifier(hostnameVerifier); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/ApiException.java b/java-client-generated/src/main/java/io/swagger/client/ApiException.java new file mode 100644 index 0000000..c4bda46 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/ApiException.java @@ -0,0 +1,89 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]")public class ApiException extends Exception { + private int code = 0; + private Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/ApiResponse.java b/java-client-generated/src/main/java/io/swagger/client/ApiResponse.java new file mode 100644 index 0000000..c20ebae --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/ApiResponse.java @@ -0,0 +1,58 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + * + * @param The type of data that is deserialized from response body + */ +public class ApiResponse { + final private int statusCode; + final private Map> headers; + final private T data; + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } + + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + public int getStatusCode() { + return statusCode; + } + + public Map> getHeaders() { + return headers; + } + + public T getData() { + return data; + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/Configuration.java b/java-client-generated/src/main/java/io/swagger/client/Configuration.java new file mode 100644 index 0000000..08834fc --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/Configuration.java @@ -0,0 +1,37 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]")public class Configuration { + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/GzipRequestInterceptor.java b/java-client-generated/src/main/java/io/swagger/client/GzipRequestInterceptor.java new file mode 100644 index 0000000..2a0ad16 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/GzipRequestInterceptor.java @@ -0,0 +1,80 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override public MediaType contentType() { + return body.contentType(); + } + + @Override public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} \ No newline at end of file diff --git a/java-client-generated/src/main/java/io/swagger/client/JSON.java b/java-client-generated/src/main/java/io/swagger/client/JSON.java new file mode 100644 index 0000000..4025618 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/JSON.java @@ -0,0 +1,363 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.PostProcessor; +import io.gsonfire.TypeSelector; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import org.threeten.bp.LocalDate; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.format.DateTimeFormatter; + +import io.swagger.client.model.*; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.util.Date; +import java.util.Map; +import java.util.HashMap; + +public class JSON { + private Gson gson; + private boolean isLenientOnJson = false; + private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + return fireBuilder.createGsonBuilder(); + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if(null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + private static Class getClassByDiscriminator(Map> classByDiscriminatorValue, String discriminatorValue) { + Class clazz = classByDiscriminatorValue.get(discriminatorValue.toUpperCase()); + if(null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + public JSON() { + gson = createGson() + .registerTypeAdapter(Date.class, dateTypeAdapter) + .registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter) + .registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter) + .registerTypeAdapter(LocalDate.class, localDateTypeAdapter) + .create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + * @return JSON + */ + public JSON setGson(Gson gson) { + this.gson = gson; + return this; + } + + public JSON setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + return this; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) + return (T) body; + else throw (e); + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public class LocalDateTypeAdapter extends TypeAdapter { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + return this; + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() { + } + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter { + + private DateFormat dateFormat; + + public DateTypeAdapter() { + } + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public JSON setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + return this; + } + + public JSON setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + return this; + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/Pair.java b/java-client-generated/src/main/java/io/swagger/client/Pair.java new file mode 100644 index 0000000..d193cb4 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/Pair.java @@ -0,0 +1,50 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]")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/java-client-generated/src/main/java/io/swagger/client/ProgressRequestBody.java b/java-client-generated/src/main/java/io/swagger/client/ProgressRequestBody.java new file mode 100644 index 0000000..de9dd0e --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/ProgressRequestBody.java @@ -0,0 +1,76 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + public interface ProgressRequestListener { + void onRequestProgress(long bytesWritten, long contentLength, boolean done); + } + + private final RequestBody requestBody; + + private final ProgressRequestListener progressListener; + + public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) { + this.requestBody = requestBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + progressListener.onRequestProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/ProgressResponseBody.java b/java-client-generated/src/main/java/io/swagger/client/ProgressResponseBody.java new file mode 100644 index 0000000..d8c4684 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/ProgressResponseBody.java @@ -0,0 +1,75 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +import com.squareup.okhttp.MediaType; +import com.squareup.okhttp.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + public interface ProgressListener { + void update(long bytesRead, long contentLength, boolean done); + } + + private final ResponseBody responseBody; + private final ProgressListener progressListener; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) { + this.responseBody = responseBody; + this.progressListener = progressListener; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() throws IOException { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + progressListener.update(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} + + diff --git a/java-client-generated/src/main/java/io/swagger/client/StringUtil.java b/java-client-generated/src/main/java/io/swagger/client/StringUtil.java new file mode 100644 index 0000000..793247b --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/StringUtil.java @@ -0,0 +1,53 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]")public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) return true; + if (value != null && value.equalsIgnoreCase(str)) return true; + } + return false; + } + + /** + * Join an array of strings with the given separator. + *

+ * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + *

+ * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) return ""; + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/api/DefaultApi.java b/java-client-generated/src/main/java/io/swagger/client/api/DefaultApi.java new file mode 100644 index 0000000..489274f --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/api/DefaultApi.java @@ -0,0 +1,655 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiCallback; +import io.swagger.client.ApiClient; +import io.swagger.client.ApiException; +import io.swagger.client.ApiResponse; +import io.swagger.client.Configuration; +import io.swagger.client.Pair; +import io.swagger.client.ProgressRequestBody; +import io.swagger.client.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import io.swagger.client.model.InlineResponse200; +import io.swagger.client.model.InlineResponse400; +import io.swagger.client.model.Person; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DefaultApi { + private ApiClient apiClient; + + public DefaultApi() { + this(Configuration.getDefaultApiClient()); + } + + public DefaultApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + public ApiClient getApiClient() { + return apiClient; + } + + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Build call for exampleGet + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call exampleGetCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/example"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "accessCode" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call exampleGetValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = exampleGetCall(progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Server example operation + * This is an example operation to show how security is applied to the call. + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void exampleGet() throws ApiException { + exampleGetWithHttpInfo(); + } + + /** + * Server example operation + * This is an example operation to show how security is applied to the call. + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse exampleGetWithHttpInfo() throws ApiException { + com.squareup.okhttp.Call call = exampleGetValidateBeforeCall(null, null); + return apiClient.execute(call); + } + + /** + * Server example operation (asynchronously) + * This is an example operation to show how security is applied to the call. + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call exampleGetAsync(final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = exampleGetValidateBeforeCall(progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for pingGet + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call pingGetCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/ping"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call pingGetValidateBeforeCall(final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = pingGetCall(progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * Server heartbeat operation + * This operation shows how to override the global security defined above, as we want to open it up for all users. + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void pingGet() throws ApiException { + pingGetWithHttpInfo(); + } + + /** + * Server heartbeat operation + * This operation shows how to override the global security defined above, as we want to open it up for all users. + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse pingGetWithHttpInfo() throws ApiException { + com.squareup.okhttp.Call call = pingGetValidateBeforeCall(null, null); + return apiClient.execute(call); + } + + /** + * Server heartbeat operation (asynchronously) + * This operation shows how to override the global security defined above, as we want to open it up for all users. + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call pingGetAsync(final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = pingGetValidateBeforeCall(progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for sisGet + * @param limit Limits the number of items on a page (optional) + * @param offset Specifies the page number of the artists to be displayed (optional) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call sisGetCall(Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sis"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + if (limit != null) + localVarQueryParams.addAll(apiClient.parameterToPair("limit", limit)); + if (offset != null) + localVarQueryParams.addAll(apiClient.parameterToPair("offset", offset)); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "accessCode" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call sisGetValidateBeforeCall(Integer limit, Integer offset, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + + com.squareup.okhttp.Call call = sisGetCall(limit, offset, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Returns a list of people + * @param limit Limits the number of items on a page (optional) + * @param offset Specifies the page number of the artists to be displayed (optional) + * @return List<Person> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public List sisGet(Integer limit, Integer offset) throws ApiException { + ApiResponse> resp = sisGetWithHttpInfo(limit, offset); + return resp.getData(); + } + + /** + * + * Returns a list of people + * @param limit Limits the number of items on a page (optional) + * @param offset Specifies the page number of the artists to be displayed (optional) + * @return ApiResponse<List<Person>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse> sisGetWithHttpInfo(Integer limit, Integer offset) throws ApiException { + com.squareup.okhttp.Call call = sisGetValidateBeforeCall(limit, offset, null, null); + Type localVarReturnType = new TypeToken>(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Returns a list of people + * @param limit Limits the number of items on a page (optional) + * @param offset Specifies the page number of the artists to be displayed (optional) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call sisGetAsync(Integer limit, Integer offset, final ApiCallback> callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = sisGetValidateBeforeCall(limit, offset, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken>(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } + /** + * Build call for sisPost + * @param body (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call sisPostCall(Person body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = body; + + // create path and map variables + String localVarPath = "/sis"; + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "accessCode" }; + return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call sisPostValidateBeforeCall(Person body, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException("Missing the required parameter 'body' when calling sisPost(Async)"); + } + + com.squareup.okhttp.Call call = sisPostCall(body, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Get a reference ID for an SoR person + * @param body (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public void sisPost(Person body) throws ApiException { + sisPostWithHttpInfo(body); + } + + /** + * + * Get a reference ID for an SoR person + * @param body (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse sisPostWithHttpInfo(Person body) throws ApiException { + com.squareup.okhttp.Call call = sisPostValidateBeforeCall(body, null, null); + return apiClient.execute(call); + } + + /** + * (asynchronously) + * Get a reference ID for an SoR person + * @param body (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call sisPostAsync(Person body, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = sisPostValidateBeforeCall(body, progressListener, progressRequestListener); + apiClient.executeAsync(call, callback); + return call; + } + /** + * Build call for sisSorIdGet + * @param sorId (required) + * @param progressListener Progress listener + * @param progressRequestListener Progress request listener + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + */ + public com.squareup.okhttp.Call sisSorIdGetCall(String sorId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/sis/{sorId}" + .replaceAll("\\{" + "sorId" + "\\}", apiClient.escapeString(sorId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + + Map localVarHeaderParams = new HashMap(); + + Map localVarFormParams = new HashMap(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + if(progressListener != null) { + apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + @Override + public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { + com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), progressListener)) + .build(); + } + }); + } + + String[] localVarAuthNames = new String[] { "accessCode" }; + return apiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); + } + + @SuppressWarnings("rawtypes") + private com.squareup.okhttp.Call sisSorIdGetValidateBeforeCall(String sorId, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { + // verify the required parameter 'sorId' is set + if (sorId == null) { + throw new ApiException("Missing the required parameter 'sorId' when calling sisSorIdGet(Async)"); + } + + com.squareup.okhttp.Call call = sisSorIdGetCall(sorId, progressListener, progressRequestListener); + return call; + + + + + + } + + /** + * + * Obtain information about an person from his or her sorId + * @param sorId (required) + * @return InlineResponse200 + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public InlineResponse200 sisSorIdGet(String sorId) throws ApiException { + ApiResponse resp = sisSorIdGetWithHttpInfo(sorId); + return resp.getData(); + } + + /** + * + * Obtain information about an person from his or her sorId + * @param sorId (required) + * @return ApiResponse<InlineResponse200> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + */ + public ApiResponse sisSorIdGetWithHttpInfo(String sorId) throws ApiException { + com.squareup.okhttp.Call call = sisSorIdGetValidateBeforeCall(sorId, null, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return apiClient.execute(call, localVarReturnType); + } + + /** + * (asynchronously) + * Obtain information about an person from his or her sorId + * @param sorId (required) + * @param callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + */ + public com.squareup.okhttp.Call sisSorIdGetAsync(String sorId, final ApiCallback callback) throws ApiException { + + ProgressResponseBody.ProgressListener progressListener = null; + ProgressRequestBody.ProgressRequestListener progressRequestListener = null; + + if (callback != null) { + progressListener = new ProgressResponseBody.ProgressListener() { + @Override + public void update(long bytesRead, long contentLength, boolean done) { + callback.onDownloadProgress(bytesRead, contentLength, done); + } + }; + + progressRequestListener = new ProgressRequestBody.ProgressRequestListener() { + @Override + public void onRequestProgress(long bytesWritten, long contentLength, boolean done) { + callback.onUploadProgress(bytesWritten, contentLength, done); + } + }; + } + + com.squareup.okhttp.Call call = sisSorIdGetValidateBeforeCall(sorId, progressListener, progressRequestListener); + Type localVarReturnType = new TypeToken(){}.getType(); + apiClient.executeAsync(call, localVarReturnType, callback); + return call; + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/java-client-generated/src/main/java/io/swagger/client/auth/ApiKeyAuth.java new file mode 100644 index 0000000..f3df495 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/auth/ApiKeyAuth.java @@ -0,0 +1,73 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]")public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/auth/Authentication.java b/java-client-generated/src/main/java/io/swagger/client/auth/Authentication.java new file mode 100644 index 0000000..aff5254 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/auth/Authentication.java @@ -0,0 +1,28 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + */ + void applyToParams(List queryParams, Map headerParams); +} diff --git a/java-client-generated/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/java-client-generated/src/main/java/io/swagger/client/auth/HttpBasicAuth.java new file mode 100644 index 0000000..ec29706 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/auth/HttpBasicAuth.java @@ -0,0 +1,53 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import com.squareup.okhttp.Credentials; + +import java.util.Map; +import java.util.List; + +import java.io.UnsupportedEncodingException; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/auth/OAuth.java b/java-client-generated/src/main/java/io/swagger/client/auth/OAuth.java new file mode 100644 index 0000000..bab4ba7 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/auth/OAuth.java @@ -0,0 +1,37 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +import io.swagger.client.Pair; + +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]")public class OAuth implements Authentication { + private String accessToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + @Override + public void applyToParams(List queryParams, Map headerParams) { + if (accessToken != null) { + headerParams.put("Authorization", "Bearer " + accessToken); + } + } +} diff --git a/java-client-generated/src/main/java/io/swagger/client/auth/OAuthFlow.java b/java-client-generated/src/main/java/io/swagger/client/auth/OAuthFlow.java new file mode 100644 index 0000000..d547a58 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/auth/OAuthFlow.java @@ -0,0 +1,17 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.auth; + +public enum OAuthFlow { + accessCode, implicit, password, application +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/InlineResponse200.java b/java-client-generated/src/main/java/io/swagger/client/model/InlineResponse200.java new file mode 100644 index 0000000..1d1c8e0 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/InlineResponse200.java @@ -0,0 +1,137 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * InlineResponse200 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class InlineResponse200 { + @SerializedName("artist_name") + private String artistName = null; + + @SerializedName("artist_genre") + private String artistGenre = null; + + @SerializedName("albums_recorded") + private Integer albumsRecorded = null; + + public InlineResponse200 artistName(String artistName) { + this.artistName = artistName; + return this; + } + + /** + * Get artistName + * @return artistName + **/ + @Schema(description = "") + public String getArtistName() { + return artistName; + } + + public void setArtistName(String artistName) { + this.artistName = artistName; + } + + public InlineResponse200 artistGenre(String artistGenre) { + this.artistGenre = artistGenre; + return this; + } + + /** + * Get artistGenre + * @return artistGenre + **/ + @Schema(description = "") + public String getArtistGenre() { + return artistGenre; + } + + public void setArtistGenre(String artistGenre) { + this.artistGenre = artistGenre; + } + + public InlineResponse200 albumsRecorded(Integer albumsRecorded) { + this.albumsRecorded = albumsRecorded; + return this; + } + + /** + * Get albumsRecorded + * @return albumsRecorded + **/ + @Schema(description = "") + public Integer getAlbumsRecorded() { + return albumsRecorded; + } + + public void setAlbumsRecorded(Integer albumsRecorded) { + this.albumsRecorded = albumsRecorded; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse200 inlineResponse200 = (InlineResponse200) o; + return Objects.equals(this.artistName, inlineResponse200.artistName) && + Objects.equals(this.artistGenre, inlineResponse200.artistGenre) && + Objects.equals(this.albumsRecorded, inlineResponse200.albumsRecorded); + } + + @Override + public int hashCode() { + return Objects.hash(artistName, artistGenre, albumsRecorded); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse200 {\n"); + + sb.append(" artistName: ").append(toIndentedString(artistName)).append("\n"); + sb.append(" artistGenre: ").append(toIndentedString(artistGenre)).append("\n"); + sb.append(" albumsRecorded: ").append(toIndentedString(albumsRecorded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/InlineResponse400.java b/java-client-generated/src/main/java/io/swagger/client/model/InlineResponse400.java new file mode 100644 index 0000000..fc3790b --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/InlineResponse400.java @@ -0,0 +1,91 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * InlineResponse400 + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class InlineResponse400 { + @SerializedName("message") + private String message = null; + + public InlineResponse400 message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @Schema(description = "") + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse400 inlineResponse400 = (InlineResponse400) o; + return Objects.equals(this.message, inlineResponse400.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse400 {\n"); + + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/Person.java b/java-client-generated/src/main/java/io/swagger/client/model/Person.java new file mode 100644 index 0000000..9690527 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/Person.java @@ -0,0 +1,322 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.client.model.PersonAddress; +import io.swagger.client.model.PersonEmailAddress; +import io.swagger.client.model.PersonIdentifier; +import io.swagger.client.model.PersonNames; +import io.swagger.client.model.PersonTelephoneNumber; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +/** + * Person + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class Person { + @SerializedName("sorId") + private Integer sorId = null; + + @SerializedName("dateOfBirth") + private String dateOfBirth = null; + + @SerializedName("names") + private List names = null; + + @SerializedName("address") + private List address = null; + + @SerializedName("emailAddress") + private List emailAddress = null; + + @SerializedName("identifier") + private List identifier = null; + + @SerializedName("primaryAffiliation") + private String primaryAffiliation = null; + + @SerializedName("gender") + private String gender = null; + + @SerializedName("telephoneNumber") + private List telephoneNumber = null; + + public Person sorId(Integer sorId) { + this.sorId = sorId; + return this; + } + + /** + * Get sorId + * @return sorId + **/ + @Schema(required = true, description = "") + public Integer getSorId() { + return sorId; + } + + public void setSorId(Integer sorId) { + this.sorId = sorId; + } + + public Person dateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * Get dateOfBirth + * @return dateOfBirth + **/ + @Schema(description = "") + public String getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public Person names(List names) { + this.names = names; + return this; + } + + public Person addNamesItem(PersonNames namesItem) { + if (this.names == null) { + this.names = new ArrayList(); + } + this.names.add(namesItem); + return this; + } + + /** + * Get names + * @return names + **/ + @Schema(description = "") + public List getNames() { + return names; + } + + public void setNames(List names) { + this.names = names; + } + + public Person address(List address) { + this.address = address; + return this; + } + + public Person addAddressItem(PersonAddress addressItem) { + if (this.address == null) { + this.address = new ArrayList(); + } + this.address.add(addressItem); + return this; + } + + /** + * Get address + * @return address + **/ + @Schema(description = "") + public List getAddress() { + return address; + } + + public void setAddress(List address) { + this.address = address; + } + + public Person emailAddress(List emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Person addEmailAddressItem(PersonEmailAddress emailAddressItem) { + if (this.emailAddress == null) { + this.emailAddress = new ArrayList(); + } + this.emailAddress.add(emailAddressItem); + return this; + } + + /** + * Get emailAddress + * @return emailAddress + **/ + @Schema(description = "") + public List getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(List emailAddress) { + this.emailAddress = emailAddress; + } + + public Person identifier(List identifier) { + this.identifier = identifier; + return this; + } + + public Person addIdentifierItem(PersonIdentifier identifierItem) { + if (this.identifier == null) { + this.identifier = new ArrayList(); + } + this.identifier.add(identifierItem); + return this; + } + + /** + * Get identifier + * @return identifier + **/ + @Schema(description = "") + public List getIdentifier() { + return identifier; + } + + public void setIdentifier(List identifier) { + this.identifier = identifier; + } + + public Person primaryAffiliation(String primaryAffiliation) { + this.primaryAffiliation = primaryAffiliation; + return this; + } + + /** + * Get primaryAffiliation + * @return primaryAffiliation + **/ + @Schema(description = "") + public String getPrimaryAffiliation() { + return primaryAffiliation; + } + + public void setPrimaryAffiliation(String primaryAffiliation) { + this.primaryAffiliation = primaryAffiliation; + } + + public Person gender(String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + **/ + @Schema(description = "") + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public Person telephoneNumber(List telephoneNumber) { + this.telephoneNumber = telephoneNumber; + return this; + } + + public Person addTelephoneNumberItem(PersonTelephoneNumber telephoneNumberItem) { + if (this.telephoneNumber == null) { + this.telephoneNumber = new ArrayList(); + } + this.telephoneNumber.add(telephoneNumberItem); + return this; + } + + /** + * Get telephoneNumber + * @return telephoneNumber + **/ + @Schema(description = "") + public List getTelephoneNumber() { + return telephoneNumber; + } + + public void setTelephoneNumber(List telephoneNumber) { + this.telephoneNumber = telephoneNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Person person = (Person) o; + return Objects.equals(this.sorId, person.sorId) && + Objects.equals(this.dateOfBirth, person.dateOfBirth) && + Objects.equals(this.names, person.names) && + Objects.equals(this.address, person.address) && + Objects.equals(this.emailAddress, person.emailAddress) && + Objects.equals(this.identifier, person.identifier) && + Objects.equals(this.primaryAffiliation, person.primaryAffiliation) && + Objects.equals(this.gender, person.gender) && + Objects.equals(this.telephoneNumber, person.telephoneNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sorId, dateOfBirth, names, address, emailAddress, identifier, primaryAffiliation, gender, telephoneNumber); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Person {\n"); + + sb.append(" sorId: ").append(toIndentedString(sorId)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append(" names: ").append(toIndentedString(names)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" primaryAffiliation: ").append(toIndentedString(primaryAffiliation)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" telephoneNumber: ").append(toIndentedString(telephoneNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/PersonAddress.java b/java-client-generated/src/main/java/io/swagger/client/model/PersonAddress.java new file mode 100644 index 0000000..564d171 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/PersonAddress.java @@ -0,0 +1,298 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * PersonAddress + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class PersonAddress { + @SerializedName("country") + private String country = null; + + @SerializedName("formatted") + private String formatted = null; + + @SerializedName("language") + private String language = null; + + @SerializedName("locality") + private String locality = null; + + @SerializedName("postalCode") + private String postalCode = null; + + @SerializedName("region") + private String region = null; + + @SerializedName("room") + private String room = null; + + @SerializedName("streetAddress") + private String streetAddress = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("verified") + private String verified = null; + + public PersonAddress country(String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + **/ + @Schema(description = "") + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public PersonAddress formatted(String formatted) { + this.formatted = formatted; + return this; + } + + /** + * Get formatted + * @return formatted + **/ + @Schema(description = "") + public String getFormatted() { + return formatted; + } + + public void setFormatted(String formatted) { + this.formatted = formatted; + } + + public PersonAddress language(String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + **/ + @Schema(description = "") + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public PersonAddress locality(String locality) { + this.locality = locality; + return this; + } + + /** + * Get locality + * @return locality + **/ + @Schema(description = "") + public String getLocality() { + return locality; + } + + public void setLocality(String locality) { + this.locality = locality; + } + + public PersonAddress postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get postalCode + * @return postalCode + **/ + @Schema(description = "") + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public PersonAddress region(String region) { + this.region = region; + return this; + } + + /** + * Get region + * @return region + **/ + @Schema(description = "") + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public PersonAddress room(String room) { + this.room = room; + return this; + } + + /** + * Get room + * @return room + **/ + @Schema(description = "") + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public PersonAddress streetAddress(String streetAddress) { + this.streetAddress = streetAddress; + return this; + } + + /** + * Get streetAddress + * @return streetAddress + **/ + @Schema(description = "") + public String getStreetAddress() { + return streetAddress; + } + + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + + public PersonAddress type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PersonAddress verified(String verified) { + this.verified = verified; + return this; + } + + /** + * Get verified + * @return verified + **/ + @Schema(description = "") + public String getVerified() { + return verified; + } + + public void setVerified(String verified) { + this.verified = verified; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonAddress personAddress = (PersonAddress) o; + return Objects.equals(this.country, personAddress.country) && + Objects.equals(this.formatted, personAddress.formatted) && + Objects.equals(this.language, personAddress.language) && + Objects.equals(this.locality, personAddress.locality) && + Objects.equals(this.postalCode, personAddress.postalCode) && + Objects.equals(this.region, personAddress.region) && + Objects.equals(this.room, personAddress.room) && + Objects.equals(this.streetAddress, personAddress.streetAddress) && + Objects.equals(this.type, personAddress.type) && + Objects.equals(this.verified, personAddress.verified); + } + + @Override + public int hashCode() { + return Objects.hash(country, formatted, language, locality, postalCode, region, room, streetAddress, type, verified); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonAddress {\n"); + + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" formatted: ").append(toIndentedString(formatted)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" room: ").append(toIndentedString(room)).append("\n"); + sb.append(" streetAddress: ").append(toIndentedString(streetAddress)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/PersonEmailAddress.java b/java-client-generated/src/main/java/io/swagger/client/model/PersonEmailAddress.java new file mode 100644 index 0000000..f59282b --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/PersonEmailAddress.java @@ -0,0 +1,137 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * PersonEmailAddress + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class PersonEmailAddress { + @SerializedName("address") + private String address = null; + + @SerializedName("type") + private String type = null; + + @SerializedName("verified") + private String verified = null; + + public PersonEmailAddress address(String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @Schema(description = "") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public PersonEmailAddress type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PersonEmailAddress verified(String verified) { + this.verified = verified; + return this; + } + + /** + * Get verified + * @return verified + **/ + @Schema(description = "") + public String getVerified() { + return verified; + } + + public void setVerified(String verified) { + this.verified = verified; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonEmailAddress personEmailAddress = (PersonEmailAddress) o; + return Objects.equals(this.address, personEmailAddress.address) && + Objects.equals(this.type, personEmailAddress.type) && + Objects.equals(this.verified, personEmailAddress.verified); + } + + @Override + public int hashCode() { + return Objects.hash(address, type, verified); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonEmailAddress {\n"); + + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/PersonIdentifier.java b/java-client-generated/src/main/java/io/swagger/client/model/PersonIdentifier.java new file mode 100644 index 0000000..d281dd0 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/PersonIdentifier.java @@ -0,0 +1,114 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * PersonIdentifier + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class PersonIdentifier { + @SerializedName("id") + private String id = null; + + @SerializedName("type") + private String type = null; + + public PersonIdentifier id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @Schema(description = "") + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PersonIdentifier type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonIdentifier personIdentifier = (PersonIdentifier) o; + return Objects.equals(this.id, personIdentifier.id) && + Objects.equals(this.type, personIdentifier.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonIdentifier {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/PersonNames.java b/java-client-generated/src/main/java/io/swagger/client/model/PersonNames.java new file mode 100644 index 0000000..825a540 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/PersonNames.java @@ -0,0 +1,137 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * PersonNames + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class PersonNames { + @SerializedName("type") + private String type = null; + + @SerializedName("given") + private String given = null; + + @SerializedName("family") + private String family = null; + + public PersonNames type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PersonNames given(String given) { + this.given = given; + return this; + } + + /** + * Get given + * @return given + **/ + @Schema(description = "") + public String getGiven() { + return given; + } + + public void setGiven(String given) { + this.given = given; + } + + public PersonNames family(String family) { + this.family = family; + return this; + } + + /** + * Get family + * @return family + **/ + @Schema(description = "") + public String getFamily() { + return family; + } + + public void setFamily(String family) { + this.family = family; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonNames personNames = (PersonNames) o; + return Objects.equals(this.type, personNames.type) && + Objects.equals(this.given, personNames.given) && + Objects.equals(this.family, personNames.family); + } + + @Override + public int hashCode() { + return Objects.hash(type, given, family); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonNames {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" given: ").append(toIndentedString(given)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/main/java/io/swagger/client/model/PersonTelephoneNumber.java b/java-client-generated/src/main/java/io/swagger/client/model/PersonTelephoneNumber.java new file mode 100644 index 0000000..2553dc7 --- /dev/null +++ b/java-client-generated/src/main/java/io/swagger/client/model/PersonTelephoneNumber.java @@ -0,0 +1,114 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.v3.oas.annotations.media.Schema; +import java.io.IOException; +/** + * PersonTelephoneNumber + */ + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2020-09-18T00:55:04.707Z[GMT]") +public class PersonTelephoneNumber { + @SerializedName("number") + private String number = null; + + @SerializedName("type") + private String type = null; + + public PersonTelephoneNumber number(String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @Schema(description = "") + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public PersonTelephoneNumber type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @Schema(description = "") + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonTelephoneNumber personTelephoneNumber = (PersonTelephoneNumber) o; + return Objects.equals(this.number, personTelephoneNumber.number) && + Objects.equals(this.type, personTelephoneNumber.type); + } + + @Override + public int hashCode() { + return Objects.hash(number, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonTelephoneNumber {\n"); + + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} diff --git a/java-client-generated/src/test/java/io/swagger/client/api/DefaultApiTest.java b/java-client-generated/src/test/java/io/swagger/client/api/DefaultApiTest.java new file mode 100644 index 0000000..10f8abd --- /dev/null +++ b/java-client-generated/src/test/java/io/swagger/client/api/DefaultApiTest.java @@ -0,0 +1,109 @@ +/* + * ID Match API + * ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + * + * OpenAPI spec version: 1.1.1 + * + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +package io.swagger.client.api; + +import io.swagger.client.ApiException; +import io.swagger.client.model.InlineResponse200; +import io.swagger.client.model.InlineResponse400; +import io.swagger.client.model.Person; +import org.junit.Test; +import org.junit.Ignore; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * API tests for DefaultApi + */ +@Ignore +public class DefaultApiTest { + + private final DefaultApi api = new DefaultApi(); + + /** + * Server example operation + * + * This is an example operation to show how security is applied to the call. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void exampleGetTest() throws ApiException { + api.exampleGet(); + + // TODO: test validations + } + /** + * Server heartbeat operation + * + * This operation shows how to override the global security defined above, as we want to open it up for all users. + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void pingGetTest() throws ApiException { + api.pingGet(); + + // TODO: test validations + } + /** + * + * + * Returns a list of people + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void sisGetTest() throws ApiException { + Integer limit = null; + Integer offset = null; + List response = api.sisGet(limit, offset); + + // TODO: test validations + } + /** + * + * + * Get a reference ID for an SoR person + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void sisPostTest() throws ApiException { + Person body = null; + api.sisPost(body); + + // TODO: test validations + } + /** + * + * + * Obtain information about an person from his or her sorId + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void sisSorIdGetTest() throws ApiException { + String sorId = null; + InlineResponse200 response = api.sisSorIdGet(sorId); + + // TODO: test validations + } +} diff --git a/java-client-generated/swagger-java-client.iml b/java-client-generated/swagger-java-client.iml new file mode 100644 index 0000000..843c67c --- /dev/null +++ b/java-client-generated/swagger-java-client.iml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nodejs-server-server-generated/.swagger-codegen-ignore b/nodejs-server-server-generated/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/nodejs-server-server-generated/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/nodejs-server-server-generated/.swagger-codegen/VERSION b/nodejs-server-server-generated/.swagger-codegen/VERSION new file mode 100644 index 0000000..402b44e --- /dev/null +++ b/nodejs-server-server-generated/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.21 \ No newline at end of file diff --git a/nodejs-server-server-generated/README.md b/nodejs-server-server-generated/README.md new file mode 100644 index 0000000..2110558 --- /dev/null +++ b/nodejs-server-server-generated/README.md @@ -0,0 +1,19 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. + +### Running the server +To run the server, run: + +``` +npm start +``` + +To view the Swagger UI interface: + +``` +open http://localhost:8080/docs +``` + +This project leverages the mega-awesome [swagger-tools](https://github.com/apigee-127/swagger-tools) middleware which does most all the work. diff --git a/nodejs-server-server-generated/api/openapi.yaml b/nodejs-server-server-generated/api/openapi.yaml new file mode 100644 index 0000000..24285a0 --- /dev/null +++ b/nodejs-server-server-generated/api/openapi.yaml @@ -0,0 +1,337 @@ +openapi: 3.0.0 +info: + title: ID Match API + description: ID Match API Specification from Internet2 Trust and Identity, and Spherical + Cow Group + version: 1.1.1 +servers: +- url: https://virtserver.swaggerhub.com/I2/idMatch/1.0.0 + description: SwaggerHub API Auto Mocking +security: +- accessCode: + - read + - write +paths: + /sis: + get: + description: Returns a list of people + operationId: sisGET + parameters: + - name: limit + in: query + description: Limits the number of items on a page + required: false + style: form + explode: true + schema: + type: integer + - name: offset + in: query + description: Specifies the page number of the artists to be displayed + required: false + style: form + explode: true + schema: + type: integer + responses: + "200": + description: Successfully returned a list of people + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/person' + x-content-type: application/json + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + x-swagger-router-controller: Default + post: + description: Get a reference ID for an SoR person + operationId: sisPOST + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/person' + required: true + responses: + "200": + description: Found (or added) person record + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + x-swagger-router-controller: Default + /sis/{sorId}: + get: + description: Obtain information about an person from his or her sorId + operationId: sisSorIdGET + parameters: + - name: sorId + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Successfully returned the requested person record + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + x-swagger-router-controller: Default + /example: + get: + summary: Server example operation + description: This is an example operation to show how security is applied to + the call. + operationId: exampleGET + responses: + "200": + description: OK + x-swagger-router-controller: Default + /ping: + get: + summary: Server heartbeat operation + description: This operation shows how to override the global security defined + above, as we want to open it up for all users. + operationId: pingGET + responses: + "200": + description: OK + security: [] + x-swagger-router-controller: Default +components: + schemas: + person: + required: + - sorId + type: object + properties: + sorId: + type: integer + dateOfBirth: + type: string + names: + type: array + items: + $ref: '#/components/schemas/person_names' + address: + type: array + items: + $ref: '#/components/schemas/person_address' + emailAddress: + type: array + items: + $ref: '#/components/schemas/person_emailAddress' + identifier: + type: array + items: + $ref: '#/components/schemas/person_identifier' + primaryAffiliation: + type: string + gender: + type: string + telephoneNumber: + type: array + items: + $ref: '#/components/schemas/person_telephoneNumber' + example: + identifier: + - id: id + type: type + - id: id + type: type + emailAddress: + - address: address + verified: verified + type: type + - address: address + verified: verified + type: type + names: + - given: given + type: type + family: family + - given: given + type: type + family: family + address: + - country: country + streetAddress: streetAddress + formatted: formatted + postalCode: postalCode + locality: locality + verified: verified + language: language + region: region + type: type + room: room + - country: country + streetAddress: streetAddress + formatted: formatted + postalCode: postalCode + locality: locality + verified: verified + language: language + region: region + type: type + room: room + telephoneNumber: + - number: number + type: type + - number: number + type: type + gender: gender + sorId: 0 + dateOfBirth: dateOfBirth + primaryAffiliation: primaryAffiliation + inline_response_400: + type: object + properties: + message: + type: string + inline_response_200: + type: object + properties: + artist_name: + type: string + artist_genre: + type: string + albums_recorded: + type: integer + example: + artist_name: artist_name + albums_recorded: 0 + artist_genre: artist_genre + person_names: + type: object + properties: + type: + type: string + given: + type: string + family: + type: string + example: + given: given + type: type + family: family + person_address: + type: object + properties: + country: + type: string + formatted: + type: string + language: + type: string + locality: + type: string + postalCode: + type: string + region: + type: string + room: + type: string + streetAddress: + type: string + type: + type: string + verified: + type: string + example: + country: country + streetAddress: streetAddress + formatted: formatted + postalCode: postalCode + locality: locality + verified: verified + language: language + region: region + type: type + room: room + person_emailAddress: + type: object + properties: + address: + type: string + type: + type: string + verified: + type: string + example: + address: address + verified: verified + type: type + person_identifier: + type: object + properties: + id: + type: string + type: + type: string + example: + id: id + type: type + person_telephoneNumber: + type: object + properties: + number: + type: string + type: + type: string + example: + number: number + type: type + responses: + "400Error": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + parameters: + PageLimit: + name: limit + in: query + description: Limits the number of items on a page + required: false + style: form + explode: true + schema: + type: integer + PageOffset: + name: offset + in: query + description: Specifies the page number of the artists to be displayed + required: false + style: form + explode: true + schema: + type: integer + securitySchemes: + accessCode: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: http://example.com/oauth/auth + tokenUrl: http://example.com/oauth/token + scopes: + write: allows modifying resources + read: allows reading resources diff --git a/nodejs-server-server-generated/controllers/Default.js b/nodejs-server-server-generated/controllers/Default.js new file mode 100644 index 0000000..1758a22 --- /dev/null +++ b/nodejs-server-server-generated/controllers/Default.js @@ -0,0 +1,54 @@ +'use strict'; + +var utils = require('../utils/writer.js'); +var Default = require('../service/DefaultService'); + +module.exports.exampleGET = function exampleGET (req, res, next) { + Default.exampleGET() + .then(function (response) { + utils.writeJson(res, response); + }) + .catch(function (response) { + utils.writeJson(res, response); + }); +}; + +module.exports.pingGET = function pingGET (req, res, next) { + Default.pingGET() + .then(function (response) { + utils.writeJson(res, response); + }) + .catch(function (response) { + utils.writeJson(res, response); + }); +}; + +module.exports.sisGET = function sisGET (req, res, next, limit, offset) { + Default.sisGET(limit, offset) + .then(function (response) { + utils.writeJson(res, response); + }) + .catch(function (response) { + utils.writeJson(res, response); + }); +}; + +module.exports.sisPOST = function sisPOST (req, res, next, body) { + Default.sisPOST(body) + .then(function (response) { + utils.writeJson(res, response); + }) + .catch(function (response) { + utils.writeJson(res, response); + }); +}; + +module.exports.sisSorIdGET = function sisSorIdGET (req, res, next, sorId) { + Default.sisSorIdGET(sorId) + .then(function (response) { + utils.writeJson(res, response); + }) + .catch(function (response) { + utils.writeJson(res, response); + }); +}; diff --git a/nodejs-server-server-generated/index.js b/nodejs-server-server-generated/index.js new file mode 100644 index 0000000..ecb8ba1 --- /dev/null +++ b/nodejs-server-server-generated/index.js @@ -0,0 +1,23 @@ +'use strict'; + +var path = require('path'); +var http = require('http'); + +var oas3Tools = require('oas3-tools'); +var serverPort = 8080; + +// swaggerRouter configuration +var options = { + controllers: path.join(__dirname, './controllers') +}; + +var expressAppConfig = oas3Tools.expressAppConfig(path.join(__dirname, 'api/openapi.yaml'), options); +expressAppConfig.addValidator(); +var app = expressAppConfig.getApp(); + +// Initialize the Swagger middleware +http.createServer(app).listen(serverPort, function () { + console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort); + console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort); +}); + diff --git a/nodejs-server-server-generated/package.json b/nodejs-server-server-generated/package.json new file mode 100644 index 0000000..c7802bd --- /dev/null +++ b/nodejs-server-server-generated/package.json @@ -0,0 +1,20 @@ +{ + "name": "id-match-api", + "version": "1.1.1", + "description": "ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group", + "main": "index.js", + "scripts": { + "prestart": "npm install", + "start": "node index.js" + }, + "keywords": [ + "swagger" + ], + "license": "Unlicense", + "private": true, + "dependencies": { + "connect": "^3.2.0", + "js-yaml": "^3.3.0", + "oas3-tools": "^2.0.2" + } +} diff --git a/nodejs-server-server-generated/service/DefaultService.js b/nodejs-server-server-generated/service/DefaultService.js new file mode 100644 index 0000000..3c8ced7 --- /dev/null +++ b/nodejs-server-server-generated/service/DefaultService.js @@ -0,0 +1,204 @@ +'use strict'; + + +/** + * Server example operation + * This is an example operation to show how security is applied to the call. + * + * no response value expected for this operation + **/ +exports.exampleGET = function() { + return new Promise(function(resolve, reject) { + resolve(); + }); +} + + +/** + * Server heartbeat operation + * This operation shows how to override the global security defined above, as we want to open it up for all users. + * + * no response value expected for this operation + **/ +exports.pingGET = function() { + return new Promise(function(resolve, reject) { + resolve(); + }); +} + + +/** + * Returns a list of people + * + * limit Integer Limits the number of items on a page (optional) + * offset Integer Specifies the page number of the artists to be displayed (optional) + * returns List + **/ +exports.sisGET = function(limit,offset) { + return new Promise(function(resolve, reject) { + var examples = {}; + examples['application/json'] = [ { + "identifier" : [ { + "id" : "id", + "type" : "type" + }, { + "id" : "id", + "type" : "type" + } ], + "emailAddress" : [ { + "address" : "address", + "verified" : "verified", + "type" : "type" + }, { + "address" : "address", + "verified" : "verified", + "type" : "type" + } ], + "names" : [ { + "given" : "given", + "type" : "type", + "family" : "family" + }, { + "given" : "given", + "type" : "type", + "family" : "family" + } ], + "address" : [ { + "country" : "country", + "streetAddress" : "streetAddress", + "formatted" : "formatted", + "postalCode" : "postalCode", + "locality" : "locality", + "verified" : "verified", + "language" : "language", + "region" : "region", + "type" : "type", + "room" : "room" + }, { + "country" : "country", + "streetAddress" : "streetAddress", + "formatted" : "formatted", + "postalCode" : "postalCode", + "locality" : "locality", + "verified" : "verified", + "language" : "language", + "region" : "region", + "type" : "type", + "room" : "room" + } ], + "telephoneNumber" : [ { + "number" : "number", + "type" : "type" + }, { + "number" : "number", + "type" : "type" + } ], + "gender" : "gender", + "sorId" : 0, + "dateOfBirth" : "dateOfBirth", + "primaryAffiliation" : "primaryAffiliation" +}, { + "identifier" : [ { + "id" : "id", + "type" : "type" + }, { + "id" : "id", + "type" : "type" + } ], + "emailAddress" : [ { + "address" : "address", + "verified" : "verified", + "type" : "type" + }, { + "address" : "address", + "verified" : "verified", + "type" : "type" + } ], + "names" : [ { + "given" : "given", + "type" : "type", + "family" : "family" + }, { + "given" : "given", + "type" : "type", + "family" : "family" + } ], + "address" : [ { + "country" : "country", + "streetAddress" : "streetAddress", + "formatted" : "formatted", + "postalCode" : "postalCode", + "locality" : "locality", + "verified" : "verified", + "language" : "language", + "region" : "region", + "type" : "type", + "room" : "room" + }, { + "country" : "country", + "streetAddress" : "streetAddress", + "formatted" : "formatted", + "postalCode" : "postalCode", + "locality" : "locality", + "verified" : "verified", + "language" : "language", + "region" : "region", + "type" : "type", + "room" : "room" + } ], + "telephoneNumber" : [ { + "number" : "number", + "type" : "type" + }, { + "number" : "number", + "type" : "type" + } ], + "gender" : "gender", + "sorId" : 0, + "dateOfBirth" : "dateOfBirth", + "primaryAffiliation" : "primaryAffiliation" +} ]; + if (Object.keys(examples).length > 0) { + resolve(examples[Object.keys(examples)[0]]); + } else { + resolve(); + } + }); +} + + +/** + * Get a reference ID for an SoR person + * + * body Person + * no response value expected for this operation + **/ +exports.sisPOST = function(body) { + return new Promise(function(resolve, reject) { + resolve(); + }); +} + + +/** + * Obtain information about an person from his or her sorId + * + * sorId String + * returns inline_response_200 + **/ +exports.sisSorIdGET = function(sorId) { + return new Promise(function(resolve, reject) { + var examples = {}; + examples['application/json'] = { + "artist_name" : "artist_name", + "albums_recorded" : 0, + "artist_genre" : "artist_genre" +}; + if (Object.keys(examples).length > 0) { + resolve(examples[Object.keys(examples)[0]]); + } else { + resolve(); + } + }); +} + diff --git a/nodejs-server-server-generated/utils/writer.js b/nodejs-server-server-generated/utils/writer.js new file mode 100644 index 0000000..d79f6e1 --- /dev/null +++ b/nodejs-server-server-generated/utils/writer.js @@ -0,0 +1,43 @@ +var ResponsePayload = function(code, payload) { + this.code = code; + this.payload = payload; +} + +exports.respondWithCode = function(code, payload) { + return new ResponsePayload(code, payload); +} + +var writeJson = exports.writeJson = function(response, arg1, arg2) { + var code; + var payload; + + if(arg1 && arg1 instanceof ResponsePayload) { + writeJson(response, arg1.payload, arg1.code); + return; + } + + if(arg2 && Number.isInteger(arg2)) { + code = arg2; + } + else { + if(arg1 && Number.isInteger(arg1)) { + code = arg1; + } + } + if(code && arg1) { + payload = arg1; + } + else if(arg1) { + payload = arg1; + } + + if(!code) { + // if no response code given, we default to 200 + code = 200; + } + if(typeof payload === 'object') { + payload = JSON.stringify(payload, null, 2); + } + response.writeHead(code, {'Content-Type': 'application/json'}); + response.end(payload); +} diff --git a/php-client-generated/.DS_Store b/php-client-generated/.DS_Store new file mode 100644 index 0000000..f121624 Binary files /dev/null and b/php-client-generated/.DS_Store differ diff --git a/php-client-generated/.swagger-codegen-ignore b/php-client-generated/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/php-client-generated/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/php-client-generated/.swagger-codegen/VERSION b/php-client-generated/.swagger-codegen/VERSION new file mode 100644 index 0000000..402b44e --- /dev/null +++ b/php-client-generated/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.21 \ No newline at end of file diff --git a/php-client-generated/SwaggerClient-php/.php_cs b/php-client-generated/SwaggerClient-php/.php_cs new file mode 100644 index 0000000..6b8e23c --- /dev/null +++ b/php-client-generated/SwaggerClient-php/.php_cs @@ -0,0 +1,18 @@ +level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->setUsingCache(true) + ->fixers( + [ + 'ordered_use', + 'phpdoc_order', + 'short_array_syntax', + 'strict', + 'strict_param' + ] + ) + ->finder( + Symfony\CS\Finder\DefaultFinder::create() + ->in(__DIR__) + ); diff --git a/php-client-generated/SwaggerClient-php/.travis.yml b/php-client-generated/SwaggerClient-php/.travis.yml new file mode 100644 index 0000000..d77f382 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/.travis.yml @@ -0,0 +1,10 @@ +language: php +sudo: false +php: + - 5.4 + - 5.5 + - 5.6 + - 7.0 + - hhvm +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/php-client-generated/SwaggerClient-php/README.md b/php-client-generated/SwaggerClient-php/README.md new file mode 100644 index 0000000..7819187 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/README.md @@ -0,0 +1,181 @@ +# SwaggerClient-php +ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + +This PHP package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.1.1 +- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen + +## Requirements + +PHP 5.5 and later + +## Installation & Usage +### Composer + +To install the bindings via [Composer](http://getcomposer.org/), add the following to `composer.json`: + +``` +{ + "repositories": [ + { + "type": "git", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + } + ], + "require": { + "GIT_USER_ID/GIT_REPO_ID": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php + require_once('/path/to/SwaggerClient-php/vendor/autoload.php'); +``` + +## Tests + +To run the unit tests: + +``` +composer install +./vendor/bin/phpunit +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->exampleGet(); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->exampleGet: ', $e->getMessage(), PHP_EOL; +} + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client() +); + +try { + $apiInstance->pingGet(); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->pingGet: ', $e->getMessage(), PHP_EOL; +} + +// Configure OAuth2 access token for authorization: accessCode +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$limit = 56; // int | Limits the number of items on a page +$offset = 56; // int | Specifies the page number of the artists to be displayed + +try { + $result = $apiInstance->sisGet($limit, $offset); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->sisGet: ', $e->getMessage(), PHP_EOL; +} + +// Configure OAuth2 access token for authorization: accessCode +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Swagger\Client\Model\Person(); // \Swagger\Client\Model\Person | + +try { + $apiInstance->sisPost($body); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->sisPost: ', $e->getMessage(), PHP_EOL; +} + +// Configure OAuth2 access token for authorization: accessCode +$config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$sor_id = "sor_id_example"; // string | + +try { + $result = $apiInstance->sisSorIdGet($sor_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->sisSorIdGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://virtserver.swaggerhub.com/I2/idMatch/1.0.0* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**exampleGet**](docs/Api/DefaultApi.md#exampleget) | **GET** /example | Server example operation +*DefaultApi* | [**pingGet**](docs/Api/DefaultApi.md#pingget) | **GET** /ping | Server heartbeat operation +*DefaultApi* | [**sisGet**](docs/Api/DefaultApi.md#sisget) | **GET** /sis | +*DefaultApi* | [**sisPost**](docs/Api/DefaultApi.md#sispost) | **POST** /sis | +*DefaultApi* | [**sisSorIdGet**](docs/Api/DefaultApi.md#sissoridget) | **GET** /sis/{sorId} | + +## Documentation For Models + + - [InlineResponse200](docs/Model/InlineResponse200.md) + - [InlineResponse400](docs/Model/InlineResponse400.md) + - [Person](docs/Model/Person.md) + - [PersonAddress](docs/Model/PersonAddress.md) + - [PersonEmailAddress](docs/Model/PersonEmailAddress.md) + - [PersonIdentifier](docs/Model/PersonIdentifier.md) + - [PersonNames](docs/Model/PersonNames.md) + - [PersonTelephoneNumber](docs/Model/PersonTelephoneNumber.md) + +## Documentation For Authorization + + +## accessCode + +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: http://example.com/oauth/auth +- **Scopes**: + - ****: + + +## Author + + + diff --git a/php-client-generated/SwaggerClient-php/composer.json b/php-client-generated/SwaggerClient-php/composer.json new file mode 100644 index 0000000..2ebbe80 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/composer.json @@ -0,0 +1,36 @@ +{ + "name": "GIT_USER_ID/GIT_REPO_ID", + "description": "", + "keywords": [ + "swagger", + "php", + "sdk", + "api" + ], + "homepage": "http://swagger.io", + "license": "proprietary", + "authors": [ + { + "name": "Swagger and contributors", + "homepage": "https://github.com/swagger-api/swagger-codegen" + } + ], + "require": { + "php": ">=5.5", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^6.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.8", + "squizlabs/php_codesniffer": "~2.6", + "friendsofphp/php-cs-fixer": "~1.12" + }, + "autoload": { + "psr-4": { "Swagger\\Client\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "Swagger\\Client\\" : "test/" } + } +} diff --git a/php-client-generated/SwaggerClient-php/docs/Api/DefaultApi.md b/php-client-generated/SwaggerClient-php/docs/Api/DefaultApi.md new file mode 100644 index 0000000..3dbf2ee --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Api/DefaultApi.md @@ -0,0 +1,264 @@ +# Swagger\Client\DefaultApi + +All URIs are relative to *https://virtserver.swaggerhub.com/I2/idMatch/1.0.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**exampleGet**](DefaultApi.md#exampleget) | **GET** /example | Server example operation +[**pingGet**](DefaultApi.md#pingget) | **GET** /ping | Server heartbeat operation +[**sisGet**](DefaultApi.md#sisget) | **GET** /sis | +[**sisPost**](DefaultApi.md#sispost) | **POST** /sis | +[**sisSorIdGet**](DefaultApi.md#sissoridget) | **GET** /sis/{sorId} | + +# **exampleGet** +> exampleGet() + +Server example operation + +This is an example operation to show how security is applied to the call. + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->exampleGet(); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->exampleGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[accessCode](../../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **pingGet** +> pingGet() + +Server heartbeat operation + +This operation shows how to override the global security defined above, as we want to open it up for all users. + +### Example +```php +pingGet(); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->pingGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md) + +# **sisGet** +> \Swagger\Client\Model\Person[] sisGet($limit, $offset) + + + +Returns a list of people + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$limit = 56; // int | Limits the number of items on a page +$offset = 56; // int | Specifies the page number of the artists to be displayed + +try { + $result = $apiInstance->sisGet($limit, $offset); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->sisGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limits the number of items on a page | [optional] + **offset** | **int**| Specifies the page number of the artists to be displayed | [optional] + +### Return type + +[**\Swagger\Client\Model\Person[]**](../Model/Person.md) + +### Authorization + +[accessCode](../../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **sisPost** +> sisPost($body) + + + +Get a reference ID for an SoR person + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$body = new \Swagger\Client\Model\Person(); // \Swagger\Client\Model\Person | + +try { + $apiInstance->sisPost($body); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->sisPost: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Swagger\Client\Model\Person**](../Model/Person.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[accessCode](../../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **sisSorIdGet** +> \Swagger\Client\Model\InlineResponse200 sisSorIdGet($sor_id) + + + +Obtain information about an person from his or her sorId + +### Example +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + +$apiInstance = new Swagger\Client\Api\DefaultApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$sor_id = "sor_id_example"; // string | + +try { + $result = $apiInstance->sisSorIdGet($sor_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling DefaultApi->sisSorIdGet: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sor_id** | **string**| | + +### Return type + +[**\Swagger\Client\Model\InlineResponse200**](../Model/InlineResponse200.md) + +### Authorization + +[accessCode](../../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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/php-client-generated/SwaggerClient-php/docs/Model/InlineResponse200.md b/php-client-generated/SwaggerClient-php/docs/Model/InlineResponse200.md new file mode 100644 index 0000000..8687dc5 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/InlineResponse200.md @@ -0,0 +1,11 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artist_name** | **string** | | [optional] +**artist_genre** | **string** | | [optional] +**albums_recorded** | **int** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/InlineResponse400.md b/php-client-generated/SwaggerClient-php/docs/Model/InlineResponse400.md new file mode 100644 index 0000000..45fc862 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/InlineResponse400.md @@ -0,0 +1,9 @@ +# InlineResponse400 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/Person.md b/php-client-generated/SwaggerClient-php/docs/Model/Person.md new file mode 100644 index 0000000..4abb7cf --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/Person.md @@ -0,0 +1,17 @@ +# Person + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sor_id** | **int** | | +**date_of_birth** | **string** | | [optional] +**names** | [**\Swagger\Client\Model\PersonNames[]**](PersonNames.md) | | [optional] +**address** | [**\Swagger\Client\Model\PersonAddress[]**](PersonAddress.md) | | [optional] +**email_address** | [**\Swagger\Client\Model\PersonEmailAddress[]**](PersonEmailAddress.md) | | [optional] +**identifier** | [**\Swagger\Client\Model\PersonIdentifier[]**](PersonIdentifier.md) | | [optional] +**primary_affiliation** | **string** | | [optional] +**gender** | **string** | | [optional] +**telephone_number** | [**\Swagger\Client\Model\PersonTelephoneNumber[]**](PersonTelephoneNumber.md) | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/PersonAddress.md b/php-client-generated/SwaggerClient-php/docs/Model/PersonAddress.md new file mode 100644 index 0000000..728a4d9 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/PersonAddress.md @@ -0,0 +1,18 @@ +# PersonAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **string** | | [optional] +**formatted** | **string** | | [optional] +**language** | **string** | | [optional] +**locality** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**region** | **string** | | [optional] +**room** | **string** | | [optional] +**street_address** | **string** | | [optional] +**type** | **string** | | [optional] +**verified** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/PersonEmailAddress.md b/php-client-generated/SwaggerClient-php/docs/Model/PersonEmailAddress.md new file mode 100644 index 0000000..5889b50 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/PersonEmailAddress.md @@ -0,0 +1,11 @@ +# PersonEmailAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **string** | | [optional] +**type** | **string** | | [optional] +**verified** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/PersonIdentifier.md b/php-client-generated/SwaggerClient-php/docs/Model/PersonIdentifier.md new file mode 100644 index 0000000..1e550a6 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/PersonIdentifier.md @@ -0,0 +1,10 @@ +# PersonIdentifier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**type** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/PersonNames.md b/php-client-generated/SwaggerClient-php/docs/Model/PersonNames.md new file mode 100644 index 0000000..e44c89f --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/PersonNames.md @@ -0,0 +1,11 @@ +# PersonNames + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **string** | | [optional] +**given** | **string** | | [optional] +**family** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/docs/Model/PersonTelephoneNumber.md b/php-client-generated/SwaggerClient-php/docs/Model/PersonTelephoneNumber.md new file mode 100644 index 0000000..c64dc96 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/docs/Model/PersonTelephoneNumber.md @@ -0,0 +1,10 @@ +# PersonTelephoneNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **string** | | [optional] +**type** | **string** | | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) + diff --git a/php-client-generated/SwaggerClient-php/git_push.sh b/php-client-generated/SwaggerClient-php/git_push.sh new file mode 100644 index 0000000..160f6f2 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/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="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/php-client-generated/SwaggerClient-php/lib/Api/DefaultApi.php b/php-client-generated/SwaggerClient-php/lib/Api/DefaultApi.php new file mode 100644 index 0000000..c801bca --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Api/DefaultApi.php @@ -0,0 +1,1290 @@ +client = $client ?: new Client(); + $this->config = $config ?: new Configuration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation exampleGet + * + * Server example operation + * + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function exampleGet() + { + $this->exampleGetWithHttpInfo(); + } + + /** + * Operation exampleGetWithHttpInfo + * + * Server example operation + * + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function exampleGetWithHttpInfo() + { + $returnType = ''; + $request = $this->exampleGetRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation exampleGetAsync + * + * Server example operation + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exampleGetAsync() + { + return $this->exampleGetAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation exampleGetAsyncWithHttpInfo + * + * Server example operation + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function exampleGetAsyncWithHttpInfo() + { + $returnType = ''; + $request = $this->exampleGetRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'exampleGet' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function exampleGetRequest() + { + + $resourcePath = '/example'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation pingGet + * + * Server heartbeat operation + * + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function pingGet() + { + $this->pingGetWithHttpInfo(); + } + + /** + * Operation pingGetWithHttpInfo + * + * Server heartbeat operation + * + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function pingGetWithHttpInfo() + { + $returnType = ''; + $request = $this->pingGetRequest(); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + } + throw $e; + } + } + + /** + * Operation pingGetAsync + * + * Server heartbeat operation + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function pingGetAsync() + { + return $this->pingGetAsyncWithHttpInfo() + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation pingGetAsyncWithHttpInfo + * + * Server heartbeat operation + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function pingGetAsyncWithHttpInfo() + { + $returnType = ''; + $request = $this->pingGetRequest(); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'pingGet' + * + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function pingGetRequest() + { + + $resourcePath = '/ping'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + [] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + [], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sisGet + * + * @param int $limit Limits the number of items on a page (optional) + * @param int $offset Specifies the page number of the artists to be displayed (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\Person[] + */ + public function sisGet($limit = null, $offset = null) + { + list($response) = $this->sisGetWithHttpInfo($limit, $offset); + return $response; + } + + /** + * Operation sisGetWithHttpInfo + * + * @param int $limit Limits the number of items on a page (optional) + * @param int $offset Specifies the page number of the artists to be displayed (optional) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\Person[], HTTP status code, HTTP response headers (array of strings) + */ + public function sisGetWithHttpInfo($limit = null, $offset = null) + { + $returnType = '\Swagger\Client\Model\Person[]'; + $request = $this->sisGetRequest($limit, $offset); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\Person[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sisGetAsync + * + * + * + * @param int $limit Limits the number of items on a page (optional) + * @param int $offset Specifies the page number of the artists to be displayed (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sisGetAsync($limit = null, $offset = null) + { + return $this->sisGetAsyncWithHttpInfo($limit, $offset) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sisGetAsyncWithHttpInfo + * + * + * + * @param int $limit Limits the number of items on a page (optional) + * @param int $offset Specifies the page number of the artists to be displayed (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sisGetAsyncWithHttpInfo($limit = null, $offset = null) + { + $returnType = '\Swagger\Client\Model\Person[]'; + $request = $this->sisGetRequest($limit, $offset); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sisGet' + * + * @param int $limit Limits the number of items on a page (optional) + * @param int $offset Specifies the page number of the artists to be displayed (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sisGetRequest($limit = null, $offset = null) + { + + $resourcePath = '/sis'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($limit !== null) { + $queryParams['limit'] = ObjectSerializer::toQueryValue($limit, null); + } + // query params + if ($offset !== null) { + $queryParams['offset'] = ObjectSerializer::toQueryValue($offset, null); + } + + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sisPost + * + * @param \Swagger\Client\Model\Person $body body (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return void + */ + public function sisPost($body) + { + $this->sisPostWithHttpInfo($body); + } + + /** + * Operation sisPostWithHttpInfo + * + * @param \Swagger\Client\Model\Person $body (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function sisPostWithHttpInfo($body) + { + $returnType = ''; + $request = $this->sisPostRequest($body); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + return [null, $statusCode, $response->getHeaders()]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sisPostAsync + * + * + * + * @param \Swagger\Client\Model\Person $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sisPostAsync($body) + { + return $this->sisPostAsyncWithHttpInfo($body) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sisPostAsyncWithHttpInfo + * + * + * + * @param \Swagger\Client\Model\Person $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sisPostAsyncWithHttpInfo($body) + { + $returnType = ''; + $request = $this->sisPostRequest($body); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sisPost' + * + * @param \Swagger\Client\Model\Person $body (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sisPostRequest($body) + { + // verify the required parameter 'body' is set + if ($body === null || (is_array($body) && count($body) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling sisPost' + ); + } + + $resourcePath = '/sis'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + ['application/json'] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'POST', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation sisSorIdGet + * + * @param string $sor_id sor_id (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return \Swagger\Client\Model\InlineResponse200 + */ + public function sisSorIdGet($sor_id) + { + list($response) = $this->sisSorIdGetWithHttpInfo($sor_id); + return $response; + } + + /** + * Operation sisSorIdGetWithHttpInfo + * + * @param string $sor_id (required) + * + * @throws \Swagger\Client\ApiException on non-2xx response + * @throws \InvalidArgumentException + * @return array of \Swagger\Client\Model\InlineResponse200, HTTP status code, HTTP response headers (array of strings) + */ + public function sisSorIdGetWithHttpInfo($sor_id) + { + $returnType = '\Swagger\Client\Model\InlineResponse200'; + $request = $this->sisSorIdGetRequest($sor_id); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? $e->getResponse()->getBody()->getContents() : null + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if (!in_array($returnType, ['string','integer','bool'])) { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse200', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + case 400: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\Swagger\Client\Model\InlineResponse400', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + break; + } + throw $e; + } + } + + /** + * Operation sisSorIdGetAsync + * + * + * + * @param string $sor_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sisSorIdGetAsync($sor_id) + { + return $this->sisSorIdGetAsyncWithHttpInfo($sor_id) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation sisSorIdGetAsyncWithHttpInfo + * + * + * + * @param string $sor_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function sisSorIdGetAsyncWithHttpInfo($sor_id) + { + $returnType = '\Swagger\Client\Model\InlineResponse200'; + $request = $this->sisSorIdGetRequest($sor_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + $responseBody = $response->getBody(); + if ($returnType === '\SplFileObject') { + $content = $responseBody; //stream goes to serializer + } else { + $content = $responseBody->getContents(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'sisSorIdGet' + * + * @param string $sor_id (required) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function sisSorIdGetRequest($sor_id) + { + // verify the required parameter 'sor_id' is set + if ($sor_id === null || (is_array($sor_id) && count($sor_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $sor_id when calling sisSorIdGet' + ); + } + + $resourcePath = '/sis/{sorId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + // path params + if ($sor_id !== null) { + $resourcePath = str_replace( + '{' . 'sorId' . '}', + ObjectSerializer::toPathValue($sor_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( + ['application/json'] + ); + } else { + $headers = $this->headerSelector->selectHeaders( + ['application/json'], + [] + ); + } + + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = $_tempBody; + // \stdClass has no __toString(), so we should encode it manually + if ($httpBody instanceof \stdClass && $headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($httpBody); + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValue + ]; + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif ($headers['Content-Type'] === 'application/json') { + $httpBody = \GuzzleHttp\json_encode($formParams); + + } else { + // for HTTP post (form) + $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + } + } + + // this endpoint requires OAuth (access token) + if ($this->config->getAccessToken() !== null) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = \GuzzleHttp\Psr7\build_query($queryParams); + return new Request( + 'GET', + $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/ApiException.php b/php-client-generated/SwaggerClient-php/lib/ApiException.php new file mode 100644 index 0000000..06f6ff2 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/ApiException.php @@ -0,0 +1,120 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return mixed HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deseralized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deseralized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Configuration.php b/php-client-generated/SwaggerClient-php/lib/Configuration.php new file mode 100644 index 0000000..f6b1492 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Configuration.php @@ -0,0 +1,428 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the detault configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (Swagger\Client) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' OpenAPI Spec Version: 1.1.1' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/HeaderSelector.php b/php-client-generated/SwaggerClient-php/lib/HeaderSelector.php new file mode 100644 index 0000000..a1ec025 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/HeaderSelector.php @@ -0,0 +1,109 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + $headers['Content-Type'] = $this->selectContentTypeHeader($contentTypes); + return $headers; + } + + /** + * @param string[] $accept + * @return array + */ + public function selectHeadersForMultipart($accept) + { + $headers = $this->selectHeaders($accept, []); + + unset($headers['Content-Type']); + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided + * + * @param string[] $accept Array of header + * + * @return string Accept (e.g. application/json) + */ + private function selectAcceptHeader($accept) + { + if (count($accept) === 0 || (count($accept) === 1 && $accept[0] === '')) { + return null; + } elseif (preg_grep("/application\/json/i", $accept)) { + return 'application/json'; + } else { + return implode(',', $accept); + } + } + + /** + * Return the content type based on an array of content-type provided + * + * @param string[] $contentType Array fo content-type + * + * @return string Content-Type (e.g. application/json) + */ + private function selectContentTypeHeader($contentType) + { + if (count($contentType) === 0 || (count($contentType) === 1 && $contentType[0] === '')) { + return 'application/json'; + } elseif (preg_grep("/application\/json/i", $contentType)) { + return 'application/json'; + } else { + return implode(',', $contentType); + } + } +} + diff --git a/php-client-generated/SwaggerClient-php/lib/Model/InlineResponse200.php b/php-client-generated/SwaggerClient-php/lib/Model/InlineResponse200.php new file mode 100644 index 0000000..ac7f8b8 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/InlineResponse200.php @@ -0,0 +1,351 @@ + 'string', +'artist_genre' => 'string', +'albums_recorded' => 'int' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'artist_name' => null, +'artist_genre' => null, +'albums_recorded' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'artist_name' => 'artist_name', +'artist_genre' => 'artist_genre', +'albums_recorded' => 'albums_recorded' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'artist_name' => 'setArtistName', +'artist_genre' => 'setArtistGenre', +'albums_recorded' => 'setAlbumsRecorded' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'artist_name' => 'getArtistName', +'artist_genre' => 'getArtistGenre', +'albums_recorded' => 'getAlbumsRecorded' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['artist_name'] = isset($data['artist_name']) ? $data['artist_name'] : null; + $this->container['artist_genre'] = isset($data['artist_genre']) ? $data['artist_genre'] : null; + $this->container['albums_recorded'] = isset($data['albums_recorded']) ? $data['albums_recorded'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets artist_name + * + * @return string + */ + public function getArtistName() + { + return $this->container['artist_name']; + } + + /** + * Sets artist_name + * + * @param string $artist_name artist_name + * + * @return $this + */ + public function setArtistName($artist_name) + { + $this->container['artist_name'] = $artist_name; + + return $this; + } + + /** + * Gets artist_genre + * + * @return string + */ + public function getArtistGenre() + { + return $this->container['artist_genre']; + } + + /** + * Sets artist_genre + * + * @param string $artist_genre artist_genre + * + * @return $this + */ + public function setArtistGenre($artist_genre) + { + $this->container['artist_genre'] = $artist_genre; + + return $this; + } + + /** + * Gets albums_recorded + * + * @return int + */ + public function getAlbumsRecorded() + { + return $this->container['albums_recorded']; + } + + /** + * Sets albums_recorded + * + * @param int $albums_recorded albums_recorded + * + * @return $this + */ + public function setAlbumsRecorded($albums_recorded) + { + $this->container['albums_recorded'] = $albums_recorded; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/InlineResponse400.php b/php-client-generated/SwaggerClient-php/lib/Model/InlineResponse400.php new file mode 100644 index 0000000..00a78e8 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/InlineResponse400.php @@ -0,0 +1,291 @@ + 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'message' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'message' => 'message' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'message' => 'setMessage' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'message' => 'getMessage' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets message + * + * @return string + */ + public function getMessage() + { + return $this->container['message']; + } + + /** + * Sets message + * + * @param string $message message + * + * @return $this + */ + public function setMessage($message) + { + $this->container['message'] = $message; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/ModelInterface.php b/php-client-generated/SwaggerClient-php/lib/Model/ModelInterface.php new file mode 100644 index 0000000..bc04bf0 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/ModelInterface.php @@ -0,0 +1,95 @@ + 'int', +'date_of_birth' => 'string', +'names' => '\Swagger\Client\Model\PersonNames[]', +'address' => '\Swagger\Client\Model\PersonAddress[]', +'email_address' => '\Swagger\Client\Model\PersonEmailAddress[]', +'identifier' => '\Swagger\Client\Model\PersonIdentifier[]', +'primary_affiliation' => 'string', +'gender' => 'string', +'telephone_number' => '\Swagger\Client\Model\PersonTelephoneNumber[]' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'sor_id' => null, +'date_of_birth' => null, +'names' => null, +'address' => null, +'email_address' => null, +'identifier' => null, +'primary_affiliation' => null, +'gender' => null, +'telephone_number' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'sor_id' => 'sorId', +'date_of_birth' => 'dateOfBirth', +'names' => 'names', +'address' => 'address', +'email_address' => 'emailAddress', +'identifier' => 'identifier', +'primary_affiliation' => 'primaryAffiliation', +'gender' => 'gender', +'telephone_number' => 'telephoneNumber' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'sor_id' => 'setSorId', +'date_of_birth' => 'setDateOfBirth', +'names' => 'setNames', +'address' => 'setAddress', +'email_address' => 'setEmailAddress', +'identifier' => 'setIdentifier', +'primary_affiliation' => 'setPrimaryAffiliation', +'gender' => 'setGender', +'telephone_number' => 'setTelephoneNumber' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'sor_id' => 'getSorId', +'date_of_birth' => 'getDateOfBirth', +'names' => 'getNames', +'address' => 'getAddress', +'email_address' => 'getEmailAddress', +'identifier' => 'getIdentifier', +'primary_affiliation' => 'getPrimaryAffiliation', +'gender' => 'getGender', +'telephone_number' => 'getTelephoneNumber' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['sor_id'] = isset($data['sor_id']) ? $data['sor_id'] : null; + $this->container['date_of_birth'] = isset($data['date_of_birth']) ? $data['date_of_birth'] : null; + $this->container['names'] = isset($data['names']) ? $data['names'] : null; + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['email_address'] = isset($data['email_address']) ? $data['email_address'] : null; + $this->container['identifier'] = isset($data['identifier']) ? $data['identifier'] : null; + $this->container['primary_affiliation'] = isset($data['primary_affiliation']) ? $data['primary_affiliation'] : null; + $this->container['gender'] = isset($data['gender']) ? $data['gender'] : null; + $this->container['telephone_number'] = isset($data['telephone_number']) ? $data['telephone_number'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['sor_id'] === null) { + $invalidProperties[] = "'sor_id' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets sor_id + * + * @return int + */ + public function getSorId() + { + return $this->container['sor_id']; + } + + /** + * Sets sor_id + * + * @param int $sor_id sor_id + * + * @return $this + */ + public function setSorId($sor_id) + { + $this->container['sor_id'] = $sor_id; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return string + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param string $date_of_birth date_of_birth + * + * @return $this + */ + public function setDateOfBirth($date_of_birth) + { + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets names + * + * @return \Swagger\Client\Model\PersonNames[] + */ + public function getNames() + { + return $this->container['names']; + } + + /** + * Sets names + * + * @param \Swagger\Client\Model\PersonNames[] $names names + * + * @return $this + */ + public function setNames($names) + { + $this->container['names'] = $names; + + return $this; + } + + /** + * Gets address + * + * @return \Swagger\Client\Model\PersonAddress[] + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param \Swagger\Client\Model\PersonAddress[] $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets email_address + * + * @return \Swagger\Client\Model\PersonEmailAddress[] + */ + public function getEmailAddress() + { + return $this->container['email_address']; + } + + /** + * Sets email_address + * + * @param \Swagger\Client\Model\PersonEmailAddress[] $email_address email_address + * + * @return $this + */ + public function setEmailAddress($email_address) + { + $this->container['email_address'] = $email_address; + + return $this; + } + + /** + * Gets identifier + * + * @return \Swagger\Client\Model\PersonIdentifier[] + */ + public function getIdentifier() + { + return $this->container['identifier']; + } + + /** + * Sets identifier + * + * @param \Swagger\Client\Model\PersonIdentifier[] $identifier identifier + * + * @return $this + */ + public function setIdentifier($identifier) + { + $this->container['identifier'] = $identifier; + + return $this; + } + + /** + * Gets primary_affiliation + * + * @return string + */ + public function getPrimaryAffiliation() + { + return $this->container['primary_affiliation']; + } + + /** + * Sets primary_affiliation + * + * @param string $primary_affiliation primary_affiliation + * + * @return $this + */ + public function setPrimaryAffiliation($primary_affiliation) + { + $this->container['primary_affiliation'] = $primary_affiliation; + + return $this; + } + + /** + * Gets gender + * + * @return string + */ + public function getGender() + { + return $this->container['gender']; + } + + /** + * Sets gender + * + * @param string $gender gender + * + * @return $this + */ + public function setGender($gender) + { + $this->container['gender'] = $gender; + + return $this; + } + + /** + * Gets telephone_number + * + * @return \Swagger\Client\Model\PersonTelephoneNumber[] + */ + public function getTelephoneNumber() + { + return $this->container['telephone_number']; + } + + /** + * Sets telephone_number + * + * @param \Swagger\Client\Model\PersonTelephoneNumber[] $telephone_number telephone_number + * + * @return $this + */ + public function setTelephoneNumber($telephone_number) + { + $this->container['telephone_number'] = $telephone_number; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/PersonAddress.php b/php-client-generated/SwaggerClient-php/lib/Model/PersonAddress.php new file mode 100644 index 0000000..7a75554 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/PersonAddress.php @@ -0,0 +1,561 @@ + 'string', +'formatted' => 'string', +'language' => 'string', +'locality' => 'string', +'postal_code' => 'string', +'region' => 'string', +'room' => 'string', +'street_address' => 'string', +'type' => 'string', +'verified' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'country' => null, +'formatted' => null, +'language' => null, +'locality' => null, +'postal_code' => null, +'region' => null, +'room' => null, +'street_address' => null, +'type' => null, +'verified' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'country' => 'country', +'formatted' => 'formatted', +'language' => 'language', +'locality' => 'locality', +'postal_code' => 'postalCode', +'region' => 'region', +'room' => 'room', +'street_address' => 'streetAddress', +'type' => 'type', +'verified' => 'verified' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'country' => 'setCountry', +'formatted' => 'setFormatted', +'language' => 'setLanguage', +'locality' => 'setLocality', +'postal_code' => 'setPostalCode', +'region' => 'setRegion', +'room' => 'setRoom', +'street_address' => 'setStreetAddress', +'type' => 'setType', +'verified' => 'setVerified' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'country' => 'getCountry', +'formatted' => 'getFormatted', +'language' => 'getLanguage', +'locality' => 'getLocality', +'postal_code' => 'getPostalCode', +'region' => 'getRegion', +'room' => 'getRoom', +'street_address' => 'getStreetAddress', +'type' => 'getType', +'verified' => 'getVerified' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['country'] = isset($data['country']) ? $data['country'] : null; + $this->container['formatted'] = isset($data['formatted']) ? $data['formatted'] : null; + $this->container['language'] = isset($data['language']) ? $data['language'] : null; + $this->container['locality'] = isset($data['locality']) ? $data['locality'] : null; + $this->container['postal_code'] = isset($data['postal_code']) ? $data['postal_code'] : null; + $this->container['region'] = isset($data['region']) ? $data['region'] : null; + $this->container['room'] = isset($data['room']) ? $data['room'] : null; + $this->container['street_address'] = isset($data['street_address']) ? $data['street_address'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['verified'] = isset($data['verified']) ? $data['verified'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets country + * + * @return string + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string $country country + * + * @return $this + */ + public function setCountry($country) + { + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets formatted + * + * @return string + */ + public function getFormatted() + { + return $this->container['formatted']; + } + + /** + * Sets formatted + * + * @param string $formatted formatted + * + * @return $this + */ + public function setFormatted($formatted) + { + $this->container['formatted'] = $formatted; + + return $this; + } + + /** + * Gets language + * + * @return string + */ + public function getLanguage() + { + return $this->container['language']; + } + + /** + * Sets language + * + * @param string $language language + * + * @return $this + */ + public function setLanguage($language) + { + $this->container['language'] = $language; + + return $this; + } + + /** + * Gets locality + * + * @return string + */ + public function getLocality() + { + return $this->container['locality']; + } + + /** + * Sets locality + * + * @param string $locality locality + * + * @return $this + */ + public function setLocality($locality) + { + $this->container['locality'] = $locality; + + return $this; + } + + /** + * Gets postal_code + * + * @return string + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string $postal_code postal_code + * + * @return $this + */ + public function setPostalCode($postal_code) + { + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets region + * + * @return string + */ + public function getRegion() + { + return $this->container['region']; + } + + /** + * Sets region + * + * @param string $region region + * + * @return $this + */ + public function setRegion($region) + { + $this->container['region'] = $region; + + return $this; + } + + /** + * Gets room + * + * @return string + */ + public function getRoom() + { + return $this->container['room']; + } + + /** + * Sets room + * + * @param string $room room + * + * @return $this + */ + public function setRoom($room) + { + $this->container['room'] = $room; + + return $this; + } + + /** + * Gets street_address + * + * @return string + */ + public function getStreetAddress() + { + return $this->container['street_address']; + } + + /** + * Sets street_address + * + * @param string $street_address street_address + * + * @return $this + */ + public function setStreetAddress($street_address) + { + $this->container['street_address'] = $street_address; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets verified + * + * @return string + */ + public function getVerified() + { + return $this->container['verified']; + } + + /** + * Sets verified + * + * @param string $verified verified + * + * @return $this + */ + public function setVerified($verified) + { + $this->container['verified'] = $verified; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/PersonEmailAddress.php b/php-client-generated/SwaggerClient-php/lib/Model/PersonEmailAddress.php new file mode 100644 index 0000000..83f1698 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/PersonEmailAddress.php @@ -0,0 +1,351 @@ + 'string', +'type' => 'string', +'verified' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'address' => null, +'type' => null, +'verified' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'address' => 'address', +'type' => 'type', +'verified' => 'verified' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'address' => 'setAddress', +'type' => 'setType', +'verified' => 'setVerified' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'address' => 'getAddress', +'type' => 'getType', +'verified' => 'getVerified' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['address'] = isset($data['address']) ? $data['address'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['verified'] = isset($data['verified']) ? $data['verified'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets address + * + * @return string + */ + public function getAddress() + { + return $this->container['address']; + } + + /** + * Sets address + * + * @param string $address address + * + * @return $this + */ + public function setAddress($address) + { + $this->container['address'] = $address; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets verified + * + * @return string + */ + public function getVerified() + { + return $this->container['verified']; + } + + /** + * Sets verified + * + * @param string $verified verified + * + * @return $this + */ + public function setVerified($verified) + { + $this->container['verified'] = $verified; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/PersonIdentifier.php b/php-client-generated/SwaggerClient-php/lib/Model/PersonIdentifier.php new file mode 100644 index 0000000..b78b057 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/PersonIdentifier.php @@ -0,0 +1,321 @@ + 'string', +'type' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'id' => null, +'type' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', +'type' => 'type' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', +'type' => 'setType' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', +'type' => 'getType' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['id'] = isset($data['id']) ? $data['id'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id id + * + * @return $this + */ + public function setId($id) + { + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/PersonNames.php b/php-client-generated/SwaggerClient-php/lib/Model/PersonNames.php new file mode 100644 index 0000000..c975c5f --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/PersonNames.php @@ -0,0 +1,351 @@ + 'string', +'given' => 'string', +'family' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'type' => null, +'given' => null, +'family' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'type' => 'type', +'given' => 'given', +'family' => 'family' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'type' => 'setType', +'given' => 'setGiven', +'family' => 'setFamily' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'type' => 'getType', +'given' => 'getGiven', +'family' => 'getFamily' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + $this->container['given'] = isset($data['given']) ? $data['given'] : null; + $this->container['family'] = isset($data['family']) ? $data['family'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets given + * + * @return string + */ + public function getGiven() + { + return $this->container['given']; + } + + /** + * Sets given + * + * @param string $given given + * + * @return $this + */ + public function setGiven($given) + { + $this->container['given'] = $given; + + return $this; + } + + /** + * Gets family + * + * @return string + */ + public function getFamily() + { + return $this->container['family']; + } + + /** + * Sets family + * + * @param string $family family + * + * @return $this + */ + public function setFamily($family) + { + $this->container['family'] = $family; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/Model/PersonTelephoneNumber.php b/php-client-generated/SwaggerClient-php/lib/Model/PersonTelephoneNumber.php new file mode 100644 index 0000000..5e55181 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/Model/PersonTelephoneNumber.php @@ -0,0 +1,321 @@ + 'string', +'type' => 'string' ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $swaggerFormats = [ + 'number' => null, +'type' => null ]; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerTypes() + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function swaggerFormats() + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'number' => 'number', +'type' => 'type' ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'number' => 'setNumber', +'type' => 'setType' ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'number' => 'getNumber', +'type' => 'getType' ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$swaggerModelName; + } + + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(array $data = null) + { + $this->container['number'] = isset($data['number']) ? $data['number'] : null; + $this->container['type'] = isset($data['type']) ? $data['type'] : null; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets number + * + * @return string + */ + public function getNumber() + { + return $this->container['number']; + } + + /** + * Sets number + * + * @param string $number number + * + * @return $this + */ + public function setNumber($number) + { + $this->container['number'] = $number; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type type + * + * @return $this + */ + public function setType($type) + { + $this->container['type'] = $type; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset) + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param integer $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value) + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset) + { + unset($this->container[$offset]); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} diff --git a/php-client-generated/SwaggerClient-php/lib/ObjectSerializer.php b/php-client-generated/SwaggerClient-php/lib/ObjectSerializer.php new file mode 100644 index 0000000..03e6f4d --- /dev/null +++ b/php-client-generated/SwaggerClient-php/lib/ObjectSerializer.php @@ -0,0 +1,318 @@ +format('Y-m-d') : $data->format(\DateTime::ATOM); + } elseif (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } elseif (is_object($data)) { + $values = []; + $formats = $data::swaggerFormats(); + foreach ($data::swaggerTypes() as $property => $swaggerType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null + && !in_array($swaggerType, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true) + && method_exists($swaggerType, 'getAllowableEnumValues') + && !in_array($value, $swaggerType::getAllowableEnumValues())) { + $imploded = implode("', '", $swaggerType::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$swaggerType', must be one of: '$imploded'"); + } + if ($value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $swaggerType, $formats[$property]); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the query, by imploding comma-separated if it's an object. + * If it's a string, pass through unchanged. It will be url-encoded + * later. + * + * @param string[]|string|\DateTime $object an object to be serialized to a string + * @param string|null $format the format of the parameter + * + * @return string the serialized object + */ + public static function toQueryValue($object, $format = null) + { + if (is_array($object)) { + return implode(',', $object); + } else { + return self::toString($object, $format); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in RFC3339 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the http body (form parameter). If it's a string, pass through unchanged + * If it's a datetime object, format it in RFC3339 + * + * @param string|\SplFileObject $value the value of the form parameter + * + * @return string the form string + */ + public static function toFormValue($value) + { + if ($value instanceof \SplFileObject) { + return $value->getRealPath(); + } else { + return self::toString($value); + } + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in RFC3339 + * If it's a date, format it in Y-m-d + * + * @param string|\DateTime $value the value of the parameter + * @param string|null $format the format of the parameter + * + * @return string the header string + */ + public static function toString($value, $format = null) + { + if ($value instanceof \DateTime) { + return ($format === 'date') ? $value->format('Y-m-d') : $value->format(\DateTime::ATOM); + } else { + return $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $collectionFormat the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $collectionFormat, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $collectionFormat)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($collectionFormat) { + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'ssv': + return implode(' ', $collection); + + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[] $httpHeaders HTTP headers + * @param string $discriminator discriminator if polymorphism is used + * + * @return object|array|null an single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } elseif (substr($class, 0, 4) === 'map[') { // for associative array e.g. map[string,int] + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } elseif (strcasecmp(substr($class, -2), '[]') === 0) { + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } elseif ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === '\DateTime') { + // Some API's return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + return new \DateTime($data); + } else { + return null; + } + } elseif (in_array($class, ['DateTime', 'bool', 'boolean', 'byte', 'double', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } elseif ($class === '\SplFileObject') { + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if (array_key_exists('Content-Disposition', $httpHeaders) && + preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match)) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } elseif (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues())) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '{{invokerPackage}}\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + $instance = new $class(); + foreach ($instance::swaggerTypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter) || !isset($data->{$instance::attributeMap()[$property]})) { + continue; + } + + $propertyValue = $data->{$instance::attributeMap()[$property]}; + if (isset($propertyValue)) { + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } +} diff --git a/php-client-generated/SwaggerClient-php/phpunit.xml.dist b/php-client-generated/SwaggerClient-php/phpunit.xml.dist new file mode 100644 index 0000000..c12ee14 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/phpunit.xml.dist @@ -0,0 +1,21 @@ + + + + + ./test/Api + ./test/Model + + + + + + ./lib/Api + ./lib/Model + + + diff --git a/php-client-generated/SwaggerClient-php/test/Api/DefaultApiTest.php b/php-client-generated/SwaggerClient-php/test/Api/DefaultApiTest.php new file mode 100644 index 0000000..2116245 --- /dev/null +++ b/php-client-generated/SwaggerClient-php/test/Api/DefaultApiTest.php @@ -0,0 +1,122 @@ + + + + \ No newline at end of file diff --git a/python-client-generated/.idea/midpoint.xml b/python-client-generated/.idea/midpoint.xml new file mode 100644 index 0000000..c0b9c43 --- /dev/null +++ b/python-client-generated/.idea/midpoint.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/python-client-generated/.idea/misc.xml b/python-client-generated/.idea/misc.xml new file mode 100644 index 0000000..2a75f48 --- /dev/null +++ b/python-client-generated/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/python-client-generated/.idea/modules.xml b/python-client-generated/.idea/modules.xml new file mode 100644 index 0000000..e2ad134 --- /dev/null +++ b/python-client-generated/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/python-client-generated/.idea/python-client-generated.iml b/python-client-generated/.idea/python-client-generated.iml new file mode 100644 index 0000000..ff0e175 --- /dev/null +++ b/python-client-generated/.idea/python-client-generated.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/python-client-generated/.swagger-codegen-ignore b/python-client-generated/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/python-client-generated/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/python-client-generated/.swagger-codegen/VERSION b/python-client-generated/.swagger-codegen/VERSION new file mode 100644 index 0000000..402b44e --- /dev/null +++ b/python-client-generated/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.21 \ No newline at end of file diff --git a/python-client-generated/.travis.yml b/python-client-generated/.travis.yml new file mode 100644 index 0000000..dd6c445 --- /dev/null +++ b/python-client-generated/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/python-client-generated/README.md b/python-client-generated/README.md new file mode 100644 index 0000000..7cbe582 --- /dev/null +++ b/python-client-generated/README.md @@ -0,0 +1,156 @@ +# swagger-client +ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + +This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: + +- API version: 1.1.1 +- Package version: 1.0.0 +- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen + +## Requirements. + +Python 2.7 and 3.4+ + +## Installation & Usage +### pip install + +If the python package is hosted on Github, you can install directly from Github + +```sh +pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git +``` +(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) + +Then import the package: +```python +import swagger_client +``` + +### Setuptools + +Install via [Setuptools](http://pypi.python.org/pypi/setuptools). + +```sh +python setup.py install --user +``` +(or `sudo python setup.py install` to install the package for all users) + +Then import the package: +```python +import swagger_client +``` + +## Getting Started + +Please follow the [installation procedure](#installation--usage) and then run the following: + +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Server example operation + api_instance.example_get() +except ApiException as e: + print("Exception when calling DefaultApi->example_get: %s\n" % e) + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Server heartbeat operation + api_instance.ping_get() +except ApiException as e: + print("Exception when calling DefaultApi->ping_get: %s\n" % e) + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +limit = 56 # int | Limits the number of items on a page (optional) +offset = 56 # int | Specifies the page number of the artists to be displayed (optional) + +try: + api_response = api_instance.sis_get(limit=limit, offset=offset) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->sis_get: %s\n" % e) + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Person() # Person | + +try: + api_instance.sis_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->sis_post: %s\n" % e) + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +sor_id = 'sor_id_example' # str | + +try: + api_response = api_instance.sis_sor_id_get(sor_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->sis_sor_id_get: %s\n" % e) +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://virtserver.swaggerhub.com/I2/idMatch/1.0.0* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*DefaultApi* | [**example_get**](docs/DefaultApi.md#example_get) | **GET** /example | Server example operation +*DefaultApi* | [**ping_get**](docs/DefaultApi.md#ping_get) | **GET** /ping | Server heartbeat operation +*DefaultApi* | [**sis_get**](docs/DefaultApi.md#sis_get) | **GET** /sis | +*DefaultApi* | [**sis_post**](docs/DefaultApi.md#sis_post) | **POST** /sis | +*DefaultApi* | [**sis_sor_id_get**](docs/DefaultApi.md#sis_sor_id_get) | **GET** /sis/{sorId} | + +## Documentation For Models + + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse400](docs/InlineResponse400.md) + - [Person](docs/Person.md) + - [PersonAddress](docs/PersonAddress.md) + - [PersonEmailAddress](docs/PersonEmailAddress.md) + - [PersonIdentifier](docs/PersonIdentifier.md) + - [PersonNames](docs/PersonNames.md) + - [PersonTelephoneNumber](docs/PersonTelephoneNumber.md) + +## Documentation For Authorization + + +## accessCode + +- **Type**: OAuth +- **Flow**: accessCode +- **Authorization URL**: http://example.com/oauth/auth +- **Scopes**: + - ****: + + +## Author + + diff --git a/python-client-generated/docs/DefaultApi.md b/python-client-generated/docs/DefaultApi.md new file mode 100644 index 0000000..a06aa6e --- /dev/null +++ b/python-client-generated/docs/DefaultApi.md @@ -0,0 +1,256 @@ +# swagger_client.DefaultApi + +All URIs are relative to *https://virtserver.swaggerhub.com/I2/idMatch/1.0.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**example_get**](DefaultApi.md#example_get) | **GET** /example | Server example operation +[**ping_get**](DefaultApi.md#ping_get) | **GET** /ping | Server heartbeat operation +[**sis_get**](DefaultApi.md#sis_get) | **GET** /sis | +[**sis_post**](DefaultApi.md#sis_post) | **POST** /sis | +[**sis_sor_id_get**](DefaultApi.md#sis_sor_id_get) | **GET** /sis/{sorId} | + +# **example_get** +> example_get() + +Server example operation + +This is an example operation to show how security is applied to the call. + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) + +try: + # Server example operation + api_instance.example_get() +except ApiException as e: + print("Exception when calling DefaultApi->example_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ping_get** +> ping_get() + +Server heartbeat operation + +This operation shows how to override the global security defined above, as we want to open it up for all users. + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# create an instance of the API class +api_instance = swagger_client.DefaultApi() + +try: + # Server heartbeat operation + api_instance.ping_get() +except ApiException as e: + print("Exception when calling DefaultApi->ping_get: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **sis_get** +> list[Person] sis_get(limit=limit, offset=offset) + + + +Returns a list of people + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +limit = 56 # int | Limits the number of items on a page (optional) +offset = 56 # int | Specifies the page number of the artists to be displayed (optional) + +try: + api_response = api_instance.sis_get(limit=limit, offset=offset) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->sis_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| Limits the number of items on a page | [optional] + **offset** | **int**| Specifies the page number of the artists to be displayed | [optional] + +### Return type + +[**list[Person]**](Person.md) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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) + +# **sis_post** +> sis_post(body) + + + +Get a reference ID for an SoR person + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +body = swagger_client.Person() # Person | + +try: + api_instance.sis_post(body) +except ApiException as e: + print("Exception when calling DefaultApi->sis_post: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Person**](Person.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: application/json + - **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) + +# **sis_sor_id_get** +> InlineResponse200 sis_sor_id_get(sor_id) + + + +Obtain information about an person from his or her sorId + +### Example +```python +from __future__ import print_function +import time +import swagger_client +from swagger_client.rest import ApiException +from pprint import pprint + +# Configure OAuth2 access token for authorization: accessCode +configuration = swagger_client.Configuration() +configuration.access_token = 'YOUR_ACCESS_TOKEN' + +# create an instance of the API class +api_instance = swagger_client.DefaultApi(swagger_client.ApiClient(configuration)) +sor_id = 'sor_id_example' # str | + +try: + api_response = api_instance.sis_sor_id_get(sor_id) + pprint(api_response) +except ApiException as e: + print("Exception when calling DefaultApi->sis_sor_id_get: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **sor_id** | **str**| | + +### Return type + +[**InlineResponse200**](InlineResponse200.md) + +### Authorization + +[accessCode](../README.md#accessCode) + +### HTTP request headers + + - **Content-Type**: Not defined + - **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/python-client-generated/docs/InlineResponse200.md b/python-client-generated/docs/InlineResponse200.md new file mode 100644 index 0000000..de39be7 --- /dev/null +++ b/python-client-generated/docs/InlineResponse200.md @@ -0,0 +1,11 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artist_name** | **str** | | [optional] +**artist_genre** | **str** | | [optional] +**albums_recorded** | **int** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/InlineResponse400.md b/python-client-generated/docs/InlineResponse400.md new file mode 100644 index 0000000..29c731f --- /dev/null +++ b/python-client-generated/docs/InlineResponse400.md @@ -0,0 +1,9 @@ +# InlineResponse400 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/Person.md b/python-client-generated/docs/Person.md new file mode 100644 index 0000000..783f262 --- /dev/null +++ b/python-client-generated/docs/Person.md @@ -0,0 +1,17 @@ +# Person + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sor_id** | **int** | | +**date_of_birth** | **str** | | [optional] +**names** | [**list[PersonNames]**](PersonNames.md) | | [optional] +**address** | [**list[PersonAddress]**](PersonAddress.md) | | [optional] +**email_address** | [**list[PersonEmailAddress]**](PersonEmailAddress.md) | | [optional] +**identifier** | [**list[PersonIdentifier]**](PersonIdentifier.md) | | [optional] +**primary_affiliation** | **str** | | [optional] +**gender** | **str** | | [optional] +**telephone_number** | [**list[PersonTelephoneNumber]**](PersonTelephoneNumber.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/PersonAddress.md b/python-client-generated/docs/PersonAddress.md new file mode 100644 index 0000000..89901f4 --- /dev/null +++ b/python-client-generated/docs/PersonAddress.md @@ -0,0 +1,18 @@ +# PersonAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**country** | **str** | | [optional] +**formatted** | **str** | | [optional] +**language** | **str** | | [optional] +**locality** | **str** | | [optional] +**postal_code** | **str** | | [optional] +**region** | **str** | | [optional] +**room** | **str** | | [optional] +**street_address** | **str** | | [optional] +**type** | **str** | | [optional] +**verified** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/PersonEmailAddress.md b/python-client-generated/docs/PersonEmailAddress.md new file mode 100644 index 0000000..5888d61 --- /dev/null +++ b/python-client-generated/docs/PersonEmailAddress.md @@ -0,0 +1,11 @@ +# PersonEmailAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address** | **str** | | [optional] +**type** | **str** | | [optional] +**verified** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/PersonIdentifier.md b/python-client-generated/docs/PersonIdentifier.md new file mode 100644 index 0000000..e3b28d7 --- /dev/null +++ b/python-client-generated/docs/PersonIdentifier.md @@ -0,0 +1,10 @@ +# PersonIdentifier + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/PersonNames.md b/python-client-generated/docs/PersonNames.md new file mode 100644 index 0000000..ce3de92 --- /dev/null +++ b/python-client-generated/docs/PersonNames.md @@ -0,0 +1,11 @@ +# PersonNames + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | | [optional] +**given** | **str** | | [optional] +**family** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/docs/PersonTelephoneNumber.md b/python-client-generated/docs/PersonTelephoneNumber.md new file mode 100644 index 0000000..28ae80d --- /dev/null +++ b/python-client-generated/docs/PersonTelephoneNumber.md @@ -0,0 +1,10 @@ +# PersonTelephoneNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number** | **str** | | [optional] +**type** | **str** | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/python-client-generated/git_push.sh b/python-client-generated/git_push.sh new file mode 100644 index 0000000..ae01b18 --- /dev/null +++ b/python-client-generated/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="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/python-client-generated/requirements.txt b/python-client-generated/requirements.txt new file mode 100644 index 0000000..bafdc07 --- /dev/null +++ b/python-client-generated/requirements.txt @@ -0,0 +1,5 @@ +certifi >= 14.05.14 +six >= 1.10 +python_dateutil >= 2.5.3 +setuptools >= 21.0.0 +urllib3 >= 1.15.1 diff --git a/python-client-generated/setup.py b/python-client-generated/setup.py new file mode 100644 index 0000000..23d0328 --- /dev/null +++ b/python-client-generated/setup.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from setuptools import setup, find_packages # noqa: H301 + +NAME = "swagger-client" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] + +setup( + name=NAME, + version=VERSION, + description="ID Match API", + author_email="", + url="", + keywords=["Swagger", "ID Match API"], + install_requires=REQUIRES, + packages=find_packages(), + include_package_data=True, + long_description="""\ + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + """ +) diff --git a/python-client-generated/swagger_client/__init__.py b/python-client-generated/swagger_client/__init__.py new file mode 100644 index 0000000..7fb6b67 --- /dev/null +++ b/python-client-generated/swagger_client/__init__.py @@ -0,0 +1,30 @@ +# coding: utf-8 + +# flake8: noqa + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import apis into sdk package +from swagger_client.api.default_api import DefaultApi +# import ApiClient +from swagger_client.api_client import ApiClient +from swagger_client.configuration import Configuration +# import models into sdk package +from swagger_client.models.inline_response200 import InlineResponse200 +from swagger_client.models.inline_response400 import InlineResponse400 +from swagger_client.models.person import Person +from swagger_client.models.person_address import PersonAddress +from swagger_client.models.person_email_address import PersonEmailAddress +from swagger_client.models.person_identifier import PersonIdentifier +from swagger_client.models.person_names import PersonNames +from swagger_client.models.person_telephone_number import PersonTelephoneNumber diff --git a/python-client-generated/swagger_client/api/__init__.py b/python-client-generated/swagger_client/api/__init__.py new file mode 100644 index 0000000..447bb1c --- /dev/null +++ b/python-client-generated/swagger_client/api/__init__.py @@ -0,0 +1,6 @@ +from __future__ import absolute_import + +# flake8: noqa + +# import apis into api package +from swagger_client.api.default_api import DefaultApi diff --git a/python-client-generated/swagger_client/api/default_api.py b/python-client-generated/swagger_client/api/default_api.py new file mode 100644 index 0000000..735f6f2 --- /dev/null +++ b/python-client-generated/swagger_client/api/default_api.py @@ -0,0 +1,488 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from swagger_client.api_client import ApiClient + + +class DefaultApi(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + Ref: https://github.com/swagger-api/swagger-codegen + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def example_get(self, **kwargs): # noqa: E501 + """Server example operation # noqa: E501 + + This is an example operation to show how security is applied to the call. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.example_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.example_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.example_get_with_http_info(**kwargs) # noqa: E501 + return data + + def example_get_with_http_info(self, **kwargs): # noqa: E501 + """Server example operation # noqa: E501 + + This is an example operation to show how security is applied to the call. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.example_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method example_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['accessCode'] # noqa: E501 + + return self.api_client.call_api( + '/example', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def ping_get(self, **kwargs): # noqa: E501 + """Server heartbeat operation # noqa: E501 + + This operation shows how to override the global security defined above, as we want to open it up for all users. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.ping_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.ping_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.ping_get_with_http_info(**kwargs) # noqa: E501 + return data + + def ping_get_with_http_info(self, **kwargs): # noqa: E501 + """Server heartbeat operation # noqa: E501 + + This operation shows how to override the global security defined above, as we want to open it up for all users. # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.ping_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = [] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method ping_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/ping', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def sis_get(self, **kwargs): # noqa: E501 + """sis_get # noqa: E501 + + Returns a list of people # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.sis_get(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Limits the number of items on a page + :param int offset: Specifies the page number of the artists to be displayed + :return: list[Person] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.sis_get_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.sis_get_with_http_info(**kwargs) # noqa: E501 + return data + + def sis_get_with_http_info(self, **kwargs): # noqa: E501 + """sis_get # noqa: E501 + + Returns a list of people # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.sis_get_with_http_info(async_req=True) + >>> result = thread.get() + + :param async_req bool + :param int limit: Limits the number of items on a page + :param int offset: Specifies the page number of the artists to be displayed + :return: list[Person] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['limit', 'offset'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method sis_get" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + if 'offset' in params: + query_params.append(('offset', params['offset'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['accessCode'] # noqa: E501 + + return self.api_client.call_api( + '/sis', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[Person]', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def sis_post(self, body, **kwargs): # noqa: E501 + """sis_post # noqa: E501 + + Get a reference ID for an SoR person # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.sis_post(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Person body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.sis_post_with_http_info(body, **kwargs) # noqa: E501 + else: + (data) = self.sis_post_with_http_info(body, **kwargs) # noqa: E501 + return data + + def sis_post_with_http_info(self, body, **kwargs): # noqa: E501 + """sis_post # noqa: E501 + + Get a reference ID for an SoR person # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.sis_post_with_http_info(body, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param Person body: (required) + :return: None + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['body'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method sis_post" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'body' is set + if ('body' not in params or + params['body'] is None): + raise ValueError("Missing the required parameter `body` when calling `sis_post`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'body' in params: + body_params = params['body'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['accessCode'] # noqa: E501 + + return self.api_client.call_api( + '/sis', 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def sis_sor_id_get(self, sor_id, **kwargs): # noqa: E501 + """sis_sor_id_get # noqa: E501 + + Obtain information about an person from his or her sorId # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.sis_sor_id_get(sor_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str sor_id: (required) + :return: InlineResponse200 + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async_req'): + return self.sis_sor_id_get_with_http_info(sor_id, **kwargs) # noqa: E501 + else: + (data) = self.sis_sor_id_get_with_http_info(sor_id, **kwargs) # noqa: E501 + return data + + def sis_sor_id_get_with_http_info(self, sor_id, **kwargs): # noqa: E501 + """sis_sor_id_get # noqa: E501 + + Obtain information about an person from his or her sorId # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.sis_sor_id_get_with_http_info(sor_id, async_req=True) + >>> result = thread.get() + + :param async_req bool + :param str sor_id: (required) + :return: InlineResponse200 + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['sor_id'] # noqa: E501 + all_params.append('async_req') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method sis_sor_id_get" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'sor_id' is set + if ('sor_id' not in params or + params['sor_id'] is None): + raise ValueError("Missing the required parameter `sor_id` when calling `sis_sor_id_get`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'sor_id' in params: + path_params['sorId'] = params['sor_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['accessCode'] # noqa: E501 + + return self.api_client.call_api( + '/sis/{sorId}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='InlineResponse200', # noqa: E501 + auth_settings=auth_settings, + async_req=params.get('async_req'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) diff --git a/python-client-generated/swagger_client/api_client.py b/python-client-generated/swagger_client/api_client.py new file mode 100644 index 0000000..e9a6824 --- /dev/null +++ b/python-client-generated/swagger_client/api_client.py @@ -0,0 +1,628 @@ +# coding: utf-8 +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" +from __future__ import absolute_import + +import datetime +import json +import mimetypes +from multiprocessing.pool import ThreadPool +import os +import re +import tempfile + +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import quote + +from swagger_client.configuration import Configuration +import swagger_client.models +from swagger_client import rest + + +class ApiClient(object): + """Generic API client for Swagger client library builds. + + Swagger generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the Swagger + templates. + + NOTE: This class is auto generated by the swagger code generator program. + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int if six.PY3 else long, # noqa: F821 + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'object': object, + } + + def __init__(self, configuration=None, header_name=None, header_value=None, + cookie=None): + if configuration is None: + configuration = Configuration() + self.configuration = configuration + + self.pool = ThreadPool() + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'Swagger-Codegen/1.0.0/python' + + def __del__(self): + self.pool.close() + self.pool.join() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + def __call_api( + self, resource_path, method, path_params=None, + query_params=None, header_params=None, body=None, post_params=None, + files=None, response_type=None, auth_settings=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, + collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, + collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + query_params = self.parameters_to_tuples(query_params, + collection_formats) + + # post parameters + if post_params or files: + post_params = self.prepare_post_parameters(post_params, files) + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, + collection_formats) + + # auth setting + self.update_params_for_auth(header_params, query_params, auth_settings) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + url = self.configuration.host + resource_path + + # perform request and return response + response_data = self.request( + method, url, query_params=query_params, headers=header_params, + post_params=post_params, body=body, + _preload_content=_preload_content, + _request_timeout=_request_timeout) + + self.last_response = response_data + + return_data = response_data + if _preload_content: + # deserialize response data + if response_type: + return_data = self.deserialize(response_data, response_type) + else: + return_data = None + + if _return_http_data_only: + return (return_data) + else: + return (return_data, response_data.status, + response_data.getheaders()) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is swagger model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) + for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) + for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + if isinstance(obj, dict): + obj_dict = obj + else: + # Convert model obj to dict except + # attributes `swagger_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) + for attr, _ in six.iteritems(obj.swagger_types) + if getattr(obj, attr) is not None} + + return {key: self.sanitize_for_serialization(val) + for key, val in six.iteritems(obj_dict)} + + def deserialize(self, response, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # handle file downloading + # save response body into a tmp file and return the instance + if response_type == "file": + return self.__deserialize_file(response) + + # fetch data from response object + try: + data = json.loads(response.data) + except ValueError: + data = response.data + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if type(klass) == str: + if klass.startswith('list['): + sub_kls = re.match(r'list\[(.*)\]', klass).group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('dict('): + sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in six.iteritems(data)} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(swagger_client.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datatime(data) + else: + return self.__deserialize_model(data, klass) + + def call_api(self, resource_path, method, + path_params=None, query_params=None, header_params=None, + body=None, post_params=None, files=None, + response_type=None, auth_settings=None, async_req=None, + _return_http_data_only=None, collection_formats=None, + _preload_content=True, _request_timeout=None): + """Makes the HTTP request (synchronous) and returns deserialized data. + + To make an async request, set the async_req parameter. + + :param resource_path: Path to method endpoint. + :param method: Method to call. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param response: Response data type. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param async_req bool: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :return: + If async_req parameter is True, + the request will be called asynchronously. + The method will return the request thread. + If parameter async_req is False or missing, + then the method will return the response directly. + """ + if not async_req: + return self.__call_api(resource_path, method, + path_params, query_params, header_params, + body, post_params, files, + response_type, auth_settings, + _return_http_data_only, collection_formats, + _preload_content, _request_timeout) + else: + thread = self.pool.apply_async(self.__call_api, (resource_path, + method, path_params, query_params, + header_params, body, + post_params, files, + response_type, auth_settings, + _return_http_data_only, + collection_formats, + _preload_content, _request_timeout)) + return thread + + def request(self, method, url, query_params=None, headers=None, + post_params=None, body=None, _preload_content=True, + _request_timeout=None): + """Makes the HTTP request using RESTClient.""" + if method == "GET": + return self.rest_client.GET(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "HEAD": + return self.rest_client.HEAD(url, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + headers=headers) + elif method == "OPTIONS": + return self.rest_client.OPTIONS(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "POST": + return self.rest_client.POST(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PUT": + return self.rest_client.PUT(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "PATCH": + return self.rest_client.PATCH(url, + query_params=query_params, + headers=headers, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + elif method == "DELETE": + return self.rest_client.DELETE(url, + query_params=query_params, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + else: + raise ValueError( + "http method must be `GET`, `HEAD`, `OPTIONS`," + " `POST`, `PATCH`, `PUT` or `DELETE`." + ) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params = [] + if collection_formats is None: + collection_formats = {} + for k, v in six.iteritems(params) if isinstance(params, dict) else params: # noqa: E501 + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def prepare_post_parameters(self, post_params=None, files=None): + """Builds form parameters. + + :param post_params: Normal form parameters. + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + + if post_params: + params = post_params + + if files: + for k, v in six.iteritems(files): + if not v: + continue + file_names = v if type(v) is list else [v] + for n in file_names: + with open(n, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + mimetype = (mimetypes.guess_type(filename)[0] or + 'application/octet-stream') + params.append( + tuple([k, tuple([filename, filedata, mimetype])])) + + return params + + def select_header_accept(self, accepts): + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return + + accepts = [x.lower() for x in accepts] + + if 'application/json' in accepts: + return 'application/json' + else: + return ', '.join(accepts) + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return 'application/json' + + content_types = [x.lower() for x in content_types] + + if 'application/json' in content_types or '*/*' in content_types: + return 'application/json' + else: + return content_types[0] + + def update_params_for_auth(self, headers, querys, auth_settings): + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param querys: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + """ + if not auth_settings: + return + + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + if not auth_setting['value']: + continue + elif auth_setting['in'] == 'header': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + querys.append((auth_setting['key'], auth_setting['value'])) + else: + raise ValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("Content-Disposition") + if content_disposition: + filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition).group(1) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return six.text_type(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return a original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datatime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __hasattr(self, object, name): + return name in object.__class__.__dict__ + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + if not klass.swagger_types and not self.__hasattr(klass, 'get_real_child_model'): + return data + + kwargs = {} + if klass.swagger_types is not None: + for attr, attr_type in six.iteritems(klass.swagger_types): + if (data is not None and + klass.attribute_map[attr] in data and + isinstance(data, (list, dict))): + value = data[klass.attribute_map[attr]] + kwargs[attr] = self.__deserialize(value, attr_type) + + instance = klass(**kwargs) + + if (isinstance(instance, dict) and + klass.swagger_types is not None and + isinstance(data, dict)): + for key, value in data.items(): + if key not in klass.swagger_types: + instance[key] = value + if self.__hasattr(instance, 'get_real_child_model'): + klass_name = instance.get_real_child_model(data) + if klass_name: + instance = self.__deserialize(data, klass_name) + return instance diff --git a/python-client-generated/swagger_client/configuration.py b/python-client-generated/swagger_client/configuration.py new file mode 100644 index 0000000..b4872f6 --- /dev/null +++ b/python-client-generated/swagger_client/configuration.py @@ -0,0 +1,253 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import copy +import logging +import multiprocessing +import sys +import urllib3 + +import six +from six.moves import http_client as httplib + + +class TypeWithDefault(type): + def __init__(cls, name, bases, dct): + super(TypeWithDefault, cls).__init__(name, bases, dct) + cls._default = None + + def __call__(cls): + if cls._default is None: + cls._default = type.__call__(cls) + return copy.copy(cls._default) + + def set_default(cls, default): + cls._default = copy.copy(default) + + +class Configuration(six.with_metaclass(TypeWithDefault, object)): + """NOTE: This class is auto generated by the swagger code generator program. + + Ref: https://github.com/swagger-api/swagger-codegen + Do not edit the class manually. + """ + + def __init__(self): + """Constructor""" + # Default Base url + self.host = "https://virtserver.swaggerhub.com/I2/idMatch/1.0.0" + # Temp file folder for downloading files + self.temp_folder_path = None + + # Authentication Settings + # dict to store API key(s) + self.api_key = {} + # dict to store API prefix (e.g. Bearer) + self.api_key_prefix = {} + # function to refresh API key if expired + self.refresh_api_key_hook = None + # Username for HTTP basic authentication + self.username = "" + # Password for HTTP basic authentication + self.password = "" + # access token for OAuth + self.access_token = "" + # Logging Settings + self.logger = {} + self.logger["package_logger"] = logging.getLogger("swagger_client") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + # Log format + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + # Log stream handler + self.logger_stream_handler = None + # Log file handler + self.logger_file_handler = None + # Debug file location + self.logger_file = None + # Debug switch + self.debug = False + + # SSL/TLS verification + # Set this to false to skip verifying SSL certificate when calling API + # from https server. + self.verify_ssl = True + # Set this to customize the certificate file to verify the peer. + self.ssl_ca_cert = None + # client certificate file + self.cert_file = None + # client key file + self.key_file = None + # Set this to True/False to enable/disable SSL hostname verification. + self.assert_hostname = None + + # urllib3 connection pool's maximum number of connections saved + # per pool. urllib3 uses 1 connection as default value, but this is + # not the best value when you are making a lot of possibly parallel + # requests to the same host, which is often the case here. + # cpu_count * 5 is used as default value to increase performance. + self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + + # Proxy URL + self.proxy = None + # Safe chars for path_param + self.safe_chars_for_path_param = '' + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_file_handler) + if self.logger_stream_handler: + logger.removeHandler(self.logger_stream_handler) + else: + # If not set logging file, + # then add stream handler and remove file handler. + self.logger_stream_handler = logging.StreamHandler() + self.logger_stream_handler.setFormatter(self.logger_formatter) + for _, logger in six.iteritems(self.logger): + logger.addHandler(self.logger_stream_handler) + if self.logger_file_handler: + logger.removeHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in six.iteritems(self.logger): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook: + self.refresh_api_key_hook(self) + + key = self.api_key.get(identifier) + if key: + prefix = self.api_key_prefix.get(identifier) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + def get_basic_auth_token(self): + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + return urllib3.util.make_headers( + basic_auth=self.username + ':' + self.password + ).get('authorization') + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + return { + 'accessCode': + { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + }, + } + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 1.1.1\n"\ + "SDK Package Version: 1.0.0".\ + format(env=sys.platform, pyversion=sys.version) diff --git a/python-client-generated/swagger_client/models/__init__.py b/python-client-generated/swagger_client/models/__init__.py new file mode 100644 index 0000000..1383e68 --- /dev/null +++ b/python-client-generated/swagger_client/models/__init__.py @@ -0,0 +1,24 @@ +# coding: utf-8 + +# flake8: noqa +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +# import models into model package +from swagger_client.models.inline_response200 import InlineResponse200 +from swagger_client.models.inline_response400 import InlineResponse400 +from swagger_client.models.person import Person +from swagger_client.models.person_address import PersonAddress +from swagger_client.models.person_email_address import PersonEmailAddress +from swagger_client.models.person_identifier import PersonIdentifier +from swagger_client.models.person_names import PersonNames +from swagger_client.models.person_telephone_number import PersonTelephoneNumber diff --git a/python-client-generated/swagger_client/models/inline_response200.py b/python-client-generated/swagger_client/models/inline_response200.py new file mode 100644 index 0000000..0b0bf58 --- /dev/null +++ b/python-client-generated/swagger_client/models/inline_response200.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse200(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'artist_name': 'str', + 'artist_genre': 'str', + 'albums_recorded': 'int' + } + + attribute_map = { + 'artist_name': 'artist_name', + 'artist_genre': 'artist_genre', + 'albums_recorded': 'albums_recorded' + } + + def __init__(self, artist_name=None, artist_genre=None, albums_recorded=None): # noqa: E501 + """InlineResponse200 - a model defined in Swagger""" # noqa: E501 + self._artist_name = None + self._artist_genre = None + self._albums_recorded = None + self.discriminator = None + if artist_name is not None: + self.artist_name = artist_name + if artist_genre is not None: + self.artist_genre = artist_genre + if albums_recorded is not None: + self.albums_recorded = albums_recorded + + @property + def artist_name(self): + """Gets the artist_name of this InlineResponse200. # noqa: E501 + + + :return: The artist_name of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._artist_name + + @artist_name.setter + def artist_name(self, artist_name): + """Sets the artist_name of this InlineResponse200. + + + :param artist_name: The artist_name of this InlineResponse200. # noqa: E501 + :type: str + """ + + self._artist_name = artist_name + + @property + def artist_genre(self): + """Gets the artist_genre of this InlineResponse200. # noqa: E501 + + + :return: The artist_genre of this InlineResponse200. # noqa: E501 + :rtype: str + """ + return self._artist_genre + + @artist_genre.setter + def artist_genre(self, artist_genre): + """Sets the artist_genre of this InlineResponse200. + + + :param artist_genre: The artist_genre of this InlineResponse200. # noqa: E501 + :type: str + """ + + self._artist_genre = artist_genre + + @property + def albums_recorded(self): + """Gets the albums_recorded of this InlineResponse200. # noqa: E501 + + + :return: The albums_recorded of this InlineResponse200. # noqa: E501 + :rtype: int + """ + return self._albums_recorded + + @albums_recorded.setter + def albums_recorded(self, albums_recorded): + """Sets the albums_recorded of this InlineResponse200. + + + :param albums_recorded: The albums_recorded of this InlineResponse200. # noqa: E501 + :type: int + """ + + self._albums_recorded = albums_recorded + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse200, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse200): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/inline_response400.py b/python-client-generated/swagger_client/models/inline_response400.py new file mode 100644 index 0000000..5e07c9c --- /dev/null +++ b/python-client-generated/swagger_client/models/inline_response400.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class InlineResponse400(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'message': 'str' + } + + attribute_map = { + 'message': 'message' + } + + def __init__(self, message=None): # noqa: E501 + """InlineResponse400 - a model defined in Swagger""" # noqa: E501 + self._message = None + self.discriminator = None + if message is not None: + self.message = message + + @property + def message(self): + """Gets the message of this InlineResponse400. # noqa: E501 + + + :return: The message of this InlineResponse400. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this InlineResponse400. + + + :param message: The message of this InlineResponse400. # noqa: E501 + :type: str + """ + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(InlineResponse400, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, InlineResponse400): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/person.py b/python-client-generated/swagger_client/models/person.py new file mode 100644 index 0000000..d12b5bd --- /dev/null +++ b/python-client-generated/swagger_client/models/person.py @@ -0,0 +1,319 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class Person(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'sor_id': 'int', + 'date_of_birth': 'str', + 'names': 'list[PersonNames]', + 'address': 'list[PersonAddress]', + 'email_address': 'list[PersonEmailAddress]', + 'identifier': 'list[PersonIdentifier]', + 'primary_affiliation': 'str', + 'gender': 'str', + 'telephone_number': 'list[PersonTelephoneNumber]' + } + + attribute_map = { + 'sor_id': 'sorId', + 'date_of_birth': 'dateOfBirth', + 'names': 'names', + 'address': 'address', + 'email_address': 'emailAddress', + 'identifier': 'identifier', + 'primary_affiliation': 'primaryAffiliation', + 'gender': 'gender', + 'telephone_number': 'telephoneNumber' + } + + def __init__(self, sor_id=None, date_of_birth=None, names=None, address=None, email_address=None, identifier=None, primary_affiliation=None, gender=None, telephone_number=None): # noqa: E501 + """Person - a model defined in Swagger""" # noqa: E501 + self._sor_id = None + self._date_of_birth = None + self._names = None + self._address = None + self._email_address = None + self._identifier = None + self._primary_affiliation = None + self._gender = None + self._telephone_number = None + self.discriminator = None + self.sor_id = sor_id + if date_of_birth is not None: + self.date_of_birth = date_of_birth + if names is not None: + self.names = names + if address is not None: + self.address = address + if email_address is not None: + self.email_address = email_address + if identifier is not None: + self.identifier = identifier + if primary_affiliation is not None: + self.primary_affiliation = primary_affiliation + if gender is not None: + self.gender = gender + if telephone_number is not None: + self.telephone_number = telephone_number + + @property + def sor_id(self): + """Gets the sor_id of this Person. # noqa: E501 + + + :return: The sor_id of this Person. # noqa: E501 + :rtype: int + """ + return self._sor_id + + @sor_id.setter + def sor_id(self, sor_id): + """Sets the sor_id of this Person. + + + :param sor_id: The sor_id of this Person. # noqa: E501 + :type: int + """ + if sor_id is None: + raise ValueError("Invalid value for `sor_id`, must not be `None`") # noqa: E501 + + self._sor_id = sor_id + + @property + def date_of_birth(self): + """Gets the date_of_birth of this Person. # noqa: E501 + + + :return: The date_of_birth of this Person. # noqa: E501 + :rtype: str + """ + return self._date_of_birth + + @date_of_birth.setter + def date_of_birth(self, date_of_birth): + """Sets the date_of_birth of this Person. + + + :param date_of_birth: The date_of_birth of this Person. # noqa: E501 + :type: str + """ + + self._date_of_birth = date_of_birth + + @property + def names(self): + """Gets the names of this Person. # noqa: E501 + + + :return: The names of this Person. # noqa: E501 + :rtype: list[PersonNames] + """ + return self._names + + @names.setter + def names(self, names): + """Sets the names of this Person. + + + :param names: The names of this Person. # noqa: E501 + :type: list[PersonNames] + """ + + self._names = names + + @property + def address(self): + """Gets the address of this Person. # noqa: E501 + + + :return: The address of this Person. # noqa: E501 + :rtype: list[PersonAddress] + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this Person. + + + :param address: The address of this Person. # noqa: E501 + :type: list[PersonAddress] + """ + + self._address = address + + @property + def email_address(self): + """Gets the email_address of this Person. # noqa: E501 + + + :return: The email_address of this Person. # noqa: E501 + :rtype: list[PersonEmailAddress] + """ + return self._email_address + + @email_address.setter + def email_address(self, email_address): + """Sets the email_address of this Person. + + + :param email_address: The email_address of this Person. # noqa: E501 + :type: list[PersonEmailAddress] + """ + + self._email_address = email_address + + @property + def identifier(self): + """Gets the identifier of this Person. # noqa: E501 + + + :return: The identifier of this Person. # noqa: E501 + :rtype: list[PersonIdentifier] + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier): + """Sets the identifier of this Person. + + + :param identifier: The identifier of this Person. # noqa: E501 + :type: list[PersonIdentifier] + """ + + self._identifier = identifier + + @property + def primary_affiliation(self): + """Gets the primary_affiliation of this Person. # noqa: E501 + + + :return: The primary_affiliation of this Person. # noqa: E501 + :rtype: str + """ + return self._primary_affiliation + + @primary_affiliation.setter + def primary_affiliation(self, primary_affiliation): + """Sets the primary_affiliation of this Person. + + + :param primary_affiliation: The primary_affiliation of this Person. # noqa: E501 + :type: str + """ + + self._primary_affiliation = primary_affiliation + + @property + def gender(self): + """Gets the gender of this Person. # noqa: E501 + + + :return: The gender of this Person. # noqa: E501 + :rtype: str + """ + return self._gender + + @gender.setter + def gender(self, gender): + """Sets the gender of this Person. + + + :param gender: The gender of this Person. # noqa: E501 + :type: str + """ + + self._gender = gender + + @property + def telephone_number(self): + """Gets the telephone_number of this Person. # noqa: E501 + + + :return: The telephone_number of this Person. # noqa: E501 + :rtype: list[PersonTelephoneNumber] + """ + return self._telephone_number + + @telephone_number.setter + def telephone_number(self, telephone_number): + """Sets the telephone_number of this Person. + + + :param telephone_number: The telephone_number of this Person. # noqa: E501 + :type: list[PersonTelephoneNumber] + """ + + self._telephone_number = telephone_number + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Person, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Person): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/person_address.py b/python-client-generated/swagger_client/models/person_address.py new file mode 100644 index 0000000..3e7edff --- /dev/null +++ b/python-client-generated/swagger_client/models/person_address.py @@ -0,0 +1,344 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PersonAddress(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'country': 'str', + 'formatted': 'str', + 'language': 'str', + 'locality': 'str', + 'postal_code': 'str', + 'region': 'str', + 'room': 'str', + 'street_address': 'str', + 'type': 'str', + 'verified': 'str' + } + + attribute_map = { + 'country': 'country', + 'formatted': 'formatted', + 'language': 'language', + 'locality': 'locality', + 'postal_code': 'postalCode', + 'region': 'region', + 'room': 'room', + 'street_address': 'streetAddress', + 'type': 'type', + 'verified': 'verified' + } + + def __init__(self, country=None, formatted=None, language=None, locality=None, postal_code=None, region=None, room=None, street_address=None, type=None, verified=None): # noqa: E501 + """PersonAddress - a model defined in Swagger""" # noqa: E501 + self._country = None + self._formatted = None + self._language = None + self._locality = None + self._postal_code = None + self._region = None + self._room = None + self._street_address = None + self._type = None + self._verified = None + self.discriminator = None + if country is not None: + self.country = country + if formatted is not None: + self.formatted = formatted + if language is not None: + self.language = language + if locality is not None: + self.locality = locality + if postal_code is not None: + self.postal_code = postal_code + if region is not None: + self.region = region + if room is not None: + self.room = room + if street_address is not None: + self.street_address = street_address + if type is not None: + self.type = type + if verified is not None: + self.verified = verified + + @property + def country(self): + """Gets the country of this PersonAddress. # noqa: E501 + + + :return: The country of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._country + + @country.setter + def country(self, country): + """Sets the country of this PersonAddress. + + + :param country: The country of this PersonAddress. # noqa: E501 + :type: str + """ + + self._country = country + + @property + def formatted(self): + """Gets the formatted of this PersonAddress. # noqa: E501 + + + :return: The formatted of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._formatted + + @formatted.setter + def formatted(self, formatted): + """Sets the formatted of this PersonAddress. + + + :param formatted: The formatted of this PersonAddress. # noqa: E501 + :type: str + """ + + self._formatted = formatted + + @property + def language(self): + """Gets the language of this PersonAddress. # noqa: E501 + + + :return: The language of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._language + + @language.setter + def language(self, language): + """Sets the language of this PersonAddress. + + + :param language: The language of this PersonAddress. # noqa: E501 + :type: str + """ + + self._language = language + + @property + def locality(self): + """Gets the locality of this PersonAddress. # noqa: E501 + + + :return: The locality of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._locality + + @locality.setter + def locality(self, locality): + """Sets the locality of this PersonAddress. + + + :param locality: The locality of this PersonAddress. # noqa: E501 + :type: str + """ + + self._locality = locality + + @property + def postal_code(self): + """Gets the postal_code of this PersonAddress. # noqa: E501 + + + :return: The postal_code of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._postal_code + + @postal_code.setter + def postal_code(self, postal_code): + """Sets the postal_code of this PersonAddress. + + + :param postal_code: The postal_code of this PersonAddress. # noqa: E501 + :type: str + """ + + self._postal_code = postal_code + + @property + def region(self): + """Gets the region of this PersonAddress. # noqa: E501 + + + :return: The region of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._region + + @region.setter + def region(self, region): + """Sets the region of this PersonAddress. + + + :param region: The region of this PersonAddress. # noqa: E501 + :type: str + """ + + self._region = region + + @property + def room(self): + """Gets the room of this PersonAddress. # noqa: E501 + + + :return: The room of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._room + + @room.setter + def room(self, room): + """Sets the room of this PersonAddress. + + + :param room: The room of this PersonAddress. # noqa: E501 + :type: str + """ + + self._room = room + + @property + def street_address(self): + """Gets the street_address of this PersonAddress. # noqa: E501 + + + :return: The street_address of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._street_address + + @street_address.setter + def street_address(self, street_address): + """Sets the street_address of this PersonAddress. + + + :param street_address: The street_address of this PersonAddress. # noqa: E501 + :type: str + """ + + self._street_address = street_address + + @property + def type(self): + """Gets the type of this PersonAddress. # noqa: E501 + + + :return: The type of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PersonAddress. + + + :param type: The type of this PersonAddress. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def verified(self): + """Gets the verified of this PersonAddress. # noqa: E501 + + + :return: The verified of this PersonAddress. # noqa: E501 + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified): + """Sets the verified of this PersonAddress. + + + :param verified: The verified of this PersonAddress. # noqa: E501 + :type: str + """ + + self._verified = verified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PersonAddress, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PersonAddress): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/person_email_address.py b/python-client-generated/swagger_client/models/person_email_address.py new file mode 100644 index 0000000..3e227c2 --- /dev/null +++ b/python-client-generated/swagger_client/models/person_email_address.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PersonEmailAddress(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'address': 'str', + 'type': 'str', + 'verified': 'str' + } + + attribute_map = { + 'address': 'address', + 'type': 'type', + 'verified': 'verified' + } + + def __init__(self, address=None, type=None, verified=None): # noqa: E501 + """PersonEmailAddress - a model defined in Swagger""" # noqa: E501 + self._address = None + self._type = None + self._verified = None + self.discriminator = None + if address is not None: + self.address = address + if type is not None: + self.type = type + if verified is not None: + self.verified = verified + + @property + def address(self): + """Gets the address of this PersonEmailAddress. # noqa: E501 + + + :return: The address of this PersonEmailAddress. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this PersonEmailAddress. + + + :param address: The address of this PersonEmailAddress. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def type(self): + """Gets the type of this PersonEmailAddress. # noqa: E501 + + + :return: The type of this PersonEmailAddress. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PersonEmailAddress. + + + :param type: The type of this PersonEmailAddress. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def verified(self): + """Gets the verified of this PersonEmailAddress. # noqa: E501 + + + :return: The verified of this PersonEmailAddress. # noqa: E501 + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified): + """Sets the verified of this PersonEmailAddress. + + + :param verified: The verified of this PersonEmailAddress. # noqa: E501 + :type: str + """ + + self._verified = verified + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PersonEmailAddress, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PersonEmailAddress): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/person_identifier.py b/python-client-generated/swagger_client/models/person_identifier.py new file mode 100644 index 0000000..ad0455d --- /dev/null +++ b/python-client-generated/swagger_client/models/person_identifier.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PersonIdentifier(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'id': 'str', + 'type': 'str' + } + + attribute_map = { + 'id': 'id', + 'type': 'type' + } + + def __init__(self, id=None, type=None): # noqa: E501 + """PersonIdentifier - a model defined in Swagger""" # noqa: E501 + self._id = None + self._type = None + self.discriminator = None + if id is not None: + self.id = id + if type is not None: + self.type = type + + @property + def id(self): + """Gets the id of this PersonIdentifier. # noqa: E501 + + + :return: The id of this PersonIdentifier. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this PersonIdentifier. + + + :param id: The id of this PersonIdentifier. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def type(self): + """Gets the type of this PersonIdentifier. # noqa: E501 + + + :return: The type of this PersonIdentifier. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PersonIdentifier. + + + :param type: The type of this PersonIdentifier. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PersonIdentifier, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PersonIdentifier): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/person_names.py b/python-client-generated/swagger_client/models/person_names.py new file mode 100644 index 0000000..a6013e4 --- /dev/null +++ b/python-client-generated/swagger_client/models/person_names.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PersonNames(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'type': 'str', + 'given': 'str', + 'family': 'str' + } + + attribute_map = { + 'type': 'type', + 'given': 'given', + 'family': 'family' + } + + def __init__(self, type=None, given=None, family=None): # noqa: E501 + """PersonNames - a model defined in Swagger""" # noqa: E501 + self._type = None + self._given = None + self._family = None + self.discriminator = None + if type is not None: + self.type = type + if given is not None: + self.given = given + if family is not None: + self.family = family + + @property + def type(self): + """Gets the type of this PersonNames. # noqa: E501 + + + :return: The type of this PersonNames. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PersonNames. + + + :param type: The type of this PersonNames. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def given(self): + """Gets the given of this PersonNames. # noqa: E501 + + + :return: The given of this PersonNames. # noqa: E501 + :rtype: str + """ + return self._given + + @given.setter + def given(self, given): + """Sets the given of this PersonNames. + + + :param given: The given of this PersonNames. # noqa: E501 + :type: str + """ + + self._given = given + + @property + def family(self): + """Gets the family of this PersonNames. # noqa: E501 + + + :return: The family of this PersonNames. # noqa: E501 + :rtype: str + """ + return self._family + + @family.setter + def family(self, family): + """Sets the family of this PersonNames. + + + :param family: The family of this PersonNames. # noqa: E501 + :type: str + """ + + self._family = family + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PersonNames, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PersonNames): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/models/person_telephone_number.py b/python-client-generated/swagger_client/models/person_telephone_number.py new file mode 100644 index 0000000..07add59 --- /dev/null +++ b/python-client-generated/swagger_client/models/person_telephone_number.py @@ -0,0 +1,136 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class PersonTelephoneNumber(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'number': 'str', + 'type': 'str' + } + + attribute_map = { + 'number': 'number', + 'type': 'type' + } + + def __init__(self, number=None, type=None): # noqa: E501 + """PersonTelephoneNumber - a model defined in Swagger""" # noqa: E501 + self._number = None + self._type = None + self.discriminator = None + if number is not None: + self.number = number + if type is not None: + self.type = type + + @property + def number(self): + """Gets the number of this PersonTelephoneNumber. # noqa: E501 + + + :return: The number of this PersonTelephoneNumber. # noqa: E501 + :rtype: str + """ + return self._number + + @number.setter + def number(self, number): + """Sets the number of this PersonTelephoneNumber. + + + :param number: The number of this PersonTelephoneNumber. # noqa: E501 + :type: str + """ + + self._number = number + + @property + def type(self): + """Gets the type of this PersonTelephoneNumber. # noqa: E501 + + + :return: The type of this PersonTelephoneNumber. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this PersonTelephoneNumber. + + + :param type: The type of this PersonTelephoneNumber. # noqa: E501 + :type: str + """ + + self._type = type + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(PersonTelephoneNumber, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PersonTelephoneNumber): + return False + + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-client-generated/swagger_client/rest.py b/python-client-generated/swagger_client/rest.py new file mode 100644 index 0000000..9bf8ea8 --- /dev/null +++ b/python-client-generated/swagger_client/rest.py @@ -0,0 +1,322 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import io +import json +import logging +import re +import ssl + +import certifi +# python 2 and python 3 compatibility library +import six +from six.moves.urllib.parse import urlencode + +try: + import urllib3 +except ImportError: + raise ImportError('Swagger python client requires urllib3.') + + +logger = logging.getLogger(__name__) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp): + self.urllib3_response = resp + self.status = resp.status + self.reason = resp.reason + self.data = resp.data + + def getheaders(self): + """Returns a dictionary of the response headers.""" + return self.urllib3_response.getheaders() + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.urllib3_response.getheader(name, default) + + +class RESTClientObject(object): + + def __init__(self, configuration, pools_size=4, maxsize=None): + # urllib3.PoolManager will pass all kw parameters to connectionpool + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 + # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 + # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 + # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 + + # cert_reqs + if configuration.verify_ssl: + cert_reqs = ssl.CERT_REQUIRED + else: + cert_reqs = ssl.CERT_NONE + + # ca_certs + if configuration.ssl_ca_cert: + ca_certs = configuration.ssl_ca_cert + else: + # if not set certificate file, use Mozilla's root certificates. + ca_certs = certifi.where() + + addition_pool_args = {} + if configuration.assert_hostname is not None: + addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + + if maxsize is None: + if configuration.connection_pool_maxsize is not None: + maxsize = configuration.connection_pool_maxsize + else: + maxsize = 4 + + # https pool manager + if configuration.proxy: + self.pool_manager = urllib3.ProxyManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + proxy_url=configuration.proxy, + **addition_pool_args + ) + else: + self.pool_manager = urllib3.PoolManager( + num_pools=pools_size, + maxsize=maxsize, + cert_reqs=cert_reqs, + ca_certs=ca_certs, + cert_file=configuration.cert_file, + key_file=configuration.key_file, + **addition_pool_args + ) + + def request(self, method, url, query_params=None, headers=None, + body=None, post_params=None, _preload_content=True, + _request_timeout=None): + """Perform requests. + + :param method: http request method + :param url: http request url + :param query_params: query parameters in the url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', + 'PATCH', 'OPTIONS'] + + if post_params and body: + raise ValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + + timeout = None + if _request_timeout: + if isinstance(_request_timeout, (int, ) if six.PY3 else (int, long)): # noqa: E501,F821 + timeout = urllib3.Timeout(total=_request_timeout) + elif (isinstance(_request_timeout, tuple) and + len(_request_timeout) == 2): + timeout = urllib3.Timeout( + connect=_request_timeout[0], read=_request_timeout[1]) + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + try: + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if query_params: + url += '?' + urlencode(query_params) + if re.search('json', headers['Content-Type'], re.IGNORECASE): + request_body = '{}' + if body is not None: + request_body = json.dumps(body) + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=False, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by urllib3 will be + # overwritten. + del headers['Content-Type'] + r = self.pool_manager.request( + method, url, + fields=post_params, + encode_multipart=True, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + # Pass a `string` parameter directly in the body to support + # other content types than Json when `body` argument is + # provided in serialized form + elif isinstance(body, str): + request_body = body + r = self.pool_manager.request( + method, url, + body=request_body, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + # For `GET`, `HEAD` + else: + r = self.pool_manager.request(method, url, + fields=query_params, + preload_content=_preload_content, + timeout=timeout, + headers=headers) + except urllib3.exceptions.SSLError as e: + msg = "{0}\n{1}".format(type(e).__name__, str(e)) + raise ApiException(status=0, reason=msg) + + if _preload_content: + r = RESTResponse(r) + + # In the python 3, the response.data is bytes. + # we need to decode it to string. + if six.PY3: + r.data = r.data.decode('utf8') + + # log response body + logger.debug("response body: %s", r.data) + + if not 200 <= r.status <= 299: + raise ApiException(http_resp=r) + + return r + + def GET(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("GET", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def HEAD(self, url, headers=None, query_params=None, _preload_content=True, + _request_timeout=None): + return self.request("HEAD", url, + headers=headers, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + query_params=query_params) + + def OPTIONS(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("OPTIONS", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def DELETE(self, url, headers=None, query_params=None, body=None, + _preload_content=True, _request_timeout=None): + return self.request("DELETE", url, + headers=headers, + query_params=query_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def POST(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("POST", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PUT(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PUT", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + def PATCH(self, url, headers=None, query_params=None, post_params=None, + body=None, _preload_content=True, _request_timeout=None): + return self.request("PATCH", url, + headers=headers, + query_params=query_params, + post_params=post_params, + _preload_content=_preload_content, + _request_timeout=_request_timeout, + body=body) + + +class ApiException(Exception): + + def __init__(self, status=None, reason=None, http_resp=None): + if http_resp: + self.status = http_resp.status + self.reason = http_resp.reason + self.body = http_resp.data + self.headers = http_resp.getheaders() + else: + self.status = status + self.reason = reason + self.body = None + self.headers = None + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + return error_message diff --git a/python-client-generated/test-requirements.txt b/python-client-generated/test-requirements.txt new file mode 100644 index 0000000..2702246 --- /dev/null +++ b/python-client-generated/test-requirements.txt @@ -0,0 +1,5 @@ +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/python-client-generated/test/__init__.py b/python-client-generated/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python-client-generated/test/test_default_api.py b/python-client-generated/test/test_default_api.py new file mode 100644 index 0000000..c64b746 --- /dev/null +++ b/python-client-generated/test/test_default_api.py @@ -0,0 +1,65 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.api.default_api import DefaultApi # noqa: E501 +from swagger_client.rest import ApiException + + +class TestDefaultApi(unittest.TestCase): + """DefaultApi unit test stubs""" + + def setUp(self): + self.api = DefaultApi() # noqa: E501 + + def tearDown(self): + pass + + def test_example_get(self): + """Test case for example_get + + Server example operation # noqa: E501 + """ + pass + + def test_ping_get(self): + """Test case for ping_get + + Server heartbeat operation # noqa: E501 + """ + pass + + def test_sis_get(self): + """Test case for sis_get + + """ + pass + + def test_sis_post(self): + """Test case for sis_post + + """ + pass + + def test_sis_sor_id_get(self): + """Test case for sis_sor_id_get + + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_inline_response200.py b/python-client-generated/test/test_inline_response200.py new file mode 100644 index 0000000..c87dda8 --- /dev/null +++ b/python-client-generated/test/test_inline_response200.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.inline_response200 import InlineResponse200 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestInlineResponse200(unittest.TestCase): + """InlineResponse200 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse200(self): + """Test InlineResponse200""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.inline_response200.InlineResponse200() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_inline_response400.py b/python-client-generated/test/test_inline_response400.py new file mode 100644 index 0000000..e620e1b --- /dev/null +++ b/python-client-generated/test/test_inline_response400.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.inline_response400 import InlineResponse400 # noqa: E501 +from swagger_client.rest import ApiException + + +class TestInlineResponse400(unittest.TestCase): + """InlineResponse400 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInlineResponse400(self): + """Test InlineResponse400""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.inline_response400.InlineResponse400() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_person.py b/python-client-generated/test/test_person.py new file mode 100644 index 0000000..3ee4a3c --- /dev/null +++ b/python-client-generated/test/test_person.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.person import Person # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPerson(unittest.TestCase): + """Person unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPerson(self): + """Test Person""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.person.Person() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_person_address.py b/python-client-generated/test/test_person_address.py new file mode 100644 index 0000000..a5800b5 --- /dev/null +++ b/python-client-generated/test/test_person_address.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.person_address import PersonAddress # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPersonAddress(unittest.TestCase): + """PersonAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPersonAddress(self): + """Test PersonAddress""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.person_address.PersonAddress() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_person_email_address.py b/python-client-generated/test/test_person_email_address.py new file mode 100644 index 0000000..72de13d --- /dev/null +++ b/python-client-generated/test/test_person_email_address.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.person_email_address import PersonEmailAddress # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPersonEmailAddress(unittest.TestCase): + """PersonEmailAddress unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPersonEmailAddress(self): + """Test PersonEmailAddress""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.person_email_address.PersonEmailAddress() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_person_identifier.py b/python-client-generated/test/test_person_identifier.py new file mode 100644 index 0000000..a214c58 --- /dev/null +++ b/python-client-generated/test/test_person_identifier.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.person_identifier import PersonIdentifier # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPersonIdentifier(unittest.TestCase): + """PersonIdentifier unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPersonIdentifier(self): + """Test PersonIdentifier""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.person_identifier.PersonIdentifier() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_person_names.py b/python-client-generated/test/test_person_names.py new file mode 100644 index 0000000..d9c14bf --- /dev/null +++ b/python-client-generated/test/test_person_names.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.person_names import PersonNames # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPersonNames(unittest.TestCase): + """PersonNames unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPersonNames(self): + """Test PersonNames""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.person_names.PersonNames() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/test/test_person_telephone_number.py b/python-client-generated/test/test_person_telephone_number.py new file mode 100644 index 0000000..dc9aa23 --- /dev/null +++ b/python-client-generated/test/test_person_telephone_number.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + ID Match API + + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group # noqa: E501 + + OpenAPI spec version: 1.1.1 + + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +from __future__ import absolute_import + +import unittest + +import swagger_client +from swagger_client.models.person_telephone_number import PersonTelephoneNumber # noqa: E501 +from swagger_client.rest import ApiException + + +class TestPersonTelephoneNumber(unittest.TestCase): + """PersonTelephoneNumber unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testPersonTelephoneNumber(self): + """Test PersonTelephoneNumber""" + # FIXME: construct object with mandatory attributes with example values + # model = swagger_client.models.person_telephone_number.PersonTelephoneNumber() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python-client-generated/tox.ini b/python-client-generated/tox.ini new file mode 100644 index 0000000..a310bec --- /dev/null +++ b/python-client-generated/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py3 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] diff --git a/python-flask-server-generated/.dockerignore b/python-flask-server-generated/.dockerignore new file mode 100644 index 0000000..cdd823e --- /dev/null +++ b/python-flask-server-generated/.dockerignore @@ -0,0 +1,72 @@ +.travis.yaml +.swagger-codegen-ignore +README.md +tox.ini +git_push.sh +test-requirements.txt +setup.py + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/python-flask-server-generated/.gitignore b/python-flask-server-generated/.gitignore new file mode 100644 index 0000000..a655050 --- /dev/null +++ b/python-flask-server-generated/.gitignore @@ -0,0 +1,64 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*,cover +.hypothesis/ +venv/ +.python-version + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +#Ipython Notebook +.ipynb_checkpoints diff --git a/python-flask-server-generated/.idea/.gitignore b/python-flask-server-generated/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/python-flask-server-generated/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/python-flask-server-generated/.idea/inspectionProfiles/profiles_settings.xml b/python-flask-server-generated/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/python-flask-server-generated/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/python-flask-server-generated/.idea/misc.xml b/python-flask-server-generated/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/python-flask-server-generated/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/python-flask-server-generated/.idea/modules.xml b/python-flask-server-generated/.idea/modules.xml new file mode 100644 index 0000000..7671f40 --- /dev/null +++ b/python-flask-server-generated/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/python-flask-server-generated/.idea/python-flask-server-generated.iml b/python-flask-server-generated/.idea/python-flask-server-generated.iml new file mode 100644 index 0000000..8b8c395 --- /dev/null +++ b/python-flask-server-generated/.idea/python-flask-server-generated.iml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/python-flask-server-generated/.swagger-codegen-ignore b/python-flask-server-generated/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/python-flask-server-generated/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/python-flask-server-generated/.swagger-codegen/VERSION b/python-flask-server-generated/.swagger-codegen/VERSION new file mode 100644 index 0000000..402b44e --- /dev/null +++ b/python-flask-server-generated/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.21 \ No newline at end of file diff --git a/python-flask-server-generated/.travis.yml b/python-flask-server-generated/.travis.yml new file mode 100644 index 0000000..dd6c445 --- /dev/null +++ b/python-flask-server-generated/.travis.yml @@ -0,0 +1,13 @@ +# ref: https://docs.travis-ci.com/user/languages/python +language: python +python: + - "3.2" + - "3.3" + - "3.4" + - "3.5" + #- "3.5-dev" # 3.5 development branch + #- "nightly" # points to the latest development branch e.g. 3.6-dev +# command to install dependencies +install: "pip install -r requirements.txt" +# command to run tests +script: nosetests diff --git a/python-flask-server-generated/Dockerfile b/python-flask-server-generated/Dockerfile new file mode 100644 index 0000000..f9243a5 --- /dev/null +++ b/python-flask-server-generated/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.6-alpine + +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY requirements.txt /usr/src/app/ + +RUN pip3 install --no-cache-dir -r requirements.txt + +COPY . /usr/src/app + +EXPOSE 8080 + +ENTRYPOINT ["python3"] + +CMD ["-m", "swagger_server"] \ No newline at end of file diff --git a/python-flask-server-generated/README.md b/python-flask-server-generated/README.md new file mode 100644 index 0000000..911693a --- /dev/null +++ b/python-flask-server-generated/README.md @@ -0,0 +1,49 @@ +# Swagger generated server + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the +[OpenAPI-Spec](https://github.com/swagger-api/swagger-core/wiki) from a remote server, you can easily generate a server stub. This +is an example of building a swagger-enabled Flask server. + +This example uses the [Connexion](https://github.com/zalando/connexion) library on top of Flask. + +## Requirements +Python 3.5.2+ + +## Usage +To run the server, please execute the following from the root directory: + +``` +pip3 install -r requirements.txt +python3 -m swagger_server +``` + +and open your browser to here: + +``` +http://localhost:8080/I2/idMatch/1.0.0/ui/ +``` + +Your Swagger definition lives here: + +``` +http://localhost:8080/I2/idMatch/1.0.0/swagger.json +``` + +To launch the integration tests, use tox: +``` +sudo pip install tox +tox +``` + +## Running with Docker + +To run the server on a Docker container, please execute the following from the root directory: + +```bash +# building the image +docker build -t swagger_server . + +# starting up a container +docker run -p 8080:8080 swagger_server +``` \ No newline at end of file diff --git a/python-flask-server-generated/git_push.sh b/python-flask-server-generated/git_push.sh new file mode 100644 index 0000000..160f6f2 --- /dev/null +++ b/python-flask-server-generated/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="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/python-flask-server-generated/requirements.txt b/python-flask-server-generated/requirements.txt new file mode 100644 index 0000000..b5bc506 --- /dev/null +++ b/python-flask-server-generated/requirements.txt @@ -0,0 +1,3 @@ +connexion == 2.2.0 +python_dateutil == 2.6.0 +setuptools >= 21.0.0 diff --git a/python-flask-server-generated/setup.py b/python-flask-server-generated/setup.py new file mode 100644 index 0000000..aa8d5c9 --- /dev/null +++ b/python-flask-server-generated/setup.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +import sys +from setuptools import setup, find_packages + +NAME = "swagger_server" +VERSION = "1.0.0" +# To install the library, run the following +# +# python setup.py install +# +# prerequisite: setuptools +# http://pypi.python.org/pypi/setuptools + +REQUIRES = ["connexion"] + +setup( + name=NAME, + version=VERSION, + description="ID Match API", + author_email="", + url="", + keywords=["Swagger", "ID Match API"], + install_requires=REQUIRES, + packages=find_packages(), + package_data={'': ['swagger/swagger.yaml']}, + include_package_data=True, + entry_points={ + 'console_scripts': ['swagger_server=swagger_server.__main__:main']}, + long_description="""\ + ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group + """ +) diff --git a/python-flask-server-generated/swagger_server/__init__.py b/python-flask-server-generated/swagger_server/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python-flask-server-generated/swagger_server/__main__.py b/python-flask-server-generated/swagger_server/__main__.py new file mode 100644 index 0000000..8a6a0a2 --- /dev/null +++ b/python-flask-server-generated/swagger_server/__main__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 + +import connexion + +from swagger_server import encoder + + +def main(): + app = connexion.App(__name__, specification_dir='./swagger/') + app.app.json_encoder = encoder.JSONEncoder + app.add_api('swagger.yaml', arguments={'title': 'ID Match API'}, pythonic_params=True) + app.run(port=8080) + + +if __name__ == '__main__': + main() diff --git a/python-flask-server-generated/swagger_server/controllers/__init__.py b/python-flask-server-generated/swagger_server/controllers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/python-flask-server-generated/swagger_server/controllers/authorization_controller.py b/python-flask-server-generated/swagger_server/controllers/authorization_controller.py new file mode 100644 index 0000000..3b446b7 --- /dev/null +++ b/python-flask-server-generated/swagger_server/controllers/authorization_controller.py @@ -0,0 +1,12 @@ +from typing import List +""" +controller generated to handled auth operation described at: +https://connexion.readthedocs.io/en/latest/security.html +""" +def check_accessCode(token): + return {'scopes': ['read:pets', 'write:pets'], 'uid': 'test_value'} + +def validate_scope_accessCode(required_scopes, token_scopes): + return set(required_scopes).issubset(set(token_scopes)) + + diff --git a/python-flask-server-generated/swagger_server/controllers/default_controller.py b/python-flask-server-generated/swagger_server/controllers/default_controller.py new file mode 100644 index 0000000..7998936 --- /dev/null +++ b/python-flask-server-generated/swagger_server/controllers/default_controller.py @@ -0,0 +1,72 @@ +import connexion +import six + +from swagger_server.models.inline_response200 import InlineResponse200 # noqa: E501 +from swagger_server.models.inline_response400 import InlineResponse400 # noqa: E501 +from swagger_server.models.person import Person # noqa: E501 +from swagger_server import util + + +def example_get(): # noqa: E501 + """Server example operation + + This is an example operation to show how security is applied to the call. # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def ping_get(): # noqa: E501 + """Server heartbeat operation + + This operation shows how to override the global security defined above, as we want to open it up for all users. # noqa: E501 + + + :rtype: None + """ + return 'do some magic!' + + +def sis_get(limit=None, offset=None): # noqa: E501 + """sis_get + + Returns a list of people # noqa: E501 + + :param limit: Limits the number of items on a page + :type limit: int + :param offset: Specifies the page number of the artists to be displayed + :type offset: int + + :rtype: List[Person] + """ + return 'do some magic!' + + +def sis_post(body): # noqa: E501 + """sis_post + + Get a reference ID for an SoR person # noqa: E501 + + :param body: + :type body: dict | bytes + + :rtype: None + """ + if connexion.request.is_json: + body = Person.from_dict(connexion.request.get_json()) # noqa: E501 + return 'do some magic!' + + +def sis_sor_id_get(sor_id): # noqa: E501 + """sis_sor_id_get + + Obtain information about an person from his or her sorId # noqa: E501 + + :param sor_id: + :type sor_id: str + + :rtype: InlineResponse200 + """ + return 'do some magic!' diff --git a/python-flask-server-generated/swagger_server/encoder.py b/python-flask-server-generated/swagger_server/encoder.py new file mode 100644 index 0000000..61ba472 --- /dev/null +++ b/python-flask-server-generated/swagger_server/encoder.py @@ -0,0 +1,20 @@ +from connexion.apps.flask_app import FlaskJSONEncoder +import six + +from swagger_server.models.base_model_ import Model + + +class JSONEncoder(FlaskJSONEncoder): + include_nulls = False + + def default(self, o): + if isinstance(o, Model): + dikt = {} + for attr, _ in six.iteritems(o.swagger_types): + value = getattr(o, attr) + if value is None and not self.include_nulls: + continue + attr = o.attribute_map[attr] + dikt[attr] = value + return dikt + return FlaskJSONEncoder.default(self, o) diff --git a/python-flask-server-generated/swagger_server/models/__init__.py b/python-flask-server-generated/swagger_server/models/__init__.py new file mode 100644 index 0000000..9850cb2 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/__init__.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +# flake8: noqa +from __future__ import absolute_import +# import models into model package +from swagger_server.models.inline_response200 import InlineResponse200 +from swagger_server.models.inline_response400 import InlineResponse400 +from swagger_server.models.person import Person +from swagger_server.models.person_address import PersonAddress +from swagger_server.models.person_email_address import PersonEmailAddress +from swagger_server.models.person_identifier import PersonIdentifier +from swagger_server.models.person_names import PersonNames +from swagger_server.models.person_telephone_number import PersonTelephoneNumber diff --git a/python-flask-server-generated/swagger_server/models/base_model_.py b/python-flask-server-generated/swagger_server/models/base_model_.py new file mode 100644 index 0000000..97999c3 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/base_model_.py @@ -0,0 +1,69 @@ +import pprint + +import six +import typing + +from swagger_server import util + +T = typing.TypeVar('T') + + +class Model(object): + # swaggerTypes: The key is attribute name and the + # value is attribute type. + swagger_types = {} + + # attributeMap: The key is attribute name and the + # value is json key in definition. + attribute_map = {} + + @classmethod + def from_dict(cls: typing.Type[T], dikt) -> T: + """Returns the dict as a model""" + return util.deserialize_model(dikt, cls) + + def to_dict(self): + """Returns the model properties as a dict + + :rtype: dict + """ + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model + + :rtype: str + """ + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + return self.__dict__ == other.__dict__ + + def __ne__(self, other): + """Returns true if both objects are not equal""" + return not self == other diff --git a/python-flask-server-generated/swagger_server/models/inline_response200.py b/python-flask-server-generated/swagger_server/models/inline_response200.py new file mode 100644 index 0000000..dfae7a8 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/inline_response200.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class InlineResponse200(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, artist_name: str=None, artist_genre: str=None, albums_recorded: int=None): # noqa: E501 + """InlineResponse200 - a model defined in Swagger + + :param artist_name: The artist_name of this InlineResponse200. # noqa: E501 + :type artist_name: str + :param artist_genre: The artist_genre of this InlineResponse200. # noqa: E501 + :type artist_genre: str + :param albums_recorded: The albums_recorded of this InlineResponse200. # noqa: E501 + :type albums_recorded: int + """ + self.swagger_types = { + 'artist_name': str, + 'artist_genre': str, + 'albums_recorded': int + } + + self.attribute_map = { + 'artist_name': 'artist_name', + 'artist_genre': 'artist_genre', + 'albums_recorded': 'albums_recorded' + } + self._artist_name = artist_name + self._artist_genre = artist_genre + self._albums_recorded = albums_recorded + + @classmethod + def from_dict(cls, dikt) -> 'InlineResponse200': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The inline_response_200 of this InlineResponse200. # noqa: E501 + :rtype: InlineResponse200 + """ + return util.deserialize_model(dikt, cls) + + @property + def artist_name(self) -> str: + """Gets the artist_name of this InlineResponse200. + + + :return: The artist_name of this InlineResponse200. + :rtype: str + """ + return self._artist_name + + @artist_name.setter + def artist_name(self, artist_name: str): + """Sets the artist_name of this InlineResponse200. + + + :param artist_name: The artist_name of this InlineResponse200. + :type artist_name: str + """ + + self._artist_name = artist_name + + @property + def artist_genre(self) -> str: + """Gets the artist_genre of this InlineResponse200. + + + :return: The artist_genre of this InlineResponse200. + :rtype: str + """ + return self._artist_genre + + @artist_genre.setter + def artist_genre(self, artist_genre: str): + """Sets the artist_genre of this InlineResponse200. + + + :param artist_genre: The artist_genre of this InlineResponse200. + :type artist_genre: str + """ + + self._artist_genre = artist_genre + + @property + def albums_recorded(self) -> int: + """Gets the albums_recorded of this InlineResponse200. + + + :return: The albums_recorded of this InlineResponse200. + :rtype: int + """ + return self._albums_recorded + + @albums_recorded.setter + def albums_recorded(self, albums_recorded: int): + """Sets the albums_recorded of this InlineResponse200. + + + :param albums_recorded: The albums_recorded of this InlineResponse200. + :type albums_recorded: int + """ + + self._albums_recorded = albums_recorded diff --git a/python-flask-server-generated/swagger_server/models/inline_response400.py b/python-flask-server-generated/swagger_server/models/inline_response400.py new file mode 100644 index 0000000..39a19f6 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/inline_response400.py @@ -0,0 +1,62 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class InlineResponse400(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, message: str=None): # noqa: E501 + """InlineResponse400 - a model defined in Swagger + + :param message: The message of this InlineResponse400. # noqa: E501 + :type message: str + """ + self.swagger_types = { + 'message': str + } + + self.attribute_map = { + 'message': 'message' + } + self._message = message + + @classmethod + def from_dict(cls, dikt) -> 'InlineResponse400': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The inline_response_400 of this InlineResponse400. # noqa: E501 + :rtype: InlineResponse400 + """ + return util.deserialize_model(dikt, cls) + + @property + def message(self) -> str: + """Gets the message of this InlineResponse400. + + + :return: The message of this InlineResponse400. + :rtype: str + """ + return self._message + + @message.setter + def message(self, message: str): + """Sets the message of this InlineResponse400. + + + :param message: The message of this InlineResponse400. + :type message: str + """ + + self._message = message diff --git a/python-flask-server-generated/swagger_server/models/person.py b/python-flask-server-generated/swagger_server/models/person.py new file mode 100644 index 0000000..036bcb4 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/person.py @@ -0,0 +1,277 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server.models.person_address import PersonAddress # noqa: F401,E501 +from swagger_server.models.person_email_address import PersonEmailAddress # noqa: F401,E501 +from swagger_server.models.person_identifier import PersonIdentifier # noqa: F401,E501 +from swagger_server.models.person_names import PersonNames # noqa: F401,E501 +from swagger_server.models.person_telephone_number import PersonTelephoneNumber # noqa: F401,E501 +from swagger_server import util + + +class Person(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, sor_id: int=None, date_of_birth: str=None, names: List[PersonNames]=None, address: List[PersonAddress]=None, email_address: List[PersonEmailAddress]=None, identifier: List[PersonIdentifier]=None, primary_affiliation: str=None, gender: str=None, telephone_number: List[PersonTelephoneNumber]=None): # noqa: E501 + """Person - a model defined in Swagger + + :param sor_id: The sor_id of this Person. # noqa: E501 + :type sor_id: int + :param date_of_birth: The date_of_birth of this Person. # noqa: E501 + :type date_of_birth: str + :param names: The names of this Person. # noqa: E501 + :type names: List[PersonNames] + :param address: The address of this Person. # noqa: E501 + :type address: List[PersonAddress] + :param email_address: The email_address of this Person. # noqa: E501 + :type email_address: List[PersonEmailAddress] + :param identifier: The identifier of this Person. # noqa: E501 + :type identifier: List[PersonIdentifier] + :param primary_affiliation: The primary_affiliation of this Person. # noqa: E501 + :type primary_affiliation: str + :param gender: The gender of this Person. # noqa: E501 + :type gender: str + :param telephone_number: The telephone_number of this Person. # noqa: E501 + :type telephone_number: List[PersonTelephoneNumber] + """ + self.swagger_types = { + 'sor_id': int, + 'date_of_birth': str, + 'names': List[PersonNames], + 'address': List[PersonAddress], + 'email_address': List[PersonEmailAddress], + 'identifier': List[PersonIdentifier], + 'primary_affiliation': str, + 'gender': str, + 'telephone_number': List[PersonTelephoneNumber] + } + + self.attribute_map = { + 'sor_id': 'sorId', + 'date_of_birth': 'dateOfBirth', + 'names': 'names', + 'address': 'address', + 'email_address': 'emailAddress', + 'identifier': 'identifier', + 'primary_affiliation': 'primaryAffiliation', + 'gender': 'gender', + 'telephone_number': 'telephoneNumber' + } + self._sor_id = sor_id + self._date_of_birth = date_of_birth + self._names = names + self._address = address + self._email_address = email_address + self._identifier = identifier + self._primary_affiliation = primary_affiliation + self._gender = gender + self._telephone_number = telephone_number + + @classmethod + def from_dict(cls, dikt) -> 'Person': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The person of this Person. # noqa: E501 + :rtype: Person + """ + return util.deserialize_model(dikt, cls) + + @property + def sor_id(self) -> int: + """Gets the sor_id of this Person. + + + :return: The sor_id of this Person. + :rtype: int + """ + return self._sor_id + + @sor_id.setter + def sor_id(self, sor_id: int): + """Sets the sor_id of this Person. + + + :param sor_id: The sor_id of this Person. + :type sor_id: int + """ + if sor_id is None: + raise ValueError("Invalid value for `sor_id`, must not be `None`") # noqa: E501 + + self._sor_id = sor_id + + @property + def date_of_birth(self) -> str: + """Gets the date_of_birth of this Person. + + + :return: The date_of_birth of this Person. + :rtype: str + """ + return self._date_of_birth + + @date_of_birth.setter + def date_of_birth(self, date_of_birth: str): + """Sets the date_of_birth of this Person. + + + :param date_of_birth: The date_of_birth of this Person. + :type date_of_birth: str + """ + + self._date_of_birth = date_of_birth + + @property + def names(self) -> List[PersonNames]: + """Gets the names of this Person. + + + :return: The names of this Person. + :rtype: List[PersonNames] + """ + return self._names + + @names.setter + def names(self, names: List[PersonNames]): + """Sets the names of this Person. + + + :param names: The names of this Person. + :type names: List[PersonNames] + """ + + self._names = names + + @property + def address(self) -> List[PersonAddress]: + """Gets the address of this Person. + + + :return: The address of this Person. + :rtype: List[PersonAddress] + """ + return self._address + + @address.setter + def address(self, address: List[PersonAddress]): + """Sets the address of this Person. + + + :param address: The address of this Person. + :type address: List[PersonAddress] + """ + + self._address = address + + @property + def email_address(self) -> List[PersonEmailAddress]: + """Gets the email_address of this Person. + + + :return: The email_address of this Person. + :rtype: List[PersonEmailAddress] + """ + return self._email_address + + @email_address.setter + def email_address(self, email_address: List[PersonEmailAddress]): + """Sets the email_address of this Person. + + + :param email_address: The email_address of this Person. + :type email_address: List[PersonEmailAddress] + """ + + self._email_address = email_address + + @property + def identifier(self) -> List[PersonIdentifier]: + """Gets the identifier of this Person. + + + :return: The identifier of this Person. + :rtype: List[PersonIdentifier] + """ + return self._identifier + + @identifier.setter + def identifier(self, identifier: List[PersonIdentifier]): + """Sets the identifier of this Person. + + + :param identifier: The identifier of this Person. + :type identifier: List[PersonIdentifier] + """ + + self._identifier = identifier + + @property + def primary_affiliation(self) -> str: + """Gets the primary_affiliation of this Person. + + + :return: The primary_affiliation of this Person. + :rtype: str + """ + return self._primary_affiliation + + @primary_affiliation.setter + def primary_affiliation(self, primary_affiliation: str): + """Sets the primary_affiliation of this Person. + + + :param primary_affiliation: The primary_affiliation of this Person. + :type primary_affiliation: str + """ + + self._primary_affiliation = primary_affiliation + + @property + def gender(self) -> str: + """Gets the gender of this Person. + + + :return: The gender of this Person. + :rtype: str + """ + return self._gender + + @gender.setter + def gender(self, gender: str): + """Sets the gender of this Person. + + + :param gender: The gender of this Person. + :type gender: str + """ + + self._gender = gender + + @property + def telephone_number(self) -> List[PersonTelephoneNumber]: + """Gets the telephone_number of this Person. + + + :return: The telephone_number of this Person. + :rtype: List[PersonTelephoneNumber] + """ + return self._telephone_number + + @telephone_number.setter + def telephone_number(self, telephone_number: List[PersonTelephoneNumber]): + """Sets the telephone_number of this Person. + + + :param telephone_number: The telephone_number of this Person. + :type telephone_number: List[PersonTelephoneNumber] + """ + + self._telephone_number = telephone_number diff --git a/python-flask-server-generated/swagger_server/models/person_address.py b/python-flask-server-generated/swagger_server/models/person_address.py new file mode 100644 index 0000000..3049b96 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/person_address.py @@ -0,0 +1,296 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class PersonAddress(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, country: str=None, formatted: str=None, language: str=None, locality: str=None, postal_code: str=None, region: str=None, room: str=None, street_address: str=None, type: str=None, verified: str=None): # noqa: E501 + """PersonAddress - a model defined in Swagger + + :param country: The country of this PersonAddress. # noqa: E501 + :type country: str + :param formatted: The formatted of this PersonAddress. # noqa: E501 + :type formatted: str + :param language: The language of this PersonAddress. # noqa: E501 + :type language: str + :param locality: The locality of this PersonAddress. # noqa: E501 + :type locality: str + :param postal_code: The postal_code of this PersonAddress. # noqa: E501 + :type postal_code: str + :param region: The region of this PersonAddress. # noqa: E501 + :type region: str + :param room: The room of this PersonAddress. # noqa: E501 + :type room: str + :param street_address: The street_address of this PersonAddress. # noqa: E501 + :type street_address: str + :param type: The type of this PersonAddress. # noqa: E501 + :type type: str + :param verified: The verified of this PersonAddress. # noqa: E501 + :type verified: str + """ + self.swagger_types = { + 'country': str, + 'formatted': str, + 'language': str, + 'locality': str, + 'postal_code': str, + 'region': str, + 'room': str, + 'street_address': str, + 'type': str, + 'verified': str + } + + self.attribute_map = { + 'country': 'country', + 'formatted': 'formatted', + 'language': 'language', + 'locality': 'locality', + 'postal_code': 'postalCode', + 'region': 'region', + 'room': 'room', + 'street_address': 'streetAddress', + 'type': 'type', + 'verified': 'verified' + } + self._country = country + self._formatted = formatted + self._language = language + self._locality = locality + self._postal_code = postal_code + self._region = region + self._room = room + self._street_address = street_address + self._type = type + self._verified = verified + + @classmethod + def from_dict(cls, dikt) -> 'PersonAddress': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The person_address of this PersonAddress. # noqa: E501 + :rtype: PersonAddress + """ + return util.deserialize_model(dikt, cls) + + @property + def country(self) -> str: + """Gets the country of this PersonAddress. + + + :return: The country of this PersonAddress. + :rtype: str + """ + return self._country + + @country.setter + def country(self, country: str): + """Sets the country of this PersonAddress. + + + :param country: The country of this PersonAddress. + :type country: str + """ + + self._country = country + + @property + def formatted(self) -> str: + """Gets the formatted of this PersonAddress. + + + :return: The formatted of this PersonAddress. + :rtype: str + """ + return self._formatted + + @formatted.setter + def formatted(self, formatted: str): + """Sets the formatted of this PersonAddress. + + + :param formatted: The formatted of this PersonAddress. + :type formatted: str + """ + + self._formatted = formatted + + @property + def language(self) -> str: + """Gets the language of this PersonAddress. + + + :return: The language of this PersonAddress. + :rtype: str + """ + return self._language + + @language.setter + def language(self, language: str): + """Sets the language of this PersonAddress. + + + :param language: The language of this PersonAddress. + :type language: str + """ + + self._language = language + + @property + def locality(self) -> str: + """Gets the locality of this PersonAddress. + + + :return: The locality of this PersonAddress. + :rtype: str + """ + return self._locality + + @locality.setter + def locality(self, locality: str): + """Sets the locality of this PersonAddress. + + + :param locality: The locality of this PersonAddress. + :type locality: str + """ + + self._locality = locality + + @property + def postal_code(self) -> str: + """Gets the postal_code of this PersonAddress. + + + :return: The postal_code of this PersonAddress. + :rtype: str + """ + return self._postal_code + + @postal_code.setter + def postal_code(self, postal_code: str): + """Sets the postal_code of this PersonAddress. + + + :param postal_code: The postal_code of this PersonAddress. + :type postal_code: str + """ + + self._postal_code = postal_code + + @property + def region(self) -> str: + """Gets the region of this PersonAddress. + + + :return: The region of this PersonAddress. + :rtype: str + """ + return self._region + + @region.setter + def region(self, region: str): + """Sets the region of this PersonAddress. + + + :param region: The region of this PersonAddress. + :type region: str + """ + + self._region = region + + @property + def room(self) -> str: + """Gets the room of this PersonAddress. + + + :return: The room of this PersonAddress. + :rtype: str + """ + return self._room + + @room.setter + def room(self, room: str): + """Sets the room of this PersonAddress. + + + :param room: The room of this PersonAddress. + :type room: str + """ + + self._room = room + + @property + def street_address(self) -> str: + """Gets the street_address of this PersonAddress. + + + :return: The street_address of this PersonAddress. + :rtype: str + """ + return self._street_address + + @street_address.setter + def street_address(self, street_address: str): + """Sets the street_address of this PersonAddress. + + + :param street_address: The street_address of this PersonAddress. + :type street_address: str + """ + + self._street_address = street_address + + @property + def type(self) -> str: + """Gets the type of this PersonAddress. + + + :return: The type of this PersonAddress. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this PersonAddress. + + + :param type: The type of this PersonAddress. + :type type: str + """ + + self._type = type + + @property + def verified(self) -> str: + """Gets the verified of this PersonAddress. + + + :return: The verified of this PersonAddress. + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified: str): + """Sets the verified of this PersonAddress. + + + :param verified: The verified of this PersonAddress. + :type verified: str + """ + + self._verified = verified diff --git a/python-flask-server-generated/swagger_server/models/person_email_address.py b/python-flask-server-generated/swagger_server/models/person_email_address.py new file mode 100644 index 0000000..c67b294 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/person_email_address.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class PersonEmailAddress(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, address: str=None, type: str=None, verified: str=None): # noqa: E501 + """PersonEmailAddress - a model defined in Swagger + + :param address: The address of this PersonEmailAddress. # noqa: E501 + :type address: str + :param type: The type of this PersonEmailAddress. # noqa: E501 + :type type: str + :param verified: The verified of this PersonEmailAddress. # noqa: E501 + :type verified: str + """ + self.swagger_types = { + 'address': str, + 'type': str, + 'verified': str + } + + self.attribute_map = { + 'address': 'address', + 'type': 'type', + 'verified': 'verified' + } + self._address = address + self._type = type + self._verified = verified + + @classmethod + def from_dict(cls, dikt) -> 'PersonEmailAddress': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The person_emailAddress of this PersonEmailAddress. # noqa: E501 + :rtype: PersonEmailAddress + """ + return util.deserialize_model(dikt, cls) + + @property + def address(self) -> str: + """Gets the address of this PersonEmailAddress. + + + :return: The address of this PersonEmailAddress. + :rtype: str + """ + return self._address + + @address.setter + def address(self, address: str): + """Sets the address of this PersonEmailAddress. + + + :param address: The address of this PersonEmailAddress. + :type address: str + """ + + self._address = address + + @property + def type(self) -> str: + """Gets the type of this PersonEmailAddress. + + + :return: The type of this PersonEmailAddress. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this PersonEmailAddress. + + + :param type: The type of this PersonEmailAddress. + :type type: str + """ + + self._type = type + + @property + def verified(self) -> str: + """Gets the verified of this PersonEmailAddress. + + + :return: The verified of this PersonEmailAddress. + :rtype: str + """ + return self._verified + + @verified.setter + def verified(self, verified: str): + """Sets the verified of this PersonEmailAddress. + + + :param verified: The verified of this PersonEmailAddress. + :type verified: str + """ + + self._verified = verified diff --git a/python-flask-server-generated/swagger_server/models/person_identifier.py b/python-flask-server-generated/swagger_server/models/person_identifier.py new file mode 100644 index 0000000..eb28225 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/person_identifier.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class PersonIdentifier(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, id: str=None, type: str=None): # noqa: E501 + """PersonIdentifier - a model defined in Swagger + + :param id: The id of this PersonIdentifier. # noqa: E501 + :type id: str + :param type: The type of this PersonIdentifier. # noqa: E501 + :type type: str + """ + self.swagger_types = { + 'id': str, + 'type': str + } + + self.attribute_map = { + 'id': 'id', + 'type': 'type' + } + self._id = id + self._type = type + + @classmethod + def from_dict(cls, dikt) -> 'PersonIdentifier': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The person_identifier of this PersonIdentifier. # noqa: E501 + :rtype: PersonIdentifier + """ + return util.deserialize_model(dikt, cls) + + @property + def id(self) -> str: + """Gets the id of this PersonIdentifier. + + + :return: The id of this PersonIdentifier. + :rtype: str + """ + return self._id + + @id.setter + def id(self, id: str): + """Sets the id of this PersonIdentifier. + + + :param id: The id of this PersonIdentifier. + :type id: str + """ + + self._id = id + + @property + def type(self) -> str: + """Gets the type of this PersonIdentifier. + + + :return: The type of this PersonIdentifier. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this PersonIdentifier. + + + :param type: The type of this PersonIdentifier. + :type type: str + """ + + self._type = type diff --git a/python-flask-server-generated/swagger_server/models/person_names.py b/python-flask-server-generated/swagger_server/models/person_names.py new file mode 100644 index 0000000..01a530a --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/person_names.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class PersonNames(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, type: str=None, given: str=None, family: str=None): # noqa: E501 + """PersonNames - a model defined in Swagger + + :param type: The type of this PersonNames. # noqa: E501 + :type type: str + :param given: The given of this PersonNames. # noqa: E501 + :type given: str + :param family: The family of this PersonNames. # noqa: E501 + :type family: str + """ + self.swagger_types = { + 'type': str, + 'given': str, + 'family': str + } + + self.attribute_map = { + 'type': 'type', + 'given': 'given', + 'family': 'family' + } + self._type = type + self._given = given + self._family = family + + @classmethod + def from_dict(cls, dikt) -> 'PersonNames': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The person_names of this PersonNames. # noqa: E501 + :rtype: PersonNames + """ + return util.deserialize_model(dikt, cls) + + @property + def type(self) -> str: + """Gets the type of this PersonNames. + + + :return: The type of this PersonNames. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this PersonNames. + + + :param type: The type of this PersonNames. + :type type: str + """ + + self._type = type + + @property + def given(self) -> str: + """Gets the given of this PersonNames. + + + :return: The given of this PersonNames. + :rtype: str + """ + return self._given + + @given.setter + def given(self, given: str): + """Sets the given of this PersonNames. + + + :param given: The given of this PersonNames. + :type given: str + """ + + self._given = given + + @property + def family(self) -> str: + """Gets the family of this PersonNames. + + + :return: The family of this PersonNames. + :rtype: str + """ + return self._family + + @family.setter + def family(self, family: str): + """Sets the family of this PersonNames. + + + :param family: The family of this PersonNames. + :type family: str + """ + + self._family = family diff --git a/python-flask-server-generated/swagger_server/models/person_telephone_number.py b/python-flask-server-generated/swagger_server/models/person_telephone_number.py new file mode 100644 index 0000000..00d50b2 --- /dev/null +++ b/python-flask-server-generated/swagger_server/models/person_telephone_number.py @@ -0,0 +1,88 @@ +# coding: utf-8 + +from __future__ import absolute_import +from datetime import date, datetime # noqa: F401 + +from typing import List, Dict # noqa: F401 + +from swagger_server.models.base_model_ import Model +from swagger_server import util + + +class PersonTelephoneNumber(Model): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + def __init__(self, number: str=None, type: str=None): # noqa: E501 + """PersonTelephoneNumber - a model defined in Swagger + + :param number: The number of this PersonTelephoneNumber. # noqa: E501 + :type number: str + :param type: The type of this PersonTelephoneNumber. # noqa: E501 + :type type: str + """ + self.swagger_types = { + 'number': str, + 'type': str + } + + self.attribute_map = { + 'number': 'number', + 'type': 'type' + } + self._number = number + self._type = type + + @classmethod + def from_dict(cls, dikt) -> 'PersonTelephoneNumber': + """Returns the dict as a model + + :param dikt: A dict. + :type: dict + :return: The person_telephoneNumber of this PersonTelephoneNumber. # noqa: E501 + :rtype: PersonTelephoneNumber + """ + return util.deserialize_model(dikt, cls) + + @property + def number(self) -> str: + """Gets the number of this PersonTelephoneNumber. + + + :return: The number of this PersonTelephoneNumber. + :rtype: str + """ + return self._number + + @number.setter + def number(self, number: str): + """Sets the number of this PersonTelephoneNumber. + + + :param number: The number of this PersonTelephoneNumber. + :type number: str + """ + + self._number = number + + @property + def type(self) -> str: + """Gets the type of this PersonTelephoneNumber. + + + :return: The type of this PersonTelephoneNumber. + :rtype: str + """ + return self._type + + @type.setter + def type(self, type: str): + """Sets the type of this PersonTelephoneNumber. + + + :param type: The type of this PersonTelephoneNumber. + :type type: str + """ + + self._type = type diff --git a/python-flask-server-generated/swagger_server/swagger/swagger.yaml b/python-flask-server-generated/swagger_server/swagger/swagger.yaml new file mode 100644 index 0000000..9ab5728 --- /dev/null +++ b/python-flask-server-generated/swagger_server/swagger/swagger.yaml @@ -0,0 +1,340 @@ +openapi: 3.0.0 +info: + title: ID Match API + description: ID Match API Specification from Internet2 Trust and Identity, and Spherical + Cow Group + version: 1.1.1 +servers: +- url: https://virtserver.swaggerhub.com/I2/idMatch/1.0.0 + description: SwaggerHub API Auto Mocking +security: +- accessCode: + - read + - write +paths: + /sis: + get: + description: Returns a list of people + operationId: sis_get + parameters: + - name: limit + in: query + description: Limits the number of items on a page + required: false + style: form + explode: true + schema: + type: integer + - name: offset + in: query + description: Specifies the page number of the artists to be displayed + required: false + style: form + explode: true + schema: + type: integer + responses: + "200": + description: Successfully returned a list of people + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/person' + x-content-type: application/json + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + x-openapi-router-controller: swagger_server.controllers.default_controller + post: + description: Get a reference ID for an SoR person + operationId: sis_post + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/person' + required: true + responses: + "200": + description: Found (or added) person record + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + x-openapi-router-controller: swagger_server.controllers.default_controller + /sis/{sorId}: + get: + description: Obtain information about an person from his or her sorId + operationId: sis_sor_id_get + parameters: + - name: sorId + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Successfully returned the requested person record + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + "400": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + x-openapi-router-controller: swagger_server.controllers.default_controller + /example: + get: + summary: Server example operation + description: This is an example operation to show how security is applied to + the call. + operationId: example_get + responses: + "200": + description: OK + x-openapi-router-controller: swagger_server.controllers.default_controller + /ping: + get: + summary: Server heartbeat operation + description: This operation shows how to override the global security defined + above, as we want to open it up for all users. + operationId: ping_get + responses: + "200": + description: OK + security: [] + x-openapi-router-controller: swagger_server.controllers.default_controller +components: + schemas: + person: + required: + - sorId + type: object + properties: + sorId: + type: integer + dateOfBirth: + type: string + names: + type: array + items: + $ref: '#/components/schemas/person_names' + address: + type: array + items: + $ref: '#/components/schemas/person_address' + emailAddress: + type: array + items: + $ref: '#/components/schemas/person_emailAddress' + identifier: + type: array + items: + $ref: '#/components/schemas/person_identifier' + primaryAffiliation: + type: string + gender: + type: string + telephoneNumber: + type: array + items: + $ref: '#/components/schemas/person_telephoneNumber' + example: + identifier: + - id: id + type: type + - id: id + type: type + emailAddress: + - address: address + verified: verified + type: type + - address: address + verified: verified + type: type + names: + - given: given + type: type + family: family + - given: given + type: type + family: family + address: + - country: country + streetAddress: streetAddress + formatted: formatted + postalCode: postalCode + locality: locality + verified: verified + language: language + region: region + type: type + room: room + - country: country + streetAddress: streetAddress + formatted: formatted + postalCode: postalCode + locality: locality + verified: verified + language: language + region: region + type: type + room: room + telephoneNumber: + - number: number + type: type + - number: number + type: type + gender: gender + sorId: 0 + dateOfBirth: dateOfBirth + primaryAffiliation: primaryAffiliation + inline_response_400: + type: object + properties: + message: + type: string + inline_response_200: + type: object + properties: + artist_name: + type: string + artist_genre: + type: string + albums_recorded: + type: integer + example: + artist_name: artist_name + albums_recorded: 0 + artist_genre: artist_genre + person_names: + type: object + properties: + type: + type: string + given: + type: string + family: + type: string + example: + given: given + type: type + family: family + person_address: + type: object + properties: + country: + type: string + formatted: + type: string + language: + type: string + locality: + type: string + postalCode: + type: string + region: + type: string + room: + type: string + streetAddress: + type: string + type: + type: string + verified: + type: string + example: + country: country + streetAddress: streetAddress + formatted: formatted + postalCode: postalCode + locality: locality + verified: verified + language: language + region: region + type: type + room: room + person_emailAddress: + type: object + properties: + address: + type: string + type: + type: string + verified: + type: string + example: + address: address + verified: verified + type: type + person_identifier: + type: object + properties: + id: + type: string + type: + type: string + example: + id: id + type: type + person_telephoneNumber: + type: object + properties: + number: + type: string + type: + type: string + example: + number: number + type: type + responses: + "400Error": + description: Invalid request + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + parameters: + PageLimit: + name: limit + in: query + description: Limits the number of items on a page + required: false + style: form + explode: true + schema: + type: integer + PageOffset: + name: offset + in: query + description: Specifies the page number of the artists to be displayed + required: false + style: form + explode: true + schema: + type: integer + securitySchemes: + accessCode: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: http://example.com/oauth/auth + tokenUrl: http://example.com/oauth/token + scopes: + write: allows modifying resources + read: allows reading resources + x-tokenInfoFunc: swagger_server.controllers.authorization_controller.check_accessCode + x-scopeValidateFunc: swagger_server.controllers.authorization_controller.validate_scope_accessCode + diff --git a/python-flask-server-generated/swagger_server/test/__init__.py b/python-flask-server-generated/swagger_server/test/__init__.py new file mode 100644 index 0000000..6445063 --- /dev/null +++ b/python-flask-server-generated/swagger_server/test/__init__.py @@ -0,0 +1,16 @@ +import logging + +import connexion +from flask_testing import TestCase + +from swagger_server.encoder import JSONEncoder + + +class BaseTestCase(TestCase): + + def create_app(self): + logging.getLogger('connexion.operation').setLevel('ERROR') + app = connexion.App(__name__, specification_dir='../swagger/') + app.app.json_encoder = JSONEncoder + app.add_api('swagger.yaml') + return app.app diff --git a/python-flask-server-generated/swagger_server/test/test_default_controller.py b/python-flask-server-generated/swagger_server/test/test_default_controller.py new file mode 100644 index 0000000..fcb0a66 --- /dev/null +++ b/python-flask-server-generated/swagger_server/test/test_default_controller.py @@ -0,0 +1,81 @@ +# coding: utf-8 + +from __future__ import absolute_import + +from flask import json +from six import BytesIO + +from swagger_server.models.inline_response200 import InlineResponse200 # noqa: E501 +from swagger_server.models.inline_response400 import InlineResponse400 # noqa: E501 +from swagger_server.models.person import Person # noqa: E501 +from swagger_server.test import BaseTestCase + + +class TestDefaultController(BaseTestCase): + """DefaultController integration test stubs""" + + def test_example_get(self): + """Test case for example_get + + Server example operation + """ + response = self.client.open( + '/I2/idMatch/1.0.0/example', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_ping_get(self): + """Test case for ping_get + + Server heartbeat operation + """ + response = self.client.open( + '/I2/idMatch/1.0.0/ping', + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_sis_get(self): + """Test case for sis_get + + + """ + query_string = [('limit', 56), + ('offset', 56)] + response = self.client.open( + '/I2/idMatch/1.0.0/sis', + method='GET', + query_string=query_string) + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_sis_post(self): + """Test case for sis_post + + + """ + body = Person() + response = self.client.open( + '/I2/idMatch/1.0.0/sis', + method='POST', + data=json.dumps(body), + content_type='application/json') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + def test_sis_sor_id_get(self): + """Test case for sis_sor_id_get + + + """ + response = self.client.open( + '/I2/idMatch/1.0.0/sis/{sorId}'.format(sor_id='sor_id_example'), + method='GET') + self.assert200(response, + 'Response body is : ' + response.data.decode('utf-8')) + + +if __name__ == '__main__': + import unittest + unittest.main() diff --git a/python-flask-server-generated/swagger_server/util.py b/python-flask-server-generated/swagger_server/util.py new file mode 100644 index 0000000..527d142 --- /dev/null +++ b/python-flask-server-generated/swagger_server/util.py @@ -0,0 +1,141 @@ +import datetime + +import six +import typing + + +def _deserialize(data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if klass in six.integer_types or klass in (float, str, bool): + return _deserialize_primitive(data, klass) + elif klass == object: + return _deserialize_object(data) + elif klass == datetime.date: + return deserialize_date(data) + elif klass == datetime.datetime: + return deserialize_datetime(data) + elif type(klass) == typing.GenericMeta: + if klass.__extra__ == list: + return _deserialize_list(data, klass.__args__[0]) + if klass.__extra__ == dict: + return _deserialize_dict(data, klass.__args__[1]) + else: + return deserialize_model(data, klass) + + +def _deserialize_primitive(data, klass): + """Deserializes to primitive type. + + :param data: data to deserialize. + :param klass: class literal. + + :return: int, long, float, str, bool. + :rtype: int | long | float | str | bool + """ + try: + value = klass(data) + except UnicodeEncodeError: + value = six.u(data) + except TypeError: + value = data + return value + + +def _deserialize_object(value): + """Return a original value. + + :return: object. + """ + return value + + +def deserialize_date(string): + """Deserializes string to date. + + :param string: str. + :type string: str + :return: date. + :rtype: date + """ + try: + from dateutil.parser import parse + return parse(string).date() + except ImportError: + return string + + +def deserialize_datetime(string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :type string: str + :return: datetime. + :rtype: datetime + """ + try: + from dateutil.parser import parse + return parse(string) + except ImportError: + return string + + +def deserialize_model(data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :type data: dict | list + :param klass: class literal. + :return: model object. + """ + instance = klass() + + if not instance.swagger_types: + return data + + for attr, attr_type in six.iteritems(instance.swagger_types): + if data is not None \ + and instance.attribute_map[attr] in data \ + and isinstance(data, (list, dict)): + value = data[instance.attribute_map[attr]] + setattr(instance, attr, _deserialize(value, attr_type)) + + return instance + + +def _deserialize_list(data, boxed_type): + """Deserializes a list and its elements. + + :param data: list to deserialize. + :type data: list + :param boxed_type: class literal. + + :return: deserialized list. + :rtype: list + """ + return [_deserialize(sub_data, boxed_type) + for sub_data in data] + + +def _deserialize_dict(data, boxed_type): + """Deserializes a dict and its elements. + + :param data: dict to deserialize. + :type data: dict + :param boxed_type: class literal. + + :return: deserialized dict. + :rtype: dict + """ + return {k: _deserialize(v, boxed_type) + for k, v in six.iteritems(data)} diff --git a/python-flask-server-generated/test-requirements.txt b/python-flask-server-generated/test-requirements.txt new file mode 100644 index 0000000..7f8d96e --- /dev/null +++ b/python-flask-server-generated/test-requirements.txt @@ -0,0 +1,6 @@ +flask_testing==0.6.1 +coverage>=4.0.3 +nose>=1.3.7 +pluggy>=0.3.1 +py>=1.4.31 +randomize>=0.13 diff --git a/python-flask-server-generated/tox.ini b/python-flask-server-generated/tox.ini new file mode 100644 index 0000000..3e0b644 --- /dev/null +++ b/python-flask-server-generated/tox.ini @@ -0,0 +1,10 @@ +[tox] +envlist = py35 + +[testenv] +deps=-r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + +commands= + nosetests \ + [] \ No newline at end of file diff --git a/spring-server-generated/.idea/.gitignore b/spring-server-generated/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/spring-server-generated/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/spring-server-generated/.idea/.name b/spring-server-generated/.idea/.name new file mode 100644 index 0000000..5c1fb09 --- /dev/null +++ b/spring-server-generated/.idea/.name @@ -0,0 +1 @@ +swagger-spring \ No newline at end of file diff --git a/spring-server-generated/.idea/compiler.xml b/spring-server-generated/.idea/compiler.xml new file mode 100644 index 0000000..1fc93a0 --- /dev/null +++ b/spring-server-generated/.idea/compiler.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/encodings.xml b/spring-server-generated/.idea/encodings.xml new file mode 100644 index 0000000..63e9001 --- /dev/null +++ b/spring-server-generated/.idea/encodings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/jarRepositories.xml b/spring-server-generated/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/spring-server-generated/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_11.xml b/spring-server-generated/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_11.xml new file mode 100644 index 0000000..c6ea67e --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__ch_qos_logback_logback_classic_1_1_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_11.xml b/spring-server-generated/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_11.xml new file mode 100644 index 0000000..f538e36 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__ch_qos_logback_logback_core_1_1_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml new file mode 100644 index 0000000..33c30b4 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_classmate_1_3_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml new file mode 100644 index 0000000..49b4ec7 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_11.xml b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_11.xml new file mode 100644 index 0000000..bb8b7db --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_11.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_11_3.xml b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_11_3.xml new file mode 100644 index 0000000..dfa2a7a --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_11_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_github_joschi_jackson_jackson_datatype_threetenbp_2_6_4.xml b/spring-server-generated/.idea/libraries/Maven__com_github_joschi_jackson_jackson_datatype_threetenbp_2_6_4.xml new file mode 100644 index 0000000..233e99b --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_github_joschi_jackson_jackson_datatype_threetenbp_2_6_4.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_google_guava_guava_20_0.xml b/spring-server-generated/.idea/libraries/Maven__com_google_guava_guava_20_0.xml new file mode 100644 index 0000000..c5bd322 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_google_guava_guava_20_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_2_0.xml b/spring-server-generated/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_2_0.xml new file mode 100644 index 0000000..578b079 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_jayway_jsonpath_json_path_2_2_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml b/spring-server-generated/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml new file mode 100644 index 0000000..b8581a6 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__com_vaadin_external_google_android_json_0_0_20131108_vaadin1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_core_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_core_2_9_2.xml new file mode 100644 index 0000000..03588dc --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_core_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_schema_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_schema_2_9_2.xml new file mode 100644 index 0000000..4a47148 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_schema_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_spi_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_spi_2_9_2.xml new file mode 100644 index 0000000..f934649 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_spi_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_spring_web_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_spring_web_2_9_2.xml new file mode 100644 index 0000000..7898a19 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_spring_web_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger2_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger2_2_9_2.xml new file mode 100644 index 0000000..4ed7d0d --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger2_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_9_2.xml new file mode 100644 index 0000000..c40ef9f --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger_common_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_9_2.xml b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_9_2.xml new file mode 100644 index 0000000..0700f01 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_springfox_springfox_swagger_ui_2_9_2.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_20.xml b/spring-server-generated/.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_20.xml new file mode 100644 index 0000000..1c4a621 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_swagger_swagger_annotations_1_5_20.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__io_swagger_swagger_models_1_5_20.xml b/spring-server-generated/.idea/libraries/Maven__io_swagger_swagger_models_1_5_20.xml new file mode 100644 index 0000000..395508f --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__io_swagger_swagger_models_1_5_20.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml b/spring-server-generated/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml new file mode 100644 index 0000000..940ce73 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__javax_validation_validation_api_1_1_0_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__junit_junit_4_12.xml b/spring-server-generated/.idea/libraries/Maven__junit_junit_4_12.xml new file mode 100644 index 0000000..d411041 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__junit_junit_4_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_8_12.xml b/spring-server-generated/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_8_12.xml new file mode 100644 index 0000000..871c76c --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_8_12.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__net_minidev_accessors_smart_1_1.xml b/spring-server-generated/.idea/libraries/Maven__net_minidev_accessors_smart_1_1.xml new file mode 100644 index 0000000..88d626e --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__net_minidev_accessors_smart_1_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__net_minidev_json_smart_2_2_1.xml b/spring-server-generated/.idea/libraries/Maven__net_minidev_json_smart_2_2_1.xml new file mode 100644 index 0000000..6c692c8 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__net_minidev_json_smart_2_2_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_43.xml b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_43.xml new file mode 100644 index 0000000..fb2d8e9 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_core_8_5_43.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_43.xml b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_43.xml new file mode 100644 index 0000000..e4745c5 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_el_8_5_43.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_43.xml b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_43.xml new file mode 100644 index 0000000..f5001c9 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_embed_tomcat_embed_websocket_8_5_43.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_8_5_43.xml b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_8_5_43.xml new file mode 100644 index 0000000..b2f7190 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_apache_tomcat_tomcat_annotations_api_8_5_43.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_assertj_assertj_core_2_6_0.xml b/spring-server-generated/.idea/libraries/Maven__org_assertj_assertj_core_2_6_0.xml new file mode 100644 index 0000000..58bdc9a --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_assertj_assertj_core_2_6_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml b/spring-server-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..f58bbc1 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml b/spring-server-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml new file mode 100644 index 0000000..78dbe45 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_hamcrest_hamcrest_library_1_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_3_6_Final.xml b/spring-server-generated/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_3_6_Final.xml new file mode 100644 index 0000000..3c0ddd4 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_hibernate_hibernate_validator_5_3_6_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml b/spring-server-generated/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml new file mode 100644 index 0000000..5f7dd01 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_3_2_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml b/spring-server-generated/.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml new file mode 100644 index 0000000..87cb599 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_mapstruct_mapstruct_1_2_0_Final.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml b/spring-server-generated/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml new file mode 100644 index 0000000..a523703 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_mockito_mockito_core_1_10_19.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml b/spring-server-generated/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml new file mode 100644 index 0000000..7ab319b --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_objenesis_objenesis_2_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_ow2_asm_asm_5_0_3.xml b/spring-server-generated/.idea/libraries/Maven__org_ow2_asm_asm_5_0_3.xml new file mode 100644 index 0000000..da69f6c --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_ow2_asm_asm_5_0_3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_4_0.xml b/spring-server-generated/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_4_0.xml new file mode 100644 index 0000000..f86d2c8 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_skyscreamer_jsonassert_1_4_0.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_26.xml b/spring-server-generated/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_26.xml new file mode 100644 index 0000000..139d592 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_26.xml b/spring-server-generated/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_26.xml new file mode 100644 index 0000000..087b2a4 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_slf4j_jul_to_slf4j_1_7_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_26.xml b/spring-server-generated/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_26.xml new file mode 100644 index 0000000..b68d9ed --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_slf4j_log4j_over_slf4j_1_7_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml b/spring-server-generated/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml new file mode 100644 index 0000000..6545f77 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_26.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_1_5_22_RELEASE.xml new file mode 100644 index 0000000..6b85b38 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_22_RELEASE.xml new file mode 100644 index 0000000..d2acda7 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_autoconfigure_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_1_5_22_RELEASE.xml new file mode 100644 index 0000000..f6dedd4 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_1_5_22_RELEASE.xml new file mode 100644 index 0000000..9beaad3 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_logging_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_5_22_RELEASE.xml new file mode 100644 index 0000000..cdd9406 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_test_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_22_RELEASE.xml new file mode 100644 index 0000000..d68d596 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_tomcat_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_1_5_22_RELEASE.xml new file mode 100644 index 0000000..41be023 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_starter_web_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_1_5_22_RELEASE.xml new file mode 100644 index 0000000..a19bd04 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_1_5_22_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_1_5_22_RELEASE.xml new file mode 100644 index 0000000..ec89659 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_boot_spring_boot_test_autoconfigure_1_5_22_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml new file mode 100644 index 0000000..fbc0452 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_core_1_2_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml new file mode 100644 index 0000000..7e6f096 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_plugin_spring_plugin_metadata_1_2_0_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_aop_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_aop_4_3_25_RELEASE.xml new file mode 100644 index 0000000..52f9ca6 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_aop_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_beans_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_beans_4_3_25_RELEASE.xml new file mode 100644 index 0000000..bf97760 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_beans_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_context_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_context_4_3_25_RELEASE.xml new file mode 100644 index 0000000..889c197 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_context_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_core_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_core_4_3_25_RELEASE.xml new file mode 100644 index 0000000..a208ff9 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_core_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_expression_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_expression_4_3_25_RELEASE.xml new file mode 100644 index 0000000..d022259 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_expression_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_test_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_test_4_3_25_RELEASE.xml new file mode 100644 index 0000000..3f3e628 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_test_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_web_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_web_4_3_25_RELEASE.xml new file mode 100644 index 0000000..d615ade --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_web_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_webmvc_4_3_25_RELEASE.xml b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_webmvc_4_3_25_RELEASE.xml new file mode 100644 index 0000000..cfbccaa --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_springframework_spring_webmvc_4_3_25_RELEASE.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_threeten_threetenbp_1_3_1.xml b/spring-server-generated/.idea/libraries/Maven__org_threeten_threetenbp_1_3_1.xml new file mode 100644 index 0000000..c56aeb0 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_threeten_threetenbp_1_3_1.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/libraries/Maven__org_yaml_snakeyaml_1_17.xml b/spring-server-generated/.idea/libraries/Maven__org_yaml_snakeyaml_1_17.xml new file mode 100644 index 0000000..20e2920 --- /dev/null +++ b/spring-server-generated/.idea/libraries/Maven__org_yaml_snakeyaml_1_17.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/midpoint.xml b/spring-server-generated/.idea/midpoint.xml new file mode 100644 index 0000000..942ab2d --- /dev/null +++ b/spring-server-generated/.idea/midpoint.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/misc.xml b/spring-server-generated/.idea/misc.xml new file mode 100644 index 0000000..735bb57 --- /dev/null +++ b/spring-server-generated/.idea/misc.xml @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.idea/modules.xml b/spring-server-generated/.idea/modules.xml new file mode 100644 index 0000000..e4d3aa6 --- /dev/null +++ b/spring-server-generated/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/spring-server-generated/.swagger-codegen-ignore b/spring-server-generated/.swagger-codegen-ignore new file mode 100644 index 0000000..c5fa491 --- /dev/null +++ b/spring-server-generated/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/spring-server-generated/.swagger-codegen/VERSION b/spring-server-generated/.swagger-codegen/VERSION new file mode 100644 index 0000000..402b44e --- /dev/null +++ b/spring-server-generated/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.21 \ No newline at end of file diff --git a/spring-server-generated/README.md b/spring-server-generated/README.md new file mode 100644 index 0000000..a2e8a9f --- /dev/null +++ b/spring-server-generated/README.md @@ -0,0 +1,18 @@ +# Swagger generated server + +Spring Boot Server + + +## Overview +This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub. +This is an example of building a swagger-enabled server in Java using the SpringBoot framework. + +The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox) + +Start your server as an simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/ + +Change default port value in application.properties \ No newline at end of file diff --git a/spring-server-generated/pom.xml b/spring-server-generated/pom.xml new file mode 100644 index 0000000..dee88a9 --- /dev/null +++ b/spring-server-generated/pom.xml @@ -0,0 +1,73 @@ + + 4.0.0 + io.swagger + swagger-spring + jar + swagger-spring + 1.0.0 + + 1.7 + ${java.version} + ${java.version} + 2.9.2 + + + org.springframework.boot + spring-boot-starter-parent + 1.5.22.RELEASE + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + io.springfox + springfox-swagger2 + ${springfox-version} + + + io.springfox + springfox-swagger-ui + ${springfox-version} + + + + com.github.joschi.jackson + jackson-datatype-threetenbp + 2.6.4 + + + + javax.validation + validation-api + + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/spring-server-generated/src/main/java/io/swagger/RFC3339DateFormat.java b/spring-server-generated/src/main/java/io/swagger/RFC3339DateFormat.java new file mode 100644 index 0000000..538b6f2 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/RFC3339DateFormat.java @@ -0,0 +1,22 @@ +package io.swagger; + +import com.fasterxml.jackson.databind.util.ISO8601DateFormat; +import com.fasterxml.jackson.databind.util.ISO8601Utils; + +import java.text.FieldPosition; +import java.util.Date; + + +public class RFC3339DateFormat extends ISO8601DateFormat { + + private static final long serialVersionUID = 1L; + + // Same as ISO8601DateFormat but serializing milliseconds. + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + String value = ISO8601Utils.format(date, true); + toAppendTo.append(value); + return toAppendTo; + } + +} \ No newline at end of file diff --git a/spring-server-generated/src/main/java/io/swagger/Swagger2SpringBoot.java b/spring-server-generated/src/main/java/io/swagger/Swagger2SpringBoot.java new file mode 100644 index 0000000..b6aaf2b --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/Swagger2SpringBoot.java @@ -0,0 +1,36 @@ +package io.swagger; + +import org.springframework.boot.CommandLineRunner; +import org.springframework.boot.ExitCodeGenerator; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.ComponentScan; + +import springfox.documentation.swagger2.annotations.EnableSwagger2; + +@SpringBootApplication +@EnableSwagger2 +@ComponentScan(basePackages = { "io.swagger", "io.swagger.api" , "io.swagger.configuration"}) +public class Swagger2SpringBoot implements CommandLineRunner { + + @Override + public void run(String... arg0) throws Exception { + if (arg0.length > 0 && arg0[0].equals("exitcode")) { + throw new ExitException(); + } + } + + public static void main(String[] args) throws Exception { + new SpringApplication(Swagger2SpringBoot.class).run(args); + } + + class ExitException extends RuntimeException implements ExitCodeGenerator { + private static final long serialVersionUID = 1L; + + @Override + public int getExitCode() { + return 10; + } + + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/ApiException.java b/spring-server-generated/src/main/java/io/swagger/api/ApiException.java new file mode 100644 index 0000000..808bce6 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/ApiException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +public class ApiException extends Exception{ + private int code; + public ApiException (int code, String msg) { + super(msg); + this.code = code; + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/ApiOriginFilter.java b/spring-server-generated/src/main/java/io/swagger/api/ApiOriginFilter.java new file mode 100644 index 0000000..e232d97 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/ApiOriginFilter.java @@ -0,0 +1,27 @@ +package io.swagger.api; + +import java.io.IOException; + +import javax.servlet.*; +import javax.servlet.http.HttpServletResponse; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +public class ApiOriginFilter implements javax.servlet.Filter { + @Override + public void doFilter(ServletRequest request, ServletResponse response, + FilterChain chain) throws IOException, ServletException { + HttpServletResponse res = (HttpServletResponse) response; + res.addHeader("Access-Control-Allow-Origin", "*"); + res.addHeader("Access-Control-Allow-Methods", "GET, POST, DELETE, PUT"); + res.addHeader("Access-Control-Allow-Headers", "Content-Type"); + chain.doFilter(request, response); + } + + @Override + public void destroy() { + } + + @Override + public void init(FilterConfig filterConfig) throws ServletException { + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/ApiResponseMessage.java b/spring-server-generated/src/main/java/io/swagger/api/ApiResponseMessage.java new file mode 100644 index 0000000..0495071 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/ApiResponseMessage.java @@ -0,0 +1,69 @@ +package io.swagger.api; + +import javax.xml.bind.annotation.XmlTransient; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@javax.xml.bind.annotation.XmlRootElement +public class ApiResponseMessage { + public static final int ERROR = 1; + public static final int WARNING = 2; + public static final int INFO = 3; + public static final int OK = 4; + public static final int TOO_BUSY = 5; + + int code; + String type; + String message; + + public ApiResponseMessage(){} + + public ApiResponseMessage(int code, String message){ + this.code = code; + switch(code){ + case ERROR: + setType("error"); + break; + case WARNING: + setType("warning"); + break; + case INFO: + setType("info"); + break; + case OK: + setType("ok"); + break; + case TOO_BUSY: + setType("too busy"); + break; + default: + setType("unknown"); + break; + } + this.message = message; + } + + @XmlTransient + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/ExampleApi.java b/spring-server-generated/src/main/java/io/swagger/api/ExampleApi.java new file mode 100644 index 0000000..1f49478 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/ExampleApi.java @@ -0,0 +1,41 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (3.0.21). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.bind.annotation.CookieValue; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Api(value = "example", description = "the example API") +public interface ExampleApi { + + @ApiOperation(value = "Server example operation", nickname = "exampleGet", notes = "This is an example operation to show how security is applied to the call.", authorizations = { + @Authorization(value = "accessCode", scopes = { + @AuthorizationScope(scope = "write", description = "allows modifying resources"), + @AuthorizationScope(scope = "read", description = "allows reading resources") + }) }, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK") }) + @RequestMapping(value = "/example", + method = RequestMethod.GET) + ResponseEntity exampleGet(); + +} + diff --git a/spring-server-generated/src/main/java/io/swagger/api/ExampleApiController.java b/spring-server-generated/src/main/java/io/swagger/api/ExampleApiController.java new file mode 100644 index 0000000..8dc76cb --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/ExampleApiController.java @@ -0,0 +1,45 @@ +package io.swagger.api; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.List; +import java.util.Map; +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Controller +public class ExampleApiController implements ExampleApi { + + private static final Logger log = LoggerFactory.getLogger(ExampleApiController.class); + + private final ObjectMapper objectMapper; + + private final HttpServletRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public ExampleApiController(ObjectMapper objectMapper, HttpServletRequest request) { + this.objectMapper = objectMapper; + this.request = request; + } + + public ResponseEntity exampleGet() { + String accept = request.getHeader("Accept"); + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/NotFoundException.java b/spring-server-generated/src/main/java/io/swagger/api/NotFoundException.java new file mode 100644 index 0000000..e35a724 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/NotFoundException.java @@ -0,0 +1,10 @@ +package io.swagger.api; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +public class NotFoundException extends ApiException { + private int code; + public NotFoundException (int code, String msg) { + super(code, msg); + this.code = code; + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/PingApi.java b/spring-server-generated/src/main/java/io/swagger/api/PingApi.java new file mode 100644 index 0000000..f113bb6 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/PingApi.java @@ -0,0 +1,37 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (3.0.21). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.bind.annotation.CookieValue; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Api(value = "ping", description = "the ping API") +public interface PingApi { + + @ApiOperation(value = "Server heartbeat operation", nickname = "pingGet", notes = "This operation shows how to override the global security defined above, as we want to open it up for all users.", tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "OK") }) + @RequestMapping(value = "/ping", + method = RequestMethod.GET) + ResponseEntity pingGet(); + +} + diff --git a/spring-server-generated/src/main/java/io/swagger/api/PingApiController.java b/spring-server-generated/src/main/java/io/swagger/api/PingApiController.java new file mode 100644 index 0000000..a1643d4 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/PingApiController.java @@ -0,0 +1,45 @@ +package io.swagger.api; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.List; +import java.util.Map; +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Controller +public class PingApiController implements PingApi { + + private static final Logger log = LoggerFactory.getLogger(PingApiController.class); + + private final ObjectMapper objectMapper; + + private final HttpServletRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public PingApiController(ObjectMapper objectMapper, HttpServletRequest request) { + this.objectMapper = objectMapper; + this.request = request; + } + + public ResponseEntity pingGet() { + String accept = request.getHeader("Accept"); + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + +} diff --git a/spring-server-generated/src/main/java/io/swagger/api/SisApi.java b/spring-server-generated/src/main/java/io/swagger/api/SisApi.java new file mode 100644 index 0000000..e9fd672 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/SisApi.java @@ -0,0 +1,79 @@ +/** + * NOTE: This class is auto generated by the swagger code generator program (3.0.21). + * https://github.com/swagger-api/swagger-codegen + * Do not edit the class manually. + */ +package io.swagger.api; + +import io.swagger.model.InlineResponse200; +import io.swagger.model.InlineResponse400; +import io.swagger.model.Person; +import io.swagger.annotations.*; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.bind.annotation.CookieValue; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Api(value = "sis", description = "the sis API") +public interface SisApi { + + @ApiOperation(value = "", nickname = "sisGet", notes = "Returns a list of people", response = Person.class, responseContainer = "List", authorizations = { + @Authorization(value = "accessCode", scopes = { + @AuthorizationScope(scope = "write", description = "allows modifying resources"), + @AuthorizationScope(scope = "read", description = "allows reading resources") + }) }, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successfully returned a list of people", response = Person.class, responseContainer = "List"), + @ApiResponse(code = 400, message = "Invalid request", response = InlineResponse400.class) }) + @RequestMapping(value = "/sis", + produces = { "application/json" }, + method = RequestMethod.GET) + ResponseEntity> sisGet(@ApiParam(value = "Limits the number of items on a page") @Valid @RequestParam(value = "limit", required = false) Integer limit +,@ApiParam(value = "Specifies the page number of the artists to be displayed") @Valid @RequestParam(value = "offset", required = false) Integer offset +); + + + @ApiOperation(value = "", nickname = "sisPost", notes = "Get a reference ID for an SoR person", authorizations = { + @Authorization(value = "accessCode", scopes = { + @AuthorizationScope(scope = "write", description = "allows modifying resources"), + @AuthorizationScope(scope = "read", description = "allows reading resources") + }) }, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Found (or added) person record"), + @ApiResponse(code = 400, message = "Invalid request", response = InlineResponse400.class) }) + @RequestMapping(value = "/sis", + produces = { "application/json" }, + consumes = { "application/json" }, + method = RequestMethod.POST) + ResponseEntity sisPost(@ApiParam(value = "" ,required=true ) @Valid @RequestBody Person body +); + + + @ApiOperation(value = "", nickname = "sisSorIdGet", notes = "Obtain information about an person from his or her sorId", response = InlineResponse200.class, authorizations = { + @Authorization(value = "accessCode", scopes = { + @AuthorizationScope(scope = "write", description = "allows modifying resources"), + @AuthorizationScope(scope = "read", description = "allows reading resources") + }) }, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successfully returned the requested person record", response = InlineResponse200.class), + @ApiResponse(code = 400, message = "Invalid request", response = InlineResponse400.class) }) + @RequestMapping(value = "/sis/{sorId}", + produces = { "application/json" }, + method = RequestMethod.GET) + ResponseEntity sisSorIdGet(@ApiParam(value = "",required=true) @PathVariable("sorId") String sorId +); + +} + diff --git a/spring-server-generated/src/main/java/io/swagger/api/SisApiController.java b/spring-server-generated/src/main/java/io/swagger/api/SisApiController.java new file mode 100644 index 0000000..2bdd800 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/api/SisApiController.java @@ -0,0 +1,80 @@ +package io.swagger.api; + +import io.swagger.model.InlineResponse200; +import io.swagger.model.InlineResponse400; +import io.swagger.model.Person; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.swagger.annotations.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.constraints.*; +import javax.validation.Valid; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.List; +import java.util.Map; +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Controller +public class SisApiController implements SisApi { + + private static final Logger log = LoggerFactory.getLogger(SisApiController.class); + + private final ObjectMapper objectMapper; + + private final HttpServletRequest request; + + @org.springframework.beans.factory.annotation.Autowired + public SisApiController(ObjectMapper objectMapper, HttpServletRequest request) { + this.objectMapper = objectMapper; + this.request = request; + } + + public ResponseEntity> sisGet(@ApiParam(value = "Limits the number of items on a page") @Valid @RequestParam(value = "limit", required = false) Integer limit +,@ApiParam(value = "Specifies the page number of the artists to be displayed") @Valid @RequestParam(value = "offset", required = false) Integer offset +) { + String accept = request.getHeader("Accept"); + if (accept != null && accept.contains("application/json")) { + try { + return new ResponseEntity>(objectMapper.readValue("[ {\n \"identifier\" : [ {\n \"id\" : \"id\",\n \"type\" : \"type\"\n }, {\n \"id\" : \"id\",\n \"type\" : \"type\"\n } ],\n \"emailAddress\" : [ {\n \"address\" : \"address\",\n \"verified\" : \"verified\",\n \"type\" : \"type\"\n }, {\n \"address\" : \"address\",\n \"verified\" : \"verified\",\n \"type\" : \"type\"\n } ],\n \"names\" : [ {\n \"given\" : \"given\",\n \"type\" : \"type\",\n \"family\" : \"family\"\n }, {\n \"given\" : \"given\",\n \"type\" : \"type\",\n \"family\" : \"family\"\n } ],\n \"address\" : [ {\n \"country\" : \"country\",\n \"streetAddress\" : \"streetAddress\",\n \"formatted\" : \"formatted\",\n \"postalCode\" : \"postalCode\",\n \"locality\" : \"locality\",\n \"verified\" : \"verified\",\n \"language\" : \"language\",\n \"region\" : \"region\",\n \"type\" : \"type\",\n \"room\" : \"room\"\n }, {\n \"country\" : \"country\",\n \"streetAddress\" : \"streetAddress\",\n \"formatted\" : \"formatted\",\n \"postalCode\" : \"postalCode\",\n \"locality\" : \"locality\",\n \"verified\" : \"verified\",\n \"language\" : \"language\",\n \"region\" : \"region\",\n \"type\" : \"type\",\n \"room\" : \"room\"\n } ],\n \"telephoneNumber\" : [ {\n \"number\" : \"number\",\n \"type\" : \"type\"\n }, {\n \"number\" : \"number\",\n \"type\" : \"type\"\n } ],\n \"gender\" : \"gender\",\n \"sorId\" : 0,\n \"dateOfBirth\" : \"dateOfBirth\",\n \"primaryAffiliation\" : \"primaryAffiliation\"\n}, {\n \"identifier\" : [ {\n \"id\" : \"id\",\n \"type\" : \"type\"\n }, {\n \"id\" : \"id\",\n \"type\" : \"type\"\n } ],\n \"emailAddress\" : [ {\n \"address\" : \"address\",\n \"verified\" : \"verified\",\n \"type\" : \"type\"\n }, {\n \"address\" : \"address\",\n \"verified\" : \"verified\",\n \"type\" : \"type\"\n } ],\n \"names\" : [ {\n \"given\" : \"given\",\n \"type\" : \"type\",\n \"family\" : \"family\"\n }, {\n \"given\" : \"given\",\n \"type\" : \"type\",\n \"family\" : \"family\"\n } ],\n \"address\" : [ {\n \"country\" : \"country\",\n \"streetAddress\" : \"streetAddress\",\n \"formatted\" : \"formatted\",\n \"postalCode\" : \"postalCode\",\n \"locality\" : \"locality\",\n \"verified\" : \"verified\",\n \"language\" : \"language\",\n \"region\" : \"region\",\n \"type\" : \"type\",\n \"room\" : \"room\"\n }, {\n \"country\" : \"country\",\n \"streetAddress\" : \"streetAddress\",\n \"formatted\" : \"formatted\",\n \"postalCode\" : \"postalCode\",\n \"locality\" : \"locality\",\n \"verified\" : \"verified\",\n \"language\" : \"language\",\n \"region\" : \"region\",\n \"type\" : \"type\",\n \"room\" : \"room\"\n } ],\n \"telephoneNumber\" : [ {\n \"number\" : \"number\",\n \"type\" : \"type\"\n }, {\n \"number\" : \"number\",\n \"type\" : \"type\"\n } ],\n \"gender\" : \"gender\",\n \"sorId\" : 0,\n \"dateOfBirth\" : \"dateOfBirth\",\n \"primaryAffiliation\" : \"primaryAffiliation\"\n} ]", List.class), HttpStatus.NOT_IMPLEMENTED); + } catch (IOException e) { + log.error("Couldn't serialize response for content type application/json", e); + return new ResponseEntity>(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + return new ResponseEntity>(HttpStatus.NOT_IMPLEMENTED); + } + + public ResponseEntity sisPost(@ApiParam(value = "" ,required=true ) @Valid @RequestBody Person body +) { + String accept = request.getHeader("Accept"); + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + + public ResponseEntity sisSorIdGet(@ApiParam(value = "",required=true) @PathVariable("sorId") String sorId +) { + String accept = request.getHeader("Accept"); + if (accept != null && accept.contains("application/json")) { + try { + return new ResponseEntity(objectMapper.readValue("{\n \"artist_name\" : \"artist_name\",\n \"albums_recorded\" : 0,\n \"artist_genre\" : \"artist_genre\"\n}", InlineResponse200.class), HttpStatus.NOT_IMPLEMENTED); + } catch (IOException e) { + log.error("Couldn't serialize response for content type application/json", e); + return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR); + } + } + + return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); + } + +} diff --git a/spring-server-generated/src/main/java/io/swagger/configuration/CustomInstantDeserializer.java b/spring-server-generated/src/main/java/io/swagger/configuration/CustomInstantDeserializer.java new file mode 100644 index 0000000..c8894e9 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/configuration/CustomInstantDeserializer.java @@ -0,0 +1,232 @@ +package io.swagger.configuration; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonTokenId; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JsonDeserializer; +import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils; +import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; +import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; +import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; +import com.fasterxml.jackson.datatype.threetenbp.function.Function; +import org.threeten.bp.DateTimeException; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZoneId; +import org.threeten.bp.ZonedDateTime; +import org.threeten.bp.format.DateTimeFormatter; +import org.threeten.bp.temporal.Temporal; +import org.threeten.bp.temporal.TemporalAccessor; + +import java.io.IOException; +import java.math.BigDecimal; + +/** + * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. + * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. + * + * @author Nick Williams + */ +public class CustomInstantDeserializer + extends ThreeTenDateTimeDeserializerBase { + private static final long serialVersionUID = 1L; + + public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( + Instant.class, DateTimeFormatter.ISO_INSTANT, + new Function() { + @Override + public Instant apply(TemporalAccessor temporalAccessor) { + return Instant.from(temporalAccessor); + } + }, + new Function() { + @Override + public Instant apply(FromIntegerArguments a) { + return Instant.ofEpochMilli(a.value); + } + }, + new Function() { + @Override + public Instant apply(FromDecimalArguments a) { + return Instant.ofEpochSecond(a.integer, a.fraction); + } + }, + null + ); + + public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( + OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, + new Function() { + @Override + public OffsetDateTime apply(TemporalAccessor temporalAccessor) { + return OffsetDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromIntegerArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public OffsetDateTime apply(FromDecimalArguments a) { + return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { + return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); + } + } + ); + + public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( + ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, + new Function() { + @Override + public ZonedDateTime apply(TemporalAccessor temporalAccessor) { + return ZonedDateTime.from(temporalAccessor); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromIntegerArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); + } + }, + new Function() { + @Override + public ZonedDateTime apply(FromDecimalArguments a) { + return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); + } + }, + new BiFunction() { + @Override + public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { + return zonedDateTime.withZoneSameInstant(zoneId); + } + } + ); + + protected final Function fromMilliseconds; + + protected final Function fromNanoseconds; + + protected final Function parsedToValue; + + protected final BiFunction adjust; + + protected CustomInstantDeserializer(Class supportedType, + DateTimeFormatter parser, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust) { + super(supportedType, parser); + this.parsedToValue = parsedToValue; + this.fromMilliseconds = fromMilliseconds; + this.fromNanoseconds = fromNanoseconds; + this.adjust = adjust == null ? new BiFunction() { + @Override + public T apply(T t, ZoneId zoneId) { + return t; + } + } : adjust; + } + + @SuppressWarnings("unchecked") + protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { + super((Class) base.handledType(), f); + parsedToValue = base.parsedToValue; + fromMilliseconds = base.fromMilliseconds; + fromNanoseconds = base.fromNanoseconds; + adjust = base.adjust; + } + + @Override + protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { + if (dtf == _formatter) { + return this; + } + return new CustomInstantDeserializer(this, dtf); + } + + @Override + public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { + //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only + //string values have to be adjusted to the configured TZ. + switch (parser.getCurrentTokenId()) { + case JsonTokenId.ID_NUMBER_FLOAT: { + BigDecimal value = parser.getDecimalValue(); + long seconds = value.longValue(); + int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); + return fromNanoseconds.apply(new FromDecimalArguments( + seconds, nanoseconds, getZone(context))); + } + + case JsonTokenId.ID_NUMBER_INT: { + long timestamp = parser.getLongValue(); + if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { + return this.fromNanoseconds.apply(new FromDecimalArguments( + timestamp, 0, this.getZone(context) + )); + } + return this.fromMilliseconds.apply(new FromIntegerArguments( + timestamp, this.getZone(context) + )); + } + + case JsonTokenId.ID_STRING: { + String string = parser.getText().trim(); + if (string.length() == 0) { + return null; + } + if (string.endsWith("+0000")) { + string = string.substring(0, string.length() - 5) + "Z"; + } + T value; + try { + TemporalAccessor acc = _formatter.parse(string); + value = parsedToValue.apply(acc); + if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { + return adjust.apply(value, this.getZone(context)); + } + } catch (DateTimeException e) { + throw _peelDTE(e); + } + return value; + } + } + throw context.mappingException("Expected type float, integer, or string."); + } + + private ZoneId getZone(DeserializationContext context) { + // Instants are always in UTC, so don't waste compute cycles + return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone()); + } + + private static class FromIntegerArguments { + public final long value; + public final ZoneId zoneId; + + private FromIntegerArguments(long value, ZoneId zoneId) { + this.value = value; + this.zoneId = zoneId; + } + } + + private static class FromDecimalArguments { + public final long integer; + public final int fraction; + public final ZoneId zoneId; + + private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { + this.integer = integer; + this.fraction = fraction; + this.zoneId = zoneId; + } + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/configuration/HomeController.java b/spring-server-generated/src/main/java/io/swagger/configuration/HomeController.java new file mode 100644 index 0000000..f832809 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/configuration/HomeController.java @@ -0,0 +1,16 @@ +package io.swagger.configuration; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * Home redirection to swagger api documentation + */ +@Controller +public class HomeController { + @RequestMapping(value = "/") + public String index() { + System.out.println("swagger-ui.html"); + return "redirect:swagger-ui.html"; + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/configuration/JacksonConfiguration.java b/spring-server-generated/src/main/java/io/swagger/configuration/JacksonConfiguration.java new file mode 100644 index 0000000..2609d72 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/configuration/JacksonConfiguration.java @@ -0,0 +1,23 @@ +package io.swagger.configuration; + +import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.threeten.bp.Instant; +import org.threeten.bp.OffsetDateTime; +import org.threeten.bp.ZonedDateTime; + +@Configuration +public class JacksonConfiguration { + + @Bean + @ConditionalOnMissingBean(ThreeTenModule.class) + ThreeTenModule threeTenModule() { + ThreeTenModule module = new ThreeTenModule(); + module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); + module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); + module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); + return module; + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java b/spring-server-generated/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java new file mode 100644 index 0000000..6fa317a --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/configuration/SwaggerDocumentationConfig.java @@ -0,0 +1,40 @@ +package io.swagger.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import springfox.documentation.builders.ApiInfoBuilder; +import springfox.documentation.builders.RequestHandlerSelectors; +import springfox.documentation.service.ApiInfo; +import springfox.documentation.service.Contact; +import springfox.documentation.spi.DocumentationType; +import springfox.documentation.spring.web.plugins.Docket; + +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") +@Configuration +public class SwaggerDocumentationConfig { + + ApiInfo apiInfo() { + return new ApiInfoBuilder() + .title("ID Match API") + .description("ID Match API Specification from Internet2 Trust and Identity, and Spherical Cow Group") + .license("") + .licenseUrl("http://unlicense.org") + .termsOfServiceUrl("") + .version("1.1.1") + .contact(new Contact("","", "")) + .build(); + } + + @Bean + public Docket customImplementation(){ + return new Docket(DocumentationType.SWAGGER_2) + .select() + .apis(RequestHandlerSelectors.basePackage("io.swagger.api")) + .build() + .directModelSubstitute(org.threeten.bp.LocalDate.class, java.sql.Date.class) + .directModelSubstitute(org.threeten.bp.OffsetDateTime.class, java.util.Date.class) + .apiInfo(apiInfo()); + } + +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/InlineResponse200.java b/spring-server-generated/src/main/java/io/swagger/model/InlineResponse200.java new file mode 100644 index 0000000..921e8e9 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/InlineResponse200.java @@ -0,0 +1,128 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * InlineResponse200 + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class InlineResponse200 { + @JsonProperty("artist_name") + private String artistName = null; + + @JsonProperty("artist_genre") + private String artistGenre = null; + + @JsonProperty("albums_recorded") + private Integer albumsRecorded = null; + + public InlineResponse200 artistName(String artistName) { + this.artistName = artistName; + return this; + } + + /** + * Get artistName + * @return artistName + **/ + @ApiModelProperty(value = "") + + public String getArtistName() { + return artistName; + } + + public void setArtistName(String artistName) { + this.artistName = artistName; + } + + public InlineResponse200 artistGenre(String artistGenre) { + this.artistGenre = artistGenre; + return this; + } + + /** + * Get artistGenre + * @return artistGenre + **/ + @ApiModelProperty(value = "") + + public String getArtistGenre() { + return artistGenre; + } + + public void setArtistGenre(String artistGenre) { + this.artistGenre = artistGenre; + } + + public InlineResponse200 albumsRecorded(Integer albumsRecorded) { + this.albumsRecorded = albumsRecorded; + return this; + } + + /** + * Get albumsRecorded + * @return albumsRecorded + **/ + @ApiModelProperty(value = "") + + public Integer getAlbumsRecorded() { + return albumsRecorded; + } + + public void setAlbumsRecorded(Integer albumsRecorded) { + this.albumsRecorded = albumsRecorded; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse200 inlineResponse200 = (InlineResponse200) o; + return Objects.equals(this.artistName, inlineResponse200.artistName) && + Objects.equals(this.artistGenre, inlineResponse200.artistGenre) && + Objects.equals(this.albumsRecorded, inlineResponse200.albumsRecorded); + } + + @Override + public int hashCode() { + return Objects.hash(artistName, artistGenre, albumsRecorded); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse200 {\n"); + + sb.append(" artistName: ").append(toIndentedString(artistName)).append("\n"); + sb.append(" artistGenre: ").append(toIndentedString(artistGenre)).append("\n"); + sb.append(" albumsRecorded: ").append(toIndentedString(albumsRecorded)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/InlineResponse400.java b/spring-server-generated/src/main/java/io/swagger/model/InlineResponse400.java new file mode 100644 index 0000000..835cbd7 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/InlineResponse400.java @@ -0,0 +1,80 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * InlineResponse400 + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class InlineResponse400 { + @JsonProperty("message") + private String message = null; + + public InlineResponse400 message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * @return message + **/ + @ApiModelProperty(value = "") + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InlineResponse400 inlineResponse400 = (InlineResponse400) o; + return Objects.equals(this.message, inlineResponse400.message); + } + + @Override + public int hashCode() { + return Objects.hash(message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InlineResponse400 {\n"); + + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/Person.java b/spring-server-generated/src/main/java/io/swagger/model/Person.java new file mode 100644 index 0000000..7ca5273 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/Person.java @@ -0,0 +1,325 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import io.swagger.model.PersonAddress; +import io.swagger.model.PersonEmailAddress; +import io.swagger.model.PersonIdentifier; +import io.swagger.model.PersonNames; +import io.swagger.model.PersonTelephoneNumber; +import java.util.ArrayList; +import java.util.List; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * Person + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class Person { + @JsonProperty("sorId") + private Integer sorId = null; + + @JsonProperty("dateOfBirth") + private String dateOfBirth = null; + + @JsonProperty("names") + @Valid + private List names = null; + + @JsonProperty("address") + @Valid + private List address = null; + + @JsonProperty("emailAddress") + @Valid + private List emailAddress = null; + + @JsonProperty("identifier") + @Valid + private List identifier = null; + + @JsonProperty("primaryAffiliation") + private String primaryAffiliation = null; + + @JsonProperty("gender") + private String gender = null; + + @JsonProperty("telephoneNumber") + @Valid + private List telephoneNumber = null; + + public Person sorId(Integer sorId) { + this.sorId = sorId; + return this; + } + + /** + * Get sorId + * @return sorId + **/ + @ApiModelProperty(required = true, value = "") + @NotNull + + public Integer getSorId() { + return sorId; + } + + public void setSorId(Integer sorId) { + this.sorId = sorId; + } + + public Person dateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + return this; + } + + /** + * Get dateOfBirth + * @return dateOfBirth + **/ + @ApiModelProperty(value = "") + + public String getDateOfBirth() { + return dateOfBirth; + } + + public void setDateOfBirth(String dateOfBirth) { + this.dateOfBirth = dateOfBirth; + } + + public Person names(List names) { + this.names = names; + return this; + } + + public Person addNamesItem(PersonNames namesItem) { + if (this.names == null) { + this.names = new ArrayList(); + } + this.names.add(namesItem); + return this; + } + + /** + * Get names + * @return names + **/ + @ApiModelProperty(value = "") + @Valid + public List getNames() { + return names; + } + + public void setNames(List names) { + this.names = names; + } + + public Person address(List address) { + this.address = address; + return this; + } + + public Person addAddressItem(PersonAddress addressItem) { + if (this.address == null) { + this.address = new ArrayList(); + } + this.address.add(addressItem); + return this; + } + + /** + * Get address + * @return address + **/ + @ApiModelProperty(value = "") + @Valid + public List getAddress() { + return address; + } + + public void setAddress(List address) { + this.address = address; + } + + public Person emailAddress(List emailAddress) { + this.emailAddress = emailAddress; + return this; + } + + public Person addEmailAddressItem(PersonEmailAddress emailAddressItem) { + if (this.emailAddress == null) { + this.emailAddress = new ArrayList(); + } + this.emailAddress.add(emailAddressItem); + return this; + } + + /** + * Get emailAddress + * @return emailAddress + **/ + @ApiModelProperty(value = "") + @Valid + public List getEmailAddress() { + return emailAddress; + } + + public void setEmailAddress(List emailAddress) { + this.emailAddress = emailAddress; + } + + public Person identifier(List identifier) { + this.identifier = identifier; + return this; + } + + public Person addIdentifierItem(PersonIdentifier identifierItem) { + if (this.identifier == null) { + this.identifier = new ArrayList(); + } + this.identifier.add(identifierItem); + return this; + } + + /** + * Get identifier + * @return identifier + **/ + @ApiModelProperty(value = "") + @Valid + public List getIdentifier() { + return identifier; + } + + public void setIdentifier(List identifier) { + this.identifier = identifier; + } + + public Person primaryAffiliation(String primaryAffiliation) { + this.primaryAffiliation = primaryAffiliation; + return this; + } + + /** + * Get primaryAffiliation + * @return primaryAffiliation + **/ + @ApiModelProperty(value = "") + + public String getPrimaryAffiliation() { + return primaryAffiliation; + } + + public void setPrimaryAffiliation(String primaryAffiliation) { + this.primaryAffiliation = primaryAffiliation; + } + + public Person gender(String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + **/ + @ApiModelProperty(value = "") + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender; + } + + public Person telephoneNumber(List telephoneNumber) { + this.telephoneNumber = telephoneNumber; + return this; + } + + public Person addTelephoneNumberItem(PersonTelephoneNumber telephoneNumberItem) { + if (this.telephoneNumber == null) { + this.telephoneNumber = new ArrayList(); + } + this.telephoneNumber.add(telephoneNumberItem); + return this; + } + + /** + * Get telephoneNumber + * @return telephoneNumber + **/ + @ApiModelProperty(value = "") + @Valid + public List getTelephoneNumber() { + return telephoneNumber; + } + + public void setTelephoneNumber(List telephoneNumber) { + this.telephoneNumber = telephoneNumber; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Person person = (Person) o; + return Objects.equals(this.sorId, person.sorId) && + Objects.equals(this.dateOfBirth, person.dateOfBirth) && + Objects.equals(this.names, person.names) && + Objects.equals(this.address, person.address) && + Objects.equals(this.emailAddress, person.emailAddress) && + Objects.equals(this.identifier, person.identifier) && + Objects.equals(this.primaryAffiliation, person.primaryAffiliation) && + Objects.equals(this.gender, person.gender) && + Objects.equals(this.telephoneNumber, person.telephoneNumber); + } + + @Override + public int hashCode() { + return Objects.hash(sorId, dateOfBirth, names, address, emailAddress, identifier, primaryAffiliation, gender, telephoneNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Person {\n"); + + sb.append(" sorId: ").append(toIndentedString(sorId)).append("\n"); + sb.append(" dateOfBirth: ").append(toIndentedString(dateOfBirth)).append("\n"); + sb.append(" names: ").append(toIndentedString(names)).append("\n"); + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" emailAddress: ").append(toIndentedString(emailAddress)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" primaryAffiliation: ").append(toIndentedString(primaryAffiliation)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" telephoneNumber: ").append(toIndentedString(telephoneNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/PersonAddress.java b/spring-server-generated/src/main/java/io/swagger/model/PersonAddress.java new file mode 100644 index 0000000..2c5e7bd --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/PersonAddress.java @@ -0,0 +1,296 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * PersonAddress + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class PersonAddress { + @JsonProperty("country") + private String country = null; + + @JsonProperty("formatted") + private String formatted = null; + + @JsonProperty("language") + private String language = null; + + @JsonProperty("locality") + private String locality = null; + + @JsonProperty("postalCode") + private String postalCode = null; + + @JsonProperty("region") + private String region = null; + + @JsonProperty("room") + private String room = null; + + @JsonProperty("streetAddress") + private String streetAddress = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("verified") + private String verified = null; + + public PersonAddress country(String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + **/ + @ApiModelProperty(value = "") + + public String getCountry() { + return country; + } + + public void setCountry(String country) { + this.country = country; + } + + public PersonAddress formatted(String formatted) { + this.formatted = formatted; + return this; + } + + /** + * Get formatted + * @return formatted + **/ + @ApiModelProperty(value = "") + + public String getFormatted() { + return formatted; + } + + public void setFormatted(String formatted) { + this.formatted = formatted; + } + + public PersonAddress language(String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + **/ + @ApiModelProperty(value = "") + + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public PersonAddress locality(String locality) { + this.locality = locality; + return this; + } + + /** + * Get locality + * @return locality + **/ + @ApiModelProperty(value = "") + + public String getLocality() { + return locality; + } + + public void setLocality(String locality) { + this.locality = locality; + } + + public PersonAddress postalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get postalCode + * @return postalCode + **/ + @ApiModelProperty(value = "") + + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + + public PersonAddress region(String region) { + this.region = region; + return this; + } + + /** + * Get region + * @return region + **/ + @ApiModelProperty(value = "") + + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + public PersonAddress room(String room) { + this.room = room; + return this; + } + + /** + * Get room + * @return room + **/ + @ApiModelProperty(value = "") + + public String getRoom() { + return room; + } + + public void setRoom(String room) { + this.room = room; + } + + public PersonAddress streetAddress(String streetAddress) { + this.streetAddress = streetAddress; + return this; + } + + /** + * Get streetAddress + * @return streetAddress + **/ + @ApiModelProperty(value = "") + + public String getStreetAddress() { + return streetAddress; + } + + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + + public PersonAddress type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PersonAddress verified(String verified) { + this.verified = verified; + return this; + } + + /** + * Get verified + * @return verified + **/ + @ApiModelProperty(value = "") + + public String getVerified() { + return verified; + } + + public void setVerified(String verified) { + this.verified = verified; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonAddress personAddress = (PersonAddress) o; + return Objects.equals(this.country, personAddress.country) && + Objects.equals(this.formatted, personAddress.formatted) && + Objects.equals(this.language, personAddress.language) && + Objects.equals(this.locality, personAddress.locality) && + Objects.equals(this.postalCode, personAddress.postalCode) && + Objects.equals(this.region, personAddress.region) && + Objects.equals(this.room, personAddress.room) && + Objects.equals(this.streetAddress, personAddress.streetAddress) && + Objects.equals(this.type, personAddress.type) && + Objects.equals(this.verified, personAddress.verified); + } + + @Override + public int hashCode() { + return Objects.hash(country, formatted, language, locality, postalCode, region, room, streetAddress, type, verified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonAddress {\n"); + + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" formatted: ").append(toIndentedString(formatted)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" locality: ").append(toIndentedString(locality)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" room: ").append(toIndentedString(room)).append("\n"); + sb.append(" streetAddress: ").append(toIndentedString(streetAddress)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/PersonEmailAddress.java b/spring-server-generated/src/main/java/io/swagger/model/PersonEmailAddress.java new file mode 100644 index 0000000..796ce15 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/PersonEmailAddress.java @@ -0,0 +1,128 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * PersonEmailAddress + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class PersonEmailAddress { + @JsonProperty("address") + private String address = null; + + @JsonProperty("type") + private String type = null; + + @JsonProperty("verified") + private String verified = null; + + public PersonEmailAddress address(String address) { + this.address = address; + return this; + } + + /** + * Get address + * @return address + **/ + @ApiModelProperty(value = "") + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public PersonEmailAddress type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PersonEmailAddress verified(String verified) { + this.verified = verified; + return this; + } + + /** + * Get verified + * @return verified + **/ + @ApiModelProperty(value = "") + + public String getVerified() { + return verified; + } + + public void setVerified(String verified) { + this.verified = verified; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonEmailAddress personEmailAddress = (PersonEmailAddress) o; + return Objects.equals(this.address, personEmailAddress.address) && + Objects.equals(this.type, personEmailAddress.type) && + Objects.equals(this.verified, personEmailAddress.verified); + } + + @Override + public int hashCode() { + return Objects.hash(address, type, verified); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonEmailAddress {\n"); + + sb.append(" address: ").append(toIndentedString(address)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/PersonIdentifier.java b/spring-server-generated/src/main/java/io/swagger/model/PersonIdentifier.java new file mode 100644 index 0000000..8eb0df1 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/PersonIdentifier.java @@ -0,0 +1,104 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * PersonIdentifier + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class PersonIdentifier { + @JsonProperty("id") + private String id = null; + + @JsonProperty("type") + private String type = null; + + public PersonIdentifier id(String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + **/ + @ApiModelProperty(value = "") + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public PersonIdentifier type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonIdentifier personIdentifier = (PersonIdentifier) o; + return Objects.equals(this.id, personIdentifier.id) && + Objects.equals(this.type, personIdentifier.type); + } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonIdentifier {\n"); + + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/PersonNames.java b/spring-server-generated/src/main/java/io/swagger/model/PersonNames.java new file mode 100644 index 0000000..d68a922 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/PersonNames.java @@ -0,0 +1,128 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * PersonNames + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class PersonNames { + @JsonProperty("type") + private String type = null; + + @JsonProperty("given") + private String given = null; + + @JsonProperty("family") + private String family = null; + + public PersonNames type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public PersonNames given(String given) { + this.given = given; + return this; + } + + /** + * Get given + * @return given + **/ + @ApiModelProperty(value = "") + + public String getGiven() { + return given; + } + + public void setGiven(String given) { + this.given = given; + } + + public PersonNames family(String family) { + this.family = family; + return this; + } + + /** + * Get family + * @return family + **/ + @ApiModelProperty(value = "") + + public String getFamily() { + return family; + } + + public void setFamily(String family) { + this.family = family; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonNames personNames = (PersonNames) o; + return Objects.equals(this.type, personNames.type) && + Objects.equals(this.given, personNames.given) && + Objects.equals(this.family, personNames.family); + } + + @Override + public int hashCode() { + return Objects.hash(type, given, family); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonNames {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" given: ").append(toIndentedString(given)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/java/io/swagger/model/PersonTelephoneNumber.java b/spring-server-generated/src/main/java/io/swagger/model/PersonTelephoneNumber.java new file mode 100644 index 0000000..077eff7 --- /dev/null +++ b/spring-server-generated/src/main/java/io/swagger/model/PersonTelephoneNumber.java @@ -0,0 +1,104 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * PersonTelephoneNumber + */ +@Validated +@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2020-09-18T00:44:36.737Z[GMT]") + + +public class PersonTelephoneNumber { + @JsonProperty("number") + private String number = null; + + @JsonProperty("type") + private String type = null; + + public PersonTelephoneNumber number(String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + **/ + @ApiModelProperty(value = "") + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public PersonTelephoneNumber type(String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(value = "") + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PersonTelephoneNumber personTelephoneNumber = (PersonTelephoneNumber) o; + return Objects.equals(this.number, personTelephoneNumber.number) && + Objects.equals(this.type, personTelephoneNumber.type); + } + + @Override + public int hashCode() { + return Objects.hash(number, type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PersonTelephoneNumber {\n"); + + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/spring-server-generated/src/main/resources/application.properties b/spring-server-generated/src/main/resources/application.properties new file mode 100644 index 0000000..55e9b61 --- /dev/null +++ b/spring-server-generated/src/main/resources/application.properties @@ -0,0 +1,5 @@ +springfox.documentation.swagger.v2.path=/api-docs +server.contextPath=/I2/idMatch/1.0.0 +server.port=8080 +spring.jackson.date-format=io.swagger.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false \ No newline at end of file diff --git a/spring-server-generated/swagger-spring.iml b/spring-server-generated/swagger-spring.iml new file mode 100644 index 0000000..6fe50b3 --- /dev/null +++ b/spring-server-generated/swagger-spring.iml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file